Merge
authorprr
Wed, 13 Dec 2017 10:25:38 -0800
changeset 48292 191ae61bd1e9
parent 48291 093027a037cf (diff)
parent 48263 a559b7cd1dea (current diff)
child 48293 2fa0077c4fec
child 48346 1f38b6c89f8a
Merge
src/java.base/share/classes/java/lang/StringDecoderUTF8.java
src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java
test/java/util/Calendar/Bug8185841.java
test/jdk/TEST.groups
test/langtools/jdk/javadoc/doclet/testMemberInheritence/TestMemberInheritence.java
test/langtools/jdk/javadoc/doclet/testMemberInheritence/diamond/A.java
test/langtools/jdk/javadoc/doclet/testMemberInheritence/diamond/B.java
test/langtools/jdk/javadoc/doclet/testMemberInheritence/diamond/C.java
test/langtools/jdk/javadoc/doclet/testMemberInheritence/diamond/X.java
test/langtools/jdk/javadoc/doclet/testMemberInheritence/diamond/Z.java
test/langtools/jdk/javadoc/doclet/testMemberInheritence/inheritDist/A.java
test/langtools/jdk/javadoc/doclet/testMemberInheritence/inheritDist/B.java
test/langtools/jdk/javadoc/doclet/testMemberInheritence/inheritDist/C.java
test/langtools/jdk/javadoc/doclet/testMemberInheritence/pkg/BaseClass.java
test/langtools/jdk/javadoc/doclet/testMemberInheritence/pkg/BaseInterface.java
test/langtools/jdk/javadoc/doclet/testMemberInheritence/pkg/SubClass.java
test/langtools/jdk/javadoc/doclet/testMemberInheritence/pkg1/Implementer.java
test/langtools/jdk/javadoc/doclet/testMemberInheritence/pkg1/Interface.java
test/langtools/jdk/javadoc/doclet/testOverridenMethods/TestBadOverride.java
test/langtools/jdk/javadoc/doclet/testOverridenMethods/TestMultiInheritence.java
test/langtools/jdk/javadoc/doclet/testOverridenMethods/TestOverrideMethods.java
test/langtools/jdk/javadoc/doclet/testOverridenMethods/TestOverridenMethodDocCopy.java
test/langtools/jdk/javadoc/doclet/testOverridenMethods/TestOverridenPrivateMethods.java
test/langtools/jdk/javadoc/doclet/testOverridenMethods/TestOverridenPrivateMethodsWithPackageFlag.java
test/langtools/jdk/javadoc/doclet/testOverridenMethods/TestOverridenPrivateMethodsWithPrivateFlag.java
test/langtools/jdk/javadoc/doclet/testOverridenMethods/pkg1/BaseClass.java
test/langtools/jdk/javadoc/doclet/testOverridenMethods/pkg1/SubClass.java
test/langtools/jdk/javadoc/doclet/testOverridenMethods/pkg2/SubClass.java
test/langtools/jdk/javadoc/doclet/testOverridenMethods/pkg3/I0.java
test/langtools/jdk/javadoc/doclet/testOverridenMethods/pkg3/I1.java
test/langtools/jdk/javadoc/doclet/testOverridenMethods/pkg3/I2.java
test/langtools/jdk/javadoc/doclet/testOverridenMethods/pkg3/I3.java
test/langtools/jdk/javadoc/doclet/testOverridenMethods/pkg3/I4.java
test/langtools/jdk/javadoc/doclet/testOverridenMethods/pkg4/Foo.java
test/langtools/jdk/javadoc/doclet/testOverridenMethods/pkg5/Classes.java
test/langtools/jdk/javadoc/doclet/testOverridenMethods/pkg5/Interfaces.java
test/langtools/jdk/javadoc/doclet/testOverridenMethods/pkg5/TestEnum.java
test/langtools/jdk/jshell/ToolSimpleTest.java
--- a/make/lib/Awt2dLibraries.gmk	Wed Dec 13 16:16:17 2017 +0000
+++ b/make/lib/Awt2dLibraries.gmk	Wed Dec 13 10:25:38 2017 -0800
@@ -681,7 +681,7 @@
     DISABLED_WARNINGS_CXX_solstudio := \
         truncwarn wvarhidenmem wvarhidemem wbadlkginit identexpected \
         hidevf w_novirtualdescr arrowrtn2, \
-    DISABLED_WARNINGS_microsoft := 4267 4244 4018 4090 4996 4146 4334 4819, \
+    DISABLED_WARNINGS_microsoft := 4267 4244 4018 4090 4996 4146 4334 4819 4101, \
     MAPFILE := $(BUILD_LIBFONTMANAGER_MAPFILE), \
     LDFLAGS := $(subst -Wl$(COMMA)-z$(COMMA)defs,,$(LDFLAGS_JDKLIB)) $(LDFLAGS_CXX_JDK) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
--- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java	Wed Dec 13 10:25:38 2017 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -502,30 +502,18 @@
         }
     }
 
-    /**
-     * Determines which modifier key is the appropriate accelerator
-     * key for menu shortcuts.
-     * <p>
-     * Menu shortcuts, which are embodied in the
-     * {@code MenuShortcut} class, are handled by the
-     * {@code MenuBar} class.
-     * <p>
-     * By default, this method returns {@code Event.CTRL_MASK}.
-     * Toolkit implementations should override this method if the
-     * <b>Control</b> key isn't the correct key for accelerators.
-     * @return    the modifier mask on the {@code Event} class
-     *                 that is used for menu shortcuts on this toolkit.
-     * @see       java.awt.MenuBar
-     * @see       java.awt.MenuShortcut
-     * @since     1.1
-     */
     @Override
-    @SuppressWarnings("deprecation")
+    @Deprecated(since = "10")
     public int getMenuShortcutKeyMask() {
         return Event.META_MASK;
     }
 
     @Override
+    public int getMenuShortcutKeyMaskEx() {
+        return InputEvent.META_DOWN_MASK;
+    }
+
+    @Override
     public Image getImage(final String filename) {
         final Image nsImage = checkForNSImage(filename);
         if (nsImage != null) {
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/AnimationController.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,436 +0,0 @@
-/*
- * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import java.security.AccessController;
-import sun.security.action.GetBooleanAction;
-
-import java.util.*;
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeEvent;
-import java.awt.*;
-import java.awt.event.*;
-import javax.swing.*;
-
-
-import com.sun.java.swing.plaf.windows.TMSchema.State;
-import static com.sun.java.swing.plaf.windows.TMSchema.State.*;
-import com.sun.java.swing.plaf.windows.TMSchema.Part;
-import com.sun.java.swing.plaf.windows.TMSchema.Prop;
-import com.sun.java.swing.plaf.windows.XPStyle.Skin;
-
-import sun.awt.AppContext;
-
-/**
- * A class to help mimic Vista theme animations.  The only kind of
- * animation it handles for now is 'transition' animation (this seems
- * to be the only animation which Vista theme can do). This is when
- * one picture fadein over another one in some period of time.
- * According to
- * https://connect.microsoft.com/feedback/ViewFeedback.aspx?FeedbackID=86852&SiteID=4
- * The animations are all linear.
- *
- * This class has a number of responsibilities.
- * <ul>
- *   <li> It trigger rapaint for the UI components involved in the animation
- *   <li> It tracks the animation state for every UI component involved in the
- *        animation and paints {@code Skin} in new {@code State} over the
- *        {@code Skin} in last {@code State} using
- *        {@code AlphaComposite.SrcOver.derive(alpha)} where {code alpha}
- *        depends on the state of animation
- * </ul>
- *
- * @author Igor Kushnirskiy
- */
-class AnimationController implements ActionListener, PropertyChangeListener {
-
-    private static final boolean VISTA_ANIMATION_DISABLED =
-        AccessController.doPrivileged(new GetBooleanAction("swing.disablevistaanimation"));
-
-
-    private static final Object ANIMATION_CONTROLLER_KEY =
-        new StringBuilder("ANIMATION_CONTROLLER_KEY");
-
-    private final Map<JComponent, Map<Part, AnimationState>> animationStateMap =
-            new WeakHashMap<JComponent, Map<Part, AnimationState>>();
-
-    //this timer is used to cause repaint on animated components
-    //30 repaints per second should give smooth animation affect
-    private final javax.swing.Timer timer =
-        new javax.swing.Timer(1000/30, this);
-
-    private static synchronized AnimationController getAnimationController() {
-        AppContext appContext = AppContext.getAppContext();
-        Object obj = appContext.get(ANIMATION_CONTROLLER_KEY);
-        if (obj == null) {
-            obj = new AnimationController();
-            appContext.put(ANIMATION_CONTROLLER_KEY, obj);
-        }
-        return (AnimationController) obj;
-    }
-
-    private AnimationController() {
-        timer.setRepeats(true);
-        timer.setCoalesce(true);
-        //we need to dispose the controller on l&f change
-        UIManager.addPropertyChangeListener(this);
-    }
-
-    private static void triggerAnimation(JComponent c,
-                           Part part, State newState) {
-        if (c instanceof javax.swing.JTabbedPane
-            || part == Part.TP_BUTTON) {
-            //idk: we can not handle tabs animation because
-            //the same (component,part) is used to handle all the tabs
-            //and we can not track the states
-            //Vista theme might have transition duration for toolbar buttons
-            //but native application does not seem to animate them
-            return;
-        }
-        AnimationController controller =
-            AnimationController.getAnimationController();
-        State oldState = controller.getState(c, part);
-        if (oldState != newState) {
-            controller.putState(c, part, newState);
-            if (newState == State.DEFAULTED) {
-                // it seems for DEFAULTED button state Vista does animation from
-                // HOT
-                oldState = State.HOT;
-            }
-            if (oldState != null) {
-                long duration;
-                if (newState == State.DEFAULTED) {
-                    //Only button might have DEFAULTED state
-                    //idk: do not know how to get the value from Vista
-                    //one second seems plausible value
-                    duration = 1000;
-                } else {
-                    XPStyle xp = XPStyle.getXP();
-                    duration = (xp != null)
-                               ? xp.getThemeTransitionDuration(
-                                       c, part,
-                                       normalizeState(oldState),
-                                       normalizeState(newState),
-                                       Prop.TRANSITIONDURATIONS)
-                               : 1000;
-                }
-                controller.startAnimation(c, part, oldState, newState, duration);
-            }
-        }
-    }
-
-    // for scrollbar up, down, left and right button pictures are
-    // defined by states.  It seems that theme has duration defined
-    // only for up button states thus we doing this translation here.
-    private static State normalizeState(State state) {
-        State rv;
-        switch (state) {
-        case DOWNPRESSED:
-            /* falls through */
-        case LEFTPRESSED:
-            /* falls through */
-        case RIGHTPRESSED:
-            rv = UPPRESSED;
-            break;
-
-        case DOWNDISABLED:
-            /* falls through */
-        case LEFTDISABLED:
-            /* falls through */
-        case RIGHTDISABLED:
-            rv = UPDISABLED;
-            break;
-
-        case DOWNHOT:
-            /* falls through */
-        case LEFTHOT:
-            /* falls through */
-        case RIGHTHOT:
-            rv = UPHOT;
-            break;
-
-        case DOWNNORMAL:
-            /* falls through */
-        case LEFTNORMAL:
-            /* falls through */
-        case RIGHTNORMAL:
-            rv = UPNORMAL;
-            break;
-
-        default :
-            rv = state;
-            break;
-        }
-        return rv;
-    }
-
-    private synchronized State getState(JComponent component, Part part) {
-        State rv = null;
-        Object tmpObject =
-            component.getClientProperty(PartUIClientPropertyKey.getKey(part));
-        if (tmpObject instanceof State) {
-            rv = (State) tmpObject;
-        }
-        return rv;
-    }
-
-    private synchronized void putState(JComponent component, Part part,
-                                       State state) {
-        component.putClientProperty(PartUIClientPropertyKey.getKey(part),
-                                    state);
-    }
-
-    private synchronized void startAnimation(JComponent component,
-                                     Part part,
-                                     State startState,
-                                     State endState,
-                                     long millis) {
-        boolean isForwardAndReverse = false;
-        if (endState == State.DEFAULTED) {
-            isForwardAndReverse = true;
-        }
-        Map<Part, AnimationState> map = animationStateMap.get(component);
-        if (millis <= 0) {
-            if (map != null) {
-                map.remove(part);
-                if (map.size() == 0) {
-                    animationStateMap.remove(component);
-                }
-            }
-            return;
-        }
-        if (map == null) {
-            map = new EnumMap<Part, AnimationState>(Part.class);
-            animationStateMap.put(component, map);
-        }
-        map.put(part,
-                new AnimationState(startState, millis, isForwardAndReverse));
-        if (! timer.isRunning()) {
-            timer.start();
-        }
-    }
-
-    static void paintSkin(JComponent component, Skin skin,
-                      Graphics g, int dx, int dy, int dw, int dh, State state) {
-        if (VISTA_ANIMATION_DISABLED) {
-            skin.paintSkinRaw(g, dx, dy, dw, dh, state);
-            return;
-        }
-        triggerAnimation(component, skin.part, state);
-        AnimationController controller = getAnimationController();
-        synchronized (controller) {
-            AnimationState animationState = null;
-            Map<Part, AnimationState> map =
-                controller.animationStateMap.get(component);
-            if (map != null) {
-                animationState = map.get(skin.part);
-            }
-            if (animationState != null) {
-                animationState.paintSkin(skin, g, dx, dy, dw, dh, state);
-            } else {
-                skin.paintSkinRaw(g, dx, dy, dw, dh, state);
-            }
-        }
-    }
-
-    public synchronized void propertyChange(PropertyChangeEvent e) {
-        if ("lookAndFeel" == e.getPropertyName()
-            && ! (e.getNewValue() instanceof WindowsLookAndFeel) ) {
-            dispose();
-        }
-    }
-
-    public synchronized void actionPerformed(ActionEvent e) {
-        java.util.List<JComponent> componentsToRemove = null;
-        java.util.List<Part> partsToRemove = null;
-        for (JComponent component : animationStateMap.keySet()) {
-            component.repaint();
-            if (partsToRemove != null) {
-                partsToRemove.clear();
-            }
-            Map<Part, AnimationState> map = animationStateMap.get(component);
-            if (! component.isShowing()
-                  || map == null
-                  || map.size() == 0) {
-                if (componentsToRemove == null) {
-                    componentsToRemove = new ArrayList<JComponent>();
-                }
-                componentsToRemove.add(component);
-                continue;
-            }
-            for (Part part : map.keySet()) {
-                if (map.get(part).isDone()) {
-                    if (partsToRemove == null) {
-                        partsToRemove = new ArrayList<Part>();
-                    }
-                    partsToRemove.add(part);
-                }
-            }
-            if (partsToRemove != null) {
-                if (partsToRemove.size() == map.size()) {
-                    //animation is done for the component
-                    if (componentsToRemove == null) {
-                        componentsToRemove = new ArrayList<JComponent>();
-                    }
-                    componentsToRemove.add(component);
-                } else {
-                    for (Part part : partsToRemove) {
-                        map.remove(part);
-                    }
-                }
-            }
-        }
-        if (componentsToRemove != null) {
-            for (JComponent component : componentsToRemove) {
-                animationStateMap.remove(component);
-            }
-        }
-        if (animationStateMap.size() == 0) {
-            timer.stop();
-        }
-    }
-
-    private synchronized void dispose() {
-        timer.stop();
-        UIManager.removePropertyChangeListener(this);
-        synchronized (AnimationController.class) {
-            AppContext.getAppContext()
-                .put(ANIMATION_CONTROLLER_KEY, null);
-        }
-    }
-
-    private static class AnimationState {
-        private final State startState;
-
-        //animation duration in nanoseconds
-        private final long duration;
-
-        //animatin start time in nanoseconds
-        private long startTime;
-
-        //direction the alpha value is changing
-        //forward  - from 0 to 1
-        //!forward - from 1 to 0
-        private boolean isForward = true;
-
-        //if isForwardAndReverse the animation continually goes
-        //forward and reverse. alpha value is changing from 0 to 1 then
-        //from 1 to 0 and so forth
-        private boolean isForwardAndReverse;
-
-        private float progress;
-
-        AnimationState(final State startState,
-                       final long milliseconds,
-                       boolean isForwardAndReverse) {
-            assert startState != null && milliseconds > 0;
-            assert SwingUtilities.isEventDispatchThread();
-
-            this.startState = startState;
-            this.duration = milliseconds * 1000000;
-            this.startTime = System.nanoTime();
-            this.isForwardAndReverse = isForwardAndReverse;
-            progress = 0f;
-        }
-        private void updateProgress() {
-            assert SwingUtilities.isEventDispatchThread();
-
-            if (isDone()) {
-                return;
-            }
-            long currentTime = System.nanoTime();
-
-            progress = ((float) (currentTime - startTime))
-                / duration;
-            progress = Math.max(progress, 0); //in case time was reset
-            if (progress >= 1) {
-                progress = 1;
-                if (isForwardAndReverse) {
-                    startTime = currentTime;
-                    progress = 0;
-                    isForward = ! isForward;
-                }
-            }
-        }
-        void paintSkin(Skin skin, Graphics _g,
-                       int dx, int dy, int dw, int dh, State state) {
-            assert SwingUtilities.isEventDispatchThread();
-
-            updateProgress();
-            if (! isDone()) {
-                Graphics2D g = (Graphics2D) _g.create();
-                if (skin.haveToSwitchStates()) {
-                    skin.paintSkinRaw(g, dx, dy, dw, dh, state);
-                    g.setComposite(AlphaComposite.SrcOver.derive(1 - progress));
-                    skin.paintSkinRaw(g, dx, dy, dw, dh, startState);
-                } else {
-                    skin.paintSkinRaw(g, dx, dy, dw, dh, startState);
-                    float alpha;
-                    if (isForward) {
-                        alpha = progress;
-                    } else {
-                        alpha = 1 - progress;
-                    }
-                    g.setComposite(AlphaComposite.SrcOver.derive(alpha));
-                    skin.paintSkinRaw(g, dx, dy, dw, dh, state);
-                }
-                g.dispose();
-            } else {
-                skin.paintSkinRaw(_g, dx, dy, dw, dh, state);
-                skin.switchStates(false);
-            }
-        }
-        boolean isDone() {
-            assert SwingUtilities.isEventDispatchThread();
-
-            return  progress >= 1;
-        }
-    }
-
-    private static class PartUIClientPropertyKey
-          implements UIClientPropertyKey {
-
-        private static final Map<Part, PartUIClientPropertyKey> map =
-            new EnumMap<Part, PartUIClientPropertyKey>(Part.class);
-
-        static synchronized PartUIClientPropertyKey getKey(Part part) {
-            PartUIClientPropertyKey rv = map.get(part);
-            if (rv == null) {
-                rv = new PartUIClientPropertyKey(part);
-                map.put(part, rv);
-            }
-            return rv;
-        }
-
-        private final Part part;
-        private PartUIClientPropertyKey(Part part) {
-            this.part  = part;
-        }
-        public String toString() {
-            return part.toString();
-        }
-    }
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/TMSchema.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,577 +0,0 @@
-/*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * <p>These classes are designed to be used while the
- * corresponding <code>LookAndFeel</code> class has been installed
- * (<code>UIManager.setLookAndFeel(new <i>XXX</i>LookAndFeel())</code>).
- * Using them while a different <code>LookAndFeel</code> is installed
- * may produce unexpected results, including exceptions.
- * Additionally, changing the <code>LookAndFeel</code>
- * maintained by the <code>UIManager</code> without updating the
- * corresponding <code>ComponentUI</code> of any
- * <code>JComponent</code>s may also produce unexpected results,
- * such as the wrong colors showing up, and is generally not
- * encouraged.
- *
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import java.awt.*;
-import java.util.*;
-
-import javax.swing.*;
-
-import sun.awt.windows.ThemeReader;
-
-/**
- * Implements Windows Parts and their States and Properties for the Windows Look and Feel.
- *
- * See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/userex/topics/partsandstates.asp
- * See tmschema.h (or vssym32.h & vsstyle.h for MS Vista)
- *
- * @author Leif Samuelsson
- */
-class TMSchema {
-
-    /**
-     * An enumeration of the various Windows controls (also known as
-     * components, or top-level parts)
-     */
-    public static enum Control {
-        BUTTON,
-        COMBOBOX,
-        EDIT,
-        HEADER,
-        LISTBOX,
-        LISTVIEW,
-        MENU,
-        PROGRESS,
-        REBAR,
-        SCROLLBAR,
-        SPIN,
-        TAB,
-        TOOLBAR,
-        TRACKBAR,
-        TREEVIEW,
-        WINDOW
-    }
-
-
-    /**
-     * An enumeration of the Windows compoent parts
-     */
-    public static enum Part {
-        MENU (Control.MENU, 0), // Special case, not in native
-        MP_BARBACKGROUND   (Control.MENU, 7),
-        MP_BARITEM         (Control.MENU, 8),
-        MP_POPUPBACKGROUND (Control.MENU, 9),
-        MP_POPUPBORDERS    (Control.MENU, 10),
-        MP_POPUPCHECK      (Control.MENU, 11),
-        MP_POPUPCHECKBACKGROUND (Control.MENU, 12),
-        MP_POPUPGUTTER     (Control.MENU, 13),
-        MP_POPUPITEM       (Control.MENU, 14),
-        MP_POPUPSEPARATOR  (Control.MENU, 15),
-        MP_POPUPSUBMENU    (Control.MENU, 16),
-
-        BP_PUSHBUTTON (Control.BUTTON, 1),
-        BP_RADIOBUTTON(Control.BUTTON, 2),
-        BP_CHECKBOX   (Control.BUTTON, 3),
-        BP_GROUPBOX   (Control.BUTTON, 4),
-
-        CP_COMBOBOX      (Control.COMBOBOX, 0),
-        CP_DROPDOWNBUTTON(Control.COMBOBOX, 1),
-        CP_BACKGROUND    (Control.COMBOBOX, 2),
-        CP_TRANSPARENTBACKGROUND (Control.COMBOBOX, 3),
-        CP_BORDER                (Control.COMBOBOX, 4),
-        CP_READONLY              (Control.COMBOBOX, 5),
-        CP_DROPDOWNBUTTONRIGHT   (Control.COMBOBOX, 6),
-        CP_DROPDOWNBUTTONLEFT    (Control.COMBOBOX, 7),
-        CP_CUEBANNER             (Control.COMBOBOX, 8),
-
-
-        EP_EDIT    (Control.EDIT, 0),
-        EP_EDITTEXT(Control.EDIT, 1),
-
-        HP_HEADERITEM(Control.HEADER,      1),
-        HP_HEADERSORTARROW(Control.HEADER, 4),
-
-        LBP_LISTBOX(Control.LISTBOX, 0),
-
-        LBCP_BORDER_HSCROLL  (Control.LISTBOX, 1),
-        LBCP_BORDER_HVSCROLL (Control.LISTBOX, 2),
-        LBCP_BORDER_NOSCROLL (Control.LISTBOX, 3),
-        LBCP_BORDER_VSCROLL  (Control.LISTBOX, 4),
-        LBCP_ITEM            (Control.LISTBOX, 5),
-
-        LVP_LISTVIEW(Control.LISTVIEW, 0),
-
-        PP_PROGRESS (Control.PROGRESS, 0),
-        PP_BAR      (Control.PROGRESS, 1),
-        PP_BARVERT  (Control.PROGRESS, 2),
-        PP_CHUNK    (Control.PROGRESS, 3),
-        PP_CHUNKVERT(Control.PROGRESS, 4),
-
-        RP_GRIPPER    (Control.REBAR, 1),
-        RP_GRIPPERVERT(Control.REBAR, 2),
-
-        SBP_SCROLLBAR     (Control.SCROLLBAR,  0),
-        SBP_ARROWBTN      (Control.SCROLLBAR,  1),
-        SBP_THUMBBTNHORZ  (Control.SCROLLBAR,  2),
-        SBP_THUMBBTNVERT  (Control.SCROLLBAR,  3),
-        SBP_LOWERTRACKHORZ(Control.SCROLLBAR,  4),
-        SBP_UPPERTRACKHORZ(Control.SCROLLBAR,  5),
-        SBP_LOWERTRACKVERT(Control.SCROLLBAR,  6),
-        SBP_UPPERTRACKVERT(Control.SCROLLBAR,  7),
-        SBP_GRIPPERHORZ   (Control.SCROLLBAR,  8),
-        SBP_GRIPPERVERT   (Control.SCROLLBAR,  9),
-        SBP_SIZEBOX       (Control.SCROLLBAR, 10),
-
-        SPNP_UP  (Control.SPIN, 1),
-        SPNP_DOWN(Control.SPIN, 2),
-
-        TABP_TABITEM         (Control.TAB, 1),
-        TABP_TABITEMLEFTEDGE (Control.TAB, 2),
-        TABP_TABITEMRIGHTEDGE(Control.TAB, 3),
-        TABP_PANE            (Control.TAB, 9),
-
-        TP_TOOLBAR        (Control.TOOLBAR, 0),
-        TP_BUTTON         (Control.TOOLBAR, 1),
-        TP_SEPARATOR      (Control.TOOLBAR, 5),
-        TP_SEPARATORVERT  (Control.TOOLBAR, 6),
-
-        TKP_TRACK      (Control.TRACKBAR,  1),
-        TKP_TRACKVERT  (Control.TRACKBAR,  2),
-        TKP_THUMB      (Control.TRACKBAR,  3),
-        TKP_THUMBBOTTOM(Control.TRACKBAR,  4),
-        TKP_THUMBTOP   (Control.TRACKBAR,  5),
-        TKP_THUMBVERT  (Control.TRACKBAR,  6),
-        TKP_THUMBLEFT  (Control.TRACKBAR,  7),
-        TKP_THUMBRIGHT (Control.TRACKBAR,  8),
-        TKP_TICS       (Control.TRACKBAR,  9),
-        TKP_TICSVERT   (Control.TRACKBAR, 10),
-
-        TVP_TREEVIEW(Control.TREEVIEW, 0),
-        TVP_GLYPH   (Control.TREEVIEW, 2),
-
-        WP_WINDOW          (Control.WINDOW,  0),
-        WP_CAPTION         (Control.WINDOW,  1),
-        WP_MINCAPTION      (Control.WINDOW,  3),
-        WP_MAXCAPTION      (Control.WINDOW,  5),
-        WP_FRAMELEFT       (Control.WINDOW,  7),
-        WP_FRAMERIGHT      (Control.WINDOW,  8),
-        WP_FRAMEBOTTOM     (Control.WINDOW,  9),
-        WP_SYSBUTTON       (Control.WINDOW, 13),
-        WP_MDISYSBUTTON    (Control.WINDOW, 14),
-        WP_MINBUTTON       (Control.WINDOW, 15),
-        WP_MDIMINBUTTON    (Control.WINDOW, 16),
-        WP_MAXBUTTON       (Control.WINDOW, 17),
-        WP_CLOSEBUTTON     (Control.WINDOW, 18),
-        WP_MDICLOSEBUTTON  (Control.WINDOW, 20),
-        WP_RESTOREBUTTON   (Control.WINDOW, 21),
-        WP_MDIRESTOREBUTTON(Control.WINDOW, 22);
-
-        private final Control control;
-        private final int value;
-
-        private Part(Control control, int value) {
-            this.control = control;
-            this.value = value;
-        }
-
-        public int getValue() {
-            return value;
-        }
-
-        public String getControlName(Component component) {
-            String str = "";
-            if (component instanceof JComponent) {
-                JComponent c = (JComponent)component;
-                String subAppName = (String)c.getClientProperty("XPStyle.subAppName");
-                if (subAppName != null) {
-                    str = subAppName + "::";
-                }
-            }
-            return str + control.toString();
-        }
-
-        public String toString() {
-            return control.toString()+"."+name();
-        }
-    }
-
-
-    /**
-     * An enumeration of the possible component states
-     */
-    public static enum State {
-        ACTIVE,
-        ASSIST,
-        BITMAP,
-        CHECKED,
-        CHECKEDDISABLED,
-        CHECKEDHOT,
-        CHECKEDNORMAL,
-        CHECKEDPRESSED,
-        CHECKMARKNORMAL,
-        CHECKMARKDISABLED,
-        BULLETNORMAL,
-        BULLETDISABLED,
-        CLOSED,
-        DEFAULTED,
-        DISABLED,
-        DISABLEDHOT,
-        DISABLEDPUSHED,
-        DOWNDISABLED,
-        DOWNHOT,
-        DOWNNORMAL,
-        DOWNPRESSED,
-        FOCUSED,
-        HOT,
-        HOTCHECKED,
-        ICONHOT,
-        ICONNORMAL,
-        ICONPRESSED,
-        ICONSORTEDHOT,
-        ICONSORTEDNORMAL,
-        ICONSORTEDPRESSED,
-        INACTIVE,
-        INACTIVENORMAL,         // See note 1
-        INACTIVEHOT,            // See note 1
-        INACTIVEPUSHED,         // See note 1
-        INACTIVEDISABLED,       // See note 1
-        LEFTDISABLED,
-        LEFTHOT,
-        LEFTNORMAL,
-        LEFTPRESSED,
-        MIXEDDISABLED,
-        MIXEDHOT,
-        MIXEDNORMAL,
-        MIXEDPRESSED,
-        NORMAL,
-        PRESSED,
-        OPENED,
-        PUSHED,
-        READONLY,
-        RIGHTDISABLED,
-        RIGHTHOT,
-        RIGHTNORMAL,
-        RIGHTPRESSED,
-        SELECTED,
-        UNCHECKEDDISABLED,
-        UNCHECKEDHOT,
-        UNCHECKEDNORMAL,
-        UNCHECKEDPRESSED,
-        UPDISABLED,
-        UPHOT,
-        UPNORMAL,
-        UPPRESSED,
-        HOVER,
-        UPHOVER,
-        DOWNHOVER,
-        LEFTHOVER,
-        RIGHTHOVER,
-        SORTEDDOWN,
-        SORTEDHOT,
-        SORTEDNORMAL,
-        SORTEDPRESSED,
-        SORTEDUP;
-
-
-        /**
-         * A map of allowed states for each Part
-         */
-        private static EnumMap<Part, State[]> stateMap;
-
-        private static synchronized void initStates() {
-            stateMap = new EnumMap<Part, State[]>(Part.class);
-
-            stateMap.put(Part.EP_EDITTEXT,
-                       new State[] {
-                        NORMAL, HOT, SELECTED, DISABLED, FOCUSED, READONLY, ASSIST
-            });
-
-            stateMap.put(Part.BP_PUSHBUTTON,
-                       new State[] { NORMAL, HOT, PRESSED, DISABLED, DEFAULTED });
-
-            stateMap.put(Part.BP_RADIOBUTTON,
-                       new State[] {
-                        UNCHECKEDNORMAL, UNCHECKEDHOT, UNCHECKEDPRESSED, UNCHECKEDDISABLED,
-                        CHECKEDNORMAL,   CHECKEDHOT,   CHECKEDPRESSED,   CHECKEDDISABLED
-            });
-
-            stateMap.put(Part.BP_CHECKBOX,
-                       new State[] {
-                        UNCHECKEDNORMAL, UNCHECKEDHOT, UNCHECKEDPRESSED, UNCHECKEDDISABLED,
-                        CHECKEDNORMAL,   CHECKEDHOT,   CHECKEDPRESSED,   CHECKEDDISABLED,
-                        MIXEDNORMAL,     MIXEDHOT,     MIXEDPRESSED,     MIXEDDISABLED
-            });
-
-            State[] comboBoxStates = new State[] { NORMAL, HOT, PRESSED, DISABLED };
-            stateMap.put(Part.CP_COMBOBOX, comboBoxStates);
-            stateMap.put(Part.CP_DROPDOWNBUTTON, comboBoxStates);
-            stateMap.put(Part.CP_BACKGROUND, comboBoxStates);
-            stateMap.put(Part.CP_TRANSPARENTBACKGROUND, comboBoxStates);
-            stateMap.put(Part.CP_BORDER, comboBoxStates);
-            stateMap.put(Part.CP_READONLY, comboBoxStates);
-            stateMap.put(Part.CP_DROPDOWNBUTTONRIGHT, comboBoxStates);
-            stateMap.put(Part.CP_DROPDOWNBUTTONLEFT, comboBoxStates);
-            stateMap.put(Part.CP_CUEBANNER, comboBoxStates);
-
-            stateMap.put(Part.HP_HEADERITEM, new State[] { NORMAL, HOT, PRESSED,
-                          SORTEDNORMAL, SORTEDHOT, SORTEDPRESSED,
-                          ICONNORMAL, ICONHOT, ICONPRESSED,
-                          ICONSORTEDNORMAL, ICONSORTEDHOT, ICONSORTEDPRESSED });
-
-            stateMap.put(Part.HP_HEADERSORTARROW,
-                         new State[] {SORTEDDOWN, SORTEDUP});
-
-            State[] listBoxStates = new State[] { NORMAL, PRESSED, HOT, DISABLED};
-            stateMap.put(Part.LBCP_BORDER_HSCROLL, listBoxStates);
-            stateMap.put(Part.LBCP_BORDER_HVSCROLL, listBoxStates);
-            stateMap.put(Part.LBCP_BORDER_NOSCROLL, listBoxStates);
-            stateMap.put(Part.LBCP_BORDER_VSCROLL, listBoxStates);
-
-            State[] scrollBarStates = new State[] { NORMAL, HOT, PRESSED, DISABLED, HOVER };
-            stateMap.put(Part.SBP_SCROLLBAR,    scrollBarStates);
-            stateMap.put(Part.SBP_THUMBBTNVERT, scrollBarStates);
-            stateMap.put(Part.SBP_THUMBBTNHORZ, scrollBarStates);
-            stateMap.put(Part.SBP_GRIPPERVERT,  scrollBarStates);
-            stateMap.put(Part.SBP_GRIPPERHORZ,  scrollBarStates);
-
-            stateMap.put(Part.SBP_ARROWBTN,
-                       new State[] {
-                UPNORMAL,    UPHOT,     UPPRESSED,    UPDISABLED,
-                DOWNNORMAL,  DOWNHOT,   DOWNPRESSED,  DOWNDISABLED,
-                LEFTNORMAL,  LEFTHOT,   LEFTPRESSED,  LEFTDISABLED,
-                RIGHTNORMAL, RIGHTHOT,  RIGHTPRESSED, RIGHTDISABLED,
-                UPHOVER,     DOWNHOVER, LEFTHOVER,    RIGHTHOVER
-            });
-
-
-            State[] spinnerStates = new State[] { NORMAL, HOT, PRESSED, DISABLED };
-            stateMap.put(Part.SPNP_UP,   spinnerStates);
-            stateMap.put(Part.SPNP_DOWN, spinnerStates);
-
-            stateMap.put(Part.TVP_GLYPH, new State[] { CLOSED, OPENED });
-
-            State[] frameButtonStates = new State[] {
-                        NORMAL,         HOT,         PUSHED,         DISABLED,  // See note 1
-                        INACTIVENORMAL, INACTIVEHOT, INACTIVEPUSHED, INACTIVEDISABLED,
-            };
-            // Note 1: The INACTIVE frame button states apply when the frame
-            //         is inactive. They are not defined in tmschema.h
-
-            // Fix for 6316538: Vista has five frame button states
-            if (ThemeReader.getInt(Control.WINDOW.toString(),
-                                   Part.WP_CLOSEBUTTON.getValue(), 1,
-                                   Prop.IMAGECOUNT.getValue()) == 10) {
-                frameButtonStates = new State[] {
-                        NORMAL,         HOT,         PUSHED,         DISABLED,         null,
-                        INACTIVENORMAL, INACTIVEHOT, INACTIVEPUSHED, INACTIVEDISABLED, null
-                };
-            }
-
-            stateMap.put(Part.WP_MINBUTTON,     frameButtonStates);
-            stateMap.put(Part.WP_MAXBUTTON,     frameButtonStates);
-            stateMap.put(Part.WP_RESTOREBUTTON, frameButtonStates);
-            stateMap.put(Part.WP_CLOSEBUTTON,   frameButtonStates);
-
-            // States for Slider (trackbar)
-            stateMap.put(Part.TKP_TRACK,     new State[] { NORMAL });
-            stateMap.put(Part.TKP_TRACKVERT, new State[] { NORMAL });
-
-            State[] sliderThumbStates =
-                new State[] { NORMAL, HOT, PRESSED, FOCUSED, DISABLED };
-            stateMap.put(Part.TKP_THUMB,       sliderThumbStates);
-            stateMap.put(Part.TKP_THUMBBOTTOM, sliderThumbStates);
-            stateMap.put(Part.TKP_THUMBTOP,    sliderThumbStates);
-            stateMap.put(Part.TKP_THUMBVERT,   sliderThumbStates);
-            stateMap.put(Part.TKP_THUMBRIGHT,  sliderThumbStates);
-
-            // States for Tabs
-            State[] tabStates = new State[] { NORMAL, HOT, SELECTED, DISABLED, FOCUSED };
-            stateMap.put(Part.TABP_TABITEM,          tabStates);
-            stateMap.put(Part.TABP_TABITEMLEFTEDGE,  tabStates);
-            stateMap.put(Part.TABP_TABITEMRIGHTEDGE, tabStates);
-
-
-            stateMap.put(Part.TP_BUTTON,
-                       new State[] {
-                        NORMAL, HOT, PRESSED, DISABLED, CHECKED, HOTCHECKED
-            });
-
-            State[] frameStates = new State[] { ACTIVE, INACTIVE };
-            stateMap.put(Part.WP_WINDOW,      frameStates);
-            stateMap.put(Part.WP_FRAMELEFT,   frameStates);
-            stateMap.put(Part.WP_FRAMERIGHT,  frameStates);
-            stateMap.put(Part.WP_FRAMEBOTTOM, frameStates);
-
-            State[] captionStates = new State[] { ACTIVE, INACTIVE, DISABLED };
-            stateMap.put(Part.WP_CAPTION,    captionStates);
-            stateMap.put(Part.WP_MINCAPTION, captionStates);
-            stateMap.put(Part.WP_MAXCAPTION, captionStates);
-
-            stateMap.put(Part.MP_BARBACKGROUND,
-                         new State[] { ACTIVE, INACTIVE });
-            stateMap.put(Part.MP_BARITEM,
-                         new State[] { NORMAL, HOT, PUSHED,
-                                       DISABLED, DISABLEDHOT, DISABLEDPUSHED });
-            stateMap.put(Part.MP_POPUPCHECK,
-                         new State[] { CHECKMARKNORMAL, CHECKMARKDISABLED,
-                                       BULLETNORMAL, BULLETDISABLED });
-            stateMap.put(Part.MP_POPUPCHECKBACKGROUND,
-                         new State[] { DISABLEDPUSHED, NORMAL, BITMAP });
-            stateMap.put(Part.MP_POPUPITEM,
-                         new State[] { NORMAL, HOT, DISABLED, DISABLEDHOT });
-            stateMap.put(Part.MP_POPUPSUBMENU,
-                         new State[] { NORMAL, DISABLED });
-
-        }
-
-
-        public static synchronized int getValue(Part part, State state) {
-            if (stateMap == null) {
-                initStates();
-            }
-
-            Enum<?>[] states = stateMap.get(part);
-            if (states != null) {
-                for (int i = 0; i < states.length; i++) {
-                    if (state == states[i]) {
-                        return i + 1;
-                    }
-                }
-            }
-
-            if (state == null || state == State.NORMAL) {
-                return 1;
-            }
-
-            return 0;
-        }
-
-    }
-
-
-    /**
-     * An enumeration of the possible component attributes and the
-     * corresponding value type
-     */
-    public static enum Prop {
-        COLOR(Color.class,                204),
-        SIZE(Dimension.class,             207),
-
-        FLATMENUS(Boolean.class,         1001),
-
-        BORDERONLY(Boolean.class,        2203), // only draw the border area of the image
-
-        IMAGECOUNT(Integer.class,        2401), // the number of state images in an imagefile
-        BORDERSIZE(Integer.class,        2403), // the size of the border line for bgtype=BorderFill
-
-        PROGRESSCHUNKSIZE(Integer.class, 2411), // size of progress control chunks
-        PROGRESSSPACESIZE(Integer.class, 2412), // size of progress control spaces
-
-        TEXTSHADOWOFFSET(Point.class,    3402), // where char shadows are drawn, relative to orig. chars
-
-        NORMALSIZE(Dimension.class,      3409), // size of dest rect that exactly source
-
-
-        SIZINGMARGINS ( Insets.class,    3601), // margins used for 9-grid sizing
-        CONTENTMARGINS(Insets.class,     3602), // margins that define where content can be placed
-        CAPTIONMARGINS(Insets.class,     3603), // margins that define where caption text can be placed
-
-        BORDERCOLOR(Color.class,         3801), // color of borders for BorderFill
-        FILLCOLOR  (  Color.class,       3802), // color of bg fill
-        TEXTCOLOR  (  Color.class,       3803), // color text is drawn in
-
-        TEXTSHADOWCOLOR(Color.class,     3818), // color of text shadow
-
-        BGTYPE(Integer.class,            4001), // basic drawing type for each part
-
-        TEXTSHADOWTYPE(Integer.class,    4010), // type of shadow to draw with text
-
-        TRANSITIONDURATIONS(Integer.class, 6000);
-
-        private final Class<?> type;
-        private final int value;
-
-        private Prop(Class<?> type, int value) {
-            this.type     = type;
-            this.value    = value;
-        }
-
-        public int getValue() {
-            return value;
-        }
-
-        public String toString() {
-            return name()+"["+type.getName()+"] = "+value;
-        }
-    }
-
-
-    /**
-     * An enumeration of attribute values for some Props
-     */
-    public static enum TypeEnum {
-        BT_IMAGEFILE (Prop.BGTYPE, "imagefile",  0),
-        BT_BORDERFILL(Prop.BGTYPE, "borderfill", 1),
-
-        TST_NONE(Prop.TEXTSHADOWTYPE, "none", 0),
-        TST_SINGLE(Prop.TEXTSHADOWTYPE, "single", 1),
-        TST_CONTINUOUS(Prop.TEXTSHADOWTYPE, "continuous", 2);
-
-
-        private TypeEnum(Prop prop, String enumName, int value) {
-            this.prop = prop;
-            this.enumName = enumName;
-            this.value = value;
-        }
-
-        private final Prop prop;
-        private final String enumName;
-        private final int value;
-
-        public String toString() {
-            return prop+"="+enumName+"="+value;
-        }
-
-        String getName() {
-            return enumName;
-        }
-
-
-        static TypeEnum getTypeEnum(Prop prop, int enumval) {
-            for (TypeEnum e : TypeEnum.values()) {
-                if (e.prop == prop && e.value == enumval) {
-                    return e;
-                }
-            }
-            return null;
-        }
-    }
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsBorders.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,341 +0,0 @@
-/*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import javax.swing.*;
-import javax.swing.border.*;
-import javax.swing.plaf.*;
-import javax.swing.plaf.basic.*;
-
-import java.awt.Component;
-import java.awt.Insets;
-import java.awt.Color;
-import java.awt.Graphics;
-
-import static com.sun.java.swing.plaf.windows.TMSchema.*;
-import static com.sun.java.swing.plaf.windows.XPStyle.Skin;
-
-/**
- * Factory object that can vend Borders appropriate for the Windows 95 {@literal L & F}.
- * @author Rich Schiavi
- */
-
-public class WindowsBorders {
-
-    /**
-     * Returns a  border instance for a Windows Progress Bar
-     * @since 1.4
-     */
-    public static Border getProgressBarBorder() {
-        UIDefaults table = UIManager.getLookAndFeelDefaults();
-        Border progressBarBorder = new BorderUIResource.CompoundBorderUIResource(
-                                         new WindowsBorders.ProgressBarBorder(
-                                              table.getColor("ProgressBar.shadow"),
-                                              table.getColor("ProgressBar.highlight")),
-                                              new EmptyBorder(1,1,1,1)
-                                        );
-        return progressBarBorder;
-    }
-
-    /**
-     * Returns a border instance for a Windows ToolBar
-     *
-     * @return a border used for the toolbar
-     * @since 1.4
-     */
-    public static Border getToolBarBorder() {
-        UIDefaults table = UIManager.getLookAndFeelDefaults();
-        Border toolBarBorder = new WindowsBorders.ToolBarBorder(
-                                        table.getColor("ToolBar.shadow"),
-                                        table.getColor("ToolBar.highlight"));
-        return toolBarBorder;
-    }
-
-    /**
-     * Returns an new instance of a border used to indicate which cell item
-     * has focus.
-     *
-     * @return a border to indicate which cell item has focus
-     * @since 1.4
-     */
-    public static Border getFocusCellHighlightBorder() {
-        return new ComplementDashedBorder();
-    }
-
-    public static Border getTableHeaderBorder() {
-        UIDefaults table = UIManager.getLookAndFeelDefaults();
-        Border tableHeaderBorder = new BorderUIResource.CompoundBorderUIResource(
-                           new BasicBorders.ButtonBorder(
-                                           table.getColor("Table.shadow"),
-                                           table.getColor("Table.darkShadow"),
-                                           table.getColor("Table.light"),
-                                           table.getColor("Table.highlight")),
-                                     new BasicBorders.MarginBorder());
-        return tableHeaderBorder;
-    }
-
-    public static Border getInternalFrameBorder() {
-        UIDefaults table = UIManager.getLookAndFeelDefaults();
-        Border internalFrameBorder = new
-            BorderUIResource.CompoundBorderUIResource(
-                BorderFactory.createBevelBorder(BevelBorder.RAISED,
-                    table.getColor("InternalFrame.borderColor"),
-                    table.getColor("InternalFrame.borderHighlight"),
-                    table.getColor("InternalFrame.borderDarkShadow"),
-                    table.getColor("InternalFrame.borderShadow")),
-                new WindowsBorders.InternalFrameLineBorder(
-                    table.getColor("InternalFrame.activeBorderColor"),
-                    table.getColor("InternalFrame.inactiveBorderColor"),
-                    table.getInt("InternalFrame.borderWidth")));
-
-        return internalFrameBorder;
-    }
-
-    @SuppressWarnings("serial") // Superclass is not serializable across versions
-    public static class ProgressBarBorder extends AbstractBorder implements UIResource {
-        protected Color shadow;
-        protected Color highlight;
-
-        public ProgressBarBorder(Color shadow, Color highlight) {
-            this.highlight = highlight;
-            this.shadow = shadow;
-        }
-
-        public void paintBorder(Component c, Graphics g, int x, int y,
-                                int width, int height) {
-            g.setColor(shadow);
-            g.drawLine(x,y, width-1,y); // draw top
-            g.drawLine(x,y, x,height-1); // draw left
-            g.setColor(highlight);
-            g.drawLine(x,height-1, width-1,height-1); // draw bottom
-            g.drawLine(width-1,y, width-1,height-1); // draw right
-        }
-
-        public Insets getBorderInsets(Component c, Insets insets) {
-            insets.set(1,1,1,1);
-            return insets;
-        }
-    }
-
-    /**
-     * A border for the ToolBar. If the ToolBar is floatable then the handle grip is drawn
-     *
-     * @since 1.4
-     */
-    @SuppressWarnings("serial") // Superclass is not serializable across versions
-    public static class ToolBarBorder extends AbstractBorder implements UIResource, SwingConstants {
-        protected Color shadow;
-        protected Color highlight;
-
-        public ToolBarBorder(Color shadow, Color highlight) {
-            this.highlight = highlight;
-            this.shadow = shadow;
-        }
-
-        public void paintBorder(Component c, Graphics g, int x, int y,
-                                int width, int height) {
-            if (!(c instanceof JToolBar)) {
-                return;
-            }
-            g.translate(x, y);
-
-            XPStyle xp = XPStyle.getXP();
-            if (xp != null) {
-                Border xpBorder = xp.getBorder(c, Part.TP_TOOLBAR);
-                if (xpBorder != null) {
-                    xpBorder.paintBorder(c, g, 0, 0, width, height);
-                }
-            }
-            if (((JToolBar)c).isFloatable()) {
-                boolean vertical = ((JToolBar)c).getOrientation() == VERTICAL;
-
-                if (xp != null) {
-                    Part part = vertical ? Part.RP_GRIPPERVERT : Part.RP_GRIPPER;
-                    Skin skin = xp.getSkin(c, part);
-                    int dx, dy, dw, dh;
-                    if (vertical) {
-                        dx = 0;
-                        dy = 2;
-                        dw = width - 1;
-                        dh = skin.getHeight();
-                    } else {
-                        dw = skin.getWidth();
-                        dh = height - 1;
-                        dx = c.getComponentOrientation().isLeftToRight() ? 2 : (width-dw-2);
-                        dy = 0;
-                    }
-                    skin.paintSkin(g, dx, dy, dw, dh, State.NORMAL);
-
-                } else {
-
-                    if (!vertical) {
-                        if (c.getComponentOrientation().isLeftToRight()) {
-                            g.setColor(shadow);
-                            g.drawLine(4, 3, 4, height - 4);
-                            g.drawLine(4, height - 4, 2, height - 4);
-
-                            g.setColor(highlight);
-                            g.drawLine(2, 3, 3, 3);
-                            g.drawLine(2, 3, 2, height - 5);
-                        } else {
-                            g.setColor(shadow);
-                            g.drawLine(width - 3, 3, width - 3, height - 4);
-                            g.drawLine(width - 4, height - 4, width - 4, height - 4);
-
-                            g.setColor(highlight);
-                            g.drawLine(width - 5, 3, width - 4, 3);
-                            g.drawLine(width - 5, 3, width - 5, height - 5);
-                        }
-                    } else { // Vertical
-                        g.setColor(shadow);
-                        g.drawLine(3, 4, width - 4, 4);
-                        g.drawLine(width - 4, 2, width - 4, 4);
-
-                        g.setColor(highlight);
-                        g.drawLine(3, 2, width - 4, 2);
-                        g.drawLine(3, 2, 3, 3);
-                    }
-                }
-            }
-
-            g.translate(-x, -y);
-        }
-
-        public Insets getBorderInsets(Component c, Insets insets) {
-            insets.set(1,1,1,1);
-            if (!(c instanceof JToolBar)) {
-                return insets;
-            }
-            if (((JToolBar)c).isFloatable()) {
-                int gripInset = (XPStyle.getXP() != null) ? 12 : 9;
-                if (((JToolBar)c).getOrientation() == HORIZONTAL) {
-                    if (c.getComponentOrientation().isLeftToRight()) {
-                        insets.left = gripInset;
-                    } else {
-                        insets.right = gripInset;
-                    }
-                } else {
-                    insets.top = gripInset;
-                }
-            }
-            return insets;
-        }
-    }
-
-    /**
-     * This class is an implementation of a dashed border.
-     * @since 1.4
-     */
-    @SuppressWarnings("serial") // Superclass is not serializable across versions
-    public static class DashedBorder extends LineBorder implements UIResource {
-        public DashedBorder(Color color) {
-            super(color);
-        }
-
-        public DashedBorder(Color color, int thickness)  {
-            super(color, thickness);
-        }
-
-        public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
-            Color oldColor = g.getColor();
-            int i;
-
-            g.setColor(lineColor);
-            for(i = 0; i < thickness; i++)  {
-                BasicGraphicsUtils.drawDashedRect(g, x+i, y+i, width-i-i, height-i-i);
-            }
-            g.setColor(oldColor);
-        }
-    }
-
-    /**
-     * A dashed border that paints itself in the complementary color
-     * of the component's background color.
-     */
-    @SuppressWarnings("serial") // Superclass is not serializable across versions
-    static class ComplementDashedBorder extends LineBorder implements UIResource {
-        private Color origColor;
-        private Color paintColor;
-
-        public ComplementDashedBorder() {
-            super(null);
-        }
-
-        public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
-            Color color = c.getBackground();
-
-            if (origColor != color) {
-                origColor = color;
-                paintColor = new Color(~origColor.getRGB());
-            }
-
-            g.setColor(paintColor);
-            BasicGraphicsUtils.drawDashedRect(g, x, y, width, height);
-        }
-    }
-
-    /**
-     * This class is an implementation of the InternalFrameLine border.
-     * @since 1.4
-     */
-    @SuppressWarnings("serial") // Superclass is not serializable across versions
-    public static class InternalFrameLineBorder extends LineBorder implements
-            UIResource {
-        protected Color activeColor;
-        protected Color inactiveColor;
-
-        public InternalFrameLineBorder(Color activeBorderColor,
-                                       Color inactiveBorderColor,
-                                       int thickness) {
-            super(activeBorderColor, thickness);
-            activeColor = activeBorderColor;
-            inactiveColor = inactiveBorderColor;
-        }
-
-        public void paintBorder(Component c, Graphics g, int x, int y,
-                int width, int height) {
-
-            JInternalFrame jif = null;
-            if (c instanceof JInternalFrame) {
-                jif = (JInternalFrame)c;
-            } else if (c instanceof JInternalFrame.JDesktopIcon) {
-                jif = ((JInternalFrame.JDesktopIcon)c).getInternalFrame();
-            } else {
-                return;
-            }
-
-            if (jif.isSelected()) {
-                // Set the line color so the line border gets the correct
-                // color.
-                lineColor = activeColor;
-                super.paintBorder(c, g, x, y, width, height);
-            } else {
-                lineColor = inactiveColor;
-                super.paintBorder(c, g, x, y, width, height);
-            }
-        }
-    }
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsButtonListener.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.java.swing.plaf.windows;
-
-import java.beans.PropertyChangeEvent;
-
-import javax.swing.*;
-import javax.swing.plaf.basic.*;
-
-/**
- * Button Listener
- * <p>
- * <strong>Warning:</strong>
- * Serialized objects of this class will not be compatible with
- * future Swing releases.  The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing.  A future release of Swing will provide support for
- * long term persistence.
- *
- * @author Rich Schiavi
- */
-public class WindowsButtonListener extends BasicButtonListener {
-    public WindowsButtonListener(AbstractButton b) {
-        super(b);
-    }
-    /*
-     This class is currently not used, but exists in case customers
-     were subclassing it.
-     */
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsButtonUI.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,321 +0,0 @@
-/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import javax.swing.plaf.basic.*;
-import javax.swing.border.*;
-import javax.swing.plaf.*;
-import javax.swing.*;
-
-import java.awt.*;
-
-import static com.sun.java.swing.plaf.windows.TMSchema.*;
-import static com.sun.java.swing.plaf.windows.TMSchema.Part.*;
-import static com.sun.java.swing.plaf.windows.XPStyle.Skin;
-import sun.awt.AppContext;
-
-
-/**
- * Windows button.
- * <p>
- * <strong>Warning:</strong>
- * Serialized objects of this class will not be compatible with
- * future Swing releases.  The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing.  A future release of Swing will provide support for
- * long term persistence.
- *
- * @author Jeff Dinkins
- *
- */
-public class WindowsButtonUI extends BasicButtonUI
-{
-    protected int dashedRectGapX;
-    protected int dashedRectGapY;
-    protected int dashedRectGapWidth;
-    protected int dashedRectGapHeight;
-
-    protected Color focusColor;
-
-    private boolean defaults_initialized = false;
-
-    private static final Object WINDOWS_BUTTON_UI_KEY = new Object();
-
-    // ********************************
-    //          Create PLAF
-    // ********************************
-    public static ComponentUI createUI(JComponent c) {
-        AppContext appContext = AppContext.getAppContext();
-        WindowsButtonUI windowsButtonUI =
-                (WindowsButtonUI) appContext.get(WINDOWS_BUTTON_UI_KEY);
-        if (windowsButtonUI == null) {
-            windowsButtonUI = new WindowsButtonUI();
-            appContext.put(WINDOWS_BUTTON_UI_KEY, windowsButtonUI);
-        }
-        return windowsButtonUI;
-    }
-
-
-    // ********************************
-    //            Defaults
-    // ********************************
-    protected void installDefaults(AbstractButton b) {
-        super.installDefaults(b);
-        if(!defaults_initialized) {
-            String pp = getPropertyPrefix();
-            dashedRectGapX = UIManager.getInt(pp + "dashedRectGapX");
-            dashedRectGapY = UIManager.getInt(pp + "dashedRectGapY");
-            dashedRectGapWidth = UIManager.getInt(pp + "dashedRectGapWidth");
-            dashedRectGapHeight = UIManager.getInt(pp + "dashedRectGapHeight");
-            focusColor = UIManager.getColor(pp + "focus");
-            defaults_initialized = true;
-        }
-
-        XPStyle xp = XPStyle.getXP();
-        if (xp != null) {
-            b.setBorder(xp.getBorder(b, getXPButtonType(b)));
-            LookAndFeel.installProperty(b, "rolloverEnabled", Boolean.TRUE);
-        }
-    }
-
-    protected void uninstallDefaults(AbstractButton b) {
-        super.uninstallDefaults(b);
-        defaults_initialized = false;
-    }
-
-    protected Color getFocusColor() {
-        return focusColor;
-    }
-
-    // ********************************
-    //         Paint Methods
-    // ********************************
-
-    /**
-     * Overridden method to render the text without the mnemonic
-     */
-    protected void paintText(Graphics g, AbstractButton b, Rectangle textRect, String text) {
-        WindowsGraphicsUtils.paintText(g, b, textRect, text, getTextShiftOffset());
-    }
-
-    protected void paintFocus(Graphics g, AbstractButton b, Rectangle viewRect, Rectangle textRect, Rectangle iconRect){
-
-        // focus painted same color as text on Basic??
-        int width = b.getWidth();
-        int height = b.getHeight();
-        g.setColor(getFocusColor());
-        BasicGraphicsUtils.drawDashedRect(g, dashedRectGapX, dashedRectGapY,
-                                          width - dashedRectGapWidth, height - dashedRectGapHeight);
-    }
-
-    protected void paintButtonPressed(Graphics g, AbstractButton b){
-        setTextShiftOffset();
-    }
-
-    // ********************************
-    //          Layout Methods
-    // ********************************
-    public Dimension getPreferredSize(JComponent c) {
-        Dimension d = super.getPreferredSize(c);
-
-        /* Ensure that the width and height of the button is odd,
-         * to allow for the focus line if focus is painted
-         */
-        AbstractButton b = (AbstractButton)c;
-        if (d != null && b.isFocusPainted()) {
-            if(d.width % 2 == 0) { d.width += 1; }
-            if(d.height % 2 == 0) { d.height += 1; }
-        }
-        return d;
-    }
-
-
-    /* These rectangles/insets are allocated once for all
-     * ButtonUI.paint() calls.  Re-using rectangles rather than
-     * allocating them in each paint call substantially reduced the time
-     * it took paint to run.  Obviously, this method can't be re-entered.
-     */
-    private Rectangle viewRect = new Rectangle();
-
-    public void paint(Graphics g, JComponent c) {
-        if (XPStyle.getXP() != null) {
-            WindowsButtonUI.paintXPButtonBackground(g, c);
-        }
-        super.paint(g, c);
-    }
-
-    static Part getXPButtonType(AbstractButton b) {
-        if(b instanceof JCheckBox) {
-            return Part.BP_CHECKBOX;
-        }
-        if(b instanceof JRadioButton) {
-            return Part.BP_RADIOBUTTON;
-        }
-        boolean toolbar = (b.getParent() instanceof JToolBar);
-        return toolbar ? Part.TP_BUTTON : Part.BP_PUSHBUTTON;
-    }
-
-    static State getXPButtonState(AbstractButton b) {
-        Part part = getXPButtonType(b);
-        ButtonModel model = b.getModel();
-        State state = State.NORMAL;
-        switch (part) {
-        case BP_RADIOBUTTON:
-            /* falls through */
-        case BP_CHECKBOX:
-            if (! model.isEnabled()) {
-                state = (model.isSelected()) ? State.CHECKEDDISABLED
-                    : State.UNCHECKEDDISABLED;
-            } else if (model.isPressed() && model.isArmed()) {
-                state = (model.isSelected()) ? State.CHECKEDPRESSED
-                    : State.UNCHECKEDPRESSED;
-            } else if (model.isRollover()) {
-                state = (model.isSelected()) ? State.CHECKEDHOT
-                    : State.UNCHECKEDHOT;
-            } else {
-                state = (model.isSelected()) ? State.CHECKEDNORMAL
-                    : State.UNCHECKEDNORMAL;
-            }
-            break;
-        case BP_PUSHBUTTON:
-            /* falls through */
-        case TP_BUTTON:
-            boolean toolbar = (b.getParent() instanceof JToolBar);
-            if (toolbar) {
-                if (model.isArmed() && model.isPressed()) {
-                    state = State.PRESSED;
-                } else if (!model.isEnabled()) {
-                    state = State.DISABLED;
-                } else if (model.isSelected() && model.isRollover()) {
-                    state = State.HOTCHECKED;
-                } else if (model.isSelected()) {
-                    state = State.CHECKED;
-                } else if (model.isRollover()) {
-                    state = State.HOT;
-                } else if (b.hasFocus()) {
-                    state = State.HOT;
-                }
-            } else {
-                if ((model.isArmed() && model.isPressed())
-                      || model.isSelected()) {
-                    state = State.PRESSED;
-                } else if (!model.isEnabled()) {
-                    state = State.DISABLED;
-                } else if (model.isRollover() || model.isPressed()) {
-                    state = State.HOT;
-                } else if (b instanceof JButton
-                           && ((JButton)b).isDefaultButton()) {
-                    state = State.DEFAULTED;
-                } else if (b.hasFocus()) {
-                    state = State.HOT;
-                }
-            }
-            break;
-        default :
-            state = State.NORMAL;
-        }
-
-        return state;
-    }
-
-    static void paintXPButtonBackground(Graphics g, JComponent c) {
-        AbstractButton b = (AbstractButton)c;
-
-        XPStyle xp = XPStyle.getXP();
-
-        Part part = getXPButtonType(b);
-
-        if (b.isContentAreaFilled() && b.getBorder() != null
-                && b.isBorderPainted() && xp != null) {
-
-            Skin skin = xp.getSkin(b, part);
-
-            State state = getXPButtonState(b);
-            Dimension d = c.getSize();
-            int dx = 0;
-            int dy = 0;
-            int dw = d.width;
-            int dh = d.height;
-
-            Border border = c.getBorder();
-            Insets insets;
-            if (border != null) {
-                // Note: The border may be compound, containing an outer
-                // opaque border (supplied by the application), plus an
-                // inner transparent margin border. We want to size the
-                // background to fill the transparent part, but stay
-                // inside the opaque part.
-                insets = WindowsButtonUI.getOpaqueInsets(border, c);
-            } else {
-                insets = c.getInsets();
-            }
-            if (insets != null) {
-                dx += insets.left;
-                dy += insets.top;
-                dw -= (insets.left + insets.right);
-                dh -= (insets.top + insets.bottom);
-            }
-            skin.paintSkin(g, dx, dy, dw, dh, state);
-        }
-    }
-
-    /**
-     * returns - b.getBorderInsets(c) if border is opaque
-     *         - null if border is completely non-opaque
-     *         - somewhere inbetween if border is compound and
-     *              outside border is opaque and inside isn't
-     */
-    private static Insets getOpaqueInsets(Border b, Component c) {
-        if (b == null) {
-            return null;
-        }
-        if (b.isBorderOpaque()) {
-            return b.getBorderInsets(c);
-        } else if (b instanceof CompoundBorder) {
-            CompoundBorder cb = (CompoundBorder)b;
-            Insets iOut = getOpaqueInsets(cb.getOutsideBorder(), c);
-            if (iOut != null && iOut.equals(cb.getOutsideBorder().getBorderInsets(c))) {
-                // Outside border is opaque, keep looking
-                Insets iIn = getOpaqueInsets(cb.getInsideBorder(), c);
-                if (iIn == null) {
-                    // Inside is non-opaque, use outside insets
-                    return iOut;
-                } else {
-                    // Found non-opaque somewhere in the inside (which is
-                    // also compound).
-                    return new Insets(iOut.top + iIn.top, iOut.left + iIn.left,
-                                      iOut.bottom + iIn.bottom, iOut.right + iIn.right);
-                }
-            } else {
-                // Outside is either all non-opaque or has non-opaque
-                // border inside another compound border
-                return iOut;
-            }
-        } else {
-            return null;
-        }
-    }
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsCheckBoxMenuItemUI.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,104 +0,0 @@
-/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import java.awt.*;
-import javax.swing.*;
-import javax.swing.plaf.*;
-import javax.swing.plaf.basic.*;
-
-import com.sun.java.swing.plaf.windows.TMSchema.Part;
-import com.sun.java.swing.plaf.windows.TMSchema.State;
-
-
-/**
- * Windows check box menu item.
- * <p>
- * <strong>Warning:</strong>
- * Serialized objects of this class will not be compatible with
- * future Swing releases.  The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing.  A future release of Swing will provide support for
- * long term persistence.
- */
-public class WindowsCheckBoxMenuItemUI extends BasicCheckBoxMenuItemUI {
-
-    final WindowsMenuItemUIAccessor accessor =
-        new WindowsMenuItemUIAccessor() {
-
-            public JMenuItem getMenuItem() {
-                return menuItem;
-            }
-
-            public State getState(JMenuItem menuItem) {
-                return WindowsMenuItemUI.getState(this, menuItem);
-            }
-
-            public Part getPart(JMenuItem menuItem) {
-                return WindowsMenuItemUI.getPart(this, menuItem);
-            }
-    };
-    public static ComponentUI createUI(JComponent b) {
-        return new WindowsCheckBoxMenuItemUI();
-    }
-
-    @Override
-    protected  void paintBackground(Graphics g, JMenuItem menuItem,
-            Color bgColor) {
-        if (WindowsMenuItemUI.isVistaPainting()) {
-            WindowsMenuItemUI.paintBackground(accessor, g, menuItem, bgColor);
-            return;
-        }
-        super.paintBackground(g, menuItem, bgColor);
-    }
-    /**
-     * Method which renders the text of the current menu item.
-     *
-     * @param g Graphics context
-     * @param menuItem Current menu item to render
-     * @param textRect Bounding rectangle to render the text.
-     * @param text String to render
-     * @since 1.4
-     */
-    protected void paintText(Graphics g, JMenuItem menuItem,
-                             Rectangle textRect, String text) {
-        if (WindowsMenuItemUI.isVistaPainting()) {
-            WindowsMenuItemUI.paintText(accessor, g, menuItem,
-                                        textRect, text);
-            return;
-        }
-        ButtonModel model = menuItem.getModel();
-        Color oldColor = g.getColor();
-
-        if(model.isEnabled() && model.isArmed()) {
-            g.setColor(selectionForeground); // Uses protected field.
-        }
-
-        WindowsGraphicsUtils.paintText(g, menuItem, textRect, text, 0);
-
-        g.setColor(oldColor);
-    }
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsCheckBoxUI.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-/*
- * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import sun.awt.AppContext;
-
-import javax.swing.plaf.basic.*;
-import javax.swing.*;
-import javax.swing.plaf.*;
-
-import java.awt.*;
-
-/**
- * Windows check box.
- * <p>
- * <strong>Warning:</strong>
- * Serialized objects of this class will not be compatible with
- * future Swing releases.  The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing.  A future release of Swing will provide support for
- * long term persistence.
- *
- * @author Jeff Dinkins
- */
-public class WindowsCheckBoxUI extends WindowsRadioButtonUI
-{
-    // NOTE: MetalCheckBoxUI inherts from MetalRadioButtonUI instead
-    // of BasicCheckBoxUI because we want to pick up all the
-    // painting changes made in MetalRadioButtonUI.
-
-    private static final Object WINDOWS_CHECK_BOX_UI_KEY = new Object();
-
-    private static final String propertyPrefix = "CheckBox" + ".";
-
-    private boolean defaults_initialized = false;
-
-    // ********************************
-    //          Create PLAF
-    // ********************************
-    public static ComponentUI createUI(JComponent c) {
-        AppContext appContext = AppContext.getAppContext();
-        WindowsCheckBoxUI windowsCheckBoxUI =
-                (WindowsCheckBoxUI) appContext.get(WINDOWS_CHECK_BOX_UI_KEY);
-        if (windowsCheckBoxUI == null) {
-            windowsCheckBoxUI = new WindowsCheckBoxUI();
-            appContext.put(WINDOWS_CHECK_BOX_UI_KEY, windowsCheckBoxUI);
-        }
-        return windowsCheckBoxUI;
-    }
-
-
-    public String getPropertyPrefix() {
-        return propertyPrefix;
-    }
-
-    // ********************************
-    //          Defaults
-    // ********************************
-    public void installDefaults(AbstractButton b) {
-        super.installDefaults(b);
-        if(!defaults_initialized) {
-            icon = UIManager.getIcon(getPropertyPrefix() + "icon");
-            defaults_initialized = true;
-        }
-    }
-
-    public void uninstallDefaults(AbstractButton b) {
-        super.uninstallDefaults(b);
-        defaults_initialized = false;
-    }
-
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsClassicLookAndFeel.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.swing.plaf.windows;
-
-/**
- * Implements the Windows95/98/ME/NT/2000 Look and Feel.
- * <p>
- * <strong>Warning:</strong>
- * Serialized objects of this class will not be compatible with
- * future Swing releases.  The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing.  A future release of Swing will provide support for
- * long term persistence.
- *
- * @since 1.5
- */
-@SuppressWarnings("serial") // Superclass is not serializable across versions
-public class WindowsClassicLookAndFeel extends WindowsLookAndFeel {
-    public String getName() {
-        return "Windows Classic";
-    }
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsComboBoxUI.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,665 +0,0 @@
-/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeEvent;
-import javax.swing.plaf.basic.*;
-import javax.swing.plaf.*;
-import javax.swing.border.*;
-import javax.swing.*;
-import java.awt.event.*;
-import java.awt.*;
-
-import static com.sun.java.swing.plaf.windows.TMSchema.Part;
-import static com.sun.java.swing.plaf.windows.TMSchema.State;
-import static com.sun.java.swing.plaf.windows.XPStyle.Skin;
-
-import sun.swing.DefaultLookup;
-import sun.swing.StringUIClientPropertyKey;
-
-import com.sun.java.swing.plaf.windows.WindowsBorders.DashedBorder;
-
-/**
- * Windows combo box.
- * <p>
- * <strong>Warning:</strong>
- * Serialized objects of this class will not be compatible with
- * future Swing releases.  The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing.  A future release of Swing will provide support for
- * long term persistence.
- *
- * @author Tom Santos
- * @author Igor Kushnirskiy
- */
-
-public class WindowsComboBoxUI extends BasicComboBoxUI {
-
-    private static final MouseListener rolloverListener =
-        new MouseAdapter() {
-            private void handleRollover(MouseEvent e, boolean isRollover) {
-                JComboBox<?> comboBox = getComboBox(e);
-                WindowsComboBoxUI comboBoxUI = getWindowsComboBoxUI(e);
-                if (comboBox == null || comboBoxUI == null) {
-                    return;
-                }
-                if (! comboBox.isEditable()) {
-                    //mouse over editable ComboBox does not switch rollover
-                    //for the arrow button
-                    ButtonModel m = null;
-                    if (comboBoxUI.arrowButton != null) {
-                        m = comboBoxUI.arrowButton.getModel();
-                    }
-                    if (m != null ) {
-                        m.setRollover(isRollover);
-                    }
-                }
-                comboBoxUI.isRollover = isRollover;
-                comboBox.repaint();
-            }
-
-            public void mouseEntered(MouseEvent e) {
-                handleRollover(e, true);
-            }
-
-            public void mouseExited(MouseEvent e) {
-                handleRollover(e, false);
-            }
-
-            private JComboBox<?> getComboBox(MouseEvent event) {
-                Object source = event.getSource();
-                JComboBox<?> rv = null;
-                if (source instanceof JComboBox) {
-                    rv = (JComboBox) source;
-                } else if (source instanceof XPComboBoxButton) {
-                    rv = ((XPComboBoxButton) source)
-                        .getWindowsComboBoxUI().comboBox;
-                } else if (source instanceof JTextField &&
-                        ((JTextField) source).getParent() instanceof JComboBox) {
-                    rv = (JComboBox) ((JTextField) source).getParent();
-                }
-                return rv;
-            }
-
-            private WindowsComboBoxUI getWindowsComboBoxUI(MouseEvent event) {
-                JComboBox<?> comboBox = getComboBox(event);
-                WindowsComboBoxUI rv = null;
-                if (comboBox != null
-                    && comboBox.getUI() instanceof WindowsComboBoxUI) {
-                    rv = (WindowsComboBoxUI) comboBox.getUI();
-                }
-                return rv;
-            }
-
-        };
-    private boolean isRollover = false;
-
-    private static final PropertyChangeListener componentOrientationListener =
-        new PropertyChangeListener() {
-            public void propertyChange(PropertyChangeEvent e) {
-                String propertyName = e.getPropertyName();
-                Object source = null;
-                if ("componentOrientation" == propertyName
-                    && (source = e.getSource()) instanceof JComboBox
-                    && ((JComboBox) source).getUI() instanceof
-                      WindowsComboBoxUI) {
-                    JComboBox<?> comboBox = (JComboBox) source;
-                    WindowsComboBoxUI comboBoxUI = (WindowsComboBoxUI) comboBox.getUI();
-                    if (comboBoxUI.arrowButton instanceof XPComboBoxButton) {
-                        ((XPComboBoxButton) comboBoxUI.arrowButton).setPart(
-                                    (comboBox.getComponentOrientation() ==
-                                       ComponentOrientation.RIGHT_TO_LEFT)
-                                    ? Part.CP_DROPDOWNBUTTONLEFT
-                                    : Part.CP_DROPDOWNBUTTONRIGHT);
-                            }
-                        }
-                    }
-                };
-
-    public static ComponentUI createUI(JComponent c) {
-        return new WindowsComboBoxUI();
-    }
-
-    public void installUI( JComponent c ) {
-        super.installUI( c );
-        isRollover = false;
-        comboBox.setRequestFocusEnabled( true );
-        if (XPStyle.getXP() != null && arrowButton != null) {
-            //we can not do it in installListeners because arrowButton
-            //is initialized after installListeners is invoked
-            comboBox.addMouseListener(rolloverListener);
-            arrowButton.addMouseListener(rolloverListener);
-            // set empty border as default to see vista animated border
-            comboBox.setBorder(new EmptyBorder(0,0,0,0));
-        }
-    }
-
-    public void uninstallUI(JComponent c ) {
-        comboBox.removeMouseListener(rolloverListener);
-        if(arrowButton != null) {
-            arrowButton.removeMouseListener(rolloverListener);
-        }
-        super.uninstallUI( c );
-    }
-
-    /**
-     * {@inheritDoc}
-     * @since 1.6
-     */
-    @Override
-    protected void installListeners() {
-        super.installListeners();
-        XPStyle xp = XPStyle.getXP();
-        //button glyph for LTR and RTL combobox might differ
-        if (xp != null
-              && xp.isSkinDefined(comboBox, Part.CP_DROPDOWNBUTTONRIGHT)) {
-            comboBox.addPropertyChangeListener("componentOrientation",
-                                               componentOrientationListener);
-        }
-    }
-
-    /**
-     * {@inheritDoc}
-     * @since 1.6
-     */
-    @Override
-    protected void uninstallListeners() {
-        super.uninstallListeners();
-        comboBox.removePropertyChangeListener("componentOrientation",
-                                              componentOrientationListener);
-    }
-
-    /**
-     * {@inheritDoc}
-     * @since 1.6
-     */
-    protected void configureEditor() {
-        super.configureEditor();
-        if (XPStyle.getXP() != null) {
-            editor.addMouseListener(rolloverListener);
-        }
-    }
-
-    /**
-     * {@inheritDoc}
-     * @since 1.6
-     */
-    protected void unconfigureEditor() {
-        super.unconfigureEditor();
-        editor.removeMouseListener(rolloverListener);
-    }
-
-    /**
-     * {@inheritDoc}
-     * @since 1.6
-     */
-    public void paint(Graphics g, JComponent c) {
-        if (XPStyle.getXP() != null) {
-            paintXPComboBoxBackground(g, c);
-        }
-        super.paint(g, c);
-    }
-
-    State getXPComboBoxState(JComponent c) {
-        State state = State.NORMAL;
-        if (!c.isEnabled()) {
-            state = State.DISABLED;
-        } else if (isPopupVisible(comboBox)) {
-            state = State.PRESSED;
-        } else if (comboBox.isEditable()
-                && comboBox.getEditor().getEditorComponent().isFocusOwner()) {
-            state = State.PRESSED;
-        } else if (isRollover) {
-            state = State.HOT;
-        }
-        return state;
-    }
-
-    private void paintXPComboBoxBackground(Graphics g, JComponent c) {
-        XPStyle xp = XPStyle.getXP();
-        if (xp == null) {
-            return;
-        }
-        State state = getXPComboBoxState(c);
-        Skin skin = null;
-        if (! comboBox.isEditable()
-              && xp.isSkinDefined(c, Part.CP_READONLY)) {
-            skin = xp.getSkin(c, Part.CP_READONLY);
-        }
-        if (skin == null) {
-            skin = xp.getSkin(c, Part.CP_BORDER);
-        }
-        skin.paintSkin(g, 0, 0, c.getWidth(), c.getHeight(), state);
-    }
-
-    /**
-     * If necessary paints the currently selected item.
-     *
-     * @param g Graphics to paint to
-     * @param bounds Region to paint current value to
-     * @param hasFocus whether or not the JComboBox has focus
-     * @throws NullPointerException if any of the arguments are null.
-     * @since 1.5
-     */
-    public void paintCurrentValue(Graphics g, Rectangle bounds,
-                                  boolean hasFocus) {
-        XPStyle xp = XPStyle.getXP();
-        if ( xp != null) {
-            bounds.x += 2;
-            bounds.y += 2;
-            bounds.width -= 4;
-            bounds.height -= 4;
-        } else {
-            bounds.x += 1;
-            bounds.y += 1;
-            bounds.width -= 2;
-            bounds.height -= 2;
-        }
-        if (! comboBox.isEditable()
-            && xp != null
-            && xp.isSkinDefined(comboBox, Part.CP_READONLY)) {
-            // On vista for READNLY ComboBox
-            // color for currentValue is the same as for any other item
-
-            // mostly copied from javax.swing.plaf.basic.BasicComboBoxUI.paintCurrentValue
-            ListCellRenderer<Object> renderer = comboBox.getRenderer();
-            Component c;
-            if ( hasFocus && !isPopupVisible(comboBox) ) {
-                c = renderer.getListCellRendererComponent(
-                        listBox,
-                        comboBox.getSelectedItem(),
-                        -1,
-                        true,
-                        false );
-            } else {
-                c = renderer.getListCellRendererComponent(
-                        listBox,
-                        comboBox.getSelectedItem(),
-                        -1,
-                        false,
-                        false );
-            }
-            c.setFont(comboBox.getFont());
-            if ( comboBox.isEnabled() ) {
-                c.setForeground(comboBox.getForeground());
-                c.setBackground(comboBox.getBackground());
-            } else {
-                c.setForeground(DefaultLookup.getColor(
-                         comboBox, this, "ComboBox.disabledForeground", null));
-                c.setBackground(DefaultLookup.getColor(
-                         comboBox, this, "ComboBox.disabledBackground", null));
-            }
-            boolean shouldValidate = false;
-            if (c instanceof JPanel)  {
-                shouldValidate = true;
-            }
-            currentValuePane.paintComponent(g, c, comboBox, bounds.x, bounds.y,
-                                            bounds.width, bounds.height, shouldValidate);
-
-        } else {
-            super.paintCurrentValue(g, bounds, hasFocus);
-        }
-    }
-
-    /**
-     * {@inheritDoc}
-     * @since 1.6
-     */
-    public void paintCurrentValueBackground(Graphics g, Rectangle bounds,
-                                            boolean hasFocus) {
-        if (XPStyle.getXP() == null) {
-            super.paintCurrentValueBackground(g, bounds, hasFocus);
-        }
-    }
-
-    public Dimension getMinimumSize( JComponent c ) {
-        Dimension d = super.getMinimumSize(c);
-        if (XPStyle.getXP() != null) {
-            d.width += 7;
-            boolean isEditable = false;
-            if (c instanceof JComboBox) {
-                isEditable = ((JComboBox) c).isEditable();
-            }
-            d.height += isEditable ? 4 : 6;
-        } else {
-            d.width += 4;
-            d.height += 2;
-        }
-        return d;
-    }
-
-    /**
-     * Creates a layout manager for managing the components which make up the
-     * combo box.
-     *
-     * @return an instance of a layout manager
-     */
-    protected LayoutManager createLayoutManager() {
-        return new BasicComboBoxUI.ComboBoxLayoutManager() {
-            public void layoutContainer(Container parent) {
-                super.layoutContainer(parent);
-
-                if (XPStyle.getXP() != null && arrowButton != null) {
-                    Dimension d = parent.getSize();
-                    Insets insets = getInsets();
-                    int buttonWidth = arrowButton.getPreferredSize().width;
-                    arrowButton.setBounds(WindowsGraphicsUtils.isLeftToRight((JComboBox)parent)
-                                          ? (d.width - insets.right - buttonWidth)
-                                          : insets.left,
-                                          insets.top,
-                                          buttonWidth, d.height - insets.top - insets.bottom);
-                }
-            }
-        };
-    }
-
-    protected void installKeyboardActions() {
-        super.installKeyboardActions();
-    }
-
-    protected ComboPopup createPopup() {
-        return new WinComboPopUp(comboBox);
-    }
-
-    /**
-     * Creates the default editor that will be used in editable combo boxes.
-     * A default editor will be used only if an editor has not been
-     * explicitly set with <code>setEditor</code>.
-     *
-     * @return a <code>ComboBoxEditor</code> used for the combo box
-     * @see javax.swing.JComboBox#setEditor
-     */
-    protected ComboBoxEditor createEditor() {
-        return new WindowsComboBoxEditor();
-    }
-
-    /**
-     * {@inheritDoc}
-     * @since 1.6
-     */
-    @Override
-    protected ListCellRenderer<Object> createRenderer() {
-        XPStyle xp = XPStyle.getXP();
-        if (xp != null && xp.isSkinDefined(comboBox, Part.CP_READONLY)) {
-            return new WindowsComboBoxRenderer();
-        } else {
-            return super.createRenderer();
-        }
-    }
-
-    /**
-     * Creates an button which will be used as the control to show or hide
-     * the popup portion of the combo box.
-     *
-     * @return a button which represents the popup control
-     */
-    protected JButton createArrowButton() {
-        XPStyle xp = XPStyle.getXP();
-        if (xp != null) {
-            return new XPComboBoxButton(xp);
-        } else {
-            return super.createArrowButton();
-        }
-    }
-
-    @SuppressWarnings("serial") // Superclass is not serializable across versions
-    private class XPComboBoxButton extends XPStyle.GlyphButton {
-        private State prevState = null;
-
-        public XPComboBoxButton(XPStyle xp) {
-            super(comboBox,
-                  (! xp.isSkinDefined(comboBox, Part.CP_DROPDOWNBUTTONRIGHT))
-                   ? Part.CP_DROPDOWNBUTTON
-                   : (comboBox.getComponentOrientation() == ComponentOrientation.RIGHT_TO_LEFT)
-                     ? Part.CP_DROPDOWNBUTTONLEFT
-                     : Part.CP_DROPDOWNBUTTONRIGHT
-                  );
-            setRequestFocusEnabled(false);
-        }
-
-        @Override
-        protected State getState() {
-            State rv;
-
-            getModel().setPressed(comboBox.isPopupVisible());
-
-            rv = super.getState();
-            XPStyle xp = XPStyle.getXP();
-            if (rv != State.DISABLED
-                    && comboBox != null && ! comboBox.isEditable()
-                    && xp != null && xp.isSkinDefined(comboBox,
-                            Part.CP_DROPDOWNBUTTONRIGHT)) {
-                /*
-                 * for non editable ComboBoxes Vista seems to have the
-                 * same glyph for all non DISABLED states
-                 */
-                rv = State.NORMAL;
-            }
-            if (rv == State.NORMAL && (prevState == State.HOT || prevState == State.PRESSED)) {
-                /*
-                 * State NORMAL of combobox button cannot overpaint states HOT or PRESSED
-                 * Therefore HOT state must be painted from alpha 1 to 0 and not as usual that
-                 * NORMAL state is painted from alpha 0 to alpha 1.
-                 */
-                skin.switchStates(true);
-            }
-            if (rv != prevState) {
-                prevState = rv;
-            }
-
-            return rv;
-        }
-
-        public Dimension getPreferredSize() {
-            return new Dimension(17, 21);
-        }
-
-        void setPart(Part part) {
-            setPart(comboBox, part);
-        }
-
-        WindowsComboBoxUI getWindowsComboBoxUI() {
-            return WindowsComboBoxUI.this;
-        }
-    }
-
-
-    /**
-     * Subclassed to add Windows specific Key Bindings.
-     * This class is now obsolete and doesn't do anything.
-     * Only included for backwards API compatibility.
-     * Do not call or override.
-     *
-     * @deprecated As of Java 2 platform v1.4.
-     */
-    @Deprecated
-    @SuppressWarnings("serial") // Superclass is not serializable across versions
-    protected class WindowsComboPopup extends BasicComboPopup {
-
-        public WindowsComboPopup( JComboBox<Object> cBox ) {
-            super( cBox );
-        }
-
-        protected KeyListener createKeyListener() {
-            return new InvocationKeyHandler();
-        }
-
-        protected class InvocationKeyHandler extends BasicComboPopup.InvocationKeyHandler {
-            protected InvocationKeyHandler() {
-                WindowsComboPopup.this.super();
-            }
-        }
-    }
-
-    @SuppressWarnings("serial") // Same-version serialization only
-    protected class WinComboPopUp extends BasicComboPopup {
-        private Skin listBoxBorder = null;
-        private XPStyle xp;
-
-        public WinComboPopUp(JComboBox<Object> combo) {
-            super(combo);
-            xp = XPStyle.getXP();
-            if (xp != null && xp.isSkinDefined(combo, Part.LBCP_BORDER_NOSCROLL)) {
-                this.listBoxBorder = new Skin(combo, Part.LBCP_BORDER_NOSCROLL);
-                this.setBorder(new EmptyBorder(1,1,1,1));
-            }
-        }
-
-        protected KeyListener createKeyListener() {
-            return new InvocationKeyHandler();
-        }
-
-        protected class InvocationKeyHandler extends BasicComboPopup.InvocationKeyHandler {
-            protected InvocationKeyHandler() {
-                WinComboPopUp.this.super();
-            }
-        }
-
-        protected void paintComponent(Graphics g) {
-            super.paintComponent(g);
-            if (this.listBoxBorder != null) {
-                this.listBoxBorder.paintSkinRaw(g, this.getX(), this.getY(),
-                        this.getWidth(), this.getHeight(), State.HOT);
-            }
-        }
-    }
-
-
-    /**
-     * Subclassed to highlight selected item in an editable combo box.
-     */
-    public static class WindowsComboBoxEditor
-        extends BasicComboBoxEditor.UIResource {
-
-        /**
-         * {@inheritDoc}
-         * @since 1.6
-         */
-        protected JTextField createEditorComponent() {
-            JTextField editor = super.createEditorComponent();
-            Border border = (Border)UIManager.get("ComboBox.editorBorder");
-
-            if (border != null) {
-                editor.setBorder(border);
-            }
-            editor.setOpaque(false);
-            return editor;
-        }
-
-        public void setItem(Object item) {
-            super.setItem(item);
-            Object focus = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
-            if ((focus == editor) || (focus == editor.getParent())) {
-                editor.selectAll();
-            }
-        }
-    }
-
-    /**
-     * Subclassed to set opacity {@code false} on the renderer
-     * and to show border for focused cells.
-     */
-    @SuppressWarnings("serial") // Superclass is not serializable across versions
-    private static class WindowsComboBoxRenderer
-          extends BasicComboBoxRenderer.UIResource {
-        private static final Object BORDER_KEY
-            = new StringUIClientPropertyKey("BORDER_KEY");
-        private static final Border NULL_BORDER = new EmptyBorder(0, 0, 0, 0);
-
-        // Create own version of DashedBorder with more space on left side
-        private class WindowsComboBoxDashedBorder extends DashedBorder {
-
-            public WindowsComboBoxDashedBorder(Color color, int thickness) {
-                super(color, thickness);
-            }
-
-            public WindowsComboBoxDashedBorder(Color color) {
-                super(color);
-            }
-
-            @Override
-            public Insets getBorderInsets(Component c, Insets i) {
-                return new Insets(0,2,0,0);
-            }
-        }
-
-        public WindowsComboBoxRenderer() {
-            super();
-
-            // correct space on the left side of text items in the combo popup list
-            Insets i = getBorder().getBorderInsets(this);
-            setBorder(new EmptyBorder(0, 2, 0, i.right));
-        }
-        /**
-         * {@inheritDoc}
-         */
-        @Override
-        public Component getListCellRendererComponent(
-                                                 JList<?> list,
-                                                 Object value,
-                                                 int index,
-                                                 boolean isSelected,
-                                                 boolean cellHasFocus) {
-            Component rv =
-                super.getListCellRendererComponent(list, value, index,
-                                                   isSelected, cellHasFocus);
-            if (rv instanceof JComponent) {
-                JComponent component = (JComponent) rv;
-                if (index == -1 && isSelected) {
-                    Border border = component.getBorder();
-                    Border dashedBorder =
-                        new WindowsComboBoxDashedBorder(list.getForeground());
-                    component.setBorder(dashedBorder);
-                    //store current border in client property if needed
-                    if (component.getClientProperty(BORDER_KEY) == null) {
-                        component.putClientProperty(BORDER_KEY,
-                                       (border == null) ? NULL_BORDER : border);
-                    }
-                } else {
-                    if (component.getBorder() instanceof
-                          WindowsBorders.DashedBorder) {
-                        Object storedBorder = component.getClientProperty(BORDER_KEY);
-                        if (storedBorder instanceof Border) {
-                            component.setBorder(
-                                (storedBorder == NULL_BORDER) ? null
-                                    : (Border) storedBorder);
-                        }
-                        component.putClientProperty(BORDER_KEY, null);
-                    }
-                }
-                if (index == -1) {
-                    component.setOpaque(false);
-                    component.setForeground(list.getForeground());
-                } else {
-                    component.setOpaque(true);
-                }
-            }
-            return rv;
-        }
-
-    }
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsDesktopIconUI.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +0,0 @@
-/*
- * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import java.awt.*;
-import javax.swing.plaf.*;
-import javax.swing.plaf.basic.*;
-import javax.swing.*;
-import javax.swing.border.*;
-
-
-
-/**
- * Windows icon for a minimized window on the desktop.
- * <p>
- * <strong>Warning:</strong>
- * Serialized objects of this class will not be compatible with
- * future Swing releases.  The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing.  A future release of Swing will provide support for
- * long term persistence.
- */
-public class WindowsDesktopIconUI extends BasicDesktopIconUI {
-    private int width;
-
-    public static ComponentUI createUI(JComponent c) {
-        return new WindowsDesktopIconUI();
-    }
-
-    public void installDefaults() {
-        super.installDefaults();
-        width = UIManager.getInt("DesktopIcon.width");
-    }
-
-    public void installUI(JComponent c)   {
-        super.installUI(c);
-
-        c.setOpaque(XPStyle.getXP() == null);
-    }
-
-    // Uninstall the listeners added by the WindowsInternalFrameTitlePane
-    public void uninstallUI(JComponent c) {
-        WindowsInternalFrameTitlePane thePane =
-                                        (WindowsInternalFrameTitlePane)iconPane;
-        super.uninstallUI(c);
-        thePane.uninstallListeners();
-    }
-
-    protected void installComponents() {
-        iconPane = new WindowsInternalFrameTitlePane(frame);
-        desktopIcon.setLayout(new BorderLayout());
-        desktopIcon.add(iconPane, BorderLayout.CENTER);
-
-        if (XPStyle.getXP() != null) {
-            desktopIcon.setBorder(null);
-        }
-    }
-
-    public Dimension getPreferredSize(JComponent c) {
-        // Windows desktop icons can not be resized.  Therefore, we should
-        // always return the minimum size of the desktop icon. See
-        // getMinimumSize(JComponent c).
-        return getMinimumSize(c);
-    }
-
-    /**
-     * Windows desktop icons are restricted to a width of 160 pixels by
-     * default.  This value is retrieved by the DesktopIcon.width property.
-     */
-    public Dimension getMinimumSize(JComponent c) {
-        Dimension dim = super.getMinimumSize(c);
-        dim.width = width;
-        return dim;
-    }
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsDesktopManager.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,104 +0,0 @@
-/*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.java.swing.plaf.windows;
-
-import javax.swing.DefaultDesktopManager;
-import javax.swing.JInternalFrame;
-import javax.swing.JLayeredPane;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.beans.PropertyVetoException;
-import java.util.Vector;
-import java.lang.ref.WeakReference;
-
-/**
- * This class implements a DesktopManager which more closely follows
- * the MDI model than the DefaultDesktopManager.  Unlike the
- * DefaultDesktopManager policy, MDI requires that the selected
- * and activated child frames are the same, and that that frame
- * always be the top-most window.
- * <p>
- * The maximized state is managed by the DesktopManager with MDI,
- * instead of just being a property of the individual child frame.
- * This means that if the currently selected window is maximized
- * and another window is selected, that new window will be maximized.
- *
- * @see javax.swing.DefaultDesktopManager
- * @author Thomas Ball
- */
-@SuppressWarnings("serial") // JDK-implementation class
-public class WindowsDesktopManager extends DefaultDesktopManager
-        implements java.io.Serializable, javax.swing.plaf.UIResource {
-
-    /* The frame which is currently selected/activated.
-     * We store this value to enforce MDI's single-selection model.
-     */
-    private WeakReference<JInternalFrame> currentFrameRef;
-
-    public void activateFrame(JInternalFrame f) {
-        JInternalFrame currentFrame = currentFrameRef != null ?
-            currentFrameRef.get() : null;
-        try {
-            super.activateFrame(f);
-            if (currentFrame != null && f != currentFrame) {
-                // If the current frame is maximized, transfer that
-                // attribute to the frame being activated.
-                if (!currentFrame.isClosed() && currentFrame.isMaximum() &&
-                    (f.getClientProperty("JInternalFrame.frameType") !=
-                    "optionDialog") ) {
-                    //Special case.  If key binding was used to select next
-                    //frame instead of minimizing the icon via the minimize
-                    //icon.
-                    if (!currentFrame.isIcon()) {
-                        currentFrame.setMaximum(false);
-                        if (f.isMaximizable()) {
-                            if (!f.isMaximum()) {
-                                f.setMaximum(true);
-                            } else if (f.isMaximum() && f.isIcon()) {
-                                f.setIcon(false);
-                            } else {
-                                f.setMaximum(false);
-                            }
-                        }
-                    }
-                }
-                if (currentFrame.isSelected()) {
-                    currentFrame.setSelected(false);
-                }
-            }
-
-            if (!f.isSelected()) {
-                f.setSelected(true);
-            }
-        } catch (PropertyVetoException e) {}
-        if (f != currentFrame) {
-            currentFrameRef = new WeakReference<JInternalFrame>(f);
-        }
-    }
-
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsDesktopPaneUI.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import javax.swing.*;
-import javax.swing.plaf.basic.*;
-import javax.swing.plaf.ComponentUI;
-import java.awt.event.*;
-
-/**
- * Windows desktop pane.
- * <p>
- * <strong>Warning:</strong>
- * Serialized objects of this class will not be compatible with
- * future Swing releases.  The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing.  A future release of Swing will provide support for
- * long term persistence.
- *
- * @author David Kloba
- */
-public class WindowsDesktopPaneUI extends BasicDesktopPaneUI
-{
-    public static ComponentUI createUI(JComponent c) {
-        return new WindowsDesktopPaneUI();
-    }
-
-    protected void installDesktopManager() {
-        desktopManager = desktop.getDesktopManager();
-        if(desktopManager == null) {
-            desktopManager = new WindowsDesktopManager();
-            desktop.setDesktopManager(desktopManager);
-        }
-    }
-
-    protected void installDefaults() {
-        super.installDefaults();
-    }
-
-    @SuppressWarnings("deprecation")
-    protected void installKeyboardActions() {
-        super.installKeyboardActions();
-
-        // Request focus if it isn't set.
-        if(!desktop.requestDefaultFocus()) {
-            desktop.requestFocus();
-        }
-    }
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsDesktopProperty.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2001, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import javax.swing.UIManager;
-
-import sun.swing.plaf.DesktopProperty;
-
-/**
- * Wrapper for a value from the desktop. The value is lazily looked up, and
- * can be accessed using the <code>UIManager.ActiveValue</code> method
- * <code>createValue</code>. If the underlying desktop property changes this
- * will force the UIs to update all known Frames. You can invoke
- * <code>invalidate</code> to force the value to be fetched again.
- */
-public class WindowsDesktopProperty extends DesktopProperty {
-
-    /**
-     * Updates the UIs of all the known Frames.
-     */
-    @Override
-    protected final void updateAllUIs() {
-        // Check if the current UI is WindowsLookAndfeel and flush the XP style map.
-        // Note: Change the package test if this class is moved to a different package.
-        Class<?> uiClass = UIManager.getLookAndFeel().getClass();
-        if (uiClass.getPackage().equals(WindowsDesktopProperty.class.getPackage())) {
-            XPStyle.invalidateStyle();
-        }
-        super.updateAllUIs();
-    }
-
-    /**
-     * Creates a WindowsDesktopProperty.
-     *
-     * @param key Key used in looking up desktop value.
-     * @param fallback Value used if desktop property is null.
-     */
-    public WindowsDesktopProperty(String key, Object fallback) {
-        super(key,fallback);
-    }
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsEditorPaneUI.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import javax.swing.plaf.*;
-import javax.swing.plaf.basic.*;
-import javax.swing.*;
-import javax.swing.text.Caret;
-
-
-/**
- * Windows rendition of the component.
- * <p>
- * <strong>Warning:</strong>
- * Serialized objects of this class will not be compatible with
- * future Swing releases.  The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing.  A future release of Swing will provide support for
- * long term persistence.
- */
-public class WindowsEditorPaneUI extends BasicEditorPaneUI
-{
-
-    /**
-     * Creates a UI for a JEditorPane.
-     *
-     * @param c the configurable text component
-     * @return the UI
-     */
-    public static ComponentUI createUI(JComponent c) {
-        return new WindowsEditorPaneUI();
-    }
-
-    /**
-     * Creates the object to use for a caret.  By default an
-     * instance of WindowsCaret is created.  This method
-     * can be redefined to provide something else that implements
-     * the InputPosition interface or a subclass of DefaultCaret.
-     *
-     * @return the caret object
-     */
-    protected Caret createCaret() {
-        return new WindowsTextUI.WindowsCaret();
-    }
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1325 +0,0 @@
-/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import javax.swing.*;
-import javax.swing.border.*;
-import javax.swing.filechooser.*;
-import javax.swing.event.*;
-import javax.swing.plaf.*;
-import javax.swing.plaf.basic.*;
-import java.awt.*;
-import java.awt.event.*;
-import java.awt.image.BufferedImage;
-import java.beans.*;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.util.*;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-import sun.awt.shell.ShellFolder;
-import sun.swing.*;
-
-import javax.accessibility.*;
-
-/**
- * Windows {@literal L&F} implementation of a FileChooser.
- *
- * @author Jeff Dinkins
- */
-public class WindowsFileChooserUI extends BasicFileChooserUI {
-
-    // The following are private because the implementation of the
-    // Windows FileChooser L&F is not complete yet.
-
-    private JPanel centerPanel;
-
-    private JLabel lookInLabel;
-    private JComboBox<File> directoryComboBox;
-    private DirectoryComboBoxModel directoryComboBoxModel;
-    private ActionListener directoryComboBoxAction = new DirectoryComboBoxAction();
-
-    private FilterComboBoxModel filterComboBoxModel;
-
-    private JTextField filenameTextField;
-    private FilePane filePane;
-    private WindowsPlacesBar placesBar;
-
-    private JButton approveButton;
-    private JButton cancelButton;
-
-    private JPanel buttonPanel;
-    private JPanel bottomPanel;
-
-    private JComboBox<FileFilter> filterComboBox;
-
-    private static final Dimension hstrut10 = new Dimension(10, 1);
-
-    private static final Dimension vstrut4  = new Dimension(1, 4);
-    private static final Dimension vstrut6  = new Dimension(1, 6);
-    private static final Dimension vstrut8  = new Dimension(1, 8);
-
-    private static final Insets shrinkwrap = new Insets(0,0,0,0);
-
-    // Preferred and Minimum sizes for the dialog box
-    private static int PREF_WIDTH = 425;
-    private static int PREF_HEIGHT = 245;
-    private static Dimension PREF_SIZE = new Dimension(PREF_WIDTH, PREF_HEIGHT);
-
-    private static int MIN_WIDTH = 425;
-    private static int MIN_HEIGHT = 245;
-
-    private static int LIST_PREF_WIDTH = 444;
-    private static int LIST_PREF_HEIGHT = 138;
-    private static Dimension LIST_PREF_SIZE = new Dimension(LIST_PREF_WIDTH, LIST_PREF_HEIGHT);
-
-    // Labels, mnemonics, and tooltips (oh my!)
-    private int    lookInLabelMnemonic = 0;
-    private String lookInLabelText = null;
-    private String saveInLabelText = null;
-
-    private int    fileNameLabelMnemonic = 0;
-    private String fileNameLabelText = null;
-    private int    folderNameLabelMnemonic = 0;
-    private String folderNameLabelText = null;
-
-    private int    filesOfTypeLabelMnemonic = 0;
-    private String filesOfTypeLabelText = null;
-
-    private String upFolderToolTipText = null;
-    private String upFolderAccessibleName = null;
-
-    private String newFolderToolTipText = null;
-    private String newFolderAccessibleName = null;
-
-    private String viewMenuButtonToolTipText = null;
-    private String viewMenuButtonAccessibleName = null;
-
-    private BasicFileView fileView = new WindowsFileView();
-
-    private JLabel fileNameLabel;
-
-    private void populateFileNameLabel() {
-        if (getFileChooser().getFileSelectionMode() == JFileChooser.DIRECTORIES_ONLY) {
-            fileNameLabel.setText(folderNameLabelText);
-            fileNameLabel.setDisplayedMnemonic(folderNameLabelMnemonic);
-        } else {
-            fileNameLabel.setText(fileNameLabelText);
-            fileNameLabel.setDisplayedMnemonic(fileNameLabelMnemonic);
-        }
-    }
-
-    //
-    // ComponentUI Interface Implementation methods
-    //
-    public static ComponentUI createUI(JComponent c) {
-        return new WindowsFileChooserUI((JFileChooser) c);
-    }
-
-    public WindowsFileChooserUI(JFileChooser filechooser) {
-        super(filechooser);
-    }
-
-    public void installUI(JComponent c) {
-        super.installUI(c);
-    }
-
-    public void uninstallComponents(JFileChooser fc) {
-        fc.removeAll();
-    }
-
-    private class WindowsFileChooserUIAccessor implements FilePane.FileChooserUIAccessor {
-        public JFileChooser getFileChooser() {
-            return WindowsFileChooserUI.this.getFileChooser();
-        }
-
-        public BasicDirectoryModel getModel() {
-            return WindowsFileChooserUI.this.getModel();
-        }
-
-        public JPanel createList() {
-            return WindowsFileChooserUI.this.createList(getFileChooser());
-        }
-
-        public JPanel createDetailsView() {
-            return WindowsFileChooserUI.this.createDetailsView(getFileChooser());
-        }
-
-        public boolean isDirectorySelected() {
-            return WindowsFileChooserUI.this.isDirectorySelected();
-        }
-
-        public File getDirectory() {
-            return WindowsFileChooserUI.this.getDirectory();
-        }
-
-        public Action getChangeToParentDirectoryAction() {
-            return WindowsFileChooserUI.this.getChangeToParentDirectoryAction();
-        }
-
-        public Action getApproveSelectionAction() {
-            return WindowsFileChooserUI.this.getApproveSelectionAction();
-        }
-
-        public Action getNewFolderAction() {
-            return WindowsFileChooserUI.this.getNewFolderAction();
-        }
-
-        public MouseListener createDoubleClickListener(JList<?> list) {
-            return WindowsFileChooserUI.this.createDoubleClickListener(getFileChooser(),
-                                                                       list);
-        }
-
-        public ListSelectionListener createListSelectionListener() {
-            return WindowsFileChooserUI.this.createListSelectionListener(getFileChooser());
-        }
-    }
-
-    public void installComponents(JFileChooser fc) {
-        filePane = new FilePane(new WindowsFileChooserUIAccessor());
-        fc.addPropertyChangeListener(filePane);
-
-        FileSystemView fsv = fc.getFileSystemView();
-
-        fc.setBorder(new EmptyBorder(4, 10, 10, 10));
-        fc.setLayout(new BorderLayout(8, 8));
-
-        updateUseShellFolder();
-
-        // ********************************* //
-        // **** Construct the top panel **** //
-        // ********************************* //
-
-        // Directory manipulation buttons
-        JToolBar topPanel = new JToolBar();
-        topPanel.setFloatable(false);
-        topPanel.putClientProperty("JToolBar.isRollover", Boolean.TRUE);
-
-        // Add the top panel to the fileChooser
-        fc.add(topPanel, BorderLayout.NORTH);
-
-        // ComboBox Label
-        @SuppressWarnings("serial") // anonymous class
-        JLabel tmp1 = new JLabel(lookInLabelText, JLabel.TRAILING) {
-            public Dimension getPreferredSize() {
-                return getMinimumSize();
-            }
-
-            public Dimension getMinimumSize() {
-                Dimension d = super.getPreferredSize();
-                if (placesBar != null) {
-                    d.width = Math.max(d.width, placesBar.getWidth());
-                }
-                return d;
-            }
-        };
-        lookInLabel = tmp1;
-        lookInLabel.setDisplayedMnemonic(lookInLabelMnemonic);
-        lookInLabel.setAlignmentX(JComponent.LEFT_ALIGNMENT);
-        lookInLabel.setAlignmentY(JComponent.CENTER_ALIGNMENT);
-        topPanel.add(lookInLabel);
-        topPanel.add(Box.createRigidArea(new Dimension(8,0)));
-
-        // CurrentDir ComboBox
-        @SuppressWarnings("serial") // anonymous class
-        JComboBox<File> tmp2 = new JComboBox<File>() {
-            public Dimension getMinimumSize() {
-                Dimension d = super.getMinimumSize();
-                d.width = 60;
-                return d;
-            }
-
-            public Dimension getPreferredSize() {
-                Dimension d = super.getPreferredSize();
-                // Must be small enough to not affect total width.
-                d.width = 150;
-                return d;
-            }
-        };
-        directoryComboBox = tmp2;
-        directoryComboBox.putClientProperty( "JComboBox.lightweightKeyboardNavigation", "Lightweight" );
-        lookInLabel.setLabelFor(directoryComboBox);
-        directoryComboBoxModel = createDirectoryComboBoxModel(fc);
-        directoryComboBox.setModel(directoryComboBoxModel);
-        directoryComboBox.addActionListener(directoryComboBoxAction);
-        directoryComboBox.setRenderer(createDirectoryComboBoxRenderer(fc));
-        directoryComboBox.setAlignmentX(JComponent.LEFT_ALIGNMENT);
-        directoryComboBox.setAlignmentY(JComponent.CENTER_ALIGNMENT);
-        directoryComboBox.setMaximumRowCount(8);
-
-        topPanel.add(directoryComboBox);
-        topPanel.add(Box.createRigidArea(hstrut10));
-
-        // Up Button
-        JButton upFolderButton = createToolButton(getChangeToParentDirectoryAction(), upFolderIcon,
-            upFolderToolTipText, upFolderAccessibleName);
-        topPanel.add(upFolderButton);
-
-        // New Directory Button
-        if (!UIManager.getBoolean("FileChooser.readOnly")) {
-            JButton newFolderButton = createToolButton(filePane.getNewFolderAction(), newFolderIcon,
-                newFolderToolTipText, newFolderAccessibleName);
-            topPanel.add(newFolderButton);
-        }
-
-        // View button group
-        ButtonGroup viewButtonGroup = new ButtonGroup();
-
-        // Popup Menu
-        final JPopupMenu viewTypePopupMenu = new JPopupMenu();
-
-        final JRadioButtonMenuItem listViewMenuItem = new JRadioButtonMenuItem(
-                filePane.getViewTypeAction(FilePane.VIEWTYPE_LIST));
-        listViewMenuItem.setSelected(filePane.getViewType() == FilePane.VIEWTYPE_LIST);
-        viewTypePopupMenu.add(listViewMenuItem);
-        viewButtonGroup.add(listViewMenuItem);
-
-        final JRadioButtonMenuItem detailsViewMenuItem = new JRadioButtonMenuItem(
-                filePane.getViewTypeAction(FilePane.VIEWTYPE_DETAILS));
-        detailsViewMenuItem.setSelected(filePane.getViewType() == FilePane.VIEWTYPE_DETAILS);
-        viewTypePopupMenu.add(detailsViewMenuItem);
-        viewButtonGroup.add(detailsViewMenuItem);
-
-        // Create icon for viewMenuButton
-        BufferedImage image = new BufferedImage(viewMenuIcon.getIconWidth() + 7, viewMenuIcon.getIconHeight(),
-                BufferedImage.TYPE_INT_ARGB);
-        Graphics graphics = image.getGraphics();
-        viewMenuIcon.paintIcon(filePane, graphics, 0, 0);
-        int x = image.getWidth() - 5;
-        int y = image.getHeight() / 2 - 1;
-        graphics.setColor(Color.BLACK);
-        graphics.fillPolygon(new int[]{x, x + 5, x + 2}, new int[]{y, y, y + 3}, 3);
-
-        // Details Button
-        final JButton viewMenuButton = createToolButton(null, new ImageIcon(image), viewMenuButtonToolTipText,
-                viewMenuButtonAccessibleName);
-
-        viewMenuButton.addMouseListener(new MouseAdapter() {
-            public void mousePressed(MouseEvent e) {
-                if (SwingUtilities.isLeftMouseButton(e) && !viewMenuButton.isSelected()) {
-                    viewMenuButton.setSelected(true);
-
-                    viewTypePopupMenu.show(viewMenuButton, 0, viewMenuButton.getHeight());
-                }
-            }
-        });
-        viewMenuButton.addKeyListener(new KeyAdapter() {
-            public void keyPressed(KeyEvent e) {
-                // Forbid keyboard actions if the button is not in rollover state
-                if (e.getKeyCode() == KeyEvent.VK_SPACE && viewMenuButton.getModel().isRollover()) {
-                    viewMenuButton.setSelected(true);
-
-                    viewTypePopupMenu.show(viewMenuButton, 0, viewMenuButton.getHeight());
-                }
-            }
-        });
-        viewTypePopupMenu.addPopupMenuListener(new PopupMenuListener() {
-            public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
-            }
-
-            public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
-                SwingUtilities.invokeLater(new Runnable() {
-                    public void run() {
-                        viewMenuButton.setSelected(false);
-                    }
-                });
-            }
-
-            public void popupMenuCanceled(PopupMenuEvent e) {
-            }
-        });
-
-        topPanel.add(viewMenuButton);
-
-        topPanel.add(Box.createRigidArea(new Dimension(80, 0)));
-
-        filePane.addPropertyChangeListener(new PropertyChangeListener() {
-            public void propertyChange(PropertyChangeEvent e) {
-                if ("viewType".equals(e.getPropertyName())) {
-                    switch (filePane.getViewType()) {
-                        case FilePane.VIEWTYPE_LIST:
-                            listViewMenuItem.setSelected(true);
-                            break;
-
-                        case FilePane.VIEWTYPE_DETAILS:
-                            detailsViewMenuItem.setSelected(true);
-                            break;
-                    }
-                }
-            }
-        });
-
-        // ************************************** //
-        // ******* Add the directory pane ******* //
-        // ************************************** //
-        centerPanel = new JPanel(new BorderLayout());
-        centerPanel.add(getAccessoryPanel(), BorderLayout.AFTER_LINE_ENDS);
-        JComponent accessory = fc.getAccessory();
-        if(accessory != null) {
-            getAccessoryPanel().add(accessory);
-        }
-        filePane.setPreferredSize(LIST_PREF_SIZE);
-        centerPanel.add(filePane, BorderLayout.CENTER);
-        fc.add(centerPanel, BorderLayout.CENTER);
-
-        // ********************************** //
-        // **** Construct the bottom panel ** //
-        // ********************************** //
-        getBottomPanel().setLayout(new BoxLayout(getBottomPanel(), BoxLayout.LINE_AXIS));
-
-        // Add the bottom panel to file chooser
-        centerPanel.add(getBottomPanel(), BorderLayout.SOUTH);
-
-        // labels
-        JPanel labelPanel = new JPanel();
-        labelPanel.setLayout(new BoxLayout(labelPanel, BoxLayout.PAGE_AXIS));
-        labelPanel.add(Box.createRigidArea(vstrut4));
-
-        fileNameLabel = new JLabel();
-        populateFileNameLabel();
-        fileNameLabel.setAlignmentY(0);
-        labelPanel.add(fileNameLabel);
-
-        labelPanel.add(Box.createRigidArea(new Dimension(1,12)));
-
-        JLabel ftl = new JLabel(filesOfTypeLabelText);
-        ftl.setDisplayedMnemonic(filesOfTypeLabelMnemonic);
-        labelPanel.add(ftl);
-
-        getBottomPanel().add(labelPanel);
-        getBottomPanel().add(Box.createRigidArea(new Dimension(15, 0)));
-
-        // file entry and filters
-        JPanel fileAndFilterPanel = new JPanel();
-        fileAndFilterPanel.add(Box.createRigidArea(vstrut8));
-        fileAndFilterPanel.setLayout(new BoxLayout(fileAndFilterPanel, BoxLayout.Y_AXIS));
-
-        @SuppressWarnings("serial") // anonymous class
-        JTextField tmp3 = new JTextField(35) {
-            public Dimension getMaximumSize() {
-                return new Dimension(Short.MAX_VALUE, super.getPreferredSize().height);
-            }
-        };
-        filenameTextField = tmp3;
-
-        fileNameLabel.setLabelFor(filenameTextField);
-        filenameTextField.addFocusListener(
-            new FocusAdapter() {
-                public void focusGained(FocusEvent e) {
-                    if (!getFileChooser().isMultiSelectionEnabled()) {
-                        filePane.clearSelection();
-                    }
-                }
-            }
-        );
-
-        if (fc.isMultiSelectionEnabled()) {
-            setFileName(fileNameString(fc.getSelectedFiles()));
-        } else {
-            setFileName(fileNameString(fc.getSelectedFile()));
-        }
-
-        fileAndFilterPanel.add(filenameTextField);
-        fileAndFilterPanel.add(Box.createRigidArea(vstrut8));
-
-        filterComboBoxModel = createFilterComboBoxModel();
-        fc.addPropertyChangeListener(filterComboBoxModel);
-        filterComboBox = new JComboBox<FileFilter>(filterComboBoxModel);
-        ftl.setLabelFor(filterComboBox);
-        filterComboBox.setRenderer(createFilterComboBoxRenderer());
-        fileAndFilterPanel.add(filterComboBox);
-
-        getBottomPanel().add(fileAndFilterPanel);
-        getBottomPanel().add(Box.createRigidArea(new Dimension(30, 0)));
-
-        // buttons
-        getButtonPanel().setLayout(new BoxLayout(getButtonPanel(), BoxLayout.Y_AXIS));
-
-        @SuppressWarnings("serial") // anonymous class
-        JButton tmp4 = new JButton(getApproveButtonText(fc)) {
-            public Dimension getMaximumSize() {
-                return approveButton.getPreferredSize().width > cancelButton.getPreferredSize().width ?
-                       approveButton.getPreferredSize() : cancelButton.getPreferredSize();
-            }
-        };
-        approveButton = tmp4;
-        Insets buttonMargin = approveButton.getMargin();
-        buttonMargin = new InsetsUIResource(buttonMargin.top,    buttonMargin.left  + 5,
-                                            buttonMargin.bottom, buttonMargin.right + 5);
-        approveButton.setMargin(buttonMargin);
-        approveButton.setMnemonic(getApproveButtonMnemonic(fc));
-        approveButton.addActionListener(getApproveSelectionAction());
-        approveButton.setToolTipText(getApproveButtonToolTipText(fc));
-        getButtonPanel().add(Box.createRigidArea(vstrut6));
-        getButtonPanel().add(approveButton);
-        getButtonPanel().add(Box.createRigidArea(vstrut4));
-
-        @SuppressWarnings("serial") // anonymous class
-        JButton tmp5 = new JButton(cancelButtonText) {
-            public Dimension getMaximumSize() {
-                return approveButton.getPreferredSize().width > cancelButton.getPreferredSize().width ?
-                       approveButton.getPreferredSize() : cancelButton.getPreferredSize();
-            }
-        };
-        cancelButton = tmp5;
-        cancelButton.setMargin(buttonMargin);
-        cancelButton.setToolTipText(cancelButtonToolTipText);
-        cancelButton.addActionListener(getCancelSelectionAction());
-        getButtonPanel().add(cancelButton);
-
-        if(fc.getControlButtonsAreShown()) {
-            addControlButtons();
-        }
-    }
-
-    private void updateUseShellFolder() {
-        // Decide whether to use the ShellFolder class to populate shortcut
-        // panel and combobox.
-        JFileChooser fc = getFileChooser();
-
-        if (FilePane.usesShellFolder(fc)) {
-            if (placesBar == null && !UIManager.getBoolean("FileChooser.noPlacesBar")) {
-                placesBar = new WindowsPlacesBar(fc, XPStyle.getXP() != null);
-                fc.add(placesBar, BorderLayout.BEFORE_LINE_BEGINS);
-                fc.addPropertyChangeListener(placesBar);
-            }
-        } else {
-            if (placesBar != null) {
-                fc.remove(placesBar);
-                fc.removePropertyChangeListener(placesBar);
-                placesBar = null;
-            }
-        }
-    }
-
-    protected JPanel getButtonPanel() {
-        if(buttonPanel == null) {
-            buttonPanel = new JPanel();
-        }
-        return buttonPanel;
-    }
-
-    protected JPanel getBottomPanel() {
-        if(bottomPanel == null) {
-            bottomPanel = new JPanel();
-        }
-        return bottomPanel;
-    }
-
-    protected void installStrings(JFileChooser fc) {
-        super.installStrings(fc);
-
-        Locale l = fc.getLocale();
-
-        lookInLabelMnemonic = getMnemonic("FileChooser.lookInLabelMnemonic", l);
-        lookInLabelText = UIManager.getString("FileChooser.lookInLabelText",l);
-        saveInLabelText = UIManager.getString("FileChooser.saveInLabelText",l);
-
-        fileNameLabelMnemonic = getMnemonic("FileChooser.fileNameLabelMnemonic", l);
-        fileNameLabelText = UIManager.getString("FileChooser.fileNameLabelText",l);
-        folderNameLabelMnemonic = getMnemonic("FileChooser.folderNameLabelMnemonic", l);
-        folderNameLabelText = UIManager.getString("FileChooser.folderNameLabelText",l);
-
-        filesOfTypeLabelMnemonic = getMnemonic("FileChooser.filesOfTypeLabelMnemonic", l);
-        filesOfTypeLabelText = UIManager.getString("FileChooser.filesOfTypeLabelText",l);
-
-        upFolderToolTipText =  UIManager.getString("FileChooser.upFolderToolTipText",l);
-        upFolderAccessibleName = UIManager.getString("FileChooser.upFolderAccessibleName",l);
-
-        newFolderToolTipText = UIManager.getString("FileChooser.newFolderToolTipText",l);
-        newFolderAccessibleName = UIManager.getString("FileChooser.newFolderAccessibleName",l);
-
-        viewMenuButtonToolTipText = UIManager.getString("FileChooser.viewMenuButtonToolTipText",l);
-        viewMenuButtonAccessibleName = UIManager.getString("FileChooser.viewMenuButtonAccessibleName",l);
-    }
-
-    private Integer getMnemonic(String key, Locale l) {
-        return SwingUtilities2.getUIDefaultsInt(key, l);
-    }
-
-    protected void installListeners(JFileChooser fc) {
-        super.installListeners(fc);
-        ActionMap actionMap = getActionMap();
-        SwingUtilities.replaceUIActionMap(fc, actionMap);
-    }
-
-    protected ActionMap getActionMap() {
-        return createActionMap();
-    }
-
-    protected ActionMap createActionMap() {
-        ActionMap map = new ActionMapUIResource();
-        FilePane.addActionsToMap(map, filePane.getActions());
-        return map;
-    }
-
-    protected JPanel createList(JFileChooser fc) {
-        return filePane.createList();
-    }
-
-    protected JPanel createDetailsView(JFileChooser fc) {
-        return filePane.createDetailsView();
-    }
-
-    /**
-     * Creates a selection listener for the list of files and directories.
-     *
-     * @param fc a <code>JFileChooser</code>
-     * @return a <code>ListSelectionListener</code>
-     */
-    public ListSelectionListener createListSelectionListener(JFileChooser fc) {
-        return super.createListSelectionListener(fc);
-    }
-
-    // Obsolete class, not used in this version.
-    @SuppressWarnings("serial")
-    protected class WindowsNewFolderAction extends NewFolderAction {
-    }
-
-    // Obsolete class, not used in this version.
-    protected class SingleClickListener extends MouseAdapter {
-    }
-
-    // Obsolete class, not used in this version.
-    @SuppressWarnings("serial") // Superclass is not serializable across versions
-    protected class FileRenderer extends DefaultListCellRenderer  {
-    }
-
-    public void uninstallUI(JComponent c) {
-        // Remove listeners
-        c.removePropertyChangeListener(filterComboBoxModel);
-        c.removePropertyChangeListener(filePane);
-        if (placesBar != null) {
-            c.removePropertyChangeListener(placesBar);
-        }
-        cancelButton.removeActionListener(getCancelSelectionAction());
-        approveButton.removeActionListener(getApproveSelectionAction());
-        filenameTextField.removeActionListener(getApproveSelectionAction());
-
-        if (filePane != null) {
-            filePane.uninstallUI();
-            filePane = null;
-        }
-
-        super.uninstallUI(c);
-    }
-
-    /**
-     * Returns the preferred size of the specified
-     * <code>JFileChooser</code>.
-     * The preferred size is at least as large,
-     * in both height and width,
-     * as the preferred size recommended
-     * by the file chooser's layout manager.
-     *
-     * @param c  a <code>JFileChooser</code>
-     * @return   a <code>Dimension</code> specifying the preferred
-     *           width and height of the file chooser
-     */
-    @Override
-    public Dimension getPreferredSize(JComponent c) {
-        int prefWidth = PREF_SIZE.width;
-        Dimension d = c.getLayout().preferredLayoutSize(c);
-        if (d != null) {
-            return new Dimension(d.width < prefWidth ? prefWidth : d.width,
-                                 d.height < PREF_SIZE.height ? PREF_SIZE.height : d.height);
-        } else {
-            return new Dimension(prefWidth, PREF_SIZE.height);
-        }
-    }
-
-    /**
-     * Returns the minimum size of the <code>JFileChooser</code>.
-     *
-     * @param c  a <code>JFileChooser</code>
-     * @return   a <code>Dimension</code> specifying the minimum
-     *           width and height of the file chooser
-     */
-    @Override
-    public Dimension getMinimumSize(JComponent c) {
-        return new Dimension(MIN_WIDTH, MIN_HEIGHT);
-    }
-
-    /**
-     * Returns the maximum size of the <code>JFileChooser</code>.
-     *
-     * @param c  a <code>JFileChooser</code>
-     * @return   a <code>Dimension</code> specifying the maximum
-     *           width and height of the file chooser
-     */
-    @Override
-    public Dimension getMaximumSize(JComponent c) {
-        return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
-    }
-
-    private String fileNameString(File file) {
-        if (file == null) {
-            return null;
-        } else {
-            JFileChooser fc = getFileChooser();
-            if ((fc.isDirectorySelectionEnabled() && !fc.isFileSelectionEnabled()) ||
-                (fc.isDirectorySelectionEnabled() && fc.isFileSelectionEnabled() && fc.getFileSystemView().isFileSystemRoot(file))){
-                return file.getPath();
-            } else {
-                return file.getName();
-            }
-        }
-    }
-
-    private String fileNameString(File[] files) {
-        StringBuilder buf = new StringBuilder();
-        for (int i = 0; files != null && i < files.length; i++) {
-            if (i > 0) {
-                buf.append(" ");
-            }
-            if (files.length > 1) {
-                buf.append("\"");
-            }
-            buf.append(fileNameString(files[i]));
-            if (files.length > 1) {
-                buf.append("\"");
-            }
-        }
-        return buf.toString();
-    }
-
-    /* The following methods are used by the PropertyChange Listener */
-
-    private void doSelectedFileChanged(PropertyChangeEvent e) {
-        File f = (File) e.getNewValue();
-        JFileChooser fc = getFileChooser();
-        if (f != null
-            && ((fc.isFileSelectionEnabled() && !f.isDirectory())
-                || (f.isDirectory() && fc.isDirectorySelectionEnabled()))) {
-
-            setFileName(fileNameString(f));
-        }
-    }
-
-    private void doSelectedFilesChanged(PropertyChangeEvent e) {
-        File[] files = (File[]) e.getNewValue();
-        JFileChooser fc = getFileChooser();
-        if (files != null
-            && files.length > 0
-            && (files.length > 1 || fc.isDirectorySelectionEnabled() || !files[0].isDirectory())) {
-            setFileName(fileNameString(files));
-        }
-    }
-
-    private void doDirectoryChanged(PropertyChangeEvent e) {
-        JFileChooser fc = getFileChooser();
-        FileSystemView fsv = fc.getFileSystemView();
-
-        clearIconCache();
-        File currentDirectory = fc.getCurrentDirectory();
-        if(currentDirectory != null) {
-            directoryComboBoxModel.addItem(currentDirectory);
-
-            if (fc.isDirectorySelectionEnabled() && !fc.isFileSelectionEnabled()) {
-                if (fsv.isFileSystem(currentDirectory)) {
-                    setFileName(currentDirectory.getPath());
-                } else {
-                    setFileName(null);
-                }
-            }
-        }
-    }
-
-    private void doFilterChanged(PropertyChangeEvent e) {
-        clearIconCache();
-    }
-
-    private void doFileSelectionModeChanged(PropertyChangeEvent e) {
-        if (fileNameLabel != null) {
-            populateFileNameLabel();
-        }
-        clearIconCache();
-
-        JFileChooser fc = getFileChooser();
-        File currentDirectory = fc.getCurrentDirectory();
-        if (currentDirectory != null
-            && fc.isDirectorySelectionEnabled()
-            && !fc.isFileSelectionEnabled()
-            && fc.getFileSystemView().isFileSystem(currentDirectory)) {
-
-            setFileName(currentDirectory.getPath());
-        } else {
-            setFileName(null);
-        }
-    }
-
-    private void doAccessoryChanged(PropertyChangeEvent e) {
-        if(getAccessoryPanel() != null) {
-            if(e.getOldValue() != null) {
-                getAccessoryPanel().remove((JComponent) e.getOldValue());
-            }
-            JComponent accessory = (JComponent) e.getNewValue();
-            if(accessory != null) {
-                getAccessoryPanel().add(accessory, BorderLayout.CENTER);
-            }
-        }
-    }
-
-    private void doApproveButtonTextChanged(PropertyChangeEvent e) {
-        JFileChooser chooser = getFileChooser();
-        approveButton.setText(getApproveButtonText(chooser));
-        approveButton.setToolTipText(getApproveButtonToolTipText(chooser));
-        approveButton.setMnemonic(getApproveButtonMnemonic(chooser));
-    }
-
-    private void doDialogTypeChanged(PropertyChangeEvent e) {
-        JFileChooser chooser = getFileChooser();
-        approveButton.setText(getApproveButtonText(chooser));
-        approveButton.setToolTipText(getApproveButtonToolTipText(chooser));
-        approveButton.setMnemonic(getApproveButtonMnemonic(chooser));
-        if (chooser.getDialogType() == JFileChooser.SAVE_DIALOG) {
-            lookInLabel.setText(saveInLabelText);
-        } else {
-            lookInLabel.setText(lookInLabelText);
-        }
-    }
-
-    private void doApproveButtonMnemonicChanged(PropertyChangeEvent e) {
-        approveButton.setMnemonic(getApproveButtonMnemonic(getFileChooser()));
-    }
-
-    private void doControlButtonsChanged(PropertyChangeEvent e) {
-        if(getFileChooser().getControlButtonsAreShown()) {
-            addControlButtons();
-        } else {
-            removeControlButtons();
-        }
-    }
-
-    /*
-     * Listen for filechooser property changes, such as
-     * the selected file changing, or the type of the dialog changing.
-     */
-    public PropertyChangeListener createPropertyChangeListener(JFileChooser fc) {
-        return new PropertyChangeListener() {
-            public void propertyChange(PropertyChangeEvent e) {
-                String s = e.getPropertyName();
-                if(s.equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) {
-                    doSelectedFileChanged(e);
-                } else if (s.equals(JFileChooser.SELECTED_FILES_CHANGED_PROPERTY)) {
-                    doSelectedFilesChanged(e);
-                } else if(s.equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) {
-                    doDirectoryChanged(e);
-                } else if(s.equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) {
-                    doFilterChanged(e);
-                } else if(s.equals(JFileChooser.FILE_SELECTION_MODE_CHANGED_PROPERTY)) {
-                    doFileSelectionModeChanged(e);
-                } else if(s.equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) {
-                    doAccessoryChanged(e);
-                } else if (s.equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY) ||
-                           s.equals(JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) {
-                    doApproveButtonTextChanged(e);
-                } else if(s.equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY)) {
-                    doDialogTypeChanged(e);
-                } else if(s.equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) {
-                    doApproveButtonMnemonicChanged(e);
-                } else if(s.equals(JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) {
-                    doControlButtonsChanged(e);
-                } else if (s == "FileChooser.useShellFolder") {
-                    updateUseShellFolder();
-                    doDirectoryChanged(e);
-                } else if (s.equals("componentOrientation")) {
-                    ComponentOrientation o = (ComponentOrientation)e.getNewValue();
-                    JFileChooser cc = (JFileChooser)e.getSource();
-                    if (o != e.getOldValue()) {
-                        cc.applyComponentOrientation(o);
-                    }
-                } else if (s.equals("ancestor")) {
-                    if (e.getOldValue() == null && e.getNewValue() != null) {
-                        // Ancestor was added, set initial focus
-                        filenameTextField.selectAll();
-                        filenameTextField.requestFocus();
-                    }
-                }
-            }
-        };
-    }
-
-
-    protected void removeControlButtons() {
-        getBottomPanel().remove(getButtonPanel());
-    }
-
-    protected void addControlButtons() {
-        getBottomPanel().add(getButtonPanel());
-    }
-
-    public void ensureFileIsVisible(JFileChooser fc, File f) {
-        filePane.ensureFileIsVisible(fc, f);
-    }
-
-    public void rescanCurrentDirectory(JFileChooser fc) {
-        filePane.rescanCurrentDirectory();
-    }
-
-    public String getFileName() {
-        if(filenameTextField != null) {
-            return filenameTextField.getText();
-        } else {
-            return null;
-        }
-    }
-
-    public void setFileName(String filename) {
-        if(filenameTextField != null) {
-            filenameTextField.setText(filename);
-        }
-    }
-
-    /**
-     * Property to remember whether a directory is currently selected in the UI.
-     * This is normally called by the UI on a selection event.
-     *
-     * @param directorySelected if a directory is currently selected.
-     * @since 1.4
-     */
-    protected void setDirectorySelected(boolean directorySelected) {
-        super.setDirectorySelected(directorySelected);
-        JFileChooser chooser = getFileChooser();
-        if(directorySelected) {
-            approveButton.setText(directoryOpenButtonText);
-            approveButton.setToolTipText(directoryOpenButtonToolTipText);
-            approveButton.setMnemonic(directoryOpenButtonMnemonic);
-        } else {
-            approveButton.setText(getApproveButtonText(chooser));
-            approveButton.setToolTipText(getApproveButtonToolTipText(chooser));
-            approveButton.setMnemonic(getApproveButtonMnemonic(chooser));
-        }
-    }
-
-    public String getDirectoryName() {
-        // PENDING(jeff) - get the name from the directory combobox
-        return null;
-    }
-
-    public void setDirectoryName(String dirname) {
-        // PENDING(jeff) - set the name in the directory combobox
-    }
-
-    protected DirectoryComboBoxRenderer createDirectoryComboBoxRenderer(JFileChooser fc) {
-        return new DirectoryComboBoxRenderer();
-    }
-
-    @SuppressWarnings("serial") // anonymous class
-    private static JButton createToolButton(Action a, Icon defaultIcon, String toolTipText, String accessibleName) {
-        final JButton result = new JButton(a);
-
-        result.setText(null);
-        result.setIcon(defaultIcon);
-        result.setToolTipText(toolTipText);
-        result.setRequestFocusEnabled(false);
-        result.putClientProperty(AccessibleContext.ACCESSIBLE_NAME_PROPERTY, accessibleName);
-        result.putClientProperty(WindowsLookAndFeel.HI_RES_DISABLED_ICON_CLIENT_KEY, Boolean.TRUE);
-        result.setAlignmentX(JComponent.LEFT_ALIGNMENT);
-        result.setAlignmentY(JComponent.CENTER_ALIGNMENT);
-        result.setMargin(shrinkwrap);
-        result.setFocusPainted(false);
-
-        result.setModel(new DefaultButtonModel() {
-            public void setPressed(boolean b) {
-                // Forbid keyboard actions if the button is not in rollover state
-                if (!b || isRollover()) {
-                    super.setPressed(b);
-                }
-            }
-
-            public void setRollover(boolean b) {
-                if (b && !isRollover()) {
-                    // Reset other buttons
-                    for (Component component : result.getParent().getComponents()) {
-                        if (component instanceof JButton && component != result) {
-                            ((JButton) component).getModel().setRollover(false);
-                        }
-                    }
-                }
-
-                super.setRollover(b);
-            }
-
-            public void setSelected(boolean b) {
-                super.setSelected(b);
-
-                if (b) {
-                    stateMask |= PRESSED | ARMED;
-                } else {
-                    stateMask &= ~(PRESSED | ARMED);
-                }
-            }
-        });
-
-        result.addFocusListener(new FocusAdapter() {
-            public void focusGained(FocusEvent e) {
-                result.getModel().setRollover(true);
-            }
-
-            public void focusLost(FocusEvent e) {
-                result.getModel().setRollover(false);
-            }
-        });
-
-        return result;
-    }
-
-    //
-    // Renderer for DirectoryComboBox
-    //
-    @SuppressWarnings("serial") // Superclass is not serializable across versions
-    class DirectoryComboBoxRenderer extends DefaultListCellRenderer  {
-        IndentIcon ii = new IndentIcon();
-        public Component getListCellRendererComponent(JList<?> list, Object value,
-                                                      int index, boolean isSelected,
-                                                      boolean cellHasFocus) {
-
-            super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
-
-            if (value == null) {
-                setText("");
-                return this;
-            }
-            File directory = (File)value;
-            setText(getFileChooser().getName(directory));
-            Icon icon = getFileChooser().getIcon(directory);
-            ii.icon = icon;
-            ii.depth = directoryComboBoxModel.getDepth(index);
-            setIcon(ii);
-
-            return this;
-        }
-    }
-
-    static final int space = 10;
-    class IndentIcon implements Icon {
-
-        Icon icon = null;
-        int depth = 0;
-
-        public void paintIcon(Component c, Graphics g, int x, int y) {
-            if (c.getComponentOrientation().isLeftToRight()) {
-                icon.paintIcon(c, g, x+depth*space, y);
-            } else {
-                icon.paintIcon(c, g, x, y);
-            }
-        }
-
-        public int getIconWidth() {
-            return icon.getIconWidth() + depth*space;
-        }
-
-        public int getIconHeight() {
-            return icon.getIconHeight();
-        }
-
-    }
-
-    //
-    // DataModel for DirectoryComboxbox
-    //
-    protected DirectoryComboBoxModel createDirectoryComboBoxModel(JFileChooser fc) {
-        return new DirectoryComboBoxModel();
-    }
-
-    /**
-     * Data model for a type-face selection combo-box.
-     */
-    @SuppressWarnings("serial") // Superclass is not serializable across versions
-    protected class DirectoryComboBoxModel extends AbstractListModel<File> implements ComboBoxModel<File> {
-        Vector<File> directories = new Vector<File>();
-        int[] depths = null;
-        File selectedDirectory = null;
-        JFileChooser chooser = getFileChooser();
-        FileSystemView fsv = chooser.getFileSystemView();
-
-        public DirectoryComboBoxModel() {
-            // Add the current directory to the model, and make it the
-            // selectedDirectory
-            File dir = getFileChooser().getCurrentDirectory();
-            if(dir != null) {
-                addItem(dir);
-            }
-        }
-
-        /**
-         * Adds the directory to the model and sets it to be selected,
-         * additionally clears out the previous selected directory and
-         * the paths leading up to it, if any.
-         */
-        private void addItem(File directory) {
-
-            if(directory == null) {
-                return;
-            }
-
-            boolean useShellFolder = FilePane.usesShellFolder(chooser);
-
-            directories.clear();
-
-            File[] baseFolders = (useShellFolder)
-                    ? (File[]) ShellFolder.get("fileChooserComboBoxFolders")
-                    : fsv.getRoots();
-            directories.addAll(Arrays.asList(baseFolders));
-
-            // Get the canonical (full) path. This has the side
-            // benefit of removing extraneous chars from the path,
-            // for example /foo/bar/ becomes /foo/bar
-            File canonical;
-            try {
-                canonical = directory.getCanonicalFile();
-            } catch (IOException e) {
-                // Maybe drive is not ready. Can't abort here.
-                canonical = directory;
-            }
-
-            // create File instances of each directory leading up to the top
-            try {
-                File sf = useShellFolder ? ShellFolder.getShellFolder(canonical)
-                                         : canonical;
-                File f = sf;
-                Vector<File> path = new Vector<File>(10);
-                do {
-                    path.addElement(f);
-                } while ((f = f.getParentFile()) != null);
-
-                int pathCount = path.size();
-                // Insert chain at appropriate place in vector
-                for (int i = 0; i < pathCount; i++) {
-                    f = path.get(i);
-                    if (directories.contains(f)) {
-                        int topIndex = directories.indexOf(f);
-                        for (int j = i-1; j >= 0; j--) {
-                            directories.insertElementAt(path.get(j), topIndex+i-j);
-                        }
-                        break;
-                    }
-                }
-                calculateDepths();
-                setSelectedItem(sf);
-            } catch (FileNotFoundException ex) {
-                calculateDepths();
-            }
-        }
-
-        private void calculateDepths() {
-            depths = new int[directories.size()];
-            for (int i = 0; i < depths.length; i++) {
-                File dir = directories.get(i);
-                File parent = dir.getParentFile();
-                depths[i] = 0;
-                if (parent != null) {
-                    for (int j = i-1; j >= 0; j--) {
-                        if (parent.equals(directories.get(j))) {
-                            depths[i] = depths[j] + 1;
-                            break;
-                        }
-                    }
-                }
-            }
-        }
-
-        public int getDepth(int i) {
-            return (depths != null && i >= 0 && i < depths.length) ? depths[i] : 0;
-        }
-
-        public void setSelectedItem(Object selectedDirectory) {
-            this.selectedDirectory = (File)selectedDirectory;
-            fireContentsChanged(this, -1, -1);
-        }
-
-        public Object getSelectedItem() {
-            return selectedDirectory;
-        }
-
-        public int getSize() {
-            return directories.size();
-        }
-
-        public File getElementAt(int index) {
-            return directories.elementAt(index);
-        }
-    }
-
-    //
-    // Renderer for Types ComboBox
-    //
-    protected FilterComboBoxRenderer createFilterComboBoxRenderer() {
-        return new FilterComboBoxRenderer();
-    }
-
-    /**
-     * Render different type sizes and styles.
-     */
-    @SuppressWarnings("serial") // Superclass is not serializable across versions
-    public class FilterComboBoxRenderer extends DefaultListCellRenderer {
-        public Component getListCellRendererComponent(JList<?> list,
-            Object value, int index, boolean isSelected,
-            boolean cellHasFocus) {
-
-            super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
-
-            if (value != null && value instanceof FileFilter) {
-                setText(((FileFilter)value).getDescription());
-            }
-
-            return this;
-        }
-    }
-
-    //
-    // DataModel for Types Comboxbox
-    //
-    protected FilterComboBoxModel createFilterComboBoxModel() {
-        return new FilterComboBoxModel();
-    }
-
-    /**
-     * Data model for a type-face selection combo-box.
-     */
-    @SuppressWarnings("serial") // Superclass is not serializable across versions
-    protected class FilterComboBoxModel extends AbstractListModel<FileFilter> implements ComboBoxModel<FileFilter>,
-            PropertyChangeListener {
-        protected FileFilter[] filters;
-        protected FilterComboBoxModel() {
-            super();
-            filters = getFileChooser().getChoosableFileFilters();
-        }
-
-        public void propertyChange(PropertyChangeEvent e) {
-            String prop = e.getPropertyName();
-            if(prop == JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) {
-                filters = (FileFilter[]) e.getNewValue();
-                fireContentsChanged(this, -1, -1);
-            } else if (prop == JFileChooser.FILE_FILTER_CHANGED_PROPERTY) {
-                fireContentsChanged(this, -1, -1);
-            }
-        }
-
-        public void setSelectedItem(Object filter) {
-            if(filter != null) {
-                getFileChooser().setFileFilter((FileFilter) filter);
-                fireContentsChanged(this, -1, -1);
-            }
-        }
-
-        public Object getSelectedItem() {
-            // Ensure that the current filter is in the list.
-            // NOTE: we shouldnt' have to do this, since JFileChooser adds
-            // the filter to the choosable filters list when the filter
-            // is set. Lets be paranoid just in case someone overrides
-            // setFileFilter in JFileChooser.
-            FileFilter currentFilter = getFileChooser().getFileFilter();
-            boolean found = false;
-            if(currentFilter != null) {
-                for (FileFilter filter : filters) {
-                    if (filter == currentFilter) {
-                        found = true;
-                    }
-                }
-                if(found == false) {
-                    getFileChooser().addChoosableFileFilter(currentFilter);
-                }
-            }
-            return getFileChooser().getFileFilter();
-        }
-
-        public int getSize() {
-            if(filters != null) {
-                return filters.length;
-            } else {
-                return 0;
-            }
-        }
-
-        public FileFilter getElementAt(int index) {
-            if(index > getSize() - 1) {
-                // This shouldn't happen. Try to recover gracefully.
-                return getFileChooser().getFileFilter();
-            }
-            if(filters != null) {
-                return filters[index];
-            } else {
-                return null;
-            }
-        }
-    }
-
-    public void valueChanged(ListSelectionEvent e) {
-        JFileChooser fc = getFileChooser();
-        File f = fc.getSelectedFile();
-        if (!e.getValueIsAdjusting() && f != null && !getFileChooser().isTraversable(f)) {
-            setFileName(fileNameString(f));
-        }
-    }
-
-    /**
-     * Acts when DirectoryComboBox has changed the selected item.
-     */
-    protected class DirectoryComboBoxAction implements ActionListener {
-
-
-
-
-        public void actionPerformed(ActionEvent e) {
-            File f = (File)directoryComboBox.getSelectedItem();
-            getFileChooser().setCurrentDirectory(f);
-        }
-    }
-
-    protected JButton getApproveButton(JFileChooser fc) {
-        return approveButton;
-    }
-
-    public FileView getFileView(JFileChooser fc) {
-        return fileView;
-    }
-
-    // ***********************
-    // * FileView operations *
-    // ***********************
-    protected class WindowsFileView extends BasicFileView {
-        /* FileView type descriptions */
-
-        public Icon getIcon(File f) {
-            Icon icon = getCachedIcon(f);
-            if (icon != null) {
-                return icon;
-            }
-            if (f != null) {
-                icon = getFileChooser().getFileSystemView().getSystemIcon(f);
-            }
-            if (icon == null) {
-                icon = super.getIcon(f);
-            }
-            cacheIcon(f, icon);
-            return icon;
-        }
-    }
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsGraphicsUtils.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,236 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import sun.swing.SwingUtilities2;
-
-import java.awt.*;
-
-import javax.swing.*;
-import javax.swing.plaf.UIResource;
-
-import static com.sun.java.swing.plaf.windows.TMSchema.*;
-
-/**
- * A collection of static utility methods used for rendering the Windows look
- * and feel.
- *
- * @author Mark Davidson
- * @since 1.4
- */
-public class WindowsGraphicsUtils {
-
-    /**
-     * Renders a text String in Windows without the mnemonic.
-     * This is here because the WindowsUI hierarchy doesn't match the Component hierarchy. All
-     * the overriden paintText methods of the ButtonUI delegates will call this static method.
-     *
-     * @param g Graphics context
-     * @param b Current button to render
-     * @param textRect Bounding rectangle to render the text.
-     * @param text String to render
-     */
-    public static void paintText(Graphics g, AbstractButton b,
-                                        Rectangle textRect, String text,
-                                        int textShiftOffset) {
-        FontMetrics fm = SwingUtilities2.getFontMetrics(b, g);
-
-        int mnemIndex = b.getDisplayedMnemonicIndex();
-        // W2K Feature: Check to see if the Underscore should be rendered.
-        if (WindowsLookAndFeel.isMnemonicHidden() == true) {
-            mnemIndex = -1;
-        }
-
-        XPStyle xp = XPStyle.getXP();
-        if (xp != null && !(b instanceof JMenuItem)) {
-            paintXPText(b, g, textRect.x + textShiftOffset,
-                    textRect.y + fm.getAscent() + textShiftOffset,
-                    text, mnemIndex);
-        } else {
-            paintClassicText(b, g, textRect.x + textShiftOffset,
-                    textRect.y + fm.getAscent() + textShiftOffset,
-                    text, mnemIndex);
-        }
-    }
-
-    static void paintClassicText(AbstractButton b, Graphics g, int x, int y,
-                                 String text, int mnemIndex) {
-        ButtonModel model = b.getModel();
-
-        /* Draw the Text */
-        Color color = b.getForeground();
-        if(model.isEnabled()) {
-            /*** paint the text normally */
-            if(!(b instanceof JMenuItem && model.isArmed())
-                && !(b instanceof JMenu && (model.isSelected() || model.isRollover()))) {
-                /* We shall not set foreground color for selected menu or
-                 * armed menuitem. Foreground must be set in appropriate
-                 * Windows* class because these colors passes from
-                 * BasicMenuItemUI as protected fields and we can't
-                 * reach them from this class */
-                g.setColor(b.getForeground());
-            }
-            SwingUtilities2.drawStringUnderlineCharAt(b, g,text, mnemIndex, x, y);
-        } else {        /*** paint the text disabled ***/
-            color = getDisabledTextColor(b);
-            if (color == null) {
-                color = UIManager.getColor("Button.shadow");
-            }
-            Color shadow = UIManager.getColor("Button.disabledShadow");
-            if(model.isArmed()) {
-                color = UIManager.getColor("Button.disabledForeground");
-            } else {
-                if (shadow == null) {
-                    shadow = b.getBackground().darker();
-                }
-                g.setColor(shadow);
-                SwingUtilities2.drawStringUnderlineCharAt(b, g, text, mnemIndex,
-                                                          x + 1, y + 1);
-            }
-            if (color == null) {
-                color = b.getBackground().brighter();
-            }
-            g.setColor(color);
-            SwingUtilities2.drawStringUnderlineCharAt(b, g, text, mnemIndex, x, y);
-        }
-    }
-
-    private static Color getDisabledTextColor(AbstractButton b) {
-        if (b instanceof JCheckBox) {
-            return UIManager.getColor("CheckBox.disabledText");
-        } else if (b instanceof JRadioButton) {
-            return UIManager.getColor("RadioButton.disabledText");
-        } else if (b instanceof JToggleButton) {
-            return  UIManager.getColor("ToggleButton.disabledText");
-        } else if (b instanceof JButton) {
-            return UIManager.getColor("Button.disabledText");
-        }
-        return null;
-    }
-
-    static void paintXPText(AbstractButton b, Graphics g, int x, int y,
-                            String text, int mnemIndex) {
-        Part part = WindowsButtonUI.getXPButtonType(b);
-        State state = WindowsButtonUI.getXPButtonState(b);
-        paintXPText(b, part, state, g, x, y, text, mnemIndex);
-    }
-
-    static void paintXPText(AbstractButton b, Part part, State state,
-            Graphics g, int x, int y, String text, int mnemIndex) {
-        XPStyle xp = XPStyle.getXP();
-        if (xp == null) {
-            return;
-        }
-        Color textColor;
-        if (b.isEnabled()) {
-            textColor = b.getForeground();
-        }
-        else {
-            textColor = getDisabledTextColor(b);
-        }
-
-        if (textColor == null || textColor instanceof UIResource) {
-            textColor = xp.getColor(b, part, state, Prop.TEXTCOLOR, b.getForeground());
-            // to work around an apparent bug in Windows, use the pushbutton
-            // color for disabled toolbar buttons if the disabled color is the
-            // same as the enabled color
-            if (part == Part.TP_BUTTON && state == State.DISABLED) {
-                Color enabledColor = xp.getColor(b, part, State.NORMAL,
-                                     Prop.TEXTCOLOR, b.getForeground());
-                if(textColor.equals(enabledColor)) {
-                    textColor = xp.getColor(b, Part.BP_PUSHBUTTON, state,
-                                Prop.TEXTCOLOR, textColor);
-                }
-            }
-            // only draw shadow if developer hasn't changed the foreground color
-            // and if the current style has text shadows.
-            TypeEnum shadowType = xp.getTypeEnum(b, part,
-                                                 state, Prop.TEXTSHADOWTYPE);
-            if (shadowType == TypeEnum.TST_SINGLE ||
-                        shadowType == TypeEnum.TST_CONTINUOUS) {
-                Color shadowColor = xp.getColor(b, part, state,
-                                                Prop.TEXTSHADOWCOLOR, Color.black);
-                Point offset = xp.getPoint(b, part, state, Prop.TEXTSHADOWOFFSET);
-                if (offset != null) {
-                    g.setColor(shadowColor);
-                    SwingUtilities2.drawStringUnderlineCharAt(b, g, text, mnemIndex,
-                                                              x + offset.x,
-                                                              y + offset.y);
-                }
-            }
-        }
-
-        g.setColor(textColor);
-        SwingUtilities2.drawStringUnderlineCharAt(b, g, text, mnemIndex, x, y);
-    }
-
-    static boolean isLeftToRight(Component c) {
-        return c.getComponentOrientation().isLeftToRight();
-    }
-
-    /*
-     * Repaints all the components with the mnemonics in the given window and
-     * all its owned windows.
-     */
-    static void repaintMnemonicsInWindow(Window w) {
-        if(w == null || !w.isShowing()) {
-            return;
-        }
-
-        Window[] ownedWindows = w.getOwnedWindows();
-        for(int i=0;i<ownedWindows.length;i++) {
-            repaintMnemonicsInWindow(ownedWindows[i]);
-        }
-
-        repaintMnemonicsInContainer(w);
-    }
-
-    /*
-     * Repaints all the components with the mnemonics in container.
-     * Recursively searches for all the subcomponents.
-     */
-    static void repaintMnemonicsInContainer(Container cont) {
-        Component c;
-        for(int i=0; i<cont.getComponentCount(); i++) {
-            c = cont.getComponent(i);
-            if(c == null || !c.isVisible()) {
-                continue;
-            }
-            if(c instanceof AbstractButton
-               && ((AbstractButton)c).getMnemonic() != '\0') {
-                c.repaint();
-                continue;
-            } else if(c instanceof JLabel
-                      && ((JLabel)c).getDisplayedMnemonic() != '\0') {
-                c.repaint();
-                continue;
-            }
-            if(c instanceof Container) {
-                repaintMnemonicsInContainer((Container)c);
-            }
-        }
-    }
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsIconFactory.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,974 +0,0 @@
-/*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import javax.swing.*;
-import javax.swing.plaf.ButtonUI;
-import javax.swing.plaf.UIResource;
-
-import java.awt.*;
-import java.io.Serializable;
-
-import static com.sun.java.swing.plaf.windows.TMSchema.*;
-import static com.sun.java.swing.plaf.windows.XPStyle.Skin;
-
-import sun.swing.MenuItemCheckIconFactory;
-import sun.swing.SwingUtilities2;
-
-/**
- * Factory object that can vend Icons appropriate for the Windows {@literal L & F}.
- * <p>
- * <strong>Warning:</strong>
- * Serialized objects of this class will not be compatible with
- * future Swing releases.  The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing.  A future release of Swing will provide support for
- * long term persistence.
- *
- * @author David Kloba
- * @author Georges Saab
- * @author Rich Schiavi
- */
-@SuppressWarnings("serial") // Same-version serialization only
-public class WindowsIconFactory implements Serializable
-{
-    private static Icon frame_closeIcon;
-    private static Icon frame_iconifyIcon;
-    private static Icon frame_maxIcon;
-    private static Icon frame_minIcon;
-    private static Icon frame_resizeIcon;
-    private static Icon checkBoxIcon;
-    private static Icon radioButtonIcon;
-    private static Icon checkBoxMenuItemIcon;
-    private static Icon radioButtonMenuItemIcon;
-    private static Icon menuItemCheckIcon;
-    private static Icon menuItemArrowIcon;
-    private static Icon menuArrowIcon;
-    private static VistaMenuItemCheckIconFactory menuItemCheckIconFactory;
-
-    public static Icon getMenuItemCheckIcon() {
-        if (menuItemCheckIcon == null) {
-            menuItemCheckIcon = new MenuItemCheckIcon();
-        }
-        return menuItemCheckIcon;
-    }
-
-    public static Icon getMenuItemArrowIcon() {
-        if (menuItemArrowIcon == null) {
-            menuItemArrowIcon = new MenuItemArrowIcon();
-        }
-        return menuItemArrowIcon;
-    }
-
-    public static Icon getMenuArrowIcon() {
-        if (menuArrowIcon == null) {
-            menuArrowIcon = new MenuArrowIcon();
-        }
-        return menuArrowIcon;
-    }
-
-    public static Icon getCheckBoxIcon() {
-        if (checkBoxIcon == null) {
-            checkBoxIcon = new CheckBoxIcon();
-        }
-        return checkBoxIcon;
-    }
-
-    public static Icon getRadioButtonIcon() {
-        if (radioButtonIcon == null) {
-            radioButtonIcon = new RadioButtonIcon();
-        }
-        return radioButtonIcon;
-    }
-
-    public static Icon getCheckBoxMenuItemIcon() {
-        if (checkBoxMenuItemIcon == null) {
-            checkBoxMenuItemIcon = new CheckBoxMenuItemIcon();
-        }
-        return checkBoxMenuItemIcon;
-    }
-
-    public static Icon getRadioButtonMenuItemIcon() {
-        if (radioButtonMenuItemIcon == null) {
-            radioButtonMenuItemIcon = new RadioButtonMenuItemIcon();
-        }
-        return radioButtonMenuItemIcon;
-    }
-
-    static
-    synchronized VistaMenuItemCheckIconFactory getMenuItemCheckIconFactory() {
-        if (menuItemCheckIconFactory == null) {
-            menuItemCheckIconFactory =
-                new VistaMenuItemCheckIconFactory();
-        }
-        return menuItemCheckIconFactory;
-    }
-
-    public static Icon createFrameCloseIcon() {
-        if (frame_closeIcon == null) {
-            frame_closeIcon = new FrameButtonIcon(Part.WP_CLOSEBUTTON);
-        }
-        return frame_closeIcon;
-    }
-
-    public static Icon createFrameIconifyIcon() {
-        if (frame_iconifyIcon == null) {
-            frame_iconifyIcon = new FrameButtonIcon(Part.WP_MINBUTTON);
-        }
-        return frame_iconifyIcon;
-    }
-
-    public static Icon createFrameMaximizeIcon() {
-        if (frame_maxIcon == null) {
-            frame_maxIcon = new FrameButtonIcon(Part.WP_MAXBUTTON);
-        }
-        return frame_maxIcon;
-    }
-
-    public static Icon createFrameMinimizeIcon() {
-        if (frame_minIcon == null) {
-            frame_minIcon = new FrameButtonIcon(Part.WP_RESTOREBUTTON);
-        }
-        return frame_minIcon;
-    }
-
-    public static Icon createFrameResizeIcon() {
-        if(frame_resizeIcon == null)
-            frame_resizeIcon = new ResizeIcon();
-        return frame_resizeIcon;
-    }
-
-
-    @SuppressWarnings("serial") // Same-version serialization only
-    private static class FrameButtonIcon implements Icon, Serializable {
-        private Part part;
-
-        private FrameButtonIcon(Part part) {
-            this.part = part;
-        }
-
-        public void paintIcon(Component c, Graphics g, int x0, int y0) {
-            int width = getIconWidth();
-            int height = getIconHeight();
-
-            XPStyle xp = XPStyle.getXP();
-            if (xp != null) {
-                Skin skin = xp.getSkin(c, part);
-                AbstractButton b = (AbstractButton)c;
-                ButtonModel model = b.getModel();
-
-                // Find out if frame is inactive
-                JInternalFrame jif = (JInternalFrame)SwingUtilities.
-                                        getAncestorOfClass(JInternalFrame.class, b);
-                boolean jifSelected = (jif != null && jif.isSelected());
-
-                State state;
-                if (jifSelected) {
-                    if (!model.isEnabled()) {
-                        state = State.DISABLED;
-                    } else if (model.isArmed() && model.isPressed()) {
-                        state = State.PUSHED;
-                    } else if (model.isRollover()) {
-                        state = State.HOT;
-                    } else {
-                        state = State.NORMAL;
-                    }
-                } else {
-                    if (!model.isEnabled()) {
-                        state = State.INACTIVEDISABLED;
-                    } else if (model.isArmed() && model.isPressed()) {
-                        state = State.INACTIVEPUSHED;
-                    } else if (model.isRollover()) {
-                        state = State.INACTIVEHOT;
-                    } else {
-                        state = State.INACTIVENORMAL;
-                    }
-                }
-                skin.paintSkin(g, 0, 0, width, height, state);
-            } else {
-                g.setColor(Color.black);
-                int x = width / 12 + 2;
-                int y = height / 5;
-                int h = height - y * 2 - 1;
-                int w = width * 3/4 -3;
-                int thickness2 = Math.max(height / 8, 2);
-                int thickness  = Math.max(width / 15, 1);
-                if (part == Part.WP_CLOSEBUTTON) {
-                    int lineWidth;
-                    if      (width > 47) lineWidth = 6;
-                    else if (width > 37) lineWidth = 5;
-                    else if (width > 26) lineWidth = 4;
-                    else if (width > 16) lineWidth = 3;
-                    else if (width > 12) lineWidth = 2;
-                    else                 lineWidth = 1;
-                    y = height / 12 + 2;
-                    if (lineWidth == 1) {
-                        if (w % 2 == 1) { x++; w++; }
-                        g.drawLine(x,     y, x+w-2, y+w-2);
-                        g.drawLine(x+w-2, y, x,     y+w-2);
-                    } else if (lineWidth == 2) {
-                        if (w > 6) { x++; w--; }
-                        g.drawLine(x,     y, x+w-2, y+w-2);
-                        g.drawLine(x+w-2, y, x,     y+w-2);
-                        g.drawLine(x+1,   y, x+w-1, y+w-2);
-                        g.drawLine(x+w-1, y, x+1,   y+w-2);
-                    } else {
-                        x += 2; y++; w -= 2;
-                        g.drawLine(x,     y,   x+w-1, y+w-1);
-                        g.drawLine(x+w-1, y,   x,     y+w-1);
-                        g.drawLine(x+1,   y,   x+w-1, y+w-2);
-                        g.drawLine(x+w-2, y,   x,     y+w-2);
-                        g.drawLine(x,     y+1, x+w-2, y+w-1);
-                        g.drawLine(x+w-1, y+1, x+1,   y+w-1);
-                        for (int i = 4; i <= lineWidth; i++) {
-                            g.drawLine(x+i-2,   y,     x+w-1,   y+w-i+1);
-                            g.drawLine(x,       y+i-2, x+w-i+1, y+w-1);
-                            g.drawLine(x+w-i+1, y,     x,       y+w-i+1);
-                            g.drawLine(x+w-1,   y+i-2, x+i-2,   y+w-1);
-                        }
-                    }
-                } else if (part == Part.WP_MINBUTTON) {
-                    g.fillRect(x, y+h-thickness2, w-w/3, thickness2);
-                } else if (part == Part.WP_MAXBUTTON) {
-                    g.fillRect(x, y, w, thickness2);
-                    g.fillRect(x, y, thickness, h);
-                    g.fillRect(x+w-thickness, y, thickness, h);
-                    g.fillRect(x, y+h-thickness, w, thickness);
-                } else if (part == Part.WP_RESTOREBUTTON) {
-                    g.fillRect(x+w/3, y, w-w/3, thickness2);
-                    g.fillRect(x+w/3, y, thickness, h/3);
-                    g.fillRect(x+w-thickness, y, thickness, h-h/3);
-                    g.fillRect(x+w-w/3, y+h-h/3-thickness, w/3, thickness);
-
-                    g.fillRect(x, y+h/3, w-w/3, thickness2);
-                    g.fillRect(x, y+h/3, thickness, h-h/3);
-                    g.fillRect(x+w-w/3-thickness, y+h/3, thickness, h-h/3);
-                    g.fillRect(x, y+h-thickness, w-w/3, thickness);
-                }
-            }
-        }
-
-        public int getIconWidth() {
-            int width;
-            if (XPStyle.getXP() != null) {
-                // Fix for XP bug where sometimes these sizes aren't updated properly
-                // Assume for now that height is correct and derive width using the
-                // ratio from the uxtheme part
-                width = UIManager.getInt("InternalFrame.titleButtonHeight") -2;
-                Dimension d = XPStyle.getPartSize(Part.WP_CLOSEBUTTON, State.NORMAL);
-                if (d != null && d.width != 0 && d.height != 0) {
-                    width = (int) ((float) width * d.width / d.height);
-                }
-            } else {
-                width = UIManager.getInt("InternalFrame.titleButtonWidth") -2;
-            }
-            if (XPStyle.getXP() != null) {
-                width -= 2;
-            }
-            return width;
-        }
-
-        public int getIconHeight() {
-            int height = UIManager.getInt("InternalFrame.titleButtonHeight")-4;
-            return height;
-        }
-    }
-
-
-
-        @SuppressWarnings("serial") // Same-version serialization only
-        private static class ResizeIcon implements Icon, Serializable {
-            public void paintIcon(Component c, Graphics g, int x, int y) {
-                g.setColor(UIManager.getColor("InternalFrame.resizeIconHighlight"));
-                g.drawLine(0, 11, 11, 0);
-                g.drawLine(4, 11, 11, 4);
-                g.drawLine(8, 11, 11, 8);
-
-                g.setColor(UIManager.getColor("InternalFrame.resizeIconShadow"));
-                g.drawLine(1, 11, 11, 1);
-                g.drawLine(2, 11, 11, 2);
-                g.drawLine(5, 11, 11, 5);
-                g.drawLine(6, 11, 11, 6);
-                g.drawLine(9, 11, 11, 9);
-                g.drawLine(10, 11, 11, 10);
-            }
-            public int getIconWidth() { return 13; }
-            public int getIconHeight() { return 13; }
-        };
-
-    @SuppressWarnings("serial") // Same-version serialization only
-    private static class CheckBoxIcon implements Icon, Serializable
-    {
-        static final int csize = 13;
-        public void paintIcon(Component c, Graphics g, int x, int y) {
-            JCheckBox cb = (JCheckBox) c;
-            ButtonModel model = cb.getModel();
-            XPStyle xp = XPStyle.getXP();
-
-            if (xp != null) {
-                State state;
-                if (model.isSelected()) {
-                    state = State.CHECKEDNORMAL;
-                    if (!model.isEnabled()) {
-                        state = State.CHECKEDDISABLED;
-                    } else if (model.isPressed() && model.isArmed()) {
-                        state = State.CHECKEDPRESSED;
-                    } else if (model.isRollover()) {
-                        state = State.CHECKEDHOT;
-                    }
-                } else {
-                    state = State.UNCHECKEDNORMAL;
-                    if (!model.isEnabled()) {
-                        state = State.UNCHECKEDDISABLED;
-                    } else if (model.isPressed() && model.isArmed()) {
-                        state = State.UNCHECKEDPRESSED;
-                    } else if (model.isRollover()) {
-                        state = State.UNCHECKEDHOT;
-                    }
-                }
-                Part part = Part.BP_CHECKBOX;
-                xp.getSkin(c, part).paintSkin(g, x, y, state);
-            } else {
-                // outer bevel
-                if(!cb.isBorderPaintedFlat()) {
-                    // Outer top/left
-                    g.setColor(UIManager.getColor("CheckBox.shadow"));
-                    g.drawLine(x, y, x+11, y);
-                    g.drawLine(x, y+1, x, y+11);
-
-                    // Outer bottom/right
-                    g.setColor(UIManager.getColor("CheckBox.highlight"));
-                    g.drawLine(x+12, y, x+12, y+12);
-                    g.drawLine(x, y+12, x+11, y+12);
-
-                    // Inner top.left
-                    g.setColor(UIManager.getColor("CheckBox.darkShadow"));
-                    g.drawLine(x+1, y+1, x+10, y+1);
-                    g.drawLine(x+1, y+2, x+1, y+10);
-
-                    // Inner bottom/right
-                    g.setColor(UIManager.getColor("CheckBox.light"));
-                    g.drawLine(x+1, y+11, x+11, y+11);
-                    g.drawLine(x+11, y+1, x+11, y+10);
-
-                    // inside box
-                    if((model.isPressed() && model.isArmed()) || !model.isEnabled()) {
-                        g.setColor(UIManager.getColor("CheckBox.background"));
-                    } else {
-                        g.setColor(UIManager.getColor("CheckBox.interiorBackground"));
-                    }
-                    g.fillRect(x+2, y+2, csize-4, csize-4);
-                } else {
-                    g.setColor(UIManager.getColor("CheckBox.shadow"));
-                    g.drawRect(x+1, y+1, csize-3, csize-3);
-
-                    if((model.isPressed() && model.isArmed()) || !model.isEnabled()) {
-                        g.setColor(UIManager.getColor("CheckBox.background"));
-                    } else {
-                        g.setColor(UIManager.getColor("CheckBox.interiorBackground"));
-                    }
-                    g.fillRect(x+2, y+2, csize-4, csize-4);
-                }
-
-                if(model.isEnabled()) {
-                    g.setColor(UIManager.getColor("CheckBox.foreground"));
-                } else {
-                    g.setColor(UIManager.getColor("CheckBox.shadow"));
-                }
-
-                // paint check
-                if (model.isSelected()) {
-                    if (SwingUtilities2.isScaledGraphics(g)) {
-                        int[] xPoints = {3, 5, 9, 9, 5, 3};
-                        int[] yPoints = {5, 7, 3, 5, 9, 7};
-                        g.translate(x, y);
-                        g.fillPolygon(xPoints, yPoints, 6);
-                        g.drawPolygon(xPoints, yPoints, 6);
-                        g.translate(-x, -y);
-                    } else {
-                        g.drawLine(x + 9, y + 3, x + 9, y + 3);
-                        g.drawLine(x + 8, y + 4, x + 9, y + 4);
-                        g.drawLine(x + 7, y + 5, x + 9, y + 5);
-                        g.drawLine(x + 6, y + 6, x + 8, y + 6);
-                        g.drawLine(x + 3, y + 7, x + 7, y + 7);
-                        g.drawLine(x + 4, y + 8, x + 6, y + 8);
-                        g.drawLine(x + 5, y + 9, x + 5, y + 9);
-                        g.drawLine(x + 3, y + 5, x + 3, y + 5);
-                        g.drawLine(x + 3, y + 6, x + 4, y + 6);
-                    }
-                }
-            }
-        }
-
-        public int getIconWidth() {
-            XPStyle xp = XPStyle.getXP();
-            if (xp != null) {
-                return xp.getSkin(null, Part.BP_CHECKBOX).getWidth();
-            } else {
-                return csize;
-            }
-        }
-
-        public int getIconHeight() {
-            XPStyle xp = XPStyle.getXP();
-            if (xp != null) {
-                return xp.getSkin(null, Part.BP_CHECKBOX).getHeight();
-            } else {
-                return csize;
-            }
-        }
-    }
-
-    @SuppressWarnings("serial") // Same-version serialization only
-    private static class RadioButtonIcon implements Icon, UIResource, Serializable
-    {
-        public void paintIcon(Component c, Graphics g, int x, int y) {
-            AbstractButton b = (AbstractButton) c;
-            ButtonModel model = b.getModel();
-            XPStyle xp = XPStyle.getXP();
-
-            if (xp != null) {
-                Part part = Part.BP_RADIOBUTTON;
-                Skin skin = xp.getSkin(b, part);
-                State state;
-                int index = 0;
-                if (model.isSelected()) {
-                    state = State.CHECKEDNORMAL;
-                    if (!model.isEnabled()) {
-                        state = State.CHECKEDDISABLED;
-                    } else if (model.isPressed() && model.isArmed()) {
-                        state = State.CHECKEDPRESSED;
-                    } else if (model.isRollover()) {
-                        state = State.CHECKEDHOT;
-                    }
-                } else {
-                    state = State.UNCHECKEDNORMAL;
-                    if (!model.isEnabled()) {
-                        state = State.UNCHECKEDDISABLED;
-                    } else if (model.isPressed() && model.isArmed()) {
-                        state = State.UNCHECKEDPRESSED;
-                    } else if (model.isRollover()) {
-                        state = State.UNCHECKEDHOT;
-                    }
-                }
-                skin.paintSkin(g, x, y, state);
-            } else {
-                // fill interior
-                if((model.isPressed() && model.isArmed()) || !model.isEnabled()) {
-                    g.setColor(UIManager.getColor("RadioButton.background"));
-                } else {
-                    g.setColor(UIManager.getColor("RadioButton.interiorBackground"));
-                }
-                g.fillRect(x+2, y+2, 8, 8);
-
-
-                boolean isScaledGraphics = SwingUtilities2.isScaledGraphics(g);
-
-                if (isScaledGraphics) {
-
-                    Graphics2D g2d = (Graphics2D) g;
-                    Stroke oldStroke = g2d.getStroke();
-                    g2d.setStroke(new BasicStroke(1.03f, BasicStroke.CAP_ROUND,
-                                                  BasicStroke.JOIN_ROUND));
-                    Object aaHint = g2d.getRenderingHint(RenderingHints.KEY_ANTIALIASING);
-                    g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
-                                         RenderingHints.VALUE_ANTIALIAS_ON);
-
-                    // outter left arc
-                    g.setColor(UIManager.getColor("RadioButton.shadow"));
-                    g.drawArc(x, y, 11, 11, 45, 180);
-                    // outter right arc
-                    g.setColor(UIManager.getColor("RadioButton.highlight"));
-                    g.drawArc(x, y, 11, 11, 45, -180);
-                    // inner left arc
-                    g.setColor(UIManager.getColor("RadioButton.darkShadow"));
-                    g.drawArc(x + 1, y + 1, 9, 9, 45, 180);
-                    // inner right arc
-                    g.setColor(UIManager.getColor("RadioButton.light"));
-                    g.drawArc(x + 1, y + 1, 9, 9, 45, -180);
-
-                    g2d.setStroke(oldStroke);
-
-                    if (model.isSelected()) {
-                        if (model.isEnabled()) {
-                            g.setColor(UIManager.getColor("RadioButton.foreground"));
-                        } else {
-                            g.setColor(UIManager.getColor("RadioButton.shadow"));
-                        }
-                        g.fillOval(x + 3, y + 3, 5, 5);
-                    }
-                    g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, aaHint);
-
-                } else {
-
-                    // outter left arc
-                    g.setColor(UIManager.getColor("RadioButton.shadow"));
-                    g.drawLine(x+4, y+0, x+7, y+0);
-                    g.drawLine(x+2, y+1, x+3, y+1);
-                    g.drawLine(x+8, y+1, x+9, y+1);
-                    g.drawLine(x+1, y+2, x+1, y+3);
-                    g.drawLine(x+0, y+4, x+0, y+7);
-                    g.drawLine(x+1, y+8, x+1, y+9);
-
-                    // outter right arc
-                    g.setColor(UIManager.getColor("RadioButton.highlight"));
-                    g.drawLine(x+2, y+10, x+3, y+10);
-                    g.drawLine(x+4, y+11, x+7, y+11);
-                    g.drawLine(x+8, y+10, x+9, y+10);
-                    g.drawLine(x+10, y+9, x+10, y+8);
-                    g.drawLine(x+11, y+7, x+11, y+4);
-                    g.drawLine(x+10, y+3, x+10, y+2);
-
-
-                    // inner left arc
-                    g.setColor(UIManager.getColor("RadioButton.darkShadow"));
-                    g.drawLine(x+4, y+1, x+7, y+1);
-                    g.drawLine(x+2, y+2, x+3, y+2);
-                    g.drawLine(x+8, y+2, x+9, y+2);
-                    g.drawLine(x+2, y+3, x+2, y+3);
-                    g.drawLine(x+1, y+4, x+1, y+7);
-                    g.drawLine(x+2, y+8, x+2, y+8);
-
-
-                    // inner right arc
-                    g.setColor(UIManager.getColor("RadioButton.light"));
-                    g.drawLine(x+2,  y+9,  x+3,  y+9);
-                    g.drawLine(x+4,  y+10, x+7,  y+10);
-                    g.drawLine(x+8,  y+9,  x+9,  y+9);
-                    g.drawLine(x+9,  y+8,  x+9,  y+8);
-                    g.drawLine(x+10, y+7,  x+10, y+4);
-                    g.drawLine(x+9,  y+3,  x+9,  y+3);
-
-
-                     // indicate whether selected or not
-                    if (model.isSelected()) {
-                        if (model.isEnabled()) {
-                            g.setColor(UIManager.getColor("RadioButton.foreground"));
-                        } else {
-                            g.setColor(UIManager.getColor("RadioButton.shadow"));
-                        }
-                        g.fillRect(x+4, y+5, 4, 2);
-                        g.fillRect(x+5, y+4, 2, 4);
-                    }
-                }
-            }
-        }
-
-        public int getIconWidth() {
-            XPStyle xp = XPStyle.getXP();
-            if (xp != null) {
-                return xp.getSkin(null, Part.BP_RADIOBUTTON).getWidth();
-            } else {
-                return 13;
-            }
-        }
-
-        public int getIconHeight() {
-            XPStyle xp = XPStyle.getXP();
-            if (xp != null) {
-                return xp.getSkin(null, Part.BP_RADIOBUTTON).getHeight();
-            } else {
-                return 13;
-            }
-        }
-    } // end class RadioButtonIcon
-
-
-    @SuppressWarnings("serial") // Same-version serialization only
-    private static class CheckBoxMenuItemIcon implements Icon, UIResource, Serializable
-    {
-        public void paintIcon(Component c, Graphics g, int x, int y) {
-            AbstractButton b = (AbstractButton) c;
-            ButtonModel model = b.getModel();
-            boolean isSelected = model.isSelected();
-            if (isSelected) {
-                y = y - getIconHeight() / 2;
-                g.drawLine(x+9, y+3, x+9, y+3);
-                g.drawLine(x+8, y+4, x+9, y+4);
-                g.drawLine(x+7, y+5, x+9, y+5);
-                g.drawLine(x+6, y+6, x+8, y+6);
-                g.drawLine(x+3, y+7, x+7, y+7);
-                g.drawLine(x+4, y+8, x+6, y+8);
-                g.drawLine(x+5, y+9, x+5, y+9);
-                g.drawLine(x+3, y+5, x+3, y+5);
-                g.drawLine(x+3, y+6, x+4, y+6);
-            }
-        }
-        public int getIconWidth() { return 9; }
-        public int getIconHeight() { return 9; }
-
-    } // End class CheckBoxMenuItemIcon
-
-
-    @SuppressWarnings("serial") // Same-version serialization only
-    private static class RadioButtonMenuItemIcon implements Icon, UIResource, Serializable
-    {
-        public void paintIcon(Component c, Graphics g, int x, int y) {
-            AbstractButton b = (AbstractButton) c;
-            ButtonModel model = b.getModel();
-            if (b.isSelected() == true) {
-               g.fillRoundRect(x+3,y+3, getIconWidth()-6, getIconHeight()-6,
-                               4, 4);
-            }
-        }
-        public int getIconWidth() { return 12; }
-        public int getIconHeight() { return 12; }
-
-    } // End class RadioButtonMenuItemIcon
-
-
-    @SuppressWarnings("serial") // Same-version serialization only
-    private static class MenuItemCheckIcon implements Icon, UIResource, Serializable{
-        public void paintIcon(Component c, Graphics g, int x, int y) {
-            /* For debugging:
-               Color oldColor = g.getColor();
-            g.setColor(Color.orange);
-            g.fill3DRect(x,y,getIconWidth(), getIconHeight(), true);
-            g.setColor(oldColor);
-            */
-        }
-        public int getIconWidth() { return 9; }
-        public int getIconHeight() { return 9; }
-
-    } // End class MenuItemCheckIcon
-
-    @SuppressWarnings("serial") // Same-version serialization only
-    private static class MenuItemArrowIcon implements Icon, UIResource, Serializable {
-        public void paintIcon(Component c, Graphics g, int x, int y) {
-            /* For debugging:
-            Color oldColor = g.getColor();
-            g.setColor(Color.green);
-            g.fill3DRect(x,y,getIconWidth(), getIconHeight(), true);
-            g.setColor(oldColor);
-            */
-        }
-        public int getIconWidth() { return 4; }
-        public int getIconHeight() { return 8; }
-
-    } // End class MenuItemArrowIcon
-
-    @SuppressWarnings("serial") // Same-version serialization only
-    private static class MenuArrowIcon implements Icon, UIResource, Serializable {
-        public void paintIcon(Component c, Graphics g, int x, int y) {
-            XPStyle xp = XPStyle.getXP();
-            if (WindowsMenuItemUI.isVistaPainting(xp)) {
-                State state = State.NORMAL;
-                if (c instanceof JMenuItem) {
-                    state = ((JMenuItem) c).getModel().isEnabled()
-                    ? State.NORMAL : State.DISABLED;
-                }
-                Skin skin = xp.getSkin(c, Part.MP_POPUPSUBMENU);
-                if (WindowsGraphicsUtils.isLeftToRight(c)) {
-                    skin.paintSkin(g, x, y, state);
-                } else {
-                    Graphics2D g2d = (Graphics2D)g.create();
-                    g2d.translate(x + skin.getWidth(), y);
-                    g2d.scale(-1, 1);
-                    skin.paintSkin(g2d, 0, 0, state);
-                    g2d.dispose();
-                }
-            } else {
-                g.translate(x,y);
-                if( WindowsGraphicsUtils.isLeftToRight(c) ) {
-                    g.drawLine( 0, 0, 0, 7 );
-                    g.drawLine( 1, 1, 1, 6 );
-                    g.drawLine( 2, 2, 2, 5 );
-                    g.drawLine( 3, 3, 3, 4 );
-                } else {
-                    g.drawLine( 4, 0, 4, 7 );
-                    g.drawLine( 3, 1, 3, 6 );
-                    g.drawLine( 2, 2, 2, 5 );
-                    g.drawLine( 1, 3, 1, 4 );
-                }
-                g.translate(-x,-y);
-            }
-        }
-        public int getIconWidth() {
-            XPStyle xp = XPStyle.getXP();
-            if (WindowsMenuItemUI.isVistaPainting(xp)) {
-                Skin skin = xp.getSkin(null, Part.MP_POPUPSUBMENU);
-                return skin.getWidth();
-            } else {
-                return 4;
-            }
-        }
-        public int getIconHeight() {
-            XPStyle xp = XPStyle.getXP();
-            if (WindowsMenuItemUI.isVistaPainting(xp)) {
-                Skin skin = xp.getSkin(null, Part.MP_POPUPSUBMENU);
-                return skin.getHeight();
-            } else {
-                return 8;
-            }
-        }
-    } // End class MenuArrowIcon
-
-    static class VistaMenuItemCheckIconFactory
-           implements MenuItemCheckIconFactory {
-        private static final int OFFSET = 3;
-
-        public Icon getIcon(JMenuItem component) {
-            return new VistaMenuItemCheckIcon(component);
-        }
-
-        public boolean isCompatible(Object icon, String prefix) {
-            return icon instanceof VistaMenuItemCheckIcon
-              && ((VistaMenuItemCheckIcon) icon).type == getType(prefix);
-        }
-
-        public Icon getIcon(String type) {
-            return new VistaMenuItemCheckIcon(type);
-        }
-
-        static int getIconWidth() {
-            XPStyle xp = XPStyle.getXP();
-            return ((xp != null) ? xp.getSkin(null, Part.MP_POPUPCHECK).getWidth() : 16)
-                + 2 * OFFSET;
-        }
-
-        private static Class<? extends JMenuItem> getType(Component c) {
-            Class<? extends JMenuItem> rv = null;
-            if (c instanceof JCheckBoxMenuItem) {
-                rv = JCheckBoxMenuItem.class;
-            } else if (c instanceof JRadioButtonMenuItem) {
-                rv = JRadioButtonMenuItem.class;
-            } else if (c instanceof JMenu) {
-                rv = JMenu.class;
-            } else if (c instanceof JMenuItem) {
-                rv = JMenuItem.class;
-            }
-            return rv;
-        }
-
-        private static Class<? extends JMenuItem> getType(String type) {
-            Class<? extends JMenuItem> rv = null;
-            if (type == "CheckBoxMenuItem") {
-                rv = JCheckBoxMenuItem.class;
-            } else if (type == "RadioButtonMenuItem") {
-                rv = JRadioButtonMenuItem.class;
-            } else if (type == "Menu") {
-                rv = JMenu.class;
-            } else if (type == "MenuItem") {
-                rv = JMenuItem.class;
-            } else {
-                // this should never happen
-                rv = JMenuItem.class;
-            }
-            return rv;
-        }
-
-        /**
-         * CheckIcon for JMenuItem, JMenu, JCheckBoxMenuItem and
-         * JRadioButtonMenuItem.
-         * Note: to be used on Vista only.
-         */
-        @SuppressWarnings("serial") // Same-version serialization only
-        private static class VistaMenuItemCheckIcon
-              implements Icon, UIResource, Serializable {
-
-            private final JMenuItem menuItem;
-            private final Class<? extends JMenuItem> type;
-
-            VistaMenuItemCheckIcon(JMenuItem menuItem) {
-                this.type = getType(menuItem);
-                this.menuItem = menuItem;
-            }
-            VistaMenuItemCheckIcon(String type) {
-                this.type = getType(type);
-                this.menuItem = null;
-            }
-
-            public int getIconHeight() {
-                Icon lafIcon = getLaFIcon();
-                if (lafIcon != null) {
-                    return lafIcon.getIconHeight();
-                }
-                Icon icon = getIcon();
-                int height = 0;
-                if (icon != null) {
-                    height = icon.getIconHeight();
-                } else {
-                    XPStyle xp = XPStyle.getXP();
-                    if (xp != null) {
-                        Skin skin = xp.getSkin(null, Part.MP_POPUPCHECK);
-                        height = skin.getHeight();
-                    } else {
-                        height = 16;
-                    }
-                }
-                height +=  2 * OFFSET;
-                return height;
-            }
-
-            public int getIconWidth() {
-                Icon lafIcon = getLaFIcon();
-                if (lafIcon != null) {
-                    return lafIcon.getIconWidth();
-                }
-                Icon icon = getIcon();
-                int width = 0;
-                if (icon != null) {
-                    width = icon.getIconWidth() + 2 * OFFSET;
-                } else {
-                    width = VistaMenuItemCheckIconFactory.getIconWidth();
-                }
-                return width;
-            }
-
-            public void paintIcon(Component c, Graphics g, int x, int y) {
-                Icon lafIcon = getLaFIcon();
-                if (lafIcon != null) {
-                    lafIcon.paintIcon(c, g, x, y);
-                    return;
-                }
-                assert menuItem == null || c == menuItem;
-                Icon icon = getIcon();
-                if (type == JCheckBoxMenuItem.class
-                      || type == JRadioButtonMenuItem.class) {
-                    AbstractButton b = (AbstractButton) c;
-                    if (b.isSelected()) {
-                        Part backgroundPart = Part.MP_POPUPCHECKBACKGROUND;
-                        Part part = Part.MP_POPUPCHECK;
-                        State backgroundState;
-                        State state;
-                        if (isEnabled(c, null)) {
-                            backgroundState =
-                                (icon != null) ? State.BITMAP : State.NORMAL;
-                            state = (type == JRadioButtonMenuItem.class)
-                              ? State.BULLETNORMAL
-                              : State.CHECKMARKNORMAL;
-                        } else {
-                            backgroundState = State.DISABLEDPUSHED;
-                            state =
-                                (type == JRadioButtonMenuItem.class)
-                                  ? State.BULLETDISABLED
-                                  : State.CHECKMARKDISABLED;
-                        }
-                        XPStyle xp = XPStyle.getXP();
-                        if (xp != null) {
-                            Skin skin;
-                            skin =  xp.getSkin(c, backgroundPart);
-                            skin.paintSkin(g, x, y,
-                                getIconWidth(), getIconHeight(), backgroundState);
-                            if (icon == null) {
-                                skin = xp.getSkin(c, part);
-                                skin.paintSkin(g, x + OFFSET, y + OFFSET, state);
-                            }
-                        }
-                    }
-                }
-                if (icon != null) {
-                    icon.paintIcon(c, g, x + OFFSET, y + OFFSET);
-                }
-            }
-            private static WindowsMenuItemUIAccessor getAccessor(
-                    JMenuItem menuItem) {
-                WindowsMenuItemUIAccessor rv = null;
-                ButtonUI uiObject = (menuItem != null) ? menuItem.getUI()
-                        : null;
-                if (uiObject instanceof WindowsMenuItemUI) {
-                    rv = ((WindowsMenuItemUI) uiObject).accessor;
-                } else if (uiObject instanceof WindowsMenuUI) {
-                    rv = ((WindowsMenuUI) uiObject).accessor;
-                } else if (uiObject instanceof WindowsCheckBoxMenuItemUI) {
-                    rv = ((WindowsCheckBoxMenuItemUI) uiObject).accessor;
-                } else if (uiObject instanceof WindowsRadioButtonMenuItemUI) {
-                    rv = ((WindowsRadioButtonMenuItemUI) uiObject).accessor;
-                }
-                return rv;
-            }
-
-            private static boolean isEnabled(Component  c, State state) {
-                if (state == null && c instanceof JMenuItem) {
-                    WindowsMenuItemUIAccessor accessor =
-                        getAccessor((JMenuItem) c);
-                    if (accessor != null) {
-                        state = accessor.getState((JMenuItem) c);
-                    }
-                }
-                if (state == null) {
-                    if (c != null) {
-                        return c.isEnabled();
-                    } else {
-                        return true;
-                    }
-                } else {
-                    return (state != State.DISABLED)
-                        && (state != State.DISABLEDHOT)
-                        && (state != State.DISABLEDPUSHED);
-                }
-            }
-            private Icon getIcon() {
-                Icon rv = null;
-                if (menuItem == null) {
-                    return rv;
-                }
-                WindowsMenuItemUIAccessor accessor =
-                    getAccessor(menuItem);
-                State state = (accessor != null) ? accessor.getState(menuItem)
-                        : null;
-                if (isEnabled(menuItem, null)) {
-                    if (state == State.PUSHED) {
-                        rv = menuItem.getPressedIcon();
-                    } else {
-                        rv = menuItem.getIcon();
-                    }
-                } else {
-                    rv = menuItem.getDisabledIcon();
-                }
-                return rv;
-            }
-            /**
-             * Check if developer changed icon in the UI table.
-             *
-             * @return the icon to use or {@code null} if the current one is to
-             * be used
-             */
-            private Icon getLaFIcon() {
-                // use icon from the UI table if it does not match this one.
-                Icon rv = (Icon) UIManager.getDefaults().get(typeToString(type));
-                if (rv instanceof VistaMenuItemCheckIcon
-                      && ((VistaMenuItemCheckIcon) rv).type == type) {
-                    rv = null;
-                }
-                return rv;
-            }
-
-            private static String typeToString(
-                    Class<? extends JMenuItem> type) {
-                assert type == JMenuItem.class
-                    || type == JMenu.class
-                    || type == JCheckBoxMenuItem.class
-                    || type == JRadioButtonMenuItem.class;
-                StringBuilder sb = new StringBuilder(type.getName());
-                // remove package name, dot and the first character
-                sb.delete(0, sb.lastIndexOf("J") + 1);
-                sb.append(".checkIcon");
-                return sb.toString();
-            }
-        }
-    } // End class VistaMenuItemCheckIconFactory
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsInternalFrameTitlePane.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,572 +0,0 @@
-/*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import sun.swing.SwingUtilities2;
-
-import javax.swing.*;
-import javax.swing.border.*;
-import javax.swing.UIManager;
-import javax.swing.plaf.*;
-import javax.swing.plaf.basic.BasicInternalFrameTitlePane;
-import java.awt.*;
-import java.awt.event.*;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyVetoException;
-
-import static com.sun.java.swing.plaf.windows.TMSchema.*;
-import static com.sun.java.swing.plaf.windows.XPStyle.Skin;
-
-@SuppressWarnings("serial") // Superclass is not serializable across versions
-public class WindowsInternalFrameTitlePane extends BasicInternalFrameTitlePane {
-    private Color selectedTitleGradientColor;
-    private Color notSelectedTitleGradientColor;
-    private JPopupMenu systemPopupMenu;
-    private JLabel systemLabel;
-
-    private Font titleFont;
-    private int titlePaneHeight;
-    private int buttonWidth, buttonHeight;
-    private boolean hotTrackingOn;
-
-    public WindowsInternalFrameTitlePane(JInternalFrame f) {
-        super(f);
-    }
-
-    protected void addSubComponents() {
-        add(systemLabel);
-        add(iconButton);
-        add(maxButton);
-        add(closeButton);
-    }
-
-    protected void installDefaults() {
-        super.installDefaults();
-
-        titlePaneHeight = UIManager.getInt("InternalFrame.titlePaneHeight");
-        buttonWidth     = UIManager.getInt("InternalFrame.titleButtonWidth")  - 4;
-        buttonHeight    = UIManager.getInt("InternalFrame.titleButtonHeight") - 4;
-
-        Object obj      = UIManager.get("InternalFrame.titleButtonToolTipsOn");
-        hotTrackingOn = (obj instanceof Boolean) ? (Boolean)obj : true;
-
-
-        if (XPStyle.getXP() != null) {
-            // Fix for XP bug where sometimes these sizes aren't updated properly
-            // Assume for now that height is correct and derive width using the
-            // ratio from the uxtheme part
-            buttonWidth = buttonHeight;
-            Dimension d = XPStyle.getPartSize(Part.WP_CLOSEBUTTON, State.NORMAL);
-            if (d != null && d.width != 0 && d.height != 0) {
-                buttonWidth = (int) ((float) buttonWidth * d.width / d.height);
-            }
-        } else {
-            buttonWidth += 2;
-            Color activeBorderColor =
-                    UIManager.getColor("InternalFrame.activeBorderColor");
-            setBorder(BorderFactory.createLineBorder(activeBorderColor, 1));
-        }
-        // JDK-8039383: initialize these colors because getXP() may return null when theme is changed
-        selectedTitleGradientColor =
-                UIManager.getColor("InternalFrame.activeTitleGradient");
-        notSelectedTitleGradientColor =
-                UIManager.getColor("InternalFrame.inactiveTitleGradient");
-    }
-
-    protected void uninstallListeners() {
-        // Get around protected method in superclass
-        super.uninstallListeners();
-    }
-
-    protected void createButtons() {
-        super.createButtons();
-        if (XPStyle.getXP() != null) {
-            iconButton.setContentAreaFilled(false);
-            maxButton.setContentAreaFilled(false);
-            closeButton.setContentAreaFilled(false);
-        }
-    }
-
-    protected void setButtonIcons() {
-        super.setButtonIcons();
-
-        if (!hotTrackingOn) {
-            iconButton.setToolTipText(null);
-            maxButton.setToolTipText(null);
-            closeButton.setToolTipText(null);
-        }
-    }
-
-
-    public void paintComponent(Graphics g)  {
-        XPStyle xp = XPStyle.getXP();
-
-        paintTitleBackground(g);
-
-        String title = frame.getTitle();
-        if (title != null) {
-            boolean isSelected = frame.isSelected();
-            Font oldFont = g.getFont();
-            Font newFont = (titleFont != null) ? titleFont : getFont();
-            g.setFont(newFont);
-
-            // Center text vertically.
-            FontMetrics fm = SwingUtilities2.getFontMetrics(frame, g, newFont);
-            int baseline = (getHeight() + fm.getAscent() - fm.getLeading() -
-                    fm.getDescent()) / 2;
-
-            Rectangle lastIconBounds = new Rectangle(0, 0, 0, 0);
-            if (frame.isIconifiable()) {
-                lastIconBounds = iconButton.getBounds();
-            } else if (frame.isMaximizable()) {
-                lastIconBounds = maxButton.getBounds();
-            } else if (frame.isClosable()) {
-                lastIconBounds = closeButton.getBounds();
-            }
-
-            int titleX;
-            int titleW;
-            int gap = 2;
-            if (WindowsGraphicsUtils.isLeftToRight(frame)) {
-                if (lastIconBounds.x == 0) { // There are no icons
-                    lastIconBounds.x = frame.getWidth() - frame.getInsets().right;
-                }
-                titleX = systemLabel.getX() + systemLabel.getWidth() + gap;
-                if (xp != null) {
-                    titleX += 2;
-                }
-                titleW = lastIconBounds.x - titleX - gap;
-            } else {
-                if (lastIconBounds.x == 0) { // There are no icons
-                    lastIconBounds.x = frame.getInsets().left;
-                }
-                titleW = SwingUtilities2.stringWidth(frame, fm, title);
-                int minTitleX = lastIconBounds.x + lastIconBounds.width + gap;
-                if (xp != null) {
-                    minTitleX += 2;
-                }
-                int availableWidth = systemLabel.getX() - gap - minTitleX;
-                if (availableWidth > titleW) {
-                    titleX = systemLabel.getX() - gap - titleW;
-                } else {
-                    titleX = minTitleX;
-                    titleW = availableWidth;
-                }
-            }
-            title = getTitle(frame.getTitle(), fm, titleW);
-
-            if (xp != null) {
-                String shadowType = null;
-                if (isSelected) {
-                    shadowType = xp.getString(this, Part.WP_CAPTION,
-                                              State.ACTIVE, Prop.TEXTSHADOWTYPE);
-                }
-                if ("single".equalsIgnoreCase(shadowType)) {
-                    Point shadowOffset = xp.getPoint(this, Part.WP_WINDOW, State.ACTIVE,
-                                                     Prop.TEXTSHADOWOFFSET);
-                    Color shadowColor  = xp.getColor(this, Part.WP_WINDOW, State.ACTIVE,
-                                                     Prop.TEXTSHADOWCOLOR, null);
-                    if (shadowOffset != null && shadowColor != null) {
-                        g.setColor(shadowColor);
-                        SwingUtilities2.drawString(frame, g, title,
-                                     titleX + shadowOffset.x,
-                                     baseline + shadowOffset.y);
-                    }
-                }
-            }
-            g.setColor(isSelected ? selectedTextColor : notSelectedTextColor);
-            SwingUtilities2.drawString(frame, g, title, titleX, baseline);
-            g.setFont(oldFont);
-        }
-    }
-
-    public Dimension getPreferredSize() {
-        return getMinimumSize();
-    }
-
-    public Dimension getMinimumSize() {
-        Dimension d = new Dimension(super.getMinimumSize());
-        d.height = titlePaneHeight + 2;
-
-        XPStyle xp = XPStyle.getXP();
-        if (xp != null) {
-            // Note: Don't know how to calculate height on XP,
-            // the captionbarheight is 25 but native caption is 30 (maximized 26)
-            if (frame.isMaximum()) {
-                d.height -= 1;
-            } else {
-                d.height += 3;
-            }
-        }
-        return d;
-    }
-
-    protected void paintTitleBackground(Graphics g) {
-        XPStyle xp = XPStyle.getXP();
-        if (xp != null) {
-            Part part = frame.isIcon() ? Part.WP_MINCAPTION
-                                       : (frame.isMaximum() ? Part.WP_MAXCAPTION
-                                                            : Part.WP_CAPTION);
-            State state = frame.isSelected() ? State.ACTIVE : State.INACTIVE;
-            Skin skin = xp.getSkin(this, part);
-            skin.paintSkin(g, 0,  0, getWidth(), getHeight(), state);
-        } else {
-            Boolean gradientsOn = (Boolean)LookAndFeel.getDesktopPropertyValue(
-                "win.frame.captionGradientsOn", Boolean.valueOf(false));
-            if (gradientsOn.booleanValue() && g instanceof Graphics2D) {
-                Graphics2D g2 = (Graphics2D)g;
-                Paint savePaint = g2.getPaint();
-
-                boolean isSelected = frame.isSelected();
-                int w = getWidth();
-
-                if (isSelected) {
-                    GradientPaint titleGradient = new GradientPaint(0,0,
-                            selectedTitleColor,
-                            (int)(w*.75),0,
-                            selectedTitleGradientColor);
-                    g2.setPaint(titleGradient);
-                } else {
-                    GradientPaint titleGradient = new GradientPaint(0,0,
-                            notSelectedTitleColor,
-                            (int)(w*.75),0,
-                            notSelectedTitleGradientColor);
-                    g2.setPaint(titleGradient);
-                }
-                g2.fillRect(0, 0, getWidth(), getHeight());
-                g2.setPaint(savePaint);
-            } else {
-                super.paintTitleBackground(g);
-            }
-        }
-    }
-
-    protected void assembleSystemMenu() {
-        systemPopupMenu = new JPopupMenu();
-        addSystemMenuItems(systemPopupMenu);
-        enableActions();
-        @SuppressWarnings("serial") // anonymous class
-        JLabel tmp = new JLabel(frame.getFrameIcon()) {
-            protected void paintComponent(Graphics g) {
-                int x = 0;
-                int y = 0;
-                int w = getWidth();
-                int h = getHeight();
-                g = g.create();  // Create scratch graphics
-                if (isOpaque()) {
-                    g.setColor(getBackground());
-                    g.fillRect(0, 0, w, h);
-                }
-                Icon icon = getIcon();
-                int iconWidth;
-                int iconHeight;
-                if (icon != null &&
-                    (iconWidth = icon.getIconWidth()) > 0 &&
-                    (iconHeight = icon.getIconHeight()) > 0) {
-
-                    // Set drawing scale to make icon scale to our desired size
-                    double drawScale;
-                    if (iconWidth > iconHeight) {
-                        // Center icon vertically
-                        y = (h - w*iconHeight/iconWidth) / 2;
-                        drawScale = w / (double)iconWidth;
-                    } else {
-                        // Center icon horizontally
-                        x = (w - h*iconWidth/iconHeight) / 2;
-                        drawScale = h / (double)iconHeight;
-                    }
-                    ((Graphics2D)g).translate(x, y);
-                    ((Graphics2D)g).scale(drawScale, drawScale);
-                    icon.paintIcon(this, g, 0, 0);
-                }
-                g.dispose();
-            }
-        };
-        systemLabel = tmp;
-        systemLabel.addMouseListener(new MouseAdapter() {
-            public void mouseClicked(MouseEvent e) {
-                if (e.getClickCount() == 2 && frame.isClosable() &&
-                    !frame.isIcon()) {
-                    systemPopupMenu.setVisible(false);
-                    frame.doDefaultCloseAction();
-                }
-                else {
-                    super.mouseClicked(e);
-                }
-            }
-            public void mousePressed(MouseEvent e) {
-                try {
-                    frame.setSelected(true);
-                } catch(PropertyVetoException pve) {
-                }
-                showSystemPopupMenu(e.getComponent());
-            }
-        });
-    }
-
-    protected void addSystemMenuItems(JPopupMenu menu) {
-        JMenuItem mi = menu.add(restoreAction);
-        mi.setMnemonic(getButtonMnemonic("restore"));
-        mi = menu.add(moveAction);
-        mi.setMnemonic(getButtonMnemonic("move"));
-        mi = menu.add(sizeAction);
-        mi.setMnemonic(getButtonMnemonic("size"));
-        mi = menu.add(iconifyAction);
-        mi.setMnemonic(getButtonMnemonic("minimize"));
-        mi = menu.add(maximizeAction);
-        mi.setMnemonic(getButtonMnemonic("maximize"));
-        menu.add(new JSeparator());
-        mi = menu.add(closeAction);
-        mi.setMnemonic(getButtonMnemonic("close"));
-    }
-
-    private static int getButtonMnemonic(String button) {
-        try {
-            return Integer.parseInt(UIManager.getString(
-                    "InternalFrameTitlePane." + button + "Button.mnemonic"));
-        } catch (NumberFormatException e) {
-            return -1;
-        }
-    }
-
-    protected void showSystemMenu(){
-        showSystemPopupMenu(systemLabel);
-    }
-
-    private void showSystemPopupMenu(Component invoker){
-        Dimension dim = new Dimension();
-        Border border = frame.getBorder();
-        if (border != null) {
-            dim.width += border.getBorderInsets(frame).left +
-                border.getBorderInsets(frame).right;
-            dim.height += border.getBorderInsets(frame).bottom +
-                border.getBorderInsets(frame).top;
-        }
-        if (!frame.isIcon()) {
-            systemPopupMenu.show(invoker,
-                getX() - dim.width,
-                getY() + getHeight() - dim.height);
-        } else {
-            systemPopupMenu.show(invoker,
-                getX() - dim.width,
-                getY() - systemPopupMenu.getPreferredSize().height -
-                     dim.height);
-        }
-    }
-
-    protected PropertyChangeListener createPropertyChangeListener() {
-        return new WindowsPropertyChangeHandler();
-    }
-
-    protected LayoutManager createLayout() {
-        return new WindowsTitlePaneLayout();
-    }
-
-    public class WindowsTitlePaneLayout extends BasicInternalFrameTitlePane.TitlePaneLayout {
-        private Insets captionMargin = null;
-        private Insets contentMargin = null;
-        private XPStyle xp = XPStyle.getXP();
-
-        WindowsTitlePaneLayout() {
-            if (xp != null) {
-                Component c = WindowsInternalFrameTitlePane.this;
-                captionMargin = xp.getMargin(c, Part.WP_CAPTION, null, Prop.CAPTIONMARGINS);
-                contentMargin = xp.getMargin(c, Part.WP_CAPTION, null, Prop.CONTENTMARGINS);
-            }
-            if (captionMargin == null) {
-                captionMargin = new Insets(0, 2, 0, 2);
-            }
-            if (contentMargin == null) {
-                contentMargin = new Insets(0, 0, 0, 0);
-            }
-        }
-
-        private int layoutButton(JComponent button, Part part,
-                                 int x, int y, int w, int h, int gap,
-                                 boolean leftToRight) {
-            if (!leftToRight) {
-                x -= w;
-            }
-            button.setBounds(x, y, w, h);
-            if (leftToRight) {
-                x += w + 2;
-            } else {
-                x -= 2;
-            }
-            return x;
-        }
-
-        public void layoutContainer(Container c) {
-            boolean leftToRight = WindowsGraphicsUtils.isLeftToRight(frame);
-            int x, y;
-            int w = getWidth();
-            int h = getHeight();
-
-            // System button
-            // Note: this icon is square, but the buttons aren't always.
-            int iconSize = (xp != null) ? (h-2)*6/10 : h-4;
-            if (xp != null) {
-                x = (leftToRight) ? captionMargin.left + 2 : w - captionMargin.right - 2;
-            } else {
-                x = (leftToRight) ? captionMargin.left : w - captionMargin.right;
-            }
-            y = (h - iconSize) / 2;
-            layoutButton(systemLabel, Part.WP_SYSBUTTON,
-                         x, y, iconSize, iconSize, 0,
-                         leftToRight);
-
-            // Right hand buttons
-            if (xp != null) {
-                x = (leftToRight) ? w - captionMargin.right - 2 : captionMargin.left + 2;
-                y = 1;  // XP seems to ignore margins and offset here
-                if (frame.isMaximum()) {
-                    y += 1;
-                } else {
-                    y += 5;
-                }
-            } else {
-                x = (leftToRight) ? w - captionMargin.right : captionMargin.left;
-                y = (h - buttonHeight) / 2;
-            }
-
-            if(frame.isClosable()) {
-                x = layoutButton(closeButton, Part.WP_CLOSEBUTTON,
-                                 x, y, buttonWidth, buttonHeight, 2,
-                                 !leftToRight);
-            }
-
-            if(frame.isMaximizable()) {
-                x = layoutButton(maxButton, Part.WP_MAXBUTTON,
-                                 x, y, buttonWidth, buttonHeight, (xp != null) ? 2 : 0,
-                                 !leftToRight);
-            }
-
-            if(frame.isIconifiable()) {
-                layoutButton(iconButton, Part.WP_MINBUTTON,
-                             x, y, buttonWidth, buttonHeight, 0,
-                             !leftToRight);
-            }
-        }
-    } // end WindowsTitlePaneLayout
-
-    public class WindowsPropertyChangeHandler extends PropertyChangeHandler {
-        public void propertyChange(PropertyChangeEvent evt) {
-            String prop = evt.getPropertyName();
-
-            // Update the internal frame icon for the system menu.
-            if (JInternalFrame.FRAME_ICON_PROPERTY.equals(prop) &&
-                    systemLabel != null) {
-                systemLabel.setIcon(frame.getFrameIcon());
-            }
-
-            super.propertyChange(evt);
-        }
-    }
-
-    /**
-     * A versatile Icon implementation which can take an array of Icon
-     * instances (typically <code>ImageIcon</code>s) and choose one that gives the best
-     * quality for a given Graphics2D scale factor when painting.
-     * <p>
-     * The class is public so it can be instantiated by UIDefaults.ProxyLazyValue.
-     * <p>
-     * Note: We assume here that icons are square.
-     */
-    public static class ScalableIconUIResource implements Icon, UIResource {
-        // We can use an arbitrary size here because we scale to it in paintIcon()
-        private static final int SIZE = 16;
-
-        private Icon[] icons;
-
-        /**
-         * @param objects an array of Icon or UIDefaults.LazyValue
-         * <p>
-         * The constructor is public so it can be called by UIDefaults.ProxyLazyValue.
-         */
-        public ScalableIconUIResource(Object[] objects) {
-            this.icons = new Icon[objects.length];
-
-            for (int i = 0; i < objects.length; i++) {
-                if (objects[i] instanceof UIDefaults.LazyValue) {
-                    icons[i] = (Icon)((UIDefaults.LazyValue)objects[i]).createValue(null);
-                } else {
-                    icons[i] = (Icon)objects[i];
-                }
-            }
-        }
-
-        /**
-         * @return the <code>Icon</code> closest to the requested size
-         */
-        protected Icon getBestIcon(int size) {
-            if (icons != null && icons.length > 0) {
-                int bestIndex = 0;
-                int minDiff = Integer.MAX_VALUE;
-                for (int i=0; i < icons.length; i++) {
-                    Icon icon = icons[i];
-                    int iconSize;
-                    if (icon != null && (iconSize = icon.getIconWidth()) > 0) {
-                        int diff = Math.abs(iconSize - size);
-                        if (diff < minDiff) {
-                            minDiff = diff;
-                            bestIndex = i;
-                        }
-                    }
-                }
-                return icons[bestIndex];
-            } else {
-                return null;
-            }
-        }
-
-        public void paintIcon(Component c, Graphics g, int x, int y) {
-            Graphics2D g2d = (Graphics2D)g.create();
-            // Calculate how big our drawing area is in pixels
-            // Assume we are square
-            int size = getIconWidth();
-            double scale = g2d.getTransform().getScaleX();
-            Icon icon = getBestIcon((int)(size * scale));
-            int iconSize;
-            if (icon != null && (iconSize = icon.getIconWidth()) > 0) {
-                // Set drawing scale to make icon act true to our reported size
-                double drawScale = size / (double)iconSize;
-                g2d.translate(x, y);
-                g2d.scale(drawScale, drawScale);
-                icon.paintIcon(c, g2d, 0, 0);
-            }
-            g2d.dispose();
-        }
-
-        public int getIconWidth() {
-            return SIZE;
-        }
-
-        public int getIconHeight() {
-            return SIZE;
-        }
-    }
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsInternalFrameUI.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,135 +0,0 @@
-/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import java.awt.*;
-import java.beans.*;
-import javax.swing.*;
-import javax.swing.border.*;
-import javax.swing.plaf.basic.*;
-import javax.swing.plaf.ComponentUI;
-
-import static com.sun.java.swing.plaf.windows.TMSchema.*;
-import static com.sun.java.swing.plaf.windows.XPStyle.Skin;
-
-/**
- * Windows rendition of the component.
- * <p>
- * <strong>Warning:</strong>
- * Serialized objects of this class will not be compatible with
- * future Swing releases.  The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing.  A future release of Swing will provide support for
- * long term persistence.
- */
-public class WindowsInternalFrameUI extends BasicInternalFrameUI
-{
-    XPStyle xp = XPStyle.getXP();
-
-    public void installDefaults() {
-        super.installDefaults();
-
-        if (xp != null) {
-            frame.setBorder(new XPBorder());
-        } else {
-            frame.setBorder(UIManager.getBorder("InternalFrame.border"));
-        }
-    }
-
-    public void installUI(JComponent c)   {
-        super.installUI(c);
-
-        LookAndFeel.installProperty(c, "opaque",
-                                    xp == null? Boolean.TRUE : Boolean.FALSE);
-    }
-
-    public void uninstallDefaults() {
-        frame.setBorder(null);
-        super.uninstallDefaults();
-    }
-
-    public static ComponentUI createUI(JComponent b)    {
-        return new WindowsInternalFrameUI((JInternalFrame)b);
-    }
-
-    public WindowsInternalFrameUI(JInternalFrame w){
-        super(w);
-    }
-
-    protected DesktopManager createDesktopManager(){
-        return new WindowsDesktopManager();
-    }
-
-    protected JComponent createNorthPane(JInternalFrame w) {
-        titlePane = new WindowsInternalFrameTitlePane(w);
-        return titlePane;
-    }
-
-    @SuppressWarnings("serial") // Superclass is not serializable across versions
-    private class XPBorder extends AbstractBorder {
-        private Skin leftSkin   = xp.getSkin(frame, Part.WP_FRAMELEFT);
-        private Skin rightSkin  = xp.getSkin(frame, Part.WP_FRAMERIGHT);
-        private Skin bottomSkin = xp.getSkin(frame, Part.WP_FRAMEBOTTOM);
-
-        /**
-         * @param x the x position of the painted border
-         * @param y the y position of the painted border
-         * @param width the width of the painted border
-         * @param height the height of the painted border
-         */
-        public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
-            State state = ((JInternalFrame)c).isSelected() ? State.ACTIVE : State.INACTIVE;
-            int topBorderHeight  = (titlePane != null) ? titlePane.getSize().height : 0;
-
-            bottomSkin.paintSkin(g, 0, height-bottomSkin.getHeight(),
-                                 width, bottomSkin.getHeight(),
-                                 state);
-
-            leftSkin.paintSkin(g, 0, topBorderHeight-1,
-                               leftSkin.getWidth(), height-topBorderHeight-bottomSkin.getHeight()+2,
-                               state);
-
-            rightSkin.paintSkin(g, width-rightSkin.getWidth(), topBorderHeight-1,
-                                rightSkin.getWidth(), height-topBorderHeight-bottomSkin.getHeight()+2,
-                                state);
-
-        }
-
-        public Insets getBorderInsets(Component c, Insets insets) {
-            insets.top    = 4;
-            insets.left   = leftSkin.getWidth();
-            insets.right  = rightSkin.getWidth();
-            insets.bottom = bottomSkin.getHeight();
-
-            return insets;
-        }
-
-        public boolean isBorderOpaque() {
-            return true;
-        }
-    }
-
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsLabelUI.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,112 +0,0 @@
-/*
- * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import sun.swing.SwingUtilities2;
-import sun.awt.AppContext;
-
-import java.awt.Color;
-import java.awt.Graphics;
-
-import javax.swing.JComponent;
-import javax.swing.JLabel;
-import javax.swing.UIManager;
-
-import javax.swing.plaf.ComponentUI;
-
-import javax.swing.plaf.basic.BasicLabelUI;
-
-
-
-/**
- * Windows rendition of the component.
- * <p>
- * <strong>Warning:</strong>
- * Serialized objects of this class will not be compatible with
- * future Swing releases.  The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing.  A future release of Swing will provide support for
- * long term persistence.
- */
-public class WindowsLabelUI extends BasicLabelUI {
-
-    private static final Object WINDOWS_LABEL_UI_KEY = new Object();
-
-    // ********************************
-    //          Create PLAF
-    // ********************************
-    public static ComponentUI createUI(JComponent c) {
-        AppContext appContext = AppContext.getAppContext();
-        WindowsLabelUI windowsLabelUI =
-                (WindowsLabelUI) appContext.get(WINDOWS_LABEL_UI_KEY);
-        if (windowsLabelUI == null) {
-            windowsLabelUI = new WindowsLabelUI();
-            appContext.put(WINDOWS_LABEL_UI_KEY, windowsLabelUI);
-        }
-        return windowsLabelUI;
-    }
-
-    protected void paintEnabledText(JLabel l, Graphics g, String s,
-                                    int textX, int textY) {
-        int mnemonicIndex = l.getDisplayedMnemonicIndex();
-        // W2K Feature: Check to see if the Underscore should be rendered.
-        if (WindowsLookAndFeel.isMnemonicHidden() == true) {
-            mnemonicIndex = -1;
-        }
-
-        g.setColor(l.getForeground());
-        SwingUtilities2.drawStringUnderlineCharAt(l, g, s, mnemonicIndex,
-                                                     textX, textY);
-    }
-
-    protected void paintDisabledText(JLabel l, Graphics g, String s,
-                                     int textX, int textY) {
-        int mnemonicIndex = l.getDisplayedMnemonicIndex();
-        // W2K Feature: Check to see if the Underscore should be rendered.
-        if (WindowsLookAndFeel.isMnemonicHidden() == true) {
-            mnemonicIndex = -1;
-        }
-        if ( UIManager.getColor("Label.disabledForeground") instanceof Color &&
-             UIManager.getColor("Label.disabledShadow") instanceof Color) {
-            g.setColor( UIManager.getColor("Label.disabledShadow") );
-            SwingUtilities2.drawStringUnderlineCharAt(l, g, s,
-                                                         mnemonicIndex,
-                                                         textX + 1, textY + 1);
-            g.setColor( UIManager.getColor("Label.disabledForeground") );
-            SwingUtilities2.drawStringUnderlineCharAt(l, g, s,
-                                                         mnemonicIndex,
-                                                         textX, textY);
-        } else {
-            Color background = l.getBackground();
-            g.setColor(background.brighter());
-            SwingUtilities2.drawStringUnderlineCharAt(l,g, s, mnemonicIndex,
-                                                         textX + 1, textY + 1);
-            g.setColor(background.darker());
-            SwingUtilities2.drawStringUnderlineCharAt(l,g, s, mnemonicIndex,
-                                                         textX, textY);
-        }
-    }
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2588 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * <p>These classes are designed to be used while the
- * corresponding <code>LookAndFeel</code> class has been installed
- * (<code>UIManager.setLookAndFeel(new <i>XXX</i>LookAndFeel())</code>).
- * Using them while a different <code>LookAndFeel</code> is installed
- * may produce unexpected results, including exceptions.
- * Additionally, changing the <code>LookAndFeel</code>
- * maintained by the <code>UIManager</code> without updating the
- * corresponding <code>ComponentUI</code> of any
- * <code>JComponent</code>s may also produce unexpected results,
- * such as the wrong colors showing up, and is generally not
- * encouraged.
- *
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import java.awt.*;
-import java.awt.image.BufferedImage;
-import java.awt.image.ImageFilter;
-import java.awt.image.ImageProducer;
-import java.awt.image.FilteredImageSource;
-import java.awt.image.RGBImageFilter;
-
-import javax.swing.plaf.*;
-import javax.swing.*;
-import javax.swing.plaf.basic.*;
-import javax.swing.border.*;
-import javax.swing.text.DefaultEditorKit;
-import static javax.swing.UIDefaults.LazyValue;
-
-import java.awt.Font;
-import java.awt.Color;
-import java.awt.event.ActionEvent;
-
-import java.security.AccessController;
-
-import sun.awt.SunToolkit;
-import sun.awt.OSInfo;
-import sun.awt.shell.ShellFolder;
-import sun.font.FontUtilities;
-import sun.security.action.GetPropertyAction;
-
-import sun.swing.DefaultLayoutStyle;
-import sun.swing.ImageIconUIResource;
-import sun.swing.SwingAccessor;
-import sun.swing.icon.SortArrowIcon;
-import sun.swing.SwingUtilities2;
-import sun.swing.StringUIClientPropertyKey;
-import sun.swing.plaf.windows.ClassicSortArrowIcon;
-
-import static com.sun.java.swing.plaf.windows.TMSchema.*;
-import static com.sun.java.swing.plaf.windows.XPStyle.Skin;
-
-import com.sun.java.swing.plaf.windows.WindowsIconFactory.VistaMenuItemCheckIconFactory;
-
-/**
- * Implements the Windows95/98/NT/2000 Look and Feel.
- * UI classes not implemented specifically for Windows will
- * default to those implemented in Basic.
- * <p>
- * <strong>Warning:</strong>
- * Serialized objects of this class will not be compatible with
- * future Swing releases.  The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing.  A future release of Swing will provide support for
- * long term persistence.
- *
- * @author unattributed
- */
-@SuppressWarnings("serial") // Superclass is not serializable across versions
-public class WindowsLookAndFeel extends BasicLookAndFeel
-{
-    /**
-     * A client property that can be used with any JComponent that will end up
-     * calling the LookAndFeel.getDisabledIcon method. This client property,
-     * when set to Boolean.TRUE, will cause getDisabledIcon to use an
-     * alternate algorithm for creating disabled icons to produce icons
-     * that appear similar to the native Windows file chooser
-     */
-    static final Object HI_RES_DISABLED_ICON_CLIENT_KEY =
-        new StringUIClientPropertyKey(
-            "WindowsLookAndFeel.generateHiResDisabledIcon");
-
-    private boolean updatePending = false;
-
-    private boolean useSystemFontSettings = true;
-    private boolean useSystemFontSizeSettings;
-
-    // These properties are not used directly, but are kept as
-    // private members to avoid being GC'd.
-    private WindowsDesktopProperty themeActive, dllName, colorName, sizeName;
-    private WindowsDesktopProperty aaSettings;
-
-    private transient LayoutStyle style;
-
-    /**
-     * Base dialog units along the horizontal axis.
-     */
-    private int baseUnitX;
-
-    /**
-     * Base dialog units along the vertical axis.
-     */
-    private int baseUnitY;
-
-    public String getName() {
-        return "Windows";
-    }
-
-    public String getDescription() {
-        return "The Microsoft Windows Look and Feel";
-    }
-
-    public String getID() {
-        return "Windows";
-    }
-
-    public boolean isNativeLookAndFeel() {
-        return OSInfo.getOSType() == OSInfo.OSType.WINDOWS;
-    }
-
-    public boolean isSupportedLookAndFeel() {
-        return isNativeLookAndFeel();
-    }
-
-    public void initialize() {
-        super.initialize();
-
-        // Set the flag which determines which version of Windows should
-        // be rendered. This flag only need to be set once.
-        // if version <= 4.0 then the classic LAF should be loaded.
-        if (OSInfo.getWindowsVersion().compareTo(OSInfo.WINDOWS_95) <= 0) {
-            isClassicWindows = true;
-        } else {
-            isClassicWindows = false;
-            XPStyle.invalidateStyle();
-        }
-
-        // Using the fonts set by the user can potentially cause
-        // performance and compatibility issues, so allow this feature
-        // to be switched off either at runtime or programmatically
-        //
-        String systemFonts = java.security.AccessController.doPrivileged(
-               new GetPropertyAction("swing.useSystemFontSettings"));
-        useSystemFontSettings = (systemFonts == null ||
-                                 Boolean.valueOf(systemFonts).booleanValue());
-
-        if (useSystemFontSettings) {
-            Object value = UIManager.get("Application.useSystemFontSettings");
-
-            useSystemFontSettings = (value == null ||
-                                     Boolean.TRUE.equals(value));
-        }
-        KeyboardFocusManager.getCurrentKeyboardFocusManager().
-            addKeyEventPostProcessor(WindowsRootPaneUI.altProcessor);
-
-    }
-
-    /**
-     * Initialize the uiClassID to BasicComponentUI mapping.
-     * The JComponent classes define their own uiClassID constants
-     * (see AbstractComponent.getUIClassID).  This table must
-     * map those constants to a BasicComponentUI class of the
-     * appropriate type.
-     *
-     * @see BasicLookAndFeel#getDefaults
-     */
-    protected void initClassDefaults(UIDefaults table)
-    {
-        super.initClassDefaults(table);
-
-        final String windowsPackageName = "com.sun.java.swing.plaf.windows.";
-
-        Object[] uiDefaults = {
-              "ButtonUI", windowsPackageName + "WindowsButtonUI",
-            "CheckBoxUI", windowsPackageName + "WindowsCheckBoxUI",
-    "CheckBoxMenuItemUI", windowsPackageName + "WindowsCheckBoxMenuItemUI",
-               "LabelUI", windowsPackageName + "WindowsLabelUI",
-         "RadioButtonUI", windowsPackageName + "WindowsRadioButtonUI",
- "RadioButtonMenuItemUI", windowsPackageName + "WindowsRadioButtonMenuItemUI",
-        "ToggleButtonUI", windowsPackageName + "WindowsToggleButtonUI",
-         "ProgressBarUI", windowsPackageName + "WindowsProgressBarUI",
-              "SliderUI", windowsPackageName + "WindowsSliderUI",
-           "SeparatorUI", windowsPackageName + "WindowsSeparatorUI",
-           "SplitPaneUI", windowsPackageName + "WindowsSplitPaneUI",
-             "SpinnerUI", windowsPackageName + "WindowsSpinnerUI",
-          "TabbedPaneUI", windowsPackageName + "WindowsTabbedPaneUI",
-            "TextAreaUI", windowsPackageName + "WindowsTextAreaUI",
-           "TextFieldUI", windowsPackageName + "WindowsTextFieldUI",
-       "PasswordFieldUI", windowsPackageName + "WindowsPasswordFieldUI",
-            "TextPaneUI", windowsPackageName + "WindowsTextPaneUI",
-          "EditorPaneUI", windowsPackageName + "WindowsEditorPaneUI",
-                "TreeUI", windowsPackageName + "WindowsTreeUI",
-             "ToolBarUI", windowsPackageName + "WindowsToolBarUI",
-    "ToolBarSeparatorUI", windowsPackageName + "WindowsToolBarSeparatorUI",
-            "ComboBoxUI", windowsPackageName + "WindowsComboBoxUI",
-         "TableHeaderUI", windowsPackageName + "WindowsTableHeaderUI",
-       "InternalFrameUI", windowsPackageName + "WindowsInternalFrameUI",
-         "DesktopPaneUI", windowsPackageName + "WindowsDesktopPaneUI",
-         "DesktopIconUI", windowsPackageName + "WindowsDesktopIconUI",
-         "FileChooserUI", windowsPackageName + "WindowsFileChooserUI",
-                "MenuUI", windowsPackageName + "WindowsMenuUI",
-            "MenuItemUI", windowsPackageName + "WindowsMenuItemUI",
-             "MenuBarUI", windowsPackageName + "WindowsMenuBarUI",
-           "PopupMenuUI", windowsPackageName + "WindowsPopupMenuUI",
-  "PopupMenuSeparatorUI", windowsPackageName + "WindowsPopupMenuSeparatorUI",
-           "ScrollBarUI", windowsPackageName + "WindowsScrollBarUI",
-            "RootPaneUI", windowsPackageName + "WindowsRootPaneUI"
-        };
-
-        table.putDefaults(uiDefaults);
-    }
-
-    /**
-     * Load the SystemColors into the defaults table.  The keys
-     * for SystemColor defaults are the same as the names of
-     * the public fields in SystemColor.  If the table is being
-     * created on a native Windows platform we use the SystemColor
-     * values, otherwise we create color objects whose values match
-     * the defaults Windows95 colors.
-     */
-    protected void initSystemColorDefaults(UIDefaults table)
-    {
-        String[] defaultSystemColors = {
-                "desktop", "#005C5C", /* Color of the desktop background */
-          "activeCaption", "#000080", /* Color for captions (title bars) when they are active. */
-      "activeCaptionText", "#FFFFFF", /* Text color for text in captions (title bars). */
-    "activeCaptionBorder", "#C0C0C0", /* Border color for caption (title bar) window borders. */
-        "inactiveCaption", "#808080", /* Color for captions (title bars) when not active. */
-    "inactiveCaptionText", "#C0C0C0", /* Text color for text in inactive captions (title bars). */
-  "inactiveCaptionBorder", "#C0C0C0", /* Border color for inactive caption (title bar) window borders. */
-                 "window", "#FFFFFF", /* Default color for the interior of windows */
-           "windowBorder", "#000000", /* ??? */
-             "windowText", "#000000", /* ??? */
-                   "menu", "#C0C0C0", /* Background color for menus */
-       "menuPressedItemB", "#000080", /* LightShadow of menubutton highlight */
-       "menuPressedItemF", "#FFFFFF", /* Default color for foreground "text" in menu item */
-               "menuText", "#000000", /* Text color for menus  */
-                   "text", "#C0C0C0", /* Text background color */
-               "textText", "#000000", /* Text foreground color */
-          "textHighlight", "#000080", /* Text background color when selected */
-      "textHighlightText", "#FFFFFF", /* Text color when selected */
-       "textInactiveText", "#808080", /* Text color when disabled */
-                "control", "#C0C0C0", /* Default color for controls (buttons, sliders, etc) */
-            "controlText", "#000000", /* Default color for text in controls */
-       "controlHighlight", "#C0C0C0",
-
-  /*"controlHighlight", "#E0E0E0",*/ /* Specular highlight (opposite of the shadow) */
-     "controlLtHighlight", "#FFFFFF", /* Highlight color for controls */
-          "controlShadow", "#808080", /* Shadow color for controls */
-        "controlDkShadow", "#000000", /* Dark shadow color for controls */
-              "scrollbar", "#E0E0E0", /* Scrollbar background (usually the "track") */
-                   "info", "#FFFFE1", /* ??? */
-               "infoText", "#000000"  /* ??? */
-        };
-
-        loadSystemColors(table, defaultSystemColors, isNativeLookAndFeel());
-    }
-
-   /**
-     * Initialize the defaults table with the name of the ResourceBundle
-     * used for getting localized defaults.
-     */
-    private void initResourceBundle(UIDefaults table) {
-        SwingAccessor.getUIDefaultsAccessor()
-                     .addInternalBundle(table,
-                             "com.sun.java.swing.plaf.windows.resources.windows");
-    }
-
-    // XXX - there are probably a lot of redundant values that could be removed.
-    // ie. Take a look at RadioButtonBorder, etc...
-    protected void initComponentDefaults(UIDefaults table)
-    {
-        super.initComponentDefaults( table );
-
-        initResourceBundle(table);
-
-        // *** Shared Fonts
-        LazyValue dialogPlain12 = t -> new FontUIResource(Font.DIALOG, Font.PLAIN, 12);
-
-        LazyValue sansSerifPlain12 =  t -> new FontUIResource(Font.SANS_SERIF, Font.PLAIN, 12);
-        LazyValue monospacedPlain12 = t -> new FontUIResource(Font.MONOSPACED, Font.PLAIN, 12);
-        LazyValue dialogBold12 = t -> new FontUIResource(Font.DIALOG, Font.BOLD, 12);
-
-        // *** Colors
-        // XXX - some of these doens't seem to be used
-        ColorUIResource red = new ColorUIResource(Color.red);
-        ColorUIResource black = new ColorUIResource(Color.black);
-        ColorUIResource white = new ColorUIResource(Color.white);
-        ColorUIResource gray = new ColorUIResource(Color.gray);
-        ColorUIResource darkGray = new ColorUIResource(Color.darkGray);
-        ColorUIResource scrollBarTrackHighlight = darkGray;
-
-        // Set the flag which determines which version of Windows should
-        // be rendered. This flag only need to be set once.
-        // if version <= 4.0 then the classic LAF should be loaded.
-        isClassicWindows = OSInfo.getWindowsVersion().compareTo(OSInfo.WINDOWS_95) <= 0;
-
-        // *** Tree
-        Object treeExpandedIcon = WindowsTreeUI.ExpandedIcon.createExpandedIcon();
-
-        Object treeCollapsedIcon = WindowsTreeUI.CollapsedIcon.createCollapsedIcon();
-
-
-        // *** Text
-        Object fieldInputMap = new UIDefaults.LazyInputMap(new Object[] {
-                      "control C", DefaultEditorKit.copyAction,
-                      "control V", DefaultEditorKit.pasteAction,
-                      "control X", DefaultEditorKit.cutAction,
-                           "COPY", DefaultEditorKit.copyAction,
-                          "PASTE", DefaultEditorKit.pasteAction,
-                            "CUT", DefaultEditorKit.cutAction,
-                 "control INSERT", DefaultEditorKit.copyAction,
-                   "shift INSERT", DefaultEditorKit.pasteAction,
-                   "shift DELETE", DefaultEditorKit.cutAction,
-                      "control A", DefaultEditorKit.selectAllAction,
-             "control BACK_SLASH", "unselect"/*DefaultEditorKit.unselectAction*/,
-                     "shift LEFT", DefaultEditorKit.selectionBackwardAction,
-                    "shift RIGHT", DefaultEditorKit.selectionForwardAction,
-                   "control LEFT", DefaultEditorKit.previousWordAction,
-                  "control RIGHT", DefaultEditorKit.nextWordAction,
-             "control shift LEFT", DefaultEditorKit.selectionPreviousWordAction,
-            "control shift RIGHT", DefaultEditorKit.selectionNextWordAction,
-                           "HOME", DefaultEditorKit.beginLineAction,
-                            "END", DefaultEditorKit.endLineAction,
-                     "shift HOME", DefaultEditorKit.selectionBeginLineAction,
-                      "shift END", DefaultEditorKit.selectionEndLineAction,
-                     "BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
-               "shift BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
-                         "ctrl H", DefaultEditorKit.deletePrevCharAction,
-                         "DELETE", DefaultEditorKit.deleteNextCharAction,
-                    "ctrl DELETE", DefaultEditorKit.deleteNextWordAction,
-                "ctrl BACK_SPACE", DefaultEditorKit.deletePrevWordAction,
-                          "RIGHT", DefaultEditorKit.forwardAction,
-                           "LEFT", DefaultEditorKit.backwardAction,
-                       "KP_RIGHT", DefaultEditorKit.forwardAction,
-                        "KP_LEFT", DefaultEditorKit.backwardAction,
-                          "ENTER", JTextField.notifyAction,
-                "control shift O", "toggle-componentOrientation"/*DefaultEditorKit.toggleComponentOrientation*/
-        });
-
-        Object passwordInputMap = new UIDefaults.LazyInputMap(new Object[] {
-                      "control C", DefaultEditorKit.copyAction,
-                      "control V", DefaultEditorKit.pasteAction,
-                      "control X", DefaultEditorKit.cutAction,
-                           "COPY", DefaultEditorKit.copyAction,
-                          "PASTE", DefaultEditorKit.pasteAction,
-                            "CUT", DefaultEditorKit.cutAction,
-                 "control INSERT", DefaultEditorKit.copyAction,
-                   "shift INSERT", DefaultEditorKit.pasteAction,
-                   "shift DELETE", DefaultEditorKit.cutAction,
-                      "control A", DefaultEditorKit.selectAllAction,
-             "control BACK_SLASH", "unselect"/*DefaultEditorKit.unselectAction*/,
-                     "shift LEFT", DefaultEditorKit.selectionBackwardAction,
-                    "shift RIGHT", DefaultEditorKit.selectionForwardAction,
-                   "control LEFT", DefaultEditorKit.beginLineAction,
-                  "control RIGHT", DefaultEditorKit.endLineAction,
-             "control shift LEFT", DefaultEditorKit.selectionBeginLineAction,
-            "control shift RIGHT", DefaultEditorKit.selectionEndLineAction,
-                           "HOME", DefaultEditorKit.beginLineAction,
-                            "END", DefaultEditorKit.endLineAction,
-                     "shift HOME", DefaultEditorKit.selectionBeginLineAction,
-                      "shift END", DefaultEditorKit.selectionEndLineAction,
-                     "BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
-               "shift BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
-                         "ctrl H", DefaultEditorKit.deletePrevCharAction,
-                         "DELETE", DefaultEditorKit.deleteNextCharAction,
-                          "RIGHT", DefaultEditorKit.forwardAction,
-                           "LEFT", DefaultEditorKit.backwardAction,
-                       "KP_RIGHT", DefaultEditorKit.forwardAction,
-                        "KP_LEFT", DefaultEditorKit.backwardAction,
-                          "ENTER", JTextField.notifyAction,
-                "control shift O", "toggle-componentOrientation"/*DefaultEditorKit.toggleComponentOrientation*/
-        });
-
-        Object multilineInputMap = new UIDefaults.LazyInputMap(new Object[] {
-                      "control C", DefaultEditorKit.copyAction,
-                      "control V", DefaultEditorKit.pasteAction,
-                      "control X", DefaultEditorKit.cutAction,
-                           "COPY", DefaultEditorKit.copyAction,
-                          "PASTE", DefaultEditorKit.pasteAction,
-                            "CUT", DefaultEditorKit.cutAction,
-                 "control INSERT", DefaultEditorKit.copyAction,
-                   "shift INSERT", DefaultEditorKit.pasteAction,
-                   "shift DELETE", DefaultEditorKit.cutAction,
-                     "shift LEFT", DefaultEditorKit.selectionBackwardAction,
-                    "shift RIGHT", DefaultEditorKit.selectionForwardAction,
-                   "control LEFT", DefaultEditorKit.previousWordAction,
-                  "control RIGHT", DefaultEditorKit.nextWordAction,
-             "control shift LEFT", DefaultEditorKit.selectionPreviousWordAction,
-            "control shift RIGHT", DefaultEditorKit.selectionNextWordAction,
-                      "control A", DefaultEditorKit.selectAllAction,
-             "control BACK_SLASH", "unselect"/*DefaultEditorKit.unselectAction*/,
-                           "HOME", DefaultEditorKit.beginLineAction,
-                            "END", DefaultEditorKit.endLineAction,
-                     "shift HOME", DefaultEditorKit.selectionBeginLineAction,
-                      "shift END", DefaultEditorKit.selectionEndLineAction,
-                   "control HOME", DefaultEditorKit.beginAction,
-                    "control END", DefaultEditorKit.endAction,
-             "control shift HOME", DefaultEditorKit.selectionBeginAction,
-              "control shift END", DefaultEditorKit.selectionEndAction,
-                             "UP", DefaultEditorKit.upAction,
-                           "DOWN", DefaultEditorKit.downAction,
-                     "BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
-               "shift BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
-                         "ctrl H", DefaultEditorKit.deletePrevCharAction,
-                         "DELETE", DefaultEditorKit.deleteNextCharAction,
-                    "ctrl DELETE", DefaultEditorKit.deleteNextWordAction,
-                "ctrl BACK_SPACE", DefaultEditorKit.deletePrevWordAction,
-                          "RIGHT", DefaultEditorKit.forwardAction,
-                           "LEFT", DefaultEditorKit.backwardAction,
-                       "KP_RIGHT", DefaultEditorKit.forwardAction,
-                        "KP_LEFT", DefaultEditorKit.backwardAction,
-                        "PAGE_UP", DefaultEditorKit.pageUpAction,
-                      "PAGE_DOWN", DefaultEditorKit.pageDownAction,
-                  "shift PAGE_UP", "selection-page-up",
-                "shift PAGE_DOWN", "selection-page-down",
-             "ctrl shift PAGE_UP", "selection-page-left",
-           "ctrl shift PAGE_DOWN", "selection-page-right",
-                       "shift UP", DefaultEditorKit.selectionUpAction,
-                     "shift DOWN", DefaultEditorKit.selectionDownAction,
-                          "ENTER", DefaultEditorKit.insertBreakAction,
-                            "TAB", DefaultEditorKit.insertTabAction,
-                      "control T", "next-link-action",
-                "control shift T", "previous-link-action",
-                  "control SPACE", "activate-link-action",
-                "control shift O", "toggle-componentOrientation"/*DefaultEditorKit.toggleComponentOrientation*/
-        });
-
-        Object menuItemAcceleratorDelimiter = "+";
-
-        Object ControlBackgroundColor = new WindowsDesktopProperty(
-                                                       "win.3d.backgroundColor",
-                                                        table.get("control"));
-        Object ControlLightColor      = new WindowsDesktopProperty(
-                                                       "win.3d.lightColor",
-                                                        table.get("controlHighlight"));
-        Object ControlHighlightColor  = new WindowsDesktopProperty(
-                                                       "win.3d.highlightColor",
-                                                        table.get("controlLtHighlight"));
-        Object ControlShadowColor     = new WindowsDesktopProperty(
-                                                       "win.3d.shadowColor",
-                                                        table.get("controlShadow"));
-        Object ControlDarkShadowColor = new WindowsDesktopProperty(
-                                                       "win.3d.darkShadowColor",
-                                                        table.get("controlDkShadow"));
-        Object ControlTextColor       = new WindowsDesktopProperty(
-                                                       "win.button.textColor",
-                                                        table.get("controlText"));
-        Object MenuBackgroundColor    = new WindowsDesktopProperty(
-                                                       "win.menu.backgroundColor",
-                                                        table.get("menu"));
-        Object MenuBarBackgroundColor = new WindowsDesktopProperty(
-                                                       "win.menubar.backgroundColor",
-                                                        table.get("menu"));
-        Object MenuTextColor          = new WindowsDesktopProperty(
-                                                       "win.menu.textColor",
-                                                        table.get("menuText"));
-        Object SelectionBackgroundColor = new WindowsDesktopProperty(
-                                                       "win.item.highlightColor",
-                                                        table.get("textHighlight"));
-        Object SelectionTextColor     = new WindowsDesktopProperty(
-                                                       "win.item.highlightTextColor",
-                                                        table.get("textHighlightText"));
-        Object WindowBackgroundColor  = new WindowsDesktopProperty(
-                                                       "win.frame.backgroundColor",
-                                                        table.get("window"));
-        Object WindowTextColor        = new WindowsDesktopProperty(
-                                                       "win.frame.textColor",
-                                                        table.get("windowText"));
-        Object WindowBorderWidth      = new WindowsDesktopProperty(
-                                                       "win.frame.sizingBorderWidth",
-                                                       Integer.valueOf(1));
-        Object TitlePaneHeight        = new WindowsDesktopProperty(
-                                                       "win.frame.captionHeight",
-                                                       Integer.valueOf(18));
-        Object TitleButtonWidth       = new WindowsDesktopProperty(
-                                                       "win.frame.captionButtonWidth",
-                                                       Integer.valueOf(16));
-        Object TitleButtonHeight      = new WindowsDesktopProperty(
-                                                       "win.frame.captionButtonHeight",
-                                                       Integer.valueOf(16));
-        Object InactiveTextColor      = new WindowsDesktopProperty(
-                                                       "win.text.grayedTextColor",
-                                                        table.get("textInactiveText"));
-        Object ScrollbarBackgroundColor = new WindowsDesktopProperty(
-                                                       "win.scrollbar.backgroundColor",
-                                                        table.get("scrollbar"));
-        Object buttonFocusColor = new FocusColorProperty();
-
-        Object TextBackground         = new XPColorValue(Part.EP_EDIT, null, Prop.FILLCOLOR,
-                                                         WindowBackgroundColor);
-        //The following four lines were commented out as part of bug 4991597
-        //This code *is* correct, however it differs from WindowsXP and is, apparently
-        //a Windows XP bug. Until Windows fixes this bug, we shall also exhibit the same
-        //behavior
-        //Object ReadOnlyTextBackground = new XPColorValue(Part.EP_EDITTEXT, State.READONLY, Prop.FILLCOLOR,
-        //                                                 ControlBackgroundColor);
-        //Object DisabledTextBackground = new XPColorValue(Part.EP_EDITTEXT, State.DISABLED, Prop.FILLCOLOR,
-        //                                                 ControlBackgroundColor);
-        Object ReadOnlyTextBackground = ControlBackgroundColor;
-        Object DisabledTextBackground = ControlBackgroundColor;
-
-        Object MenuFont = dialogPlain12;
-        Object FixedControlFont = monospacedPlain12;
-        Object ControlFont = dialogPlain12;
-        Object MessageFont = dialogPlain12;
-        Object WindowFont = dialogBold12;
-        Object ToolTipFont = sansSerifPlain12;
-        Object IconFont = ControlFont;
-
-        Object scrollBarWidth = new WindowsDesktopProperty("win.scrollbar.width", Integer.valueOf(16));
-
-        Object menuBarHeight = new WindowsDesktopProperty("win.menu.height", null);
-
-        Object hotTrackingOn = new WindowsDesktopProperty("win.item.hotTrackingOn", true);
-
-        Object showMnemonics = new WindowsDesktopProperty("win.menu.keyboardCuesOn", Boolean.TRUE);
-
-        if (useSystemFontSettings) {
-            MenuFont = getDesktopFontValue("win.menu.font", MenuFont);
-            FixedControlFont = getDesktopFontValue("win.ansiFixed.font", FixedControlFont);
-            ControlFont = getDesktopFontValue("win.defaultGUI.font", ControlFont);
-            MessageFont = getDesktopFontValue("win.messagebox.font", MessageFont);
-            WindowFont = getDesktopFontValue("win.frame.captionFont", WindowFont);
-            IconFont    = getDesktopFontValue("win.icon.font", IconFont);
-            ToolTipFont = getDesktopFontValue("win.tooltip.font", ToolTipFont);
-
-            /* Put the desktop AA settings in the defaults.
-             * JComponent.setUI() retrieves this and makes it available
-             * as a client property on the JComponent. Use the same key name
-             * for both client property and UIDefaults.
-             * Also need to set up listeners for changes in these settings.
-             */
-            SwingUtilities2.putAATextInfo(true, table);
-            this.aaSettings =
-                new FontDesktopProperty(SunToolkit.DESKTOPFONTHINTS);
-        }
-        if (useSystemFontSizeSettings) {
-            MenuFont = new WindowsFontSizeProperty("win.menu.font.height", Font.DIALOG, Font.PLAIN, 12);
-            FixedControlFont = new WindowsFontSizeProperty("win.ansiFixed.font.height", Font.MONOSPACED,
-                       Font.PLAIN, 12);
-            ControlFont = new WindowsFontSizeProperty("win.defaultGUI.font.height", Font.DIALOG, Font.PLAIN, 12);
-            MessageFont = new WindowsFontSizeProperty("win.messagebox.font.height", Font.DIALOG, Font.PLAIN, 12);
-            WindowFont = new WindowsFontSizeProperty("win.frame.captionFont.height", Font.DIALOG, Font.BOLD, 12);
-            ToolTipFont = new WindowsFontSizeProperty("win.tooltip.font.height", Font.SANS_SERIF, Font.PLAIN, 12);
-            IconFont    = new WindowsFontSizeProperty("win.icon.font.height", Font.DIALOG, Font.PLAIN, 12);
-        }
-
-
-        if (!(this instanceof WindowsClassicLookAndFeel) &&
-            (OSInfo.getOSType() == OSInfo.OSType.WINDOWS &&
-             OSInfo.getWindowsVersion().compareTo(OSInfo.WINDOWS_XP) >= 0) &&
-            AccessController.doPrivileged(new GetPropertyAction("swing.noxp")) == null) {
-
-            // These desktop properties are not used directly, but are needed to
-            // trigger realoading of UI's.
-            this.themeActive = new TriggerDesktopProperty("win.xpstyle.themeActive");
-            this.dllName     = new TriggerDesktopProperty("win.xpstyle.dllName");
-            this.colorName   = new TriggerDesktopProperty("win.xpstyle.colorName");
-            this.sizeName    = new TriggerDesktopProperty("win.xpstyle.sizeName");
-        }
-
-
-        Object[] defaults = {
-            // *** Auditory Feedback
-            // this key defines which of the various cues to render
-            // Overridden from BasicL&F. This L&F should play all sounds
-            // all the time. The infrastructure decides what to play.
-            // This is disabled until sound bugs can be resolved.
-            "AuditoryCues.playList", null, // table.get("AuditoryCues.cueList"),
-
-            "Application.useSystemFontSettings", Boolean.valueOf(useSystemFontSettings),
-
-            "TextField.focusInputMap", fieldInputMap,
-            "PasswordField.focusInputMap", passwordInputMap,
-            "TextArea.focusInputMap", multilineInputMap,
-            "TextPane.focusInputMap", multilineInputMap,
-            "EditorPane.focusInputMap", multilineInputMap,
-
-            // Buttons
-            "Button.font", ControlFont,
-            "Button.background", ControlBackgroundColor,
-            // Button.foreground, Button.shadow, Button.darkShadow,
-            // Button.disabledForground, and Button.disabledShadow are only
-            // used for Windows Classic. Windows XP will use colors
-            // from the current visual style.
-            "Button.foreground", ControlTextColor,
-            "Button.shadow", ControlShadowColor,
-            "Button.darkShadow", ControlDarkShadowColor,
-            "Button.light", ControlLightColor,
-            "Button.highlight", ControlHighlightColor,
-            "Button.disabledForeground", InactiveTextColor,
-            "Button.disabledShadow", ControlHighlightColor,
-            "Button.focus", buttonFocusColor,
-            "Button.dashedRectGapX", new XPValue(Integer.valueOf(3), Integer.valueOf(5)),
-            "Button.dashedRectGapY", new XPValue(Integer.valueOf(3), Integer.valueOf(4)),
-            "Button.dashedRectGapWidth", new XPValue(Integer.valueOf(6), Integer.valueOf(10)),
-            "Button.dashedRectGapHeight", new XPValue(Integer.valueOf(6), Integer.valueOf(8)),
-            "Button.textShiftOffset", new XPValue(Integer.valueOf(0),
-                                                  Integer.valueOf(1)),
-            // W2K keyboard navigation hidding.
-            "Button.showMnemonics", showMnemonics,
-            "Button.focusInputMap",
-               new UIDefaults.LazyInputMap(new Object[] {
-                            "SPACE", "pressed",
-                   "released SPACE", "released"
-                 }),
-
-            "Caret.width",
-                  new WindowsDesktopProperty("win.caret.width", null),
-
-            "CheckBox.font", ControlFont,
-            "CheckBox.interiorBackground", WindowBackgroundColor,
-            "CheckBox.background", ControlBackgroundColor,
-            "CheckBox.foreground", WindowTextColor,
-            "CheckBox.shadow", ControlShadowColor,
-            "CheckBox.darkShadow", ControlDarkShadowColor,
-            "CheckBox.light", ControlLightColor,
-            "CheckBox.highlight", ControlHighlightColor,
-            "CheckBox.focus", buttonFocusColor,
-            "CheckBox.focusInputMap",
-               new UIDefaults.LazyInputMap(new Object[] {
-                            "SPACE", "pressed",
-                   "released SPACE", "released"
-                 }),
-            // margin is 2 all the way around, BasicBorders.RadioButtonBorder
-            // (checkbox uses RadioButtonBorder) is 2 all the way around too.
-            "CheckBox.totalInsets", new Insets(4, 4, 4, 4),
-
-            "CheckBoxMenuItem.font", MenuFont,
-            "CheckBoxMenuItem.background", MenuBackgroundColor,
-            "CheckBoxMenuItem.foreground", MenuTextColor,
-            "CheckBoxMenuItem.selectionForeground", SelectionTextColor,
-            "CheckBoxMenuItem.selectionBackground", SelectionBackgroundColor,
-            "CheckBoxMenuItem.acceleratorForeground", MenuTextColor,
-            "CheckBoxMenuItem.acceleratorSelectionForeground", SelectionTextColor,
-            "CheckBoxMenuItem.commandSound", "win.sound.menuCommand",
-
-            "ComboBox.font", ControlFont,
-            "ComboBox.background", WindowBackgroundColor,
-            "ComboBox.foreground", WindowTextColor,
-            "ComboBox.buttonBackground", ControlBackgroundColor,
-            "ComboBox.buttonShadow", ControlShadowColor,
-            "ComboBox.buttonDarkShadow", ControlDarkShadowColor,
-            "ComboBox.buttonHighlight", ControlHighlightColor,
-            "ComboBox.selectionBackground", SelectionBackgroundColor,
-            "ComboBox.selectionForeground", SelectionTextColor,
-            "ComboBox.editorBorder", new XPValue(new EmptyBorder(1,4,1,1),
-                                                 new EmptyBorder(1,4,1,4)),
-            "ComboBox.disabledBackground",
-                        new XPColorValue(Part.CP_COMBOBOX, State.DISABLED,
-                        Prop.FILLCOLOR, DisabledTextBackground),
-            "ComboBox.disabledForeground",
-                        new XPColorValue(Part.CP_COMBOBOX, State.DISABLED,
-                        Prop.TEXTCOLOR, InactiveTextColor),
-            "ComboBox.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] {
-                   "ESCAPE", "hidePopup",
-                  "PAGE_UP", "pageUpPassThrough",
-                "PAGE_DOWN", "pageDownPassThrough",
-                     "HOME", "homePassThrough",
-                      "END", "endPassThrough",
-                     "DOWN", "selectNext2",
-                  "KP_DOWN", "selectNext2",
-                       "UP", "selectPrevious2",
-                    "KP_UP", "selectPrevious2",
-                    "ENTER", "enterPressed",
-                       "F4", "togglePopup",
-                 "alt DOWN", "togglePopup",
-              "alt KP_DOWN", "togglePopup",
-                   "alt UP", "togglePopup",
-                "alt KP_UP", "togglePopup"
-              }),
-
-            // DeskTop.
-            "Desktop.background", new WindowsDesktopProperty(
-                                                 "win.mdi.backgroundColor",
-                                                  table.get("desktop")),
-            "Desktop.ancestorInputMap",
-               new UIDefaults.LazyInputMap(new Object[] {
-                   "ctrl F5", "restore",
-                   "ctrl F4", "close",
-                   "ctrl F7", "move",
-                   "ctrl F8", "resize",
-                   "RIGHT", "right",
-                   "KP_RIGHT", "right",
-                   "LEFT", "left",
-                   "KP_LEFT", "left",
-                   "UP", "up",
-                   "KP_UP", "up",
-                   "DOWN", "down",
-                   "KP_DOWN", "down",
-                   "ESCAPE", "escape",
-                   "ctrl F9", "minimize",
-                   "ctrl F10", "maximize",
-                   "ctrl F6", "selectNextFrame",
-                   "ctrl TAB", "selectNextFrame",
-                   "ctrl alt F6", "selectNextFrame",
-                   "shift ctrl alt F6", "selectPreviousFrame",
-                   "ctrl F12", "navigateNext",
-                   "shift ctrl F12", "navigatePrevious"
-               }),
-
-            // DesktopIcon
-            "DesktopIcon.width", Integer.valueOf(160),
-
-            "EditorPane.font", ControlFont,
-            "EditorPane.background", WindowBackgroundColor,
-            "EditorPane.foreground", WindowTextColor,
-            "EditorPane.selectionBackground", SelectionBackgroundColor,
-            "EditorPane.selectionForeground", SelectionTextColor,
-            "EditorPane.caretForeground", WindowTextColor,
-            "EditorPane.inactiveForeground", InactiveTextColor,
-            "EditorPane.inactiveBackground", WindowBackgroundColor,
-            "EditorPane.disabledBackground", DisabledTextBackground,
-
-            "FileChooser.homeFolderIcon",  new LazyWindowsIcon(null,
-                                                               "icons/HomeFolder.gif"),
-            "FileChooser.listFont", IconFont,
-            "FileChooser.listViewBackground", new XPColorValue(Part.LVP_LISTVIEW, null, Prop.FILLCOLOR,
-                                                               WindowBackgroundColor),
-            "FileChooser.listViewBorder", new XPBorderValue(Part.LVP_LISTVIEW,
-               (LazyValue) t -> BorderUIResource.getLoweredBevelBorderUIResource()),
-            "FileChooser.listViewIcon",    new LazyWindowsIcon("fileChooserIcon ListView",
-                                                               "icons/ListView.gif"),
-            "FileChooser.listViewWindowsStyle", Boolean.TRUE,
-            "FileChooser.detailsViewIcon", new LazyWindowsIcon("fileChooserIcon DetailsView",
-                                                               "icons/DetailsView.gif"),
-            "FileChooser.viewMenuIcon", new LazyWindowsIcon("fileChooserIcon ViewMenu",
-                                                            "icons/ListView.gif"),
-            "FileChooser.upFolderIcon",    new LazyWindowsIcon("fileChooserIcon UpFolder",
-                                                               "icons/UpFolder.gif"),
-            "FileChooser.newFolderIcon",   new LazyWindowsIcon("fileChooserIcon NewFolder",
-                                                               "icons/NewFolder.gif"),
-            "FileChooser.useSystemExtensionHiding", Boolean.TRUE,
-
-            "FileChooser.usesSingleFilePane", Boolean.TRUE,
-            "FileChooser.noPlacesBar", new WindowsDesktopProperty("win.comdlg.noPlacesBar",
-                                                                  Boolean.FALSE),
-            "FileChooser.ancestorInputMap",
-               new UIDefaults.LazyInputMap(new Object[] {
-                     "ESCAPE", "cancelSelection",
-                     "F2", "editFileName",
-                     "F5", "refresh",
-                     "BACK_SPACE", "Go Up"
-                 }),
-
-            "FileView.directoryIcon", SwingUtilities2.makeIcon(getClass(),
-                                                               WindowsLookAndFeel.class,
-                                                               "icons/Directory.gif"),
-            "FileView.fileIcon", SwingUtilities2.makeIcon(getClass(),
-                                                          WindowsLookAndFeel.class,
-                                                          "icons/File.gif"),
-            "FileView.computerIcon", SwingUtilities2.makeIcon(getClass(),
-                                                              WindowsLookAndFeel.class,
-                                                              "icons/Computer.gif"),
-            "FileView.hardDriveIcon", SwingUtilities2.makeIcon(getClass(),
-                                                               WindowsLookAndFeel.class,
-                                                               "icons/HardDrive.gif"),
-            "FileView.floppyDriveIcon", SwingUtilities2.makeIcon(getClass(),
-                                                                 WindowsLookAndFeel.class,
-                                                                 "icons/FloppyDrive.gif"),
-
-            "FormattedTextField.font", ControlFont,
-            "InternalFrame.titleFont", WindowFont,
-            "InternalFrame.titlePaneHeight",   TitlePaneHeight,
-            "InternalFrame.titleButtonWidth",  TitleButtonWidth,
-            "InternalFrame.titleButtonHeight", TitleButtonHeight,
-            "InternalFrame.titleButtonToolTipsOn", hotTrackingOn,
-            "InternalFrame.borderColor", ControlBackgroundColor,
-            "InternalFrame.borderShadow", ControlShadowColor,
-            "InternalFrame.borderDarkShadow", ControlDarkShadowColor,
-            "InternalFrame.borderHighlight", ControlHighlightColor,
-            "InternalFrame.borderLight", ControlLightColor,
-            "InternalFrame.borderWidth", WindowBorderWidth,
-            "InternalFrame.minimizeIconBackground", ControlBackgroundColor,
-            "InternalFrame.resizeIconHighlight", ControlLightColor,
-            "InternalFrame.resizeIconShadow", ControlShadowColor,
-            "InternalFrame.activeBorderColor", new WindowsDesktopProperty(
-                                                       "win.frame.activeBorderColor",
-                                                       table.get("windowBorder")),
-            "InternalFrame.inactiveBorderColor", new WindowsDesktopProperty(
-                                                       "win.frame.inactiveBorderColor",
-                                                       table.get("windowBorder")),
-            "InternalFrame.activeTitleBackground", new WindowsDesktopProperty(
-                                                        "win.frame.activeCaptionColor",
-                                                         table.get("activeCaption")),
-            "InternalFrame.activeTitleGradient", new WindowsDesktopProperty(
-                                                        "win.frame.activeCaptionGradientColor",
-                                                         table.get("activeCaption")),
-            "InternalFrame.activeTitleForeground", new WindowsDesktopProperty(
-                                                        "win.frame.captionTextColor",
-                                                         table.get("activeCaptionText")),
-            "InternalFrame.inactiveTitleBackground", new WindowsDesktopProperty(
-                                                        "win.frame.inactiveCaptionColor",
-                                                         table.get("inactiveCaption")),
-            "InternalFrame.inactiveTitleGradient", new WindowsDesktopProperty(
-                                                        "win.frame.inactiveCaptionGradientColor",
-                                                         table.get("inactiveCaption")),
-            "InternalFrame.inactiveTitleForeground", new WindowsDesktopProperty(
-                                                        "win.frame.inactiveCaptionTextColor",
-                                                         table.get("inactiveCaptionText")),
-
-            "InternalFrame.maximizeIcon",
-                WindowsIconFactory.createFrameMaximizeIcon(),
-            "InternalFrame.minimizeIcon",
-                WindowsIconFactory.createFrameMinimizeIcon(),
-            "InternalFrame.iconifyIcon",
-                WindowsIconFactory.createFrameIconifyIcon(),
-            "InternalFrame.closeIcon",
-                WindowsIconFactory.createFrameCloseIcon(),
-            "InternalFrame.icon",
-                (LazyValue) t -> new WindowsInternalFrameTitlePane.ScalableIconUIResource(new Object[]{
-                    // The constructor takes one arg: an array of UIDefaults.LazyValue
-                    // representing the icons
-                        SwingUtilities2.makeIcon(getClass(), BasicLookAndFeel.class, "icons/JavaCup16.png"),
-                        SwingUtilities2.makeIcon(getClass(), WindowsLookAndFeel.class, "icons/JavaCup32.png")
-                }),
-            // Internal Frame Auditory Cue Mappings
-            "InternalFrame.closeSound", "win.sound.close",
-            "InternalFrame.maximizeSound", "win.sound.maximize",
-            "InternalFrame.minimizeSound", "win.sound.minimize",
-            "InternalFrame.restoreDownSound", "win.sound.restoreDown",
-            "InternalFrame.restoreUpSound", "win.sound.restoreUp",
-
-            "InternalFrame.windowBindings", new Object[] {
-                "shift ESCAPE", "showSystemMenu",
-                  "ctrl SPACE", "showSystemMenu",
-                      "ESCAPE", "hideSystemMenu"},
-
-            // Label
-            "Label.font", ControlFont,
-            "Label.background", ControlBackgroundColor,
-            "Label.foreground", WindowTextColor,
-            "Label.disabledForeground", InactiveTextColor,
-            "Label.disabledShadow", ControlHighlightColor,
-
-            // List.
-            "List.font", ControlFont,
-            "List.background", WindowBackgroundColor,
-            "List.foreground", WindowTextColor,
-            "List.selectionBackground", SelectionBackgroundColor,
-            "List.selectionForeground", SelectionTextColor,
-            "List.lockToPositionOnScroll", Boolean.TRUE,
-            "List.focusInputMap",
-               new UIDefaults.LazyInputMap(new Object[] {
-                           "ctrl C", "copy",
-                           "ctrl V", "paste",
-                           "ctrl X", "cut",
-                             "COPY", "copy",
-                            "PASTE", "paste",
-                              "CUT", "cut",
-                   "control INSERT", "copy",
-                     "shift INSERT", "paste",
-                     "shift DELETE", "cut",
-                               "UP", "selectPreviousRow",
-                            "KP_UP", "selectPreviousRow",
-                         "shift UP", "selectPreviousRowExtendSelection",
-                      "shift KP_UP", "selectPreviousRowExtendSelection",
-                    "ctrl shift UP", "selectPreviousRowExtendSelection",
-                 "ctrl shift KP_UP", "selectPreviousRowExtendSelection",
-                          "ctrl UP", "selectPreviousRowChangeLead",
-                       "ctrl KP_UP", "selectPreviousRowChangeLead",
-                             "DOWN", "selectNextRow",
-                          "KP_DOWN", "selectNextRow",
-                       "shift DOWN", "selectNextRowExtendSelection",
-                    "shift KP_DOWN", "selectNextRowExtendSelection",
-                  "ctrl shift DOWN", "selectNextRowExtendSelection",
-               "ctrl shift KP_DOWN", "selectNextRowExtendSelection",
-                        "ctrl DOWN", "selectNextRowChangeLead",
-                     "ctrl KP_DOWN", "selectNextRowChangeLead",
-                             "LEFT", "selectPreviousColumn",
-                          "KP_LEFT", "selectPreviousColumn",
-                       "shift LEFT", "selectPreviousColumnExtendSelection",
-                    "shift KP_LEFT", "selectPreviousColumnExtendSelection",
-                  "ctrl shift LEFT", "selectPreviousColumnExtendSelection",
-               "ctrl shift KP_LEFT", "selectPreviousColumnExtendSelection",
-                        "ctrl LEFT", "selectPreviousColumnChangeLead",
-                     "ctrl KP_LEFT", "selectPreviousColumnChangeLead",
-                            "RIGHT", "selectNextColumn",
-                         "KP_RIGHT", "selectNextColumn",
-                      "shift RIGHT", "selectNextColumnExtendSelection",
-                   "shift KP_RIGHT", "selectNextColumnExtendSelection",
-                 "ctrl shift RIGHT", "selectNextColumnExtendSelection",
-              "ctrl shift KP_RIGHT", "selectNextColumnExtendSelection",
-                       "ctrl RIGHT", "selectNextColumnChangeLead",
-                    "ctrl KP_RIGHT", "selectNextColumnChangeLead",
-                             "HOME", "selectFirstRow",
-                       "shift HOME", "selectFirstRowExtendSelection",
-                  "ctrl shift HOME", "selectFirstRowExtendSelection",
-                        "ctrl HOME", "selectFirstRowChangeLead",
-                              "END", "selectLastRow",
-                        "shift END", "selectLastRowExtendSelection",
-                   "ctrl shift END", "selectLastRowExtendSelection",
-                         "ctrl END", "selectLastRowChangeLead",
-                          "PAGE_UP", "scrollUp",
-                    "shift PAGE_UP", "scrollUpExtendSelection",
-               "ctrl shift PAGE_UP", "scrollUpExtendSelection",
-                     "ctrl PAGE_UP", "scrollUpChangeLead",
-                        "PAGE_DOWN", "scrollDown",
-                  "shift PAGE_DOWN", "scrollDownExtendSelection",
-             "ctrl shift PAGE_DOWN", "scrollDownExtendSelection",
-                   "ctrl PAGE_DOWN", "scrollDownChangeLead",
-                           "ctrl A", "selectAll",
-                       "ctrl SLASH", "selectAll",
-                  "ctrl BACK_SLASH", "clearSelection",
-                            "SPACE", "addToSelection",
-                       "ctrl SPACE", "toggleAndAnchor",
-                      "shift SPACE", "extendTo",
-                 "ctrl shift SPACE", "moveSelectionTo"
-                 }),
-
-            // PopupMenu
-            "PopupMenu.font", MenuFont,
-            "PopupMenu.background", MenuBackgroundColor,
-            "PopupMenu.foreground", MenuTextColor,
-            "PopupMenu.popupSound", "win.sound.menuPopup",
-            "PopupMenu.consumeEventOnClose", Boolean.TRUE,
-
-            // Menus
-            "Menu.font", MenuFont,
-            "Menu.foreground", MenuTextColor,
-            "Menu.background", MenuBackgroundColor,
-            "Menu.useMenuBarBackgroundForTopLevel", Boolean.TRUE,
-            "Menu.selectionForeground", SelectionTextColor,
-            "Menu.selectionBackground", SelectionBackgroundColor,
-            "Menu.acceleratorForeground", MenuTextColor,
-            "Menu.acceleratorSelectionForeground", SelectionTextColor,
-            "Menu.menuPopupOffsetX", Integer.valueOf(0),
-            "Menu.menuPopupOffsetY", Integer.valueOf(0),
-            "Menu.submenuPopupOffsetX", Integer.valueOf(-4),
-            "Menu.submenuPopupOffsetY", Integer.valueOf(-3),
-            "Menu.crossMenuMnemonic", Boolean.FALSE,
-            "Menu.preserveTopLevelSelection", Boolean.TRUE,
-
-            // MenuBar.
-            "MenuBar.font", MenuFont,
-            "MenuBar.background", new XPValue(MenuBarBackgroundColor,
-                                              MenuBackgroundColor),
-            "MenuBar.foreground", MenuTextColor,
-            "MenuBar.shadow", ControlShadowColor,
-            "MenuBar.highlight", ControlHighlightColor,
-            "MenuBar.height", menuBarHeight,
-            "MenuBar.rolloverEnabled", hotTrackingOn,
-            "MenuBar.windowBindings", new Object[] {
-                "F10", "takeFocus" },
-
-            "MenuItem.font", MenuFont,
-            "MenuItem.acceleratorFont", MenuFont,
-            "MenuItem.foreground", MenuTextColor,
-            "MenuItem.background", MenuBackgroundColor,
-            "MenuItem.selectionForeground", SelectionTextColor,
-            "MenuItem.selectionBackground", SelectionBackgroundColor,
-            "MenuItem.disabledForeground", InactiveTextColor,
-            "MenuItem.acceleratorForeground", MenuTextColor,
-            "MenuItem.acceleratorSelectionForeground", SelectionTextColor,
-            "MenuItem.acceleratorDelimiter", menuItemAcceleratorDelimiter,
-                 // Menu Item Auditory Cue Mapping
-            "MenuItem.commandSound", "win.sound.menuCommand",
-             // indicates that keyboard navigation won't skip disabled menu items
-            "MenuItem.disabledAreNavigable", Boolean.TRUE,
-
-            "RadioButton.font", ControlFont,
-            "RadioButton.interiorBackground", WindowBackgroundColor,
-            "RadioButton.background", ControlBackgroundColor,
-            "RadioButton.foreground", WindowTextColor,
-            "RadioButton.shadow", ControlShadowColor,
-            "RadioButton.darkShadow", ControlDarkShadowColor,
-            "RadioButton.light", ControlLightColor,
-            "RadioButton.highlight", ControlHighlightColor,
-            "RadioButton.focus", buttonFocusColor,
-            "RadioButton.focusInputMap",
-               new UIDefaults.LazyInputMap(new Object[] {
-                          "SPACE", "pressed",
-                 "released SPACE", "released"
-              }),
-            // margin is 2 all the way around, BasicBorders.RadioButtonBorder
-            // is 2 all the way around too.
-            "RadioButton.totalInsets", new Insets(4, 4, 4, 4),
-
-
-            "RadioButtonMenuItem.font", MenuFont,
-            "RadioButtonMenuItem.foreground", MenuTextColor,
-            "RadioButtonMenuItem.background", MenuBackgroundColor,
-            "RadioButtonMenuItem.selectionForeground", SelectionTextColor,
-            "RadioButtonMenuItem.selectionBackground", SelectionBackgroundColor,
-            "RadioButtonMenuItem.disabledForeground", InactiveTextColor,
-            "RadioButtonMenuItem.acceleratorForeground", MenuTextColor,
-            "RadioButtonMenuItem.acceleratorSelectionForeground", SelectionTextColor,
-            "RadioButtonMenuItem.commandSound", "win.sound.menuCommand",
-
-            // OptionPane.
-            "OptionPane.font", MessageFont,
-            "OptionPane.messageFont", MessageFont,
-            "OptionPane.buttonFont", MessageFont,
-            "OptionPane.background", ControlBackgroundColor,
-            "OptionPane.foreground", WindowTextColor,
-            "OptionPane.buttonMinimumWidth", new XPDLUValue(50, 50, SwingConstants.EAST),
-            "OptionPane.messageForeground", ControlTextColor,
-            "OptionPane.errorIcon",       new LazyWindowsIcon("optionPaneIcon Error",
-                                                              "icons/Error.gif"),
-            "OptionPane.informationIcon", new LazyWindowsIcon("optionPaneIcon Information",
-                                                              "icons/Inform.gif"),
-            "OptionPane.questionIcon",    new LazyWindowsIcon("optionPaneIcon Question",
-                                                              "icons/Question.gif"),
-            "OptionPane.warningIcon",     new LazyWindowsIcon("optionPaneIcon Warning",
-                                                              "icons/Warn.gif"),
-            "OptionPane.windowBindings", new Object[] {
-                "ESCAPE", "close" },
-                 // Option Pane Auditory Cue Mappings
-            "OptionPane.errorSound", "win.sound.hand", // Error
-            "OptionPane.informationSound", "win.sound.asterisk", // Info Plain
-            "OptionPane.questionSound", "win.sound.question", // Question
-            "OptionPane.warningSound", "win.sound.exclamation", // Warning
-
-            "FormattedTextField.focusInputMap",
-              new UIDefaults.LazyInputMap(new Object[] {
-                           "ctrl C", DefaultEditorKit.copyAction,
-                           "ctrl V", DefaultEditorKit.pasteAction,
-                           "ctrl X", DefaultEditorKit.cutAction,
-                             "COPY", DefaultEditorKit.copyAction,
-                            "PASTE", DefaultEditorKit.pasteAction,
-                              "CUT", DefaultEditorKit.cutAction,
-                   "control INSERT", DefaultEditorKit.copyAction,
-                     "shift INSERT", DefaultEditorKit.pasteAction,
-                     "shift DELETE", DefaultEditorKit.cutAction,
-                       "shift LEFT", DefaultEditorKit.selectionBackwardAction,
-                    "shift KP_LEFT", DefaultEditorKit.selectionBackwardAction,
-                      "shift RIGHT", DefaultEditorKit.selectionForwardAction,
-                   "shift KP_RIGHT", DefaultEditorKit.selectionForwardAction,
-                        "ctrl LEFT", DefaultEditorKit.previousWordAction,
-                     "ctrl KP_LEFT", DefaultEditorKit.previousWordAction,
-                       "ctrl RIGHT", DefaultEditorKit.nextWordAction,
-                    "ctrl KP_RIGHT", DefaultEditorKit.nextWordAction,
-                  "ctrl shift LEFT", DefaultEditorKit.selectionPreviousWordAction,
-               "ctrl shift KP_LEFT", DefaultEditorKit.selectionPreviousWordAction,
-                 "ctrl shift RIGHT", DefaultEditorKit.selectionNextWordAction,
-              "ctrl shift KP_RIGHT", DefaultEditorKit.selectionNextWordAction,
-                           "ctrl A", DefaultEditorKit.selectAllAction,
-                             "HOME", DefaultEditorKit.beginLineAction,
-                              "END", DefaultEditorKit.endLineAction,
-                       "shift HOME", DefaultEditorKit.selectionBeginLineAction,
-                        "shift END", DefaultEditorKit.selectionEndLineAction,
-                       "BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
-                 "shift BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
-                           "ctrl H", DefaultEditorKit.deletePrevCharAction,
-                           "DELETE", DefaultEditorKit.deleteNextCharAction,
-                      "ctrl DELETE", DefaultEditorKit.deleteNextWordAction,
-                  "ctrl BACK_SPACE", DefaultEditorKit.deletePrevWordAction,
-                            "RIGHT", DefaultEditorKit.forwardAction,
-                             "LEFT", DefaultEditorKit.backwardAction,
-                         "KP_RIGHT", DefaultEditorKit.forwardAction,
-                          "KP_LEFT", DefaultEditorKit.backwardAction,
-                            "ENTER", JTextField.notifyAction,
-                  "ctrl BACK_SLASH", "unselect",
-                   "control shift O", "toggle-componentOrientation",
-                           "ESCAPE", "reset-field-edit",
-                               "UP", "increment",
-                            "KP_UP", "increment",
-                             "DOWN", "decrement",
-                          "KP_DOWN", "decrement",
-              }),
-            "FormattedTextField.inactiveBackground", ReadOnlyTextBackground,
-            "FormattedTextField.disabledBackground", DisabledTextBackground,
-            "FormattedTextField.background", TextBackground,
-            "FormattedTextField.foreground", WindowTextColor,
-
-            // *** Panel
-            "Panel.font", ControlFont,
-            "Panel.background", ControlBackgroundColor,
-            "Panel.foreground", WindowTextColor,
-
-            // *** PasswordField
-            "PasswordField.font", ControlFont,
-            "PasswordField.background", TextBackground,
-            "PasswordField.foreground", WindowTextColor,
-            "PasswordField.inactiveForeground", InactiveTextColor,      // for disabled
-            "PasswordField.inactiveBackground", ReadOnlyTextBackground, // for readonly
-            "PasswordField.disabledBackground", DisabledTextBackground, // for disabled
-            "PasswordField.selectionBackground", SelectionBackgroundColor,
-            "PasswordField.selectionForeground", SelectionTextColor,
-            "PasswordField.caretForeground",WindowTextColor,
-            "PasswordField.echoChar", new XPValue((char)0x25CF, '*'),
-
-            // *** ProgressBar
-            "ProgressBar.font", ControlFont,
-            "ProgressBar.foreground",  SelectionBackgroundColor,
-            "ProgressBar.background", ControlBackgroundColor,
-            "ProgressBar.shadow", ControlShadowColor,
-            "ProgressBar.highlight", ControlHighlightColor,
-            "ProgressBar.selectionForeground", ControlBackgroundColor,
-            "ProgressBar.selectionBackground", SelectionBackgroundColor,
-            "ProgressBar.cellLength", Integer.valueOf(7),
-            "ProgressBar.cellSpacing", Integer.valueOf(2),
-            "ProgressBar.indeterminateInsets", new Insets(3, 3, 3, 3),
-
-            // *** RootPane.
-            // These bindings are only enabled when there is a default
-            // button set on the rootpane.
-            "RootPane.defaultButtonWindowKeyBindings", new Object[] {
-                             "ENTER", "press",
-                    "released ENTER", "release",
-                        "ctrl ENTER", "press",
-               "ctrl released ENTER", "release"
-              },
-
-            // *** ScrollBar.
-            "ScrollBar.background", ScrollbarBackgroundColor,
-            "ScrollBar.foreground", ControlBackgroundColor,
-            "ScrollBar.track", white,
-            "ScrollBar.trackForeground", ScrollbarBackgroundColor,
-            "ScrollBar.trackHighlight", black,
-            "ScrollBar.trackHighlightForeground", scrollBarTrackHighlight,
-            "ScrollBar.thumb", ControlBackgroundColor,
-            "ScrollBar.thumbHighlight", ControlHighlightColor,
-            "ScrollBar.thumbDarkShadow", ControlDarkShadowColor,
-            "ScrollBar.thumbShadow", ControlShadowColor,
-            "ScrollBar.width", scrollBarWidth,
-            "ScrollBar.ancestorInputMap",
-               new UIDefaults.LazyInputMap(new Object[] {
-                       "RIGHT", "positiveUnitIncrement",
-                    "KP_RIGHT", "positiveUnitIncrement",
-                        "DOWN", "positiveUnitIncrement",
-                     "KP_DOWN", "positiveUnitIncrement",
-                   "PAGE_DOWN", "positiveBlockIncrement",
-              "ctrl PAGE_DOWN", "positiveBlockIncrement",
-                        "LEFT", "negativeUnitIncrement",
-                     "KP_LEFT", "negativeUnitIncrement",
-                          "UP", "negativeUnitIncrement",
-                       "KP_UP", "negativeUnitIncrement",
-                     "PAGE_UP", "negativeBlockIncrement",
-                "ctrl PAGE_UP", "negativeBlockIncrement",
-                        "HOME", "minScroll",
-                         "END", "maxScroll"
-                 }),
-
-            // *** ScrollPane.
-            "ScrollPane.font", ControlFont,
-            "ScrollPane.background", ControlBackgroundColor,
-            "ScrollPane.foreground", ControlTextColor,
-            "ScrollPane.ancestorInputMap",
-               new UIDefaults.LazyInputMap(new Object[] {
-                           "RIGHT", "unitScrollRight",
-                        "KP_RIGHT", "unitScrollRight",
-                            "DOWN", "unitScrollDown",
-                         "KP_DOWN", "unitScrollDown",
-                            "LEFT", "unitScrollLeft",
-                         "KP_LEFT", "unitScrollLeft",
-                              "UP", "unitScrollUp",
-                           "KP_UP", "unitScrollUp",
-                         "PAGE_UP", "scrollUp",
-                       "PAGE_DOWN", "scrollDown",
-                    "ctrl PAGE_UP", "scrollLeft",
-                  "ctrl PAGE_DOWN", "scrollRight",
-                       "ctrl HOME", "scrollHome",
-                        "ctrl END", "scrollEnd"
-                 }),
-
-            // *** Separator
-            "Separator.background", ControlHighlightColor,
-            "Separator.foreground", ControlShadowColor,
-
-            // *** Slider.
-            "Slider.font", ControlFont,
-            "Slider.foreground", ControlBackgroundColor,
-            "Slider.background", ControlBackgroundColor,
-            "Slider.highlight", ControlHighlightColor,
-            "Slider.shadow", ControlShadowColor,
-            "Slider.focus", ControlDarkShadowColor,
-            "Slider.focusInputMap",
-               new UIDefaults.LazyInputMap(new Object[] {
-                       "RIGHT", "positiveUnitIncrement",
-                    "KP_RIGHT", "positiveUnitIncrement",
-                        "DOWN", "negativeUnitIncrement",
-                     "KP_DOWN", "negativeUnitIncrement",
-                   "PAGE_DOWN", "negativeBlockIncrement",
-                        "LEFT", "negativeUnitIncrement",
-                     "KP_LEFT", "negativeUnitIncrement",
-                          "UP", "positiveUnitIncrement",
-                       "KP_UP", "positiveUnitIncrement",
-                     "PAGE_UP", "positiveBlockIncrement",
-                        "HOME", "minScroll",
-                         "END", "maxScroll"
-                 }),
-
-            // Spinner
-            "Spinner.font", ControlFont,
-            "Spinner.ancestorInputMap",
-               new UIDefaults.LazyInputMap(new Object[] {
-                               "UP", "increment",
-                            "KP_UP", "increment",
-                             "DOWN", "decrement",
-                          "KP_DOWN", "decrement",
-               }),
-
-            // *** SplitPane
-            "SplitPane.background", ControlBackgroundColor,
-            "SplitPane.highlight", ControlHighlightColor,
-            "SplitPane.shadow", ControlShadowColor,
-            "SplitPane.darkShadow", ControlDarkShadowColor,
-            "SplitPane.dividerSize", Integer.valueOf(5),
-            "SplitPane.ancestorInputMap",
-               new UIDefaults.LazyInputMap(new Object[] {
-                        "UP", "negativeIncrement",
-                      "DOWN", "positiveIncrement",
-                      "LEFT", "negativeIncrement",
-                     "RIGHT", "positiveIncrement",
-                     "KP_UP", "negativeIncrement",
-                   "KP_DOWN", "positiveIncrement",
-                   "KP_LEFT", "negativeIncrement",
-                  "KP_RIGHT", "positiveIncrement",
-                      "HOME", "selectMin",
-                       "END", "selectMax",
-                        "F8", "startResize",
-                        "F6", "toggleFocus",
-                  "ctrl TAB", "focusOutForward",
-            "ctrl shift TAB", "focusOutBackward"
-               }),
-
-            // *** TabbedPane
-            "TabbedPane.tabsOverlapBorder", new XPValue(Boolean.TRUE, Boolean.FALSE),
-            "TabbedPane.tabInsets",         new XPValue(new InsetsUIResource(1, 4, 1, 4),
-                                                        new InsetsUIResource(0, 4, 1, 4)),
-            "TabbedPane.tabAreaInsets",     new XPValue(new InsetsUIResource(3, 2, 2, 2),
-                                                        new InsetsUIResource(3, 2, 0, 2)),
-            "TabbedPane.font", ControlFont,
-            "TabbedPane.background", ControlBackgroundColor,
-            "TabbedPane.foreground", ControlTextColor,
-            "TabbedPane.highlight", ControlHighlightColor,
-            "TabbedPane.light", ControlLightColor,
-            "TabbedPane.shadow", ControlShadowColor,
-            "TabbedPane.darkShadow", ControlDarkShadowColor,
-            "TabbedPane.focus", ControlTextColor,
-            "TabbedPane.focusInputMap",
-              new UIDefaults.LazyInputMap(new Object[] {
-                         "RIGHT", "navigateRight",
-                      "KP_RIGHT", "navigateRight",
-                          "LEFT", "navigateLeft",
-                       "KP_LEFT", "navigateLeft",
-                            "UP", "navigateUp",
-                         "KP_UP", "navigateUp",
-                          "DOWN", "navigateDown",
-                       "KP_DOWN", "navigateDown",
-                     "ctrl DOWN", "requestFocusForVisibleComponent",
-                  "ctrl KP_DOWN", "requestFocusForVisibleComponent",
-                }),
-            "TabbedPane.ancestorInputMap",
-               new UIDefaults.LazyInputMap(new Object[] {
-                         "ctrl TAB", "navigateNext",
-                   "ctrl shift TAB", "navigatePrevious",
-                   "ctrl PAGE_DOWN", "navigatePageDown",
-                     "ctrl PAGE_UP", "navigatePageUp",
-                          "ctrl UP", "requestFocus",
-                       "ctrl KP_UP", "requestFocus",
-                 }),
-
-            // *** Table
-            "Table.font", ControlFont,
-            "Table.foreground", ControlTextColor,  // cell text color
-            "Table.background", WindowBackgroundColor,  // cell background color
-            "Table.highlight", ControlHighlightColor,
-            "Table.light", ControlLightColor,
-            "Table.shadow", ControlShadowColor,
-            "Table.darkShadow", ControlDarkShadowColor,
-            "Table.selectionForeground", SelectionTextColor,
-            "Table.selectionBackground", SelectionBackgroundColor,
-            "Table.gridColor", gray,  // grid line color
-            "Table.focusCellBackground", WindowBackgroundColor,
-            "Table.focusCellForeground", ControlTextColor,
-            "Table.ancestorInputMap",
-               new UIDefaults.LazyInputMap(new Object[] {
-                               "ctrl C", "copy",
-                               "ctrl V", "paste",
-                               "ctrl X", "cut",
-                                 "COPY", "copy",
-                                "PASTE", "paste",
-                                  "CUT", "cut",
-                       "control INSERT", "copy",
-                         "shift INSERT", "paste",
-                         "shift DELETE", "cut",
-                                "RIGHT", "selectNextColumn",
-                             "KP_RIGHT", "selectNextColumn",
-                          "shift RIGHT", "selectNextColumnExtendSelection",
-                       "shift KP_RIGHT", "selectNextColumnExtendSelection",
-                     "ctrl shift RIGHT", "selectNextColumnExtendSelection",
-                  "ctrl shift KP_RIGHT", "selectNextColumnExtendSelection",
-                           "ctrl RIGHT", "selectNextColumnChangeLead",
-                        "ctrl KP_RIGHT", "selectNextColumnChangeLead",
-                                 "LEFT", "selectPreviousColumn",
-                              "KP_LEFT", "selectPreviousColumn",
-                           "shift LEFT", "selectPreviousColumnExtendSelection",
-                        "shift KP_LEFT", "selectPreviousColumnExtendSelection",
-                      "ctrl shift LEFT", "selectPreviousColumnExtendSelection",
-                   "ctrl shift KP_LEFT", "selectPreviousColumnExtendSelection",
-                            "ctrl LEFT", "selectPreviousColumnChangeLead",
-                         "ctrl KP_LEFT", "selectPreviousColumnChangeLead",
-                                 "DOWN", "selectNextRow",
-                              "KP_DOWN", "selectNextRow",
-                           "shift DOWN", "selectNextRowExtendSelection",
-                        "shift KP_DOWN", "selectNextRowExtendSelection",
-                      "ctrl shift DOWN", "selectNextRowExtendSelection",
-                   "ctrl shift KP_DOWN", "selectNextRowExtendSelection",
-                            "ctrl DOWN", "selectNextRowChangeLead",
-                         "ctrl KP_DOWN", "selectNextRowChangeLead",
-                                   "UP", "selectPreviousRow",
-                                "KP_UP", "selectPreviousRow",
-                             "shift UP", "selectPreviousRowExtendSelection",
-                          "shift KP_UP", "selectPreviousRowExtendSelection",
-                        "ctrl shift UP", "selectPreviousRowExtendSelection",
-                     "ctrl shift KP_UP", "selectPreviousRowExtendSelection",
-                              "ctrl UP", "selectPreviousRowChangeLead",
-                           "ctrl KP_UP", "selectPreviousRowChangeLead",
-                                 "HOME", "selectFirstColumn",
-                           "shift HOME", "selectFirstColumnExtendSelection",
-                      "ctrl shift HOME", "selectFirstRowExtendSelection",
-                            "ctrl HOME", "selectFirstRow",
-                                  "END", "selectLastColumn",
-                            "shift END", "selectLastColumnExtendSelection",
-                       "ctrl shift END", "selectLastRowExtendSelection",
-                             "ctrl END", "selectLastRow",
-                              "PAGE_UP", "scrollUpChangeSelection",
-                        "shift PAGE_UP", "scrollUpExtendSelection",
-                   "ctrl shift PAGE_UP", "scrollLeftExtendSelection",
-                         "ctrl PAGE_UP", "scrollLeftChangeSelection",
-                            "PAGE_DOWN", "scrollDownChangeSelection",
-                      "shift PAGE_DOWN", "scrollDownExtendSelection",
-                 "ctrl shift PAGE_DOWN", "scrollRightExtendSelection",
-                       "ctrl PAGE_DOWN", "scrollRightChangeSelection",
-                                  "TAB", "selectNextColumnCell",
-                            "shift TAB", "selectPreviousColumnCell",
-                                "ENTER", "selectNextRowCell",
-                          "shift ENTER", "selectPreviousRowCell",
-                               "ctrl A", "selectAll",
-                           "ctrl SLASH", "selectAll",
-                      "ctrl BACK_SLASH", "clearSelection",
-                               "ESCAPE", "cancel",
-                                   "F2", "startEditing",
-                                "SPACE", "addToSelection",
-                           "ctrl SPACE", "toggleAndAnchor",
-                          "shift SPACE", "extendTo",
-                     "ctrl shift SPACE", "moveSelectionTo",
-                                   "F8", "focusHeader"
-                 }),
-            "Table.sortIconHighlight", ControlShadowColor,
-            "Table.sortIconLight", white,
-
-            "TableHeader.font", ControlFont,
-            "TableHeader.foreground", ControlTextColor, // header text color
-            "TableHeader.background", ControlBackgroundColor, // header background
-            "TableHeader.focusCellBackground",
-                new XPValue(XPValue.NULL_VALUE,     // use default bg from XP styles
-                            WindowBackgroundColor), // or white bg otherwise
-
-            // *** TextArea
-            "TextArea.font", FixedControlFont,
-            "TextArea.background", WindowBackgroundColor,
-            "TextArea.foreground", WindowTextColor,
-            "TextArea.inactiveForeground", InactiveTextColor,
-            "TextArea.inactiveBackground", WindowBackgroundColor,
-            "TextArea.disabledBackground", DisabledTextBackground,
-            "TextArea.selectionBackground", SelectionBackgroundColor,
-            "TextArea.selectionForeground", SelectionTextColor,
-            "TextArea.caretForeground", WindowTextColor,
-
-            // *** TextField
-            "TextField.font", ControlFont,
-            "TextField.background", TextBackground,
-            "TextField.foreground", WindowTextColor,
-            "TextField.shadow", ControlShadowColor,
-            "TextField.darkShadow", ControlDarkShadowColor,
-            "TextField.light", ControlLightColor,
-            "TextField.highlight", ControlHighlightColor,
-            "TextField.inactiveForeground", InactiveTextColor,      // for disabled
-            "TextField.inactiveBackground", ReadOnlyTextBackground, // for readonly
-            "TextField.disabledBackground", DisabledTextBackground, // for disabled
-            "TextField.selectionBackground", SelectionBackgroundColor,
-            "TextField.selectionForeground", SelectionTextColor,
-            "TextField.caretForeground", WindowTextColor,
-
-            // *** TextPane
-            "TextPane.font", ControlFont,
-            "TextPane.background", WindowBackgroundColor,
-            "TextPane.foreground", WindowTextColor,
-            "TextPane.selectionBackground", SelectionBackgroundColor,
-            "TextPane.selectionForeground", SelectionTextColor,
-            "TextPane.inactiveBackground", WindowBackgroundColor,
-            "TextPane.disabledBackground", DisabledTextBackground,
-            "TextPane.caretForeground", WindowTextColor,
-
-            // *** TitledBorder
-            "TitledBorder.font", ControlFont,
-            "TitledBorder.titleColor",
-                        new XPColorValue(Part.BP_GROUPBOX, null, Prop.TEXTCOLOR,
-                                         WindowTextColor),
-
-            // *** ToggleButton
-            "ToggleButton.font", ControlFont,
-            "ToggleButton.background", ControlBackgroundColor,
-            "ToggleButton.foreground", ControlTextColor,
-            "ToggleButton.shadow", ControlShadowColor,
-            "ToggleButton.darkShadow", ControlDarkShadowColor,
-            "ToggleButton.light", ControlLightColor,
-            "ToggleButton.highlight", ControlHighlightColor,
-            "ToggleButton.focus", ControlTextColor,
-            "ToggleButton.textShiftOffset", Integer.valueOf(1),
-            "ToggleButton.focusInputMap",
-              new UIDefaults.LazyInputMap(new Object[] {
-                            "SPACE", "pressed",
-                   "released SPACE", "released"
-                }),
-
-            // *** ToolBar
-            "ToolBar.font", MenuFont,
-            "ToolBar.background", ControlBackgroundColor,
-            "ToolBar.foreground", ControlTextColor,
-            "ToolBar.shadow", ControlShadowColor,
-            "ToolBar.darkShadow", ControlDarkShadowColor,
-            "ToolBar.light", ControlLightColor,
-            "ToolBar.highlight", ControlHighlightColor,
-            "ToolBar.dockingBackground", ControlBackgroundColor,
-            "ToolBar.dockingForeground", red,
-            "ToolBar.floatingBackground", ControlBackgroundColor,
-            "ToolBar.floatingForeground", darkGray,
-            "ToolBar.ancestorInputMap",
-               new UIDefaults.LazyInputMap(new Object[] {
-                        "UP", "navigateUp",
-                     "KP_UP", "navigateUp",
-                      "DOWN", "navigateDown",
-                   "KP_DOWN", "navigateDown",
-                      "LEFT", "navigateLeft",
-                   "KP_LEFT", "navigateLeft",
-                     "RIGHT", "navigateRight",
-                  "KP_RIGHT", "navigateRight"
-                 }),
-            "ToolBar.separatorSize", null,
-
-            // *** ToolTip
-            "ToolTip.font", ToolTipFont,
-            "ToolTip.background", new WindowsDesktopProperty("win.tooltip.backgroundColor", table.get("info")),
-            "ToolTip.foreground", new WindowsDesktopProperty("win.tooltip.textColor", table.get("infoText")),
-
-        // *** ToolTipManager
-            "ToolTipManager.enableToolTipMode", "activeApplication",
-
-        // *** Tree
-            "Tree.selectionBorderColor", black,
-            "Tree.drawDashedFocusIndicator", Boolean.TRUE,
-            "Tree.lineTypeDashed", Boolean.TRUE,
-            "Tree.font", ControlFont,
-            "Tree.background", WindowBackgroundColor,
-            "Tree.foreground", WindowTextColor,
-            "Tree.hash", gray,
-            "Tree.leftChildIndent", Integer.valueOf(8),
-            "Tree.rightChildIndent", Integer.valueOf(11),
-            "Tree.textForeground", WindowTextColor,
-            "Tree.textBackground", WindowBackgroundColor,
-            "Tree.selectionForeground", SelectionTextColor,
-            "Tree.selectionBackground", SelectionBackgroundColor,
-            "Tree.expandedIcon", treeExpandedIcon,
-            "Tree.collapsedIcon", treeCollapsedIcon,
-            "Tree.openIcon",   new ActiveWindowsIcon("win.icon.shellIconBPP",
-                                   "shell32Icon 5", "icons/TreeOpen.gif"),
-            "Tree.closedIcon", new ActiveWindowsIcon("win.icon.shellIconBPP",
-                                   "shell32Icon 4", "icons/TreeClosed.gif"),
-            "Tree.focusInputMap",
-               new UIDefaults.LazyInputMap(new Object[] {
-                                    "ADD", "expand",
-                               "SUBTRACT", "collapse",
-                                 "ctrl C", "copy",
-                                 "ctrl V", "paste",
-                                 "ctrl X", "cut",
-                                   "COPY", "copy",
-                                  "PASTE", "paste",
-                                    "CUT", "cut",
-                         "control INSERT", "copy",
-                           "shift INSERT", "paste",
-                           "shift DELETE", "cut",
-                                     "UP", "selectPrevious",
-                                  "KP_UP", "selectPrevious",
-                               "shift UP", "selectPreviousExtendSelection",
-                            "shift KP_UP", "selectPreviousExtendSelection",
-                          "ctrl shift UP", "selectPreviousExtendSelection",
-                       "ctrl shift KP_UP", "selectPreviousExtendSelection",
-                                "ctrl UP", "selectPreviousChangeLead",
-                             "ctrl KP_UP", "selectPreviousChangeLead",
-                                   "DOWN", "selectNext",
-                                "KP_DOWN", "selectNext",
-                             "shift DOWN", "selectNextExtendSelection",
-                          "shift KP_DOWN", "selectNextExtendSelection",
-                        "ctrl shift DOWN", "selectNextExtendSelection",
-                     "ctrl shift KP_DOWN", "selectNextExtendSelection",
-                              "ctrl DOWN", "selectNextChangeLead",
-                           "ctrl KP_DOWN", "selectNextChangeLead",
-                                  "RIGHT", "selectChild",
-                               "KP_RIGHT", "selectChild",
-                                   "LEFT", "selectParent",
-                                "KP_LEFT", "selectParent",
-                                "PAGE_UP", "scrollUpChangeSelection",
-                          "shift PAGE_UP", "scrollUpExtendSelection",
-                     "ctrl shift PAGE_UP", "scrollUpExtendSelection",
-                           "ctrl PAGE_UP", "scrollUpChangeLead",
-                              "PAGE_DOWN", "scrollDownChangeSelection",
-                        "shift PAGE_DOWN", "scrollDownExtendSelection",
-                   "ctrl shift PAGE_DOWN", "scrollDownExtendSelection",
-                         "ctrl PAGE_DOWN", "scrollDownChangeLead",
-                                   "HOME", "selectFirst",
-                             "shift HOME", "selectFirstExtendSelection",
-                        "ctrl shift HOME", "selectFirstExtendSelection",
-                              "ctrl HOME", "selectFirstChangeLead",
-                                    "END", "selectLast",
-                              "shift END", "selectLastExtendSelection",
-                         "ctrl shift END", "selectLastExtendSelection",
-                               "ctrl END", "selectLastChangeLead",
-                                     "F2", "startEditing",
-                                 "ctrl A", "selectAll",
-                             "ctrl SLASH", "selectAll",
-                        "ctrl BACK_SLASH", "clearSelection",
-                              "ctrl LEFT", "scrollLeft",
-                           "ctrl KP_LEFT", "scrollLeft",
-                             "ctrl RIGHT", "scrollRight",
-                          "ctrl KP_RIGHT", "scrollRight",
-                                  "SPACE", "addToSelection",
-                             "ctrl SPACE", "toggleAndAnchor",
-                            "shift SPACE", "extendTo",
-                       "ctrl shift SPACE", "moveSelectionTo"
-                 }),
-            "Tree.ancestorInputMap",
-               new UIDefaults.LazyInputMap(new Object[] {
-                     "ESCAPE", "cancel"
-                 }),
-
-            // *** Viewport
-            "Viewport.font", ControlFont,
-            "Viewport.background", ControlBackgroundColor,
-            "Viewport.foreground", WindowTextColor,
-
-
-        };
-
-        table.putDefaults(defaults);
-        table.putDefaults(getLazyValueDefaults());
-        initVistaComponentDefaults(table);
-    }
-
-    static boolean isOnVista() {
-        return OSInfo.getOSType() == OSInfo.OSType.WINDOWS
-                && OSInfo.getWindowsVersion().compareTo(OSInfo.WINDOWS_VISTA) >= 0;
-    }
-
-    static boolean isOnWindows7() {
-        return OSInfo.getOSType() == OSInfo.OSType.WINDOWS
-                && OSInfo.getWindowsVersion().compareTo(OSInfo.WINDOWS_7) >= 0;
-    }
-
-    private void initVistaComponentDefaults(UIDefaults table) {
-        if (! isOnVista()) {
-            return;
-        }
-        /* START handling menus for Vista */
-        String[] menuClasses = { "MenuItem", "Menu",
-                "CheckBoxMenuItem", "RadioButtonMenuItem",
-        };
-
-        Object menuDefaults[] = new Object[menuClasses.length * 2];
-
-        /* all the menus need to be non opaque. */
-        for (int i = 0, j = 0; i < menuClasses.length; i++) {
-            String key = menuClasses[i] + ".opaque";
-            Object oldValue = table.get(key);
-            menuDefaults[j++] = key;
-            menuDefaults[j++] =
-                new XPValue(Boolean.FALSE, oldValue);
-        }
-        table.putDefaults(menuDefaults);
-
-        /*
-         * acceleratorSelectionForeground color is the same as
-         * acceleratorForeground
-         */
-        for (int i = 0, j = 0; i < menuClasses.length; i++) {
-            String key = menuClasses[i] + ".acceleratorSelectionForeground";
-            Object oldValue = table.get(key);
-            menuDefaults[j++] = key;
-            menuDefaults[j++] =
-                new XPValue(
-                    table.getColor(
-                        menuClasses[i] + ".acceleratorForeground"),
-                        oldValue);
-        }
-        table.putDefaults(menuDefaults);
-
-        /* they have the same MenuItemCheckIconFactory */
-        VistaMenuItemCheckIconFactory menuItemCheckIconFactory =
-            WindowsIconFactory.getMenuItemCheckIconFactory();
-        for (int i = 0, j = 0; i < menuClasses.length; i++) {
-            String key = menuClasses[i] + ".checkIconFactory";
-            Object oldValue = table.get(key);
-            menuDefaults[j++] = key;
-            menuDefaults[j++] =
-                new XPValue(menuItemCheckIconFactory, oldValue);
-        }
-        table.putDefaults(menuDefaults);
-
-        for (int i = 0, j = 0; i < menuClasses.length; i++) {
-            String key = menuClasses[i] + ".checkIcon";
-            Object oldValue = table.get(key);
-            menuDefaults[j++] = key;
-            menuDefaults[j++] =
-                new XPValue(menuItemCheckIconFactory.getIcon(menuClasses[i]),
-                    oldValue);
-        }
-        table.putDefaults(menuDefaults);
-
-
-        /* height can be even */
-        for (int i = 0, j = 0; i < menuClasses.length; i++) {
-            String key = menuClasses[i] + ".evenHeight";
-            Object oldValue = table.get(key);
-            menuDefaults[j++] = key;
-            menuDefaults[j++] = new XPValue(Boolean.TRUE, oldValue);
-        }
-        table.putDefaults(menuDefaults);
-
-        /*For Windows7 margin and checkIconOffset should be greater than 0 */
-        if (!isOnWindows7()) {
-            /* no margins */
-            InsetsUIResource insets = new InsetsUIResource(0, 0, 0, 0);
-            for (int i = 0, j = 0; i < menuClasses.length; i++) {
-                String key = menuClasses[i] + ".margin";
-                Object oldValue = table.get(key);
-                menuDefaults[j++] = key;
-                menuDefaults[j++] = new XPValue(insets, oldValue);
-            }
-            table.putDefaults(menuDefaults);
-
-            /* set checkIcon offset */
-            Integer checkIconOffsetInteger =
-                Integer.valueOf(0);
-            for (int i = 0, j = 0; i < menuClasses.length; i++) {
-                String key = menuClasses[i] + ".checkIconOffset";
-                Object oldValue = table.get(key);
-                menuDefaults[j++] = key;
-                menuDefaults[j++] =
-                    new XPValue(checkIconOffsetInteger, oldValue);
-            }
-            table.putDefaults(menuDefaults);
-        }
-        /* set width of the gap after check icon */
-        Integer afterCheckIconGap = WindowsPopupMenuUI.getSpanBeforeGutter()
-                + WindowsPopupMenuUI.getGutterWidth()
-                + WindowsPopupMenuUI.getSpanAfterGutter();
-        for (int i = 0, j = 0; i < menuClasses.length; i++) {
-            String key = menuClasses[i] + ".afterCheckIconGap";
-            Object oldValue = table.get(key);
-            menuDefaults[j++] = key;
-            menuDefaults[j++] =
-                new XPValue(afterCheckIconGap, oldValue);
-        }
-        table.putDefaults(menuDefaults);
-
-        /* text is started after this position */
-        Object minimumTextOffset = new UIDefaults.ActiveValue() {
-            public Object createValue(UIDefaults table) {
-                return VistaMenuItemCheckIconFactory.getIconWidth()
-                + WindowsPopupMenuUI.getSpanBeforeGutter()
-                + WindowsPopupMenuUI.getGutterWidth()
-                + WindowsPopupMenuUI.getSpanAfterGutter();
-            }
-        };
-        for (int i = 0, j = 0; i < menuClasses.length; i++) {
-            String key = menuClasses[i] + ".minimumTextOffset";
-            Object oldValue = table.get(key);
-            menuDefaults[j++] = key;
-            menuDefaults[j++] = new XPValue(minimumTextOffset, oldValue);
-        }
-        table.putDefaults(menuDefaults);
-
-        /*
-         * JPopupMenu has a bit of free space around menu items
-         */
-        String POPUP_MENU_BORDER = "PopupMenu.border";
-
-        Object popupMenuBorder = new XPBorderValue(Part.MENU,
-            (LazyValue) t -> BasicBorders.getInternalFrameBorder(),
-                  BorderFactory.createEmptyBorder(2, 2, 2, 2));
-        table.put(POPUP_MENU_BORDER, popupMenuBorder);
-        /* END handling menus for Vista */
-
-        /* START table handling for Vista */
-        table.put("Table.ascendingSortIcon", new XPValue(
-            new SkinIcon(Part.HP_HEADERSORTARROW, State.SORTEDDOWN),
-               (LazyValue) t -> new ClassicSortArrowIcon(true)));
-        table.put("Table.descendingSortIcon", new XPValue(
-            new SkinIcon(Part.HP_HEADERSORTARROW, State.SORTEDUP),
-               (LazyValue) t -> new ClassicSortArrowIcon(false)));
-        /* END table handling for Vista */
-    }
-
-    /**
-     * If we support loading of fonts from the desktop this will return
-     * a WindowsDesktopProperty representing the font. If the font can't be
-     * represented in the current encoding this will return null and
-     * turn off the use of system fonts.
-     */
-    private Object getDesktopFontValue(String fontName, Object backup) {
-        if (useSystemFontSettings) {
-            return new WindowsFontProperty(fontName, backup);
-        }
-        return null;
-    }
-
-    // When a desktop property change is detected, these classes must be
-    // reinitialized in the defaults table to ensure the classes reference
-    // the updated desktop property values (colors mostly)
-    //
-    private Object[] getLazyValueDefaults() {
-
-        Object buttonBorder =
-            new XPBorderValue(Part.BP_PUSHBUTTON,
-               (LazyValue) t -> BasicBorders.getButtonBorder());
-
-        Object textFieldBorder =
-            new XPBorderValue(Part.EP_EDIT,
-               (LazyValue) t -> BasicBorders.getTextFieldBorder());
-
-        Object textFieldMargin =
-            new XPValue(new InsetsUIResource(2, 2, 2, 2),
-                        new InsetsUIResource(1, 1, 1, 1));
-
-        Object spinnerBorder =
-            new XPBorderValue(Part.EP_EDIT, textFieldBorder,
-                              new EmptyBorder(2, 2, 2, 2));
-
-        Object spinnerArrowInsets =
-            new XPValue(new InsetsUIResource(1, 1, 1, 1),
-                        null);
-
-        Object comboBoxBorder = new XPBorderValue(Part.CP_COMBOBOX, textFieldBorder);
-
-        // For focus rectangle for cells and trees.
-        LazyValue focusCellHighlightBorder = t -> WindowsBorders.getFocusCellHighlightBorder();
-
-        LazyValue etchedBorder = t -> BorderUIResource.getEtchedBorderUIResource();
-
-        LazyValue internalFrameBorder = t -> WindowsBorders.getInternalFrameBorder();
-
-        LazyValue loweredBevelBorder = t -> BorderUIResource.getLoweredBevelBorderUIResource();
-
-
-        LazyValue marginBorder = t -> new BasicBorders.MarginBorder();
-
-        LazyValue menuBarBorder = t -> BasicBorders.getMenuBarBorder();
-
-
-        Object popupMenuBorder = new XPBorderValue(Part.MENU,
-            (LazyValue) t -> BasicBorders.getInternalFrameBorder());
-
-        // *** ProgressBar
-        LazyValue progressBarBorder = t -> WindowsBorders.getProgressBarBorder();
-
-        LazyValue radioButtonBorder = t -> BasicBorders.getRadioButtonBorder();
-
-        Object scrollPaneBorder =
-            new XPBorderValue(Part.LBP_LISTBOX, textFieldBorder);
-
-        Object tableScrollPaneBorder =
-            new XPBorderValue(Part.LBP_LISTBOX, loweredBevelBorder);
-
-        LazyValue tableHeaderBorder = t -> WindowsBorders.getTableHeaderBorder();
-
-        // *** ToolBar
-        LazyValue toolBarBorder = t -> WindowsBorders.getToolBarBorder();
-
-        // *** ToolTips
-        LazyValue toolTipBorder = t -> BorderUIResource.getBlackLineBorderUIResource();
-
-
-
-        LazyValue checkBoxIcon = t -> WindowsIconFactory.getCheckBoxIcon();
-
-        LazyValue radioButtonIcon = t -> WindowsIconFactory.getRadioButtonIcon();
-
-        LazyValue radioButtonMenuItemIcon = t -> WindowsIconFactory.getRadioButtonMenuItemIcon();
-
-        LazyValue menuItemCheckIcon = t -> WindowsIconFactory.getMenuItemCheckIcon();
-
-        LazyValue menuItemArrowIcon = t -> WindowsIconFactory.getMenuItemArrowIcon();
-
-        LazyValue menuArrowIcon = t -> WindowsIconFactory.getMenuArrowIcon();
-
-        Color highlight = (Color) Toolkit.getDefaultToolkit().
-                getDesktopProperty("win.3d.highlightColor");
-
-        Color shadow = (Color) Toolkit.getDefaultToolkit().
-                getDesktopProperty("win.3d.shadowColor");
-
-        Object[] lazyDefaults = {
-            "Button.border", buttonBorder,
-            "CheckBox.border", radioButtonBorder,
-            "ComboBox.border", comboBoxBorder,
-            "DesktopIcon.border", internalFrameBorder,
-            "FormattedTextField.border", textFieldBorder,
-            "FormattedTextField.margin", textFieldMargin,
-            "InternalFrame.border", internalFrameBorder,
-            "List.focusCellHighlightBorder", focusCellHighlightBorder,
-            "Table.focusCellHighlightBorder", focusCellHighlightBorder,
-            "Menu.border", marginBorder,
-            "MenuBar.border", menuBarBorder,
-            "MenuItem.border", marginBorder,
-            "PasswordField.border", textFieldBorder,
-            "PasswordField.margin", textFieldMargin,
-            "PopupMenu.border", popupMenuBorder,
-            "ProgressBar.border", progressBarBorder,
-            "RadioButton.border", radioButtonBorder,
-            "ScrollPane.border", scrollPaneBorder,
-            "Spinner.border", spinnerBorder,
-            "Spinner.arrowButtonInsets", spinnerArrowInsets,
-            "Spinner.arrowButtonSize", new Dimension(17, 9),
-            "Table.scrollPaneBorder", tableScrollPaneBorder,
-            "TableHeader.cellBorder", tableHeaderBorder,
-            "TextArea.margin", textFieldMargin,
-            "TextField.border", textFieldBorder,
-            "TextField.margin", textFieldMargin,
-            "TitledBorder.border", new UIDefaults.LazyValue() {
-                public Object createValue(UIDefaults table) {
-                    return new BorderUIResource.
-                            EtchedBorderUIResource(highlight, shadow);
-                }
-            },
-            "ToggleButton.border", radioButtonBorder,
-            "ToolBar.border", toolBarBorder,
-            "ToolTip.border", toolTipBorder,
-
-            "CheckBox.icon", checkBoxIcon,
-            "Menu.arrowIcon", menuArrowIcon,
-            "MenuItem.checkIcon", menuItemCheckIcon,
-            "MenuItem.arrowIcon", menuItemArrowIcon,
-            "RadioButton.icon", radioButtonIcon,
-            "RadioButtonMenuItem.checkIcon", radioButtonMenuItemIcon,
-            "InternalFrame.layoutTitlePaneAtOrigin",
-                        new XPValue(Boolean.TRUE, Boolean.FALSE),
-            "Table.ascendingSortIcon", new XPValue(
-               (LazyValue) t -> new SortArrowIcon(true,"Table.sortIconColor"),
-                  (LazyValue) t -> new ClassicSortArrowIcon(true)),
-            "Table.descendingSortIcon", new XPValue(
-               (LazyValue) t -> new SortArrowIcon(false,"Table.sortIconColor"),
-                  (LazyValue) t -> new ClassicSortArrowIcon(false)),
-        };
-
-        return lazyDefaults;
-    }
-
-    public void uninitialize() {
-        super.uninitialize();
-
-        if (WindowsPopupMenuUI.mnemonicListener != null) {
-            MenuSelectionManager.defaultManager().
-                removeChangeListener(WindowsPopupMenuUI.mnemonicListener);
-        }
-        KeyboardFocusManager.getCurrentKeyboardFocusManager().
-            removeKeyEventPostProcessor(WindowsRootPaneUI.altProcessor);
-        WindowsDesktopProperty.flushUnreferencedProperties();
-    }
-
-
-    // Toggle flag for drawing the mnemonic state
-    private static boolean isMnemonicHidden = true;
-
-    // Flag which indicates that the Win98/Win2k/WinME features
-    // should be disabled.
-    private static boolean isClassicWindows = false;
-
-    /**
-     * Sets the state of the hide mnemonic flag. This flag is used by the
-     * component UI delegates to determine if the mnemonic should be rendered.
-     * This method is a non operation if the underlying operating system
-     * does not support the mnemonic hiding feature.
-     *
-     * @param hide true if mnemonics should be hidden
-     * @since 1.4
-     */
-    public static void setMnemonicHidden(boolean hide) {
-        if (UIManager.getBoolean("Button.showMnemonics") == true) {
-            // Do not hide mnemonics if the UI defaults do not support this
-            isMnemonicHidden = false;
-        } else {
-            isMnemonicHidden = hide;
-        }
-    }
-
-    /**
-     * Gets the state of the hide mnemonic flag. This only has meaning
-     * if this feature is supported by the underlying OS.
-     *
-     * @return true if mnemonics are hidden, otherwise, false
-     * @see #setMnemonicHidden
-     * @since 1.4
-     */
-    public static boolean isMnemonicHidden() {
-        if (UIManager.getBoolean("Button.showMnemonics") == true) {
-            // Do not hide mnemonics if the UI defaults do not support this
-            isMnemonicHidden = false;
-        }
-        return isMnemonicHidden;
-    }
-
-    /**
-     * Gets the state of the flag which indicates if the old Windows
-     * look and feel should be rendered. This flag is used by the
-     * component UI delegates as a hint to determine which style the component
-     * should be rendered.
-     *
-     * @return true if Windows 95 and Windows NT 4 look and feel should
-     *         be rendered
-     * @since 1.4
-     */
-    public static boolean isClassicWindows() {
-        return isClassicWindows;
-    }
-
-    /**
-     * <p>
-     * Invoked when the user attempts an invalid operation,
-     * such as pasting into an uneditable <code>JTextField</code>
-     * that has focus.
-     * </p>
-     * <p>
-     * If the user has enabled visual error indication on
-     * the desktop, this method will flash the caption bar
-     * of the active window. The user can also set the
-     * property awt.visualbell=true to achieve the same
-     * results.
-     * </p>
-     *
-     * @param component Component the error occurred in, may be
-     *                  null indicating the error condition is
-     *                  not directly associated with a
-     *                  <code>Component</code>.
-     *
-     * @see javax.swing.LookAndFeel#provideErrorFeedback
-     */
-     public void provideErrorFeedback(Component component) {
-         super.provideErrorFeedback(component);
-     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public LayoutStyle getLayoutStyle() {
-        LayoutStyle style = this.style;
-        if (style == null) {
-            style = new WindowsLayoutStyle();
-            this.style = style;
-        }
-        return style;
-    }
-
-    // ********* Auditory Cue support methods and objects *********
-
-    /**
-     * Returns an <code>Action</code>.
-     * <P>
-     * This Action contains the information and logic to render an
-     * auditory cue. The <code>Object</code> that is passed to this
-     * method contains the information needed to render the auditory
-     * cue. Normally, this <code>Object</code> is a <code>String</code>
-     * that points to a <code>Toolkit</code> <code>desktopProperty</code>.
-     * This <code>desktopProperty</code> is resolved by AWT and the
-     * Windows OS.
-     * <P>
-     * This <code>Action</code>'s <code>actionPerformed</code> method
-     * is fired by the <code>playSound</code> method.
-     *
-     * @return      an Action which knows how to render the auditory
-     *              cue for one particular system or user activity
-     * @see #playSound(Action)
-     * @since 1.4
-     */
-    protected Action createAudioAction(Object key) {
-        if (key != null) {
-            String audioKey = (String)key;
-            String audioValue = (String)UIManager.get(key);
-            return new AudioAction(audioKey, audioValue);
-        } else {
-            return null;
-        }
-    }
-
-    static void repaintRootPane(Component c) {
-        JRootPane root = null;
-        for (; c != null; c = c.getParent()) {
-            if (c instanceof JRootPane) {
-                root = (JRootPane)c;
-            }
-        }
-
-        if (root != null) {
-            root.repaint();
-        } else {
-            c.repaint();
-        }
-    }
-
-    /**
-     * Pass the name String to the super constructor. This is used
-     * later to identify the Action and decide whether to play it or
-     * not. Store the resource String. It is used to get the audio
-     * resource. In this case, the resource is a <code>Runnable</code>
-     * supplied by <code>Toolkit</code>. This <code>Runnable</code> is
-     * effectively a pointer down into the Win32 OS that knows how to
-     * play the right sound.
-     *
-     * @since 1.4
-     */
-    @SuppressWarnings("serial") // Superclass is not serializable across versions
-    private static class AudioAction extends AbstractAction {
-        private Runnable audioRunnable;
-        private String audioResource;
-        /**
-         * We use the String as the name of the Action and as a pointer to
-         * the underlying OSes audio resource.
-         */
-        public AudioAction(String name, String resource) {
-            super(name);
-            audioResource = resource;
-        }
-        public void actionPerformed(ActionEvent e) {
-            if (audioRunnable == null) {
-                audioRunnable = (Runnable)Toolkit.getDefaultToolkit().getDesktopProperty(audioResource);
-            }
-            if (audioRunnable != null) {
-                // Runnable appears to block until completed playing, hence
-                // start up another thread to handle playing.
-                new Thread(null, audioRunnable, "Audio", 0, false).start();
-            }
-        }
-    }
-
-    /**
-     * Gets an <code>Icon</code> from the native libraries if available,
-     * otherwise gets it from an image resource file.
-     */
-    private static class LazyWindowsIcon implements UIDefaults.LazyValue {
-        private String nativeImage;
-        private String resource;
-
-        LazyWindowsIcon(String nativeImage, String resource) {
-            this.nativeImage = nativeImage;
-            this.resource = resource;
-        }
-
-        public Object createValue(UIDefaults table) {
-            if (nativeImage != null) {
-                Image image = (Image)ShellFolder.get(nativeImage);
-                if (image != null) {
-                    return new ImageIcon(image);
-                }
-            }
-            return SwingUtilities2.makeIcon(getClass(),
-                                            WindowsLookAndFeel.class,
-                                            resource);
-        }
-    }
-
-
-    /**
-     * Gets an <code>Icon</code> from the native libraries if available.
-     * A desktop property is used to trigger reloading the icon when needed.
-     */
-    private class ActiveWindowsIcon implements UIDefaults.ActiveValue {
-        private Icon icon;
-        private String nativeImageName;
-        private String fallbackName;
-        private WindowsDesktopProperty desktopProperty;
-
-        ActiveWindowsIcon(String desktopPropertyName,
-                            String nativeImageName, String fallbackName) {
-            this.nativeImageName = nativeImageName;
-            this.fallbackName = fallbackName;
-
-            if (OSInfo.getOSType() == OSInfo.OSType.WINDOWS &&
-                    OSInfo.getWindowsVersion().compareTo(OSInfo.WINDOWS_XP) < 0) {
-                // This desktop property is needed to trigger reloading the icon.
-                // It is kept in member variable to avoid GC.
-                this.desktopProperty = new TriggerDesktopProperty(desktopPropertyName) {
-                    @Override protected void updateUI() {
-                        icon = null;
-                        super.updateUI();
-                    }
-                };
-            }
-        }
-
-        @Override
-        public Object createValue(UIDefaults table) {
-            if (icon == null) {
-                Image image = (Image)ShellFolder.get(nativeImageName);
-                if (image != null) {
-                    icon = new ImageIconUIResource(image);
-                }
-            }
-            if (icon == null && fallbackName != null) {
-                UIDefaults.LazyValue fallback = (UIDefaults.LazyValue)
-                        SwingUtilities2.makeIcon(WindowsLookAndFeel.class,
-                            BasicLookAndFeel.class, fallbackName);
-                icon = (Icon) fallback.createValue(table);
-            }
-            return icon;
-        }
-    }
-
-    /**
-     * Icon backed-up by XP Skin.
-     */
-    private static class SkinIcon implements Icon, UIResource {
-        private final Part part;
-        private final State state;
-        SkinIcon(Part part, State state) {
-            this.part = part;
-            this.state = state;
-        }
-
-        /**
-         * Draw the icon at the specified location.  Icon implementations
-         * may use the Component argument to get properties useful for
-         * painting, e.g. the foreground or background color.
-         */
-        public void paintIcon(Component c, Graphics g, int x, int y) {
-            XPStyle xp = XPStyle.getXP();
-            assert xp != null;
-            if (xp != null) {
-                Skin skin = xp.getSkin(null, part);
-                skin.paintSkin(g, x, y, state);
-            }
-        }
-
-        /**
-         * Returns the icon's width.
-         *
-         * @return an int specifying the fixed width of the icon.
-         */
-        public int getIconWidth() {
-            int width = 0;
-            XPStyle xp = XPStyle.getXP();
-            assert xp != null;
-            if (xp != null) {
-                Skin skin = xp.getSkin(null, part);
-                width = skin.getWidth();
-            }
-            return width;
-        }
-
-        /**
-         * Returns the icon's height.
-         *
-         * @return an int specifying the fixed height of the icon.
-         */
-        public int getIconHeight() {
-            int height = 0;
-            XPStyle xp = XPStyle.getXP();
-            if (xp != null) {
-                Skin skin = xp.getSkin(null, part);
-                height = skin.getHeight();
-            }
-            return height;
-        }
-
-    }
-
-    /**
-     * WindowsDesktopProperty for fonts. If a font with the name 'MS Sans Serif'
-     * is returned, it is mapped to 'Microsoft Sans Serif'.
-     */
-    private static class WindowsFontProperty extends WindowsDesktopProperty {
-        WindowsFontProperty(String key, Object backup) {
-            super(key, backup);
-        }
-
-        public void invalidate(LookAndFeel laf) {
-            if ("win.defaultGUI.font.height".equals(getKey())) {
-                ((WindowsLookAndFeel)laf).style = null;
-            }
-            super.invalidate(laf);
-        }
-
-        protected Object configureValue(Object value) {
-            if (value instanceof Font) {
-                Font font = (Font)value;
-                if ("MS Sans Serif".equals(font.getName())) {
-                    int size = font.getSize();
-                    // 4950968: Workaround to mimic the way Windows maps the default
-                    // font size of 6 pts to the smallest available bitmap font size.
-                    // This happens mostly on Win 98/Me & NT.
-                    int dpi;
-                    try {
-                        dpi = Toolkit.getDefaultToolkit().getScreenResolution();
-                    } catch (HeadlessException ex) {
-                        dpi = 96;
-                    }
-                    if (Math.round(size * 72F / dpi) < 8) {
-                        size = Math.round(8 * dpi / 72F);
-                    }
-                    Font msFont = new FontUIResource("Microsoft Sans Serif",
-                                          font.getStyle(), size);
-                    if (msFont.getName() != null &&
-                        msFont.getName().equals(msFont.getFamily())) {
-                        font = msFont;
-                    } else if (size != font.getSize()) {
-                        font = new FontUIResource("MS Sans Serif",
-                                                  font.getStyle(), size);
-                    }
-                }
-
-                if (FontUtilities.fontSupportsDefaultEncoding(font)) {
-                    if (!(font instanceof UIResource)) {
-                        font = new FontUIResource(font);
-                    }
-                }
-                else {
-                    font = FontUtilities.getCompositeFontUIResource(font);
-                }
-                return font;
-
-            }
-            return super.configureValue(value);
-        }
-    }
-
-
-    /**
-     * WindowsDesktopProperty for fonts that only gets sizes from the desktop,
-     * font name and style are passed into the constructor
-     */
-    private static class WindowsFontSizeProperty extends
-                                                 WindowsDesktopProperty {
-        private String fontName;
-        private int fontSize;
-        private int fontStyle;
-
-        WindowsFontSizeProperty(String key, String fontName,
-                                int fontStyle, int fontSize) {
-            super(key, null);
-            this.fontName = fontName;
-            this.fontSize = fontSize;
-            this.fontStyle = fontStyle;
-        }
-
-        protected Object configureValue(Object value) {
-            if (value == null) {
-                value = new FontUIResource(fontName, fontStyle, fontSize);
-            }
-            else if (value instanceof Integer) {
-                value = new FontUIResource(fontName, fontStyle,
-                                           ((Integer)value).intValue());
-            }
-            return value;
-        }
-    }
-
-
-    /**
-     * A value wrapper that actively retrieves values from xp or falls back
-     * to the classic value if not running XP styles.
-     */
-    private static class XPValue implements UIDefaults.ActiveValue {
-        protected Object classicValue, xpValue;
-
-        // A constant that lets you specify null when using XP styles.
-        private static final Object NULL_VALUE = new Object();
-
-        XPValue(Object xpValue, Object classicValue) {
-            this.xpValue = xpValue;
-            this.classicValue = classicValue;
-        }
-
-        public Object createValue(UIDefaults table) {
-            Object value = null;
-            if (XPStyle.getXP() != null) {
-                value = getXPValue(table);
-            }
-
-            if (value == null) {
-                value = getClassicValue(table);
-            } else if (value == NULL_VALUE) {
-                value = null;
-            }
-
-            return value;
-        }
-
-        protected Object getXPValue(UIDefaults table) {
-            return recursiveCreateValue(xpValue, table);
-        }
-
-        protected Object getClassicValue(UIDefaults table) {
-            return recursiveCreateValue(classicValue, table);
-        }
-
-        private Object recursiveCreateValue(Object value, UIDefaults table) {
-            if (value instanceof UIDefaults.LazyValue) {
-                value = ((UIDefaults.LazyValue)value).createValue(table);
-            }
-            if (value instanceof UIDefaults.ActiveValue) {
-                return ((UIDefaults.ActiveValue)value).createValue(table);
-            } else {
-                return value;
-            }
-        }
-    }
-
-    private static class XPBorderValue extends XPValue {
-        private final Border extraMargin;
-
-        XPBorderValue(Part xpValue, Object classicValue) {
-            this(xpValue, classicValue, null);
-        }
-
-        XPBorderValue(Part xpValue, Object classicValue, Border extraMargin) {
-            super(xpValue, classicValue);
-            this.extraMargin = extraMargin;
-        }
-
-        public Object getXPValue(UIDefaults table) {
-            XPStyle xp = XPStyle.getXP();
-            Border xpBorder = xp != null ? xp.getBorder(null, (Part)xpValue) : null;
-            if (xpBorder != null && extraMargin != null) {
-                return new BorderUIResource.
-                        CompoundBorderUIResource(xpBorder, extraMargin);
-            } else {
-                return xpBorder;
-            }
-        }
-    }
-
-    private static class XPColorValue extends XPValue {
-        XPColorValue(Part part, State state, Prop prop, Object classicValue) {
-            super(new XPColorValueKey(part, state, prop), classicValue);
-        }
-
-        public Object getXPValue(UIDefaults table) {
-            XPColorValueKey key = (XPColorValueKey)xpValue;
-            XPStyle xp = XPStyle.getXP();
-            return xp != null ? xp.getColor(key.skin, key.prop, null) : null;
-        }
-
-        private static class XPColorValueKey {
-            Skin skin;
-            Prop prop;
-
-            XPColorValueKey(Part part, State state, Prop prop) {
-                this.skin = new Skin(part, state);
-                this.prop = prop;
-            }
-        }
-    }
-
-    private class XPDLUValue extends XPValue {
-        private int direction;
-
-        XPDLUValue(int xpdlu, int classicdlu, int direction) {
-            super(Integer.valueOf(xpdlu), Integer.valueOf(classicdlu));
-            this.direction = direction;
-        }
-
-        public Object getXPValue(UIDefaults table) {
-            int px = dluToPixels(((Integer)xpValue).intValue(), direction);
-            return Integer.valueOf(px);
-        }
-
-        public Object getClassicValue(UIDefaults table) {
-            int px = dluToPixels(((Integer)classicValue).intValue(), direction);
-            return Integer.valueOf(px);
-        }
-    }
-
-    private class TriggerDesktopProperty extends WindowsDesktopProperty {
-        TriggerDesktopProperty(String key) {
-            super(key, null);
-            // This call adds a property change listener for the property,
-            // which triggers a call to updateUI(). The value returned
-            // is not interesting here.
-            getValueFromDesktop();
-        }
-
-        protected void updateUI() {
-            super.updateUI();
-
-            // Make sure property change listener is readded each time
-            getValueFromDesktop();
-        }
-    }
-
-    private class FontDesktopProperty extends TriggerDesktopProperty {
-        FontDesktopProperty(String key) {
-            super(key);
-        }
-
-        protected void updateUI() {
-            UIDefaults defaults = UIManager.getLookAndFeelDefaults();
-            SwingUtilities2.putAATextInfo(true, defaults);
-            super.updateUI();
-        }
-    }
-
-    // Windows LayoutStyle.  From:
-    // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwue/html/ch14e.asp
-    @SuppressWarnings("fallthrough")
-    private class WindowsLayoutStyle extends DefaultLayoutStyle {
-        @Override
-        public int getPreferredGap(JComponent component1,
-                JComponent component2, ComponentPlacement type, int position,
-                Container parent) {
-            // Checks args
-            super.getPreferredGap(component1, component2, type, position,
-                                  parent);
-
-            switch(type) {
-            case INDENT:
-                // Windows doesn't spec this
-                if (position == SwingConstants.EAST ||
-                        position == SwingConstants.WEST) {
-                    int indent = getIndent(component1, position);
-                    if (indent > 0) {
-                        return indent;
-                    }
-                    return 10;
-                }
-                // Fall through to related.
-            case RELATED:
-                if (isLabelAndNonlabel(component1, component2, position)) {
-                    // Between text labels and their associated controls (for
-                    // example, text boxes and list boxes): 3
-                    // NOTE: We're not honoring:
-                    // 'Text label beside a button 3 down from the top of
-                    // the button,' but I suspect that is an attempt to
-                    // enforce a baseline layout which will be handled
-                    // separately.  In order to enforce this we would need
-                    // this API to return a more complicated type (Insets,
-                    // or something else).
-                    return getButtonGap(component1, component2, position,
-                                        dluToPixels(3, position));
-                }
-                // Between related controls: 4
-                return getButtonGap(component1, component2, position,
-                                    dluToPixels(4, position));
-            case UNRELATED:
-                // Between unrelated controls: 7
-                return getButtonGap(component1, component2, position,
-                                    dluToPixels(7, position));
-            }
-            return 0;
-        }
-
-        @Override
-        public int getContainerGap(JComponent component, int position,
-                                   Container parent) {
-            // Checks args
-            super.getContainerGap(component, position, parent);
-            return getButtonGap(component, position, dluToPixels(7, position));
-        }
-
-    }
-
-    /**
-     * Converts the dialog unit argument to pixels along the specified
-     * axis.
-     */
-    private int dluToPixels(int dlu, int direction) {
-        if (baseUnitX == 0) {
-            calculateBaseUnits();
-        }
-        if (direction == SwingConstants.EAST ||
-            direction == SwingConstants.WEST) {
-            return dlu * baseUnitX / 4;
-        }
-        assert (direction == SwingConstants.NORTH ||
-                direction == SwingConstants.SOUTH);
-        return dlu * baseUnitY / 8;
-    }
-
-    /**
-     * Calculates the dialog unit mapping.
-     */
-    @SuppressWarnings("deprecation")
-    private void calculateBaseUnits() {
-        // This calculation comes from:
-        // http://support.microsoft.com/default.aspx?scid=kb;EN-US;125681
-        FontMetrics metrics = Toolkit.getDefaultToolkit().getFontMetrics(
-                UIManager.getFont("Button.font"));
-        baseUnitX = metrics.stringWidth(
-                "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz");
-        baseUnitX = (baseUnitX / 26 + 1) / 2;
-        // The -1 comes from experimentation.
-        baseUnitY = metrics.getAscent() + metrics.getDescent() - 1;
-    }
-
-    /**
-     * {@inheritDoc}
-     *
-     * @since 1.6
-     */
-    public Icon getDisabledIcon(JComponent component, Icon icon) {
-        // if the component has a HI_RES_DISABLED_ICON_CLIENT_KEY
-        // client property set to Boolean.TRUE, then use the new
-        // hi res algorithm for creating the disabled icon (used
-        // in particular by the WindowsFileChooserUI class)
-        if (icon != null
-                && component != null
-                && Boolean.TRUE.equals(component.getClientProperty(HI_RES_DISABLED_ICON_CLIENT_KEY))
-                && icon.getIconWidth() > 0
-                && icon.getIconHeight() > 0) {
-            BufferedImage img = new BufferedImage(icon.getIconWidth(),
-                    icon.getIconWidth(), BufferedImage.TYPE_INT_ARGB);
-            icon.paintIcon(component, img.getGraphics(), 0, 0);
-            ImageFilter filter = new RGBGrayFilter();
-            ImageProducer producer = new FilteredImageSource(img.getSource(), filter);
-            Image resultImage = component.createImage(producer);
-            return new ImageIconUIResource(resultImage);
-        }
-        return super.getDisabledIcon(component, icon);
-    }
-
-    private static class RGBGrayFilter extends RGBImageFilter {
-        public RGBGrayFilter() {
-            canFilterIndexColorModel = true;
-        }
-        public int filterRGB(int x, int y, int rgb) {
-            // find the average of red, green, and blue
-            float avg = (((rgb >> 16) & 0xff) / 255f +
-                          ((rgb >>  8) & 0xff) / 255f +
-                           (rgb        & 0xff) / 255f) / 3;
-            // pull out the alpha channel
-            float alpha = (((rgb>>24)&0xff)/255f);
-            // calc the average
-            avg = Math.min(1.0f, (1f-avg)/(100.0f/35.0f) + avg);
-            // turn back into rgb
-            int rgbval = (int)(alpha * 255f) << 24 |
-                         (int)(avg   * 255f) << 16 |
-                         (int)(avg   * 255f) <<  8 |
-                         (int)(avg   * 255f);
-            return rgbval;
-        }
-    }
-
-    private static class FocusColorProperty extends WindowsDesktopProperty {
-        public FocusColorProperty () {
-            // Fallback value is never used because of the configureValue method doesn't return null
-            super("win.3d.backgroundColor", Color.BLACK);
-        }
-
-        @Override
-        protected Object configureValue(Object value) {
-            Object highContrastOn = Toolkit.getDefaultToolkit().
-                    getDesktopProperty("win.highContrast.on");
-            if (highContrastOn == null || !((Boolean) highContrastOn).booleanValue()) {
-                return Color.BLACK;
-            }
-            return Color.BLACK.equals(value) ? Color.WHITE : Color.BLACK;
-        }
-    }
-
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsMenuBarUI.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,187 +0,0 @@
-/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import javax.swing.plaf.basic.*;
-import javax.swing.*;
-import javax.swing.plaf.ActionMapUIResource;
-import javax.swing.plaf.ComponentUI;
-import java.awt.event.ActionEvent;
-import java.awt.event.HierarchyEvent;
-import java.awt.event.HierarchyListener;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.awt.event.WindowListener;
-import java.awt.event.WindowStateListener;
-
-import java.awt.*;
-
-import com.sun.java.swing.plaf.windows.TMSchema.*;
-import com.sun.java.swing.plaf.windows.XPStyle.*;
-
-/**
- * Windows rendition of the component.
- * <p>
- * <strong>Warning:</strong>
- * Serialized objects of this class will not be compatible with
- * future Swing releases.  The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing.  A future release of Swing will provide support for
- * long term persistence.
- */
-public class WindowsMenuBarUI extends BasicMenuBarUI
-{
-    /* to be accessed on the EDT only */
-    private WindowListener windowListener = null;
-    private HierarchyListener hierarchyListener = null;
-    private Window window = null;
-
-    public static ComponentUI createUI(JComponent x) {
-        return new WindowsMenuBarUI();
-    }
-
-    @Override
-    protected void uninstallListeners() {
-        uninstallWindowListener();
-        if (hierarchyListener != null) {
-            menuBar.removeHierarchyListener(hierarchyListener);
-            hierarchyListener = null;
-        }
-        super.uninstallListeners();
-    }
-    private void installWindowListener() {
-        if (windowListener == null) {
-            Component component = menuBar.getTopLevelAncestor();
-            if (component instanceof Window) {
-                window = (Window) component;
-                windowListener = new WindowAdapter() {
-                    @Override
-                    public void windowActivated(WindowEvent e) {
-                        menuBar.repaint();
-                    }
-                    @Override
-                    public void windowDeactivated(WindowEvent e) {
-                        menuBar.repaint();
-                    }
-                };
-                ((Window) component).addWindowListener(windowListener);
-            }
-        }
-    }
-    private void uninstallWindowListener() {
-        if (windowListener != null && window != null) {
-            window.removeWindowListener(windowListener);
-        }
-        window = null;
-        windowListener = null;
-    }
-    @Override
-    protected void installListeners() {
-        if (WindowsLookAndFeel.isOnVista()) {
-            installWindowListener();
-            hierarchyListener =
-                new HierarchyListener() {
-                    public void hierarchyChanged(HierarchyEvent e) {
-                        if ((e.getChangeFlags()
-                                & HierarchyEvent.DISPLAYABILITY_CHANGED) != 0) {
-                            if (menuBar.isDisplayable()) {
-                                installWindowListener();
-                            } else {
-                                uninstallWindowListener();
-                            }
-                        }
-                    }
-            };
-            menuBar.addHierarchyListener(hierarchyListener);
-        }
-        super.installListeners();
-    }
-
-    protected void installKeyboardActions() {
-        super.installKeyboardActions();
-        ActionMap map = SwingUtilities.getUIActionMap(menuBar);
-        if (map == null) {
-            map = new ActionMapUIResource();
-            SwingUtilities.replaceUIActionMap(menuBar, map);
-        }
-        map.put("takeFocus", new TakeFocus());
-    }
-
-    /**
-     * Action that activates the menu (e.g. when F10 is pressed).
-     * Unlike BasicMenuBarUI.TakeFocus, this Action will not show menu popup.
-     */
-    @SuppressWarnings("serial") // Superclass is not serializable across versions
-    private static class TakeFocus extends AbstractAction {
-        public void actionPerformed(ActionEvent e) {
-            JMenuBar menuBar = (JMenuBar)e.getSource();
-            JMenu menu = menuBar.getMenu(0);
-            if (menu != null) {
-                MenuSelectionManager msm =
-                    MenuSelectionManager.defaultManager();
-                MenuElement path[] = new MenuElement[2];
-                path[0] = (MenuElement)menuBar;
-                path[1] = (MenuElement)menu;
-                msm.setSelectedPath(path);
-
-                // show mnemonics
-                WindowsLookAndFeel.setMnemonicHidden(false);
-                WindowsLookAndFeel.repaintRootPane(menuBar);
-            }
-        }
-    }
-
-    @Override
-    public void paint(Graphics g, JComponent c) {
-        XPStyle xp = XPStyle.getXP();
-        if (WindowsMenuItemUI.isVistaPainting(xp)) {
-            Skin skin;
-            skin = xp.getSkin(c, Part.MP_BARBACKGROUND);
-            int width = c.getWidth();
-            int height = c.getHeight();
-            State state =  isActive(c) ? State.ACTIVE : State.INACTIVE;
-            skin.paintSkin(g, 0, 0, width, height, state);
-        } else {
-            super.paint(g, c);
-        }
-    }
-
-    /**
-     * Checks if component belongs to an active window.
-     * @param c component to check
-     * @return true if component belongs to an active window
-     */
-    static boolean isActive(JComponent c) {
-        JRootPane rootPane = c.getRootPane();
-        if (rootPane != null) {
-            Component component = rootPane.getParent();
-            if (component instanceof Window) {
-                return ((Window) component).isActive();
-            }
-        }
-        return true;
-    }
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsMenuItemUI.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,180 +0,0 @@
-/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import java.awt.*;
-import javax.swing.*;
-import javax.swing.plaf.*;
-import javax.swing.plaf.basic.*;
-
-import sun.swing.SwingUtilities2;
-
-import com.sun.java.swing.plaf.windows.TMSchema.*;
-import com.sun.java.swing.plaf.windows.XPStyle.*;
-
-/**
- * Windows rendition of the component.
- * <p>
- * <strong>Warning:</strong>
- * Serialized objects of this class will not be compatible with
- * future Swing releases.  The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing.  A future release of Swing will provide support for
- * long term persistence.
- *
- * @author Igor Kushnirskiy
- */
-
-public class WindowsMenuItemUI extends BasicMenuItemUI {
-    final WindowsMenuItemUIAccessor accessor =
-        new  WindowsMenuItemUIAccessor() {
-
-            public JMenuItem getMenuItem() {
-                return menuItem;
-            }
-
-            public State getState(JMenuItem menuItem) {
-                return WindowsMenuItemUI.getState(this, menuItem);
-            }
-
-            public Part getPart(JMenuItem menuItem) {
-                return WindowsMenuItemUI.getPart(this, menuItem);
-            }
-    };
-    public static ComponentUI createUI(JComponent c) {
-        return new WindowsMenuItemUI();
-    }
-
-    /**
-     * Method which renders the text of the current menu item.
-     *
-     * @param g Graphics context
-     * @param menuItem Current menu item to render
-     * @param textRect Bounding rectangle to render the text.
-     * @param text String to render
-     */
-    protected void paintText(Graphics g, JMenuItem menuItem,
-                             Rectangle textRect, String text) {
-        if (WindowsMenuItemUI.isVistaPainting()) {
-            WindowsMenuItemUI.paintText(accessor, g, menuItem, textRect, text);
-            return;
-        }
-        ButtonModel model = menuItem.getModel();
-        Color oldColor = g.getColor();
-
-        if(model.isEnabled() &&
-            (model.isArmed() || (menuItem instanceof JMenu &&
-             model.isSelected()))) {
-            g.setColor(selectionForeground); // Uses protected field.
-        }
-
-        WindowsGraphicsUtils.paintText(g, menuItem, textRect, text, 0);
-
-        g.setColor(oldColor);
-    }
-
-    @Override
-    protected void paintBackground(Graphics g, JMenuItem menuItem,
-            Color bgColor) {
-        if (WindowsMenuItemUI.isVistaPainting()) {
-            WindowsMenuItemUI.paintBackground(accessor, g, menuItem, bgColor);
-            return;
-        }
-        super.paintBackground(g, menuItem, bgColor);
-    }
-
-    static void paintBackground(WindowsMenuItemUIAccessor menuItemUI,
-            Graphics g, JMenuItem menuItem, Color bgColor) {
-        XPStyle xp = XPStyle.getXP();
-        assert isVistaPainting(xp);
-        if (isVistaPainting(xp)) {
-            int menuWidth = menuItem.getWidth();
-            int menuHeight = menuItem.getHeight();
-            if (menuItem.isOpaque()) {
-                Color oldColor = g.getColor();
-                g.setColor(menuItem.getBackground());
-                g.fillRect(0,0, menuWidth, menuHeight);
-                g.setColor(oldColor);
-            }
-            Part part = menuItemUI.getPart(menuItem);
-            Skin skin = xp.getSkin(menuItem, part);
-            skin.paintSkin(g, 0 , 0,
-                menuWidth,
-                menuHeight,
-                menuItemUI.getState(menuItem));
-        }
-    }
-
-    static void paintText(WindowsMenuItemUIAccessor menuItemUI, Graphics g,
-                                JMenuItem menuItem, Rectangle textRect,
-                                String text) {
-        assert isVistaPainting();
-        if (isVistaPainting()) {
-            State state = menuItemUI.getState(menuItem);
-
-            /* part of it copied from WindowsGraphicsUtils.java */
-            FontMetrics fm = SwingUtilities2.getFontMetrics(menuItem, g);
-            int mnemIndex = menuItem.getDisplayedMnemonicIndex();
-            // W2K Feature: Check to see if the Underscore should be rendered.
-            if (WindowsLookAndFeel.isMnemonicHidden() == true) {
-                mnemIndex = -1;
-            }
-            WindowsGraphicsUtils.paintXPText(menuItem,
-                menuItemUI.getPart(menuItem), state,
-                g, textRect.x,
-                textRect.y + fm.getAscent(),
-                text, mnemIndex);
-        }
-    }
-
-    static State getState(WindowsMenuItemUIAccessor menuItemUI, JMenuItem menuItem) {
-        State state;
-        ButtonModel model = menuItem.getModel();
-        if (model.isArmed()) {
-            state = (model.isEnabled()) ? State.HOT : State.DISABLEDHOT;
-        } else {
-            state = (model.isEnabled()) ? State.NORMAL : State.DISABLED;
-        }
-        return state;
-    }
-
-    static Part getPart(WindowsMenuItemUIAccessor menuItemUI, JMenuItem menuItem) {
-        return Part.MP_POPUPITEM;
-    }
-
-    /*
-     * TODO idk can we use XPStyle.isVista?
-     * is it possible that in some theme some Vista parts are not defined while
-     * others are?
-     */
-    static boolean isVistaPainting(final XPStyle xp) {
-        return xp != null && xp.isSkinDefined(null, Part.MP_POPUPITEM);
-    }
-
-    static boolean isVistaPainting() {
-        return isVistaPainting(XPStyle.getXP());
-    }
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsMenuItemUIAccessor.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import java.awt.Color;
-import java.awt.Graphics;
-
-import javax.swing.JMenuItem;
-
-import com.sun.java.swing.plaf.windows.TMSchema.Part;
-import com.sun.java.swing.plaf.windows.TMSchema.State;
-
-/**
- * Accessor interface for WindowsMenuItemUI to allow for "multiple implementation
- * inheritance".
- *
- * @author Igor Kushnirskiy
- */
-interface WindowsMenuItemUIAccessor {
-    JMenuItem getMenuItem();
-    State getState(JMenuItem menuItem);
-    Part getPart(JMenuItem menuItem);
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsMenuUI.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,295 +0,0 @@
-/*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import java.awt.*;
-import java.awt.event.MouseEvent;
-
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.basic.BasicMenuUI;
-import javax.swing.event.MouseInputListener;
-import javax.swing.*;
-
-import com.sun.java.swing.plaf.windows.TMSchema.Part;
-import com.sun.java.swing.plaf.windows.TMSchema.State;
-
-/**
- * Windows rendition of the component.
- * <p>
- * <strong>Warning:</strong>
- * Serialized objects of this class will not be compatible with
- * future Swing releases.  The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing.  A future release of Swing will provide support for
- * long term persistence.
- */
-public class WindowsMenuUI extends BasicMenuUI {
-    protected Integer menuBarHeight;
-    protected boolean hotTrackingOn;
-
-    final WindowsMenuItemUIAccessor accessor =
-        new WindowsMenuItemUIAccessor() {
-
-            public JMenuItem getMenuItem() {
-                return menuItem;
-            }
-
-            public State getState(JMenuItem menu) {
-                State state = menu.isEnabled() ? State.NORMAL
-                        : State.DISABLED;
-                ButtonModel model = menu.getModel();
-                if (model.isArmed() || model.isSelected()) {
-                    state = (menu.isEnabled()) ? State.PUSHED
-                            : State.DISABLEDPUSHED;
-                } else if (model.isRollover()
-                           && ((JMenu) menu).isTopLevelMenu()) {
-                    /*
-                     * Only paint rollover if no other menu on menubar is
-                     * selected
-                     */
-                    State stateTmp = state;
-                    state = (menu.isEnabled()) ? State.HOT
-                            : State.DISABLEDHOT;
-                    for (MenuElement menuElement :
-                        ((JMenuBar) menu.getParent()).getSubElements()) {
-                        if (((JMenuItem) menuElement).isSelected()) {
-                            state = stateTmp;
-                            break;
-                        }
-                    }
-                }
-
-                //non top level menus have HOT state instead of PUSHED
-                if (!((JMenu) menu).isTopLevelMenu()) {
-                    if (state == State.PUSHED) {
-                        state = State.HOT;
-                    } else if (state == State.DISABLEDPUSHED) {
-                        state = State.DISABLEDHOT;
-                    }
-                }
-
-                /*
-                 * on Vista top level menu for non active frame looks disabled
-                 */
-                if (((JMenu) menu).isTopLevelMenu() && WindowsMenuItemUI.isVistaPainting()) {
-                    if (! WindowsMenuBarUI.isActive(menu)) {
-                        state = State.DISABLED;
-                    }
-                }
-                return state;
-            }
-
-            public Part getPart(JMenuItem menuItem) {
-                return ((JMenu) menuItem).isTopLevelMenu() ? Part.MP_BARITEM
-                        : Part.MP_POPUPITEM;
-            }
-    };
-    public static ComponentUI createUI(JComponent x) {
-        return new WindowsMenuUI();
-    }
-
-    protected void installDefaults() {
-        super.installDefaults();
-        if (!WindowsLookAndFeel.isClassicWindows()) {
-            menuItem.setRolloverEnabled(true);
-        }
-
-        menuBarHeight = (Integer)UIManager.getInt("MenuBar.height");
-
-        Object obj      = UIManager.get("MenuBar.rolloverEnabled");
-        hotTrackingOn = (obj instanceof Boolean) ? (Boolean)obj : true;
-    }
-
-    /**
-     * Draws the background of the menu.
-     * @since 1.4
-     */
-    protected void paintBackground(Graphics g, JMenuItem menuItem, Color bgColor) {
-        if (WindowsMenuItemUI.isVistaPainting()) {
-            WindowsMenuItemUI.paintBackground(accessor, g, menuItem, bgColor);
-            return;
-        }
-
-        JMenu menu = (JMenu)menuItem;
-        ButtonModel model = menu.getModel();
-
-        // Use superclass method for the old Windows LAF,
-        // for submenus, and for XP toplevel if selected or pressed
-        if (WindowsLookAndFeel.isClassicWindows() ||
-            !menu.isTopLevelMenu() ||
-            (XPStyle.getXP() != null && (model.isArmed() || model.isSelected()))) {
-
-            super.paintBackground(g, menu, bgColor);
-            return;
-        }
-
-        Color oldColor = g.getColor();
-        int menuWidth = menu.getWidth();
-        int menuHeight = menu.getHeight();
-
-        UIDefaults table = UIManager.getLookAndFeelDefaults();
-        Color highlight = table.getColor("controlLtHighlight");
-        Color shadow = table.getColor("controlShadow");
-
-        g.setColor(menu.getBackground());
-        g.fillRect(0,0, menuWidth, menuHeight);
-
-        if (menu.isOpaque()) {
-            if (model.isArmed() || model.isSelected()) {
-                // Draw a lowered bevel border
-                g.setColor(shadow);
-                g.drawLine(0,0, menuWidth - 1,0);
-                g.drawLine(0,0, 0,menuHeight - 2);
-
-                g.setColor(highlight);
-                g.drawLine(menuWidth - 1,0, menuWidth - 1,menuHeight - 2);
-                g.drawLine(0,menuHeight - 2, menuWidth - 1,menuHeight - 2);
-            } else if (model.isRollover() && model.isEnabled()) {
-                // Only paint rollover if no other menu on menubar is selected
-                boolean otherMenuSelected = false;
-                MenuElement[] menus = ((JMenuBar)menu.getParent()).getSubElements();
-                for (int i = 0; i < menus.length; i++) {
-                    if (((JMenuItem)menus[i]).isSelected()) {
-                        otherMenuSelected = true;
-                        break;
-                    }
-                }
-                if (!otherMenuSelected) {
-                    if (XPStyle.getXP() != null) {
-                        g.setColor(selectionBackground); // Uses protected field.
-                        g.fillRect(0, 0, menuWidth, menuHeight);
-                    } else {
-                        // Draw a raised bevel border
-                        g.setColor(highlight);
-                        g.drawLine(0,0, menuWidth - 1,0);
-                        g.drawLine(0,0, 0,menuHeight - 2);
-
-                        g.setColor(shadow);
-                        g.drawLine(menuWidth - 1,0, menuWidth - 1,menuHeight - 2);
-                        g.drawLine(0,menuHeight - 2, menuWidth - 1,menuHeight - 2);
-                    }
-                }
-            }
-        }
-        g.setColor(oldColor);
-    }
-
-    /**
-     * Method which renders the text of the current menu item.
-     *
-     * @param g Graphics context
-     * @param menuItem Current menu item to render
-     * @param textRect Bounding rectangle to render the text.
-     * @param text String to render
-     * @since 1.4
-     */
-    protected void paintText(Graphics g, JMenuItem menuItem,
-                             Rectangle textRect, String text) {
-        if (WindowsMenuItemUI.isVistaPainting()) {
-            WindowsMenuItemUI.paintText(accessor, g, menuItem, textRect, text);
-            return;
-        }
-        JMenu menu = (JMenu)menuItem;
-        ButtonModel model = menuItem.getModel();
-        Color oldColor = g.getColor();
-
-        // Only paint rollover if no other menu on menubar is selected
-        boolean paintRollover = model.isRollover();
-        if (paintRollover && menu.isTopLevelMenu()) {
-            MenuElement[] menus = ((JMenuBar)menu.getParent()).getSubElements();
-            for (int i = 0; i < menus.length; i++) {
-                if (((JMenuItem)menus[i]).isSelected()) {
-                    paintRollover = false;
-                    break;
-                }
-            }
-        }
-
-        if ((model.isSelected() && (WindowsLookAndFeel.isClassicWindows() ||
-                                    !menu.isTopLevelMenu())) ||
-            (XPStyle.getXP() != null && (paintRollover ||
-                                         model.isArmed() ||
-                                         model.isSelected()))) {
-            g.setColor(selectionForeground); // Uses protected field.
-        }
-
-        WindowsGraphicsUtils.paintText(g, menuItem, textRect, text, 0);
-
-        g.setColor(oldColor);
-    }
-
-    protected MouseInputListener createMouseInputListener(JComponent c) {
-        return new WindowsMouseInputHandler();
-    }
-
-    /**
-     * This class implements a mouse handler that sets the rollover flag to
-     * true when the mouse enters the menu and false when it exits.
-     * @since 1.4
-     */
-    protected class WindowsMouseInputHandler extends BasicMenuUI.MouseInputHandler {
-        public void mouseEntered(MouseEvent evt) {
-            super.mouseEntered(evt);
-
-            JMenu menu = (JMenu)evt.getSource();
-            if (hotTrackingOn && menu.isTopLevelMenu() && menu.isRolloverEnabled()) {
-                menu.getModel().setRollover(true);
-                menuItem.repaint();
-            }
-        }
-
-        public void mouseExited(MouseEvent evt) {
-            super.mouseExited(evt);
-
-            JMenu menu = (JMenu)evt.getSource();
-            ButtonModel model = menu.getModel();
-            if (menu.isRolloverEnabled()) {
-                model.setRollover(false);
-                menuItem.repaint();
-            }
-        }
-    }
-
-    protected Dimension getPreferredMenuItemSize(JComponent c,
-                                                     Icon checkIcon,
-                                                     Icon arrowIcon,
-                                                     int defaultTextIconGap) {
-
-        Dimension d = super.getPreferredMenuItemSize(c, checkIcon, arrowIcon,
-                                                     defaultTextIconGap);
-
-        // Note: When toolbar containers (rebars) are implemented, only do
-        // this if the JMenuBar is not in a rebar (i.e. ignore the desktop
-        // property win.menu.height if in a rebar.)
-        if (c instanceof JMenu && ((JMenu)c).isTopLevelMenu() &&
-            menuBarHeight != null && d.height < menuBarHeight) {
-
-            d.height = menuBarHeight;
-        }
-
-        return d;
-    }
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsOptionPaneUI.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 1997, 2000, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import javax.swing.*;
-import javax.swing.plaf.*;
-import javax.swing.plaf.basic.*;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-
-
-
-/**
- * Windows rendition of the component.
- * <p>
- * <strong>Warning:</strong>
- * Serialized objects of this class will not be compatible with
- * future Swing releases.  The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing.  A future release of Swing will provide support for
- * long term persistence.
- */
-public class WindowsOptionPaneUI extends BasicOptionPaneUI {
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsPasswordFieldUI.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import javax.swing.plaf.*;
-import javax.swing.plaf.basic.*;
-import javax.swing.*;
-import javax.swing.text.Caret;
-
-
-
-/**
- * Windows rendition of the component.
- * <p>
- * <strong>Warning:</strong>
- * Serialized objects of this class will not be compatible with
- * future Swing releases.  The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing.  A future release of Swing will provide support for
- * long term persistence.
- */
-public class WindowsPasswordFieldUI extends BasicPasswordFieldUI {
-
-    /**
-     * Creates a UI for a JPasswordField
-     *
-     * @param c the password field
-     * @return the UI
-     */
-    public static ComponentUI createUI(JComponent c) {
-        return new WindowsPasswordFieldUI();
-    }
-
-
-    /**
-     * Creates the object to use for a caret.  By default an
-     * instance of WindowsCaret is created.  This method
-     * can be redefined to provide something else that implements
-     * the InputPosition interface or a subclass of DefaultCaret.
-     *
-     * @return the caret object
-     */
-    protected Caret createCaret() {
-        return new WindowsTextUI.WindowsCaret();
-    }
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsPopupMenuSeparatorUI.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-/*
- * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import java.awt.*;
-
-import javax.swing.*;
-import javax.swing.plaf.basic.BasicPopupMenuSeparatorUI;
-import javax.swing.plaf.ComponentUI;
-
-import com.sun.java.swing.plaf.windows.TMSchema.Part;
-import com.sun.java.swing.plaf.windows.TMSchema.State;
-import com.sun.java.swing.plaf.windows.XPStyle.Skin;
-
-/**
- * Windows {@literal L&F} implementation of PopupMenuSeparatorUI.
- *
- * @author Leif Samuelsson
- * @author Igor Kushnirskiy
- */
-
-public class WindowsPopupMenuSeparatorUI extends BasicPopupMenuSeparatorUI {
-
-    public static ComponentUI createUI(JComponent c) {
-        return new WindowsPopupMenuSeparatorUI();
-    }
-
-    public void paint(Graphics g, JComponent c) {
-        Dimension s = c.getSize();
-        XPStyle xp = XPStyle.getXP();
-        if (WindowsMenuItemUI.isVistaPainting(xp)) {
-            int x = 1;
-            Component parent = c.getParent();
-            if (parent instanceof JComponent) {
-                Object gutterOffsetObject =
-                    ((JComponent) parent).getClientProperty(
-                        WindowsPopupMenuUI.GUTTER_OFFSET_KEY);
-                if (gutterOffsetObject instanceof Integer) {
-                    /*
-                     * gutter offset is in parent's coordinates.
-                     * See comment in
-                     * WindowsPopupMenuUI.getTextOffset(JComponent)
-                     */
-                    x = ((Integer) gutterOffsetObject).intValue() - c.getX();
-                    x += WindowsPopupMenuUI.getGutterWidth();
-                }
-            }
-            Skin skin = xp.getSkin(c, Part.MP_POPUPSEPARATOR);
-            int skinHeight = skin.getHeight();
-            int y = (s.height - skinHeight) / 2;
-            skin.paintSkin(g, x, y, s.width - x - 1, skinHeight, State.NORMAL);
-        } else {
-            int y = s.height / 2;
-            g.setColor(c.getForeground());
-            g.drawLine(1, y - 1, s.width - 2, y - 1);
-
-            g.setColor(c.getBackground());
-            g.drawLine(1, y,     s.width - 2, y);
-        }
-    }
-
-    public Dimension getPreferredSize(JComponent c) {
-        int fontHeight = 0;
-        Font font = c.getFont();
-        if (font != null) {
-            fontHeight = c.getFontMetrics(font).getHeight();
-        }
-
-        return new Dimension(0, fontHeight/2 + 2);
-    }
-
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsPopupMenuUI.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,224 +0,0 @@
-/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import java.awt.Component;
-import java.awt.Graphics;
-import java.awt.Insets;
-import java.awt.KeyEventPostProcessor;
-import java.awt.KeyboardFocusManager;
-import java.awt.Window;
-import java.awt.event.KeyEvent;
-import javax.swing.*;
-import javax.swing.event.*;
-import javax.swing.plaf.*;
-import javax.swing.plaf.basic.*;
-
-import sun.swing.StringUIClientPropertyKey;
-
-import com.sun.java.swing.plaf.windows.TMSchema.Part;
-import com.sun.java.swing.plaf.windows.TMSchema.State;
-import com.sun.java.swing.plaf.windows.XPStyle.Skin;
-import static sun.swing.SwingUtilities2.BASICMENUITEMUI_MAX_TEXT_OFFSET;
-
-/**
- * Windows rendition of the component.
- * <p>
- * <strong>Warning:</strong>
- * Serialized objects of this class will not be compatible with
- * future Swing releases.  The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing.  A future release of Swing will provide support for
- * long term persistence.
- *
- * @author Igor Kushnirskiy
- */
-public class WindowsPopupMenuUI extends BasicPopupMenuUI {
-
-    static MnemonicListener mnemonicListener = null;
-    static final Object GUTTER_OFFSET_KEY =
-        new StringUIClientPropertyKey("GUTTER_OFFSET_KEY");
-
-    public static ComponentUI createUI(JComponent c) {
-        return new WindowsPopupMenuUI();
-    }
-
-    public void installListeners() {
-        super.installListeners();
-        if (! UIManager.getBoolean("Button.showMnemonics") &&
-            mnemonicListener == null) {
-
-            mnemonicListener = new MnemonicListener();
-            MenuSelectionManager.defaultManager().
-                addChangeListener(mnemonicListener);
-        }
-    }
-
-    /**
-     * Returns the <code>Popup</code> that will be responsible for
-     * displaying the <code>JPopupMenu</code>.
-     *
-     * @param popupMenu JPopupMenu requesting Popup
-     * @param x     Screen x location Popup is to be shown at
-     * @param y     Screen y location Popup is to be shown at.
-     * @return Popup that will show the JPopupMenu
-     * @since 1.4
-     */
-    public Popup getPopup(JPopupMenu popupMenu, int x, int y) {
-        PopupFactory popupFactory = PopupFactory.getSharedInstance();
-        return popupFactory.getPopup(popupMenu.getInvoker(), popupMenu, x, y);
-    }
-
-    static class MnemonicListener implements ChangeListener {
-        JRootPane repaintRoot = null;
-
-        public void stateChanged(ChangeEvent ev) {
-            MenuSelectionManager msm = (MenuSelectionManager)ev.getSource();
-            MenuElement[] path = msm.getSelectedPath();
-            if (path.length == 0) {
-                if(!WindowsLookAndFeel.isMnemonicHidden()) {
-                    // menu was canceled -- hide mnemonics
-                    WindowsLookAndFeel.setMnemonicHidden(true);
-                    if (repaintRoot != null) {
-                        Window win =
-                            SwingUtilities.getWindowAncestor(repaintRoot);
-                        WindowsGraphicsUtils.repaintMnemonicsInWindow(win);
-                    }
-                }
-            } else {
-                Component c = (Component)path[0];
-                if (c instanceof JPopupMenu) c = ((JPopupMenu)c).getInvoker();
-                repaintRoot = SwingUtilities.getRootPane(c);
-            }
-        }
-    }
-
-    /**
-     * Returns offset for the text.
-     * BasicMenuItemUI sets max text offset on the JPopupMenuUI.
-     * @param c PopupMenu to return text offset for.
-     * @return text offset for the component
-     */
-    static int getTextOffset(JComponent c) {
-        int rv = -1;
-        Object maxTextOffset =
-            c.getClientProperty(BASICMENUITEMUI_MAX_TEXT_OFFSET);
-        if (maxTextOffset instanceof Integer) {
-            /*
-             * this is in JMenuItem coordinates.
-             * Let's assume all the JMenuItem have the same offset along X.
-             */
-            rv = (Integer) maxTextOffset;
-            int menuItemOffset = 0;
-            Component component = c.getComponent(0);
-            if (component != null) {
-                menuItemOffset = component.getX();
-            }
-            rv += menuItemOffset;
-        }
-        return rv;
-    }
-
-    /**
-     * Returns span before gutter.
-     * used only on Vista.
-     * @return span before gutter
-     */
-    static int getSpanBeforeGutter() {
-        return 3;
-    }
-
-    /**
-     * Returns span after gutter.
-     * used only on Vista.
-     * @return span after gutter
-     */
-    static int getSpanAfterGutter() {
-        return 3;
-    }
-
-    /**
-     * Returns gutter width.
-     * used only on Vista.
-     * @return width of the gutter
-     */
-    static int getGutterWidth() {
-        int rv = 2;
-        XPStyle xp = XPStyle.getXP();
-        if (xp != null) {
-            Skin skin = xp.getSkin(null, Part.MP_POPUPGUTTER);
-            rv = skin.getWidth();
-        }
-        return rv;
-    }
-
-    /**
-     * Checks if PopupMenu is leftToRight
-     * The orientation is derived from the children of the component.
-     * It is leftToRight if all the children are leftToRight
-     *
-     * @param c component to return orientation for
-     * @return true if all the children are leftToRight
-     */
-    private static boolean isLeftToRight(JComponent c) {
-        boolean leftToRight = true;
-        for (int i = c.getComponentCount() - 1; i >=0 && leftToRight; i-- ) {
-            leftToRight =
-                c.getComponent(i).getComponentOrientation().isLeftToRight();
-        }
-        return leftToRight;
-    }
-
-    @Override
-    public void paint(Graphics g, JComponent c) {
-        XPStyle xp = XPStyle.getXP();
-        if (WindowsMenuItemUI.isVistaPainting(xp)) {
-            Skin skin = xp.getSkin(c, Part.MP_POPUPBACKGROUND);
-            skin.paintSkin(g, 0, 0, c.getWidth(),c.getHeight(), State.NORMAL);
-            int textOffset = getTextOffset(c);
-            if (textOffset >= 0
-                    /* paint gutter only for leftToRight case */
-                    && isLeftToRight(c)) {
-                skin = xp.getSkin(c, Part.MP_POPUPGUTTER);
-                int gutterWidth = getGutterWidth();
-                int gutterOffset =
-                    textOffset - getSpanAfterGutter() - gutterWidth;
-                c.putClientProperty(GUTTER_OFFSET_KEY,
-                    Integer.valueOf(gutterOffset));
-                Insets insets = c.getInsets();
-                skin.paintSkin(g, gutterOffset, insets.top,
-                    gutterWidth, c.getHeight() - insets.bottom - insets.top,
-                    State.NORMAL);
-            } else {
-                if (c.getClientProperty(GUTTER_OFFSET_KEY) != null) {
-                    c.putClientProperty(GUTTER_OFFSET_KEY, null);
-                }
-            }
-        } else {
-            super.paint(g, c);
-        }
-    }
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsPopupWindow.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +0,0 @@
-/*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.java.swing.plaf.windows;
-
-import javax.swing.JWindow;
-import java.awt.Window;
-import java.awt.Graphics;
-
-/**
- * A class which tags a window with a particular semantic usage,
- * either tooltip, menu, sub-menu, popup-menu, or comobobox-popup.
- * This is used as a temporary solution for getting native AWT support
- * for transition effects in Windows 98 and Windows 2000.  The native
- * code will interpret the windowType property and automatically
- * implement appropriate animation when the window is shown/hidden.
- * <p>
- * Note that support for transition effects may be supported with a
- * different mechanism in the future and so this class is
- * package-private and targeted for Swing implementation use only.
- * <p>
- * <strong>Warning:</strong>
- * Serialized objects of this class will not be compatible with
- * future Swing releases.  The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing.  A future release of Swing will provide support for
- * long term persistence.
- *
- * @author Amy Fowler
- */
-@SuppressWarnings("serial") // Superclass is not serializable across versions
-class WindowsPopupWindow extends JWindow {
-
-    static final int UNDEFINED_WINDOW_TYPE      = 0;
-    static final int TOOLTIP_WINDOW_TYPE        = 1;
-    static final int MENU_WINDOW_TYPE           = 2;
-    static final int SUBMENU_WINDOW_TYPE        = 3;
-    static final int POPUPMENU_WINDOW_TYPE      = 4;
-    static final int COMBOBOX_POPUP_WINDOW_TYPE = 5;
-
-    private int windowType;
-
-    WindowsPopupWindow(Window parent) {
-        super(parent);
-        setFocusableWindowState(false);
-    }
-
-    void setWindowType(int type) {
-        windowType = type;
-    }
-
-    int getWindowType() {
-        return windowType;
-    }
-
-    public void update(Graphics g) {
-        paint(g);
-    }
-
-    @SuppressWarnings("deprecation")
-    public void hide() {
-        super.hide();
-        /** We need to call removeNotify() here because hide() does
-         * something only if Component.visible is true. When the app
-         * frame is miniaturized, the parent frame of this frame is
-         * invisible, causing AWT to believe that this frame
-         *  is invisible and causing hide() to do nothing
-         */
-        removeNotify();
-    }
-
-    @SuppressWarnings("deprecation")
-    public void show() {
-        super.show();
-        this.pack();
-    }
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsProgressBarUI.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,412 +0,0 @@
-/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import javax.swing.plaf.basic.*;
-import javax.swing.plaf.*;
-import javax.swing.*;
-import java.awt.*;
-
-import static com.sun.java.swing.plaf.windows.TMSchema.*;
-import static com.sun.java.swing.plaf.windows.XPStyle.Skin;
-
-
-/**
- * Windows rendition of the component.
- * <p>
- * <strong>Warning:</strong>
- * Serialized objects of this class will not be compatible with
- * future Swing releases.  The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing.  A future release of Swing will provide support for
- * long term persistence.
- *
- * @author Michael C. Albers
- */
-public class WindowsProgressBarUI extends BasicProgressBarUI
-{
-
-    private Rectangle previousFullBox;
-    private Insets indeterminateInsets;
-
-    public static ComponentUI createUI(JComponent x) {
-        return new WindowsProgressBarUI();
-    }
-
-
-    protected void installDefaults() {
-        super.installDefaults();
-
-        if (XPStyle.getXP() != null) {
-            LookAndFeel.installProperty(progressBar, "opaque", Boolean.FALSE);
-            progressBar.setBorder(null);
-            indeterminateInsets = UIManager.getInsets("ProgressBar.indeterminateInsets");
-        }
-    }
-
-    /**
-     * Returns the baseline.
-     *
-     * @throws NullPointerException {@inheritDoc}
-     * @throws IllegalArgumentException {@inheritDoc}
-     * @see javax.swing.JComponent#getBaseline(int, int)
-     * @since 1.6
-     */
-    public int getBaseline(JComponent c, int width, int height) {
-        int baseline = super.getBaseline(c, width, height);
-        if (XPStyle.getXP() != null && progressBar.isStringPainted() &&
-                progressBar.getOrientation() == JProgressBar.HORIZONTAL) {
-            FontMetrics metrics = progressBar.
-                    getFontMetrics(progressBar.getFont());
-            int y = progressBar.getInsets().top;
-            if (progressBar.isIndeterminate()) {
-                y = -1;
-                height--;
-            }
-            else {
-                y = 0;
-                height -= 3;
-            }
-            baseline = y + (height + metrics.getAscent() -
-                        metrics.getLeading() -
-                        metrics.getDescent()) / 2;
-        }
-        return baseline;
-    }
-
-    protected Dimension getPreferredInnerHorizontal() {
-        XPStyle xp = XPStyle.getXP();
-        if (xp != null) {
-             Skin skin = xp.getSkin(progressBar, Part.PP_BAR);
-             return new Dimension(
-                     (int)super.getPreferredInnerHorizontal().getWidth(),
-                     skin.getHeight());
-         }
-         return super.getPreferredInnerHorizontal();
-    }
-
-    protected Dimension getPreferredInnerVertical() {
-         XPStyle xp = XPStyle.getXP();
-         if (xp != null) {
-             Skin skin = xp.getSkin(progressBar, Part.PP_BARVERT);
-             return new Dimension(
-                     skin.getWidth(),
-                     (int)super.getPreferredInnerVertical().getHeight());
-         }
-         return super.getPreferredInnerVertical();
-    }
-
-    protected void paintDeterminate(Graphics g, JComponent c) {
-        XPStyle xp = XPStyle.getXP();
-        if (xp != null) {
-            boolean vertical = (progressBar.getOrientation() == JProgressBar.VERTICAL);
-            boolean isLeftToRight = WindowsGraphicsUtils.isLeftToRight(c);
-            int barRectWidth = progressBar.getWidth();
-            int barRectHeight = progressBar.getHeight()-1;
-            // amount of progress to draw
-            int amountFull = getAmountFull(null, barRectWidth, barRectHeight);
-
-            paintXPBackground(g, vertical, barRectWidth, barRectHeight);
-            // Paint progress
-            if (progressBar.isStringPainted()) {
-                // Do not paint the standard stripes from the skin, because they obscure
-                // the text
-                g.setColor(progressBar.getForeground());
-                barRectHeight -= 2;
-                barRectWidth -= 2;
-
-                if (barRectWidth <= 0 || barRectHeight <= 0) {
-                    return;
-                }
-
-                Graphics2D g2 = (Graphics2D)g;
-                g2.setStroke(new BasicStroke((float)(vertical ? barRectWidth : barRectHeight),
-                                             BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL));
-                if (!vertical) {
-                    if (isLeftToRight) {
-                        g2.drawLine(2,              barRectHeight / 2 + 1,
-                                    amountFull - 2, barRectHeight / 2 + 1);
-                    } else {
-                        g2.drawLine(2 + barRectWidth,
-                                    barRectHeight / 2 + 1,
-                                    2 + barRectWidth - (amountFull - 2),
-                                    barRectHeight / 2 + 1);
-                    }
-                    paintString(g, 0, 0, barRectWidth, barRectHeight, amountFull, null);
-                } else {
-                    g2.drawLine(barRectWidth/2 + 1, barRectHeight + 1,
-                                barRectWidth/2 + 1, barRectHeight + 1 - amountFull + 2);
-                    paintString(g, 2, 2, barRectWidth, barRectHeight, amountFull, null);
-                }
-
-            } else {
-                Skin skin = xp.getSkin(progressBar, vertical ? Part.PP_CHUNKVERT : Part.PP_CHUNK);
-                int thickness;
-                if (vertical) {
-                    thickness = barRectWidth - 5;
-                } else {
-                    thickness = barRectHeight - 5;
-                }
-
-                int chunkSize = xp.getInt(progressBar, Part.PP_PROGRESS, null, Prop.PROGRESSCHUNKSIZE, 2);
-                int spaceSize = xp.getInt(progressBar, Part.PP_PROGRESS, null, Prop.PROGRESSSPACESIZE, 0);
-                int nChunks = (amountFull-4) / (chunkSize + spaceSize);
-
-                // See if we can squeeze in an extra chunk without spacing after
-                if (spaceSize > 0 && (nChunks * (chunkSize + spaceSize) + chunkSize) < (amountFull-4)) {
-                    nChunks++;
-                }
-
-                for (int i = 0; i < nChunks; i++) {
-                    if (vertical) {
-                        skin.paintSkin(g,
-                                       3, barRectHeight - i * (chunkSize + spaceSize) - chunkSize - 2,
-                                       thickness, chunkSize, null);
-                    } else {
-                        if (isLeftToRight) {
-                            skin.paintSkin(g,
-                                           4 + i * (chunkSize + spaceSize), 2,
-                                           chunkSize, thickness, null);
-                        } else {
-                            skin.paintSkin(g,
-                                           barRectWidth - (2 + (i+1) * (chunkSize + spaceSize)), 2,
-                                           chunkSize, thickness, null);
-                        }
-                    }
-                }
-            }
-        } else {
-            super.paintDeterminate(g, c);
-        }
-    }
-
-
-    /**
-     * {@inheritDoc}
-     * @since 1.6
-     */
-    protected void setAnimationIndex(int newValue) {
-        super.setAnimationIndex(newValue);
-        XPStyle xp = XPStyle.getXP();
-        if (xp != null) {
-            if (boxRect != null) {
-                // get the full repaint area and add it the
-                // previous one so we can erase it
-                Rectangle chunk = getFullChunkBounds(boxRect);
-                if (previousFullBox != null) {
-                    chunk.add(previousFullBox);
-                }
-                progressBar.repaint(chunk);
-            } else {
-                progressBar.repaint();
-            }
-        }
-    }
-
-
-    /**
-     * {@inheritDoc}
-     * @since 1.6
-     */
-    protected int getBoxLength(int availableLength, int otherDimension) {
-        XPStyle xp = XPStyle.getXP();
-        if (xp != null) {
-            return 6; // an apparently hard coded value in Windows
-        }
-        return super.getBoxLength(availableLength, otherDimension);
-    }
-
-    /**
-     * {@inheritDoc}
-     * @since 1.6
-     */
-    protected Rectangle getBox(Rectangle r) {
-        Rectangle rect = super.getBox(r);
-
-        XPStyle xp = XPStyle.getXP();
-        if (xp != null) {
-            boolean vertical = (progressBar.getOrientation()
-                                 == JProgressBar.VERTICAL);
-            Part part = vertical ? Part.PP_BARVERT : Part.PP_BAR;
-            Insets ins = indeterminateInsets;
-
-            int currentFrame = getAnimationIndex();
-            int framecount = getFrameCount()/2;
-
-            int gap = xp.getInt(progressBar, Part.PP_PROGRESS, null,
-                    Prop.PROGRESSSPACESIZE, 0);
-            currentFrame = currentFrame % framecount;
-
-            // this code adjusts the chunk size to properly account for the
-            // size and gap specified in the XP style. It also does it's own
-            // box placement for the chunk animation. This is required because
-            // the inherited algorithm from BasicProgressBarUI goes back and
-            // forth whereas XP only goes in one direction. XP also has ghosted
-            // trailing chunks to create the illusion of speed. This code
-            // adjusts the pixel length of the animation to account for the
-            // trails.
-            if (!vertical) {
-                rect.y = rect.y + ins.top;
-                rect.height = progressBar.getHeight() - ins.top - ins.bottom;
-                int len = progressBar.getWidth() - ins.left - ins.right;
-                len += (rect.width+gap)*2; // add 2x for the trails
-                double delta = (double)(len) / (double)framecount;
-                rect.x = (int)(delta * currentFrame) + ins.left;
-            } else {
-                rect.x = rect.x + ins.left;
-                rect.width = progressBar.getWidth() - ins.left - ins.right;
-                int len = progressBar.getHeight() - ins.top - ins.bottom;
-                len += (rect.height+gap)*2; // add 2x for the trails
-                double delta = (double)(len) / (double)framecount;
-                rect.y = (int)(delta * currentFrame) + ins.top;
-            }
-        }
-        return rect;
-    }
-
-
-    protected void paintIndeterminate(Graphics g, JComponent c) {
-        XPStyle xp = XPStyle.getXP();
-        if (xp != null) {
-            boolean vertical = (progressBar.getOrientation()
-                                 == JProgressBar.VERTICAL);
-            int barRectWidth = progressBar.getWidth();
-            int barRectHeight = progressBar.getHeight();
-            paintXPBackground(g, vertical, barRectWidth, barRectHeight);
-
-            // Paint the bouncing box.
-            boxRect = getBox(boxRect);
-            if (boxRect != null) {
-                g.setColor(progressBar.getForeground());
-                if (!(g instanceof Graphics2D)) {
-                    return;
-                }
-                paintIndeterminateFrame(boxRect, (Graphics2D)g, vertical,
-                                        barRectWidth, barRectHeight);
-                if (progressBar.isStringPainted()) {
-                    if (!vertical) {
-                        paintString(g, -1, -1, barRectWidth, barRectHeight, 0, null);
-                    } else {
-                        paintString(g, 1, 1, barRectWidth, barRectHeight, 0, null);
-                    }
-                }
-            }
-        } else {
-            super.paintIndeterminate(g, c);
-        }
-    }
-
-    private Rectangle getFullChunkBounds(Rectangle box) {
-        boolean vertical = (progressBar.getOrientation() == JProgressBar.VERTICAL);
-        XPStyle xp = XPStyle.getXP();
-        int gap = (xp != null) ? xp.getInt(progressBar, Part.PP_PROGRESS,
-                                           null, Prop.PROGRESSSPACESIZE, 0)
-                               : 0;
-
-        if (!vertical) {
-            int chunksize = box.width+gap;
-            return new Rectangle(box.x-chunksize*2, box.y, chunksize*3, box.height);
-        } else {
-            int chunksize = box.height+gap;
-            return new Rectangle(box.x, box.y-chunksize*2, box.width, chunksize*3);
-        }
-    }
-
-    private void paintIndeterminateFrame(Rectangle box, Graphics2D g,
-                                          boolean vertical,
-                                          int bgwidth, int bgheight) {
-        XPStyle xp = XPStyle.getXP();
-        if (xp == null) {
-            return;
-        }
-
-        // create a new graphics to keep drawing surface state
-        Graphics2D gfx = (Graphics2D)g.create();
-
-        Part part = vertical ? Part.PP_BARVERT : Part.PP_BAR;
-        Part chunk = vertical ? Part.PP_CHUNKVERT : Part.PP_CHUNK;
-
-        // calculate the chunk offsets
-        int gap = xp.getInt(progressBar, Part.PP_PROGRESS, null,
-                            Prop.PROGRESSSPACESIZE, 0);
-        int deltax = 0;
-        int deltay = 0;
-        if (!vertical) {
-            deltax = -box.width - gap;
-            deltay = 0;
-        } else {
-            deltax = 0;
-            deltay = -box.height - gap;
-        }
-
-        // Calculate the area of the chunks combined
-        Rectangle fullBox = getFullChunkBounds(box);
-
-        // save this box for the next time
-        previousFullBox = fullBox;
-
-        // this is the entire progress bar minus the track and borders
-        Insets ins = indeterminateInsets;
-        Rectangle progbarExtents = new Rectangle(ins.left, ins.top,
-                                                 bgwidth  - ins.left - ins.right,
-                                                 bgheight - ins.top  - ins.bottom);
-
-        // only paint where the chunks overlap with the progress bar drawing area
-        Rectangle repaintArea = progbarExtents.intersection(fullBox);
-
-        // adjust the cliprect to chop the chunks when they go off the end
-        gfx.clip(repaintArea);
-
-        // get the skin
-        XPStyle.Skin skin = xp.getSkin(progressBar, chunk);
-
-        // do the drawing
-        gfx.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.8f));
-        skin.paintSkin(gfx, box.x, box.y, box.width, box.height, null);
-        box.translate(deltax, deltay);
-        gfx.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f));
-        skin.paintSkin(gfx, box.x, box.y, box.width, box.height, null);
-        box.translate(deltax, deltay);
-        gfx.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.2f));
-        skin.paintSkin(gfx, box.x, box.y, box.width, box.height, null);
-
-        // get rid of our clip and composite changes
-        gfx.dispose();
-    }
-
-    private void paintXPBackground(Graphics g, boolean vertical,
-                                   int barRectWidth, int barRectHeight) {
-        XPStyle xp = XPStyle.getXP();
-        if (xp == null) {
-            return;
-        }
-        Part part = vertical ? Part.PP_BARVERT : Part.PP_BAR;
-        Skin skin = xp.getSkin(progressBar, part);
-
-        // Paint background
-        skin.paintSkin(g, 0, 0, barRectWidth, barRectHeight, null);
-    }
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsRadioButtonMenuItemUI.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +0,0 @@
-/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import java.awt.*;
-import javax.swing.*;
-import javax.swing.plaf.*;
-import javax.swing.plaf.basic.*;
-
-import com.sun.java.swing.plaf.windows.TMSchema.Part;
-import com.sun.java.swing.plaf.windows.TMSchema.State;
-
-/**
- * Windows rendition of the component.
- * <p>
- * <strong>Warning:</strong>
- * Serialized objects of this class will not be compatible with
- * future Swing releases.  The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing.  A future release of Swing will provide support for
- * long term persistence.
- */
-public class WindowsRadioButtonMenuItemUI extends BasicRadioButtonMenuItemUI {
-
-    final WindowsMenuItemUIAccessor accessor =
-        new WindowsMenuItemUIAccessor() {
-
-           public JMenuItem getMenuItem() {
-               return menuItem;
-           }
-
-           public State getState(JMenuItem menuItem) {
-               return WindowsMenuItemUI.getState(this, menuItem);
-           }
-
-           public Part getPart(JMenuItem menuItem) {
-               return WindowsMenuItemUI.getPart(this, menuItem);
-           }
-    };
-    public static ComponentUI createUI(JComponent b) {
-        return new WindowsRadioButtonMenuItemUI();
-    }
-
-    @Override
-    protected  void paintBackground(Graphics g, JMenuItem menuItem,
-            Color bgColor) {
-        if (WindowsMenuItemUI.isVistaPainting()) {
-            WindowsMenuItemUI.paintBackground(accessor, g, menuItem, bgColor);
-            return;
-        }
-        super.paintBackground(g, menuItem, bgColor);
-    }
-
-    /**
-     * Method which renders the text of the current menu item.
-     *
-     * @param g Graphics context
-     * @param menuItem Current menu item to render
-     * @param textRect Bounding rectangle to render the text.
-     * @param text String to render
-     * @since 1.4
-     */
-    protected void paintText(Graphics g, JMenuItem menuItem,
-            Rectangle textRect, String text) {
-        if (WindowsMenuItemUI.isVistaPainting()) {
-            WindowsMenuItemUI.paintText(accessor, g, menuItem, textRect, text);
-            return;
-        }
-        ButtonModel model = menuItem.getModel();
-        Color oldColor = g.getColor();
-
-        if(model.isEnabled() && model.isArmed()) {
-            g.setColor(selectionForeground); // Uses protected field.
-        }
-
-        WindowsGraphicsUtils.paintText(g, menuItem, textRect, text, 0);
-
-        g.setColor(oldColor);
-    }
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsRadioButtonUI.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,135 +0,0 @@
-/*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import sun.awt.AppContext;
-
-import javax.swing.plaf.basic.*;
-import javax.swing.*;
-import javax.swing.plaf.*;
-
-import java.awt.*;
-
-
-/**
- * Windows rendition of the component.
- * <p>
- * <strong>Warning:</strong>
- * Serialized objects of this class will not be compatible with
- * future Swing releases.  The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing.  A future release of Swing will provide support for
- * long term persistence.
- */
-public class WindowsRadioButtonUI extends BasicRadioButtonUI
-{
-    private static final Object WINDOWS_RADIO_BUTTON_UI_KEY = new Object();
-
-    protected int dashedRectGapX;
-    protected int dashedRectGapY;
-    protected int dashedRectGapWidth;
-    protected int dashedRectGapHeight;
-
-    protected Color focusColor;
-
-    private boolean initialized = false;
-
-    // ********************************
-    //          Create PLAF
-    // ********************************
-    public static ComponentUI createUI(JComponent c) {
-        AppContext appContext = AppContext.getAppContext();
-        WindowsRadioButtonUI windowsRadioButtonUI =
-                (WindowsRadioButtonUI) appContext.get(WINDOWS_RADIO_BUTTON_UI_KEY);
-        if (windowsRadioButtonUI == null) {
-            windowsRadioButtonUI = new WindowsRadioButtonUI();
-            appContext.put(WINDOWS_RADIO_BUTTON_UI_KEY, windowsRadioButtonUI);
-        }
-        return windowsRadioButtonUI;
-    }
-
-    // ********************************
-    //           Defaults
-    // ********************************
-    public void installDefaults(AbstractButton b) {
-        super.installDefaults(b);
-        if(!initialized) {
-            dashedRectGapX = ((Integer)UIManager.get("Button.dashedRectGapX")).intValue();
-            dashedRectGapY = ((Integer)UIManager.get("Button.dashedRectGapY")).intValue();
-            dashedRectGapWidth = ((Integer)UIManager.get("Button.dashedRectGapWidth")).intValue();
-            dashedRectGapHeight = ((Integer)UIManager.get("Button.dashedRectGapHeight")).intValue();
-            focusColor = UIManager.getColor(getPropertyPrefix() + "focus");
-            initialized = true;
-        }
-        if (XPStyle.getXP() != null) {
-            LookAndFeel.installProperty(b, "rolloverEnabled", Boolean.TRUE);
-        }
-    }
-
-    protected void uninstallDefaults(AbstractButton b) {
-        super.uninstallDefaults(b);
-        initialized = false;
-    }
-
-    protected Color getFocusColor() {
-        return focusColor;
-    }
-
-    // ********************************
-    //          Paint Methods
-    // ********************************
-
-    /**
-     * Overridden method to render the text without the mnemonic
-     */
-    protected void paintText(Graphics g, AbstractButton b, Rectangle textRect, String text) {
-        WindowsGraphicsUtils.paintText(g, b, textRect, text, getTextShiftOffset());
-    }
-
-
-    protected void paintFocus(Graphics g, Rectangle textRect, Dimension d){
-        g.setColor(getFocusColor());
-        BasicGraphicsUtils.drawDashedRect(g, textRect.x, textRect.y, textRect.width, textRect.height);
-    }
-
-    // ********************************
-    //          Layout Methods
-    // ********************************
-    public Dimension getPreferredSize(JComponent c) {
-        Dimension d = super.getPreferredSize(c);
-
-        /* Ensure that the width and height of the button is odd,
-         * to allow for the focus line if focus is painted
-         */
-        AbstractButton b = (AbstractButton)c;
-        if (d != null && b.isFocusPainted()) {
-            if(d.width % 2 == 0) { d.width += 1; }
-            if(d.height % 2 == 0) { d.height += 1; }
-        }
-        return d;
-    }
-
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsRootPaneUI.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,212 +0,0 @@
-/*
- * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.Event;
-import java.awt.KeyEventPostProcessor;
-import java.awt.Window;
-import java.awt.Toolkit;
-
-import sun.awt.AWTAccessor;
-import sun.awt.SunToolkit;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.KeyEvent;
-
-import javax.swing.AbstractAction;
-import javax.swing.ActionMap;
-import javax.swing.InputMap;
-import javax.swing.KeyStroke;
-import javax.swing.JComponent;
-import javax.swing.JLabel;
-import javax.swing.JRootPane;
-import javax.swing.SwingUtilities;
-import javax.swing.UIManager;
-import javax.swing.AbstractButton;
-import javax.swing.JFrame;
-import javax.swing.JMenu;
-import javax.swing.JMenuBar;
-import javax.swing.MenuElement;
-import javax.swing.MenuSelectionManager;
-
-import javax.swing.plaf.ActionMapUIResource;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.InputMapUIResource;
-
-import javax.swing.plaf.basic.BasicRootPaneUI;
-import javax.swing.plaf.basic.ComboPopup;
-
-/**
- * Windows implementation of RootPaneUI, there is one shared between all
- * JRootPane instances.
- *
- * @author Mark Davidson
- * @since 1.4
- */
-public class WindowsRootPaneUI extends BasicRootPaneUI {
-
-    private static final WindowsRootPaneUI windowsRootPaneUI = new WindowsRootPaneUI();
-    static final AltProcessor altProcessor = new AltProcessor();
-
-    public static ComponentUI createUI(JComponent c) {
-        return windowsRootPaneUI;
-    }
-
-    static class AltProcessor implements KeyEventPostProcessor {
-        static boolean altKeyPressed = false;
-        static boolean menuCanceledOnPress = false;
-        static JRootPane root = null;
-        static Window winAncestor = null;
-
-        void altPressed(KeyEvent ev) {
-            MenuSelectionManager msm =
-                MenuSelectionManager.defaultManager();
-            MenuElement[] path = msm.getSelectedPath();
-            if (path.length > 0 && ! (path[0] instanceof ComboPopup)) {
-                msm.clearSelectedPath();
-                menuCanceledOnPress = true;
-                ev.consume();
-            } else if(path.length > 0) { // We are in ComboBox
-                menuCanceledOnPress = false;
-                WindowsLookAndFeel.setMnemonicHidden(false);
-                WindowsGraphicsUtils.repaintMnemonicsInWindow(winAncestor);
-                ev.consume();
-            } else {
-                menuCanceledOnPress = false;
-                WindowsLookAndFeel.setMnemonicHidden(false);
-                WindowsGraphicsUtils.repaintMnemonicsInWindow(winAncestor);
-                JMenuBar mbar = root != null ? root.getJMenuBar() : null;
-                if(mbar == null && winAncestor instanceof JFrame) {
-                    mbar = ((JFrame)winAncestor).getJMenuBar();
-                }
-                JMenu menu = mbar != null ? mbar.getMenu(0) : null;
-                if(menu != null) {
-                    ev.consume();
-                }
-            }
-        }
-
-        void altReleased(KeyEvent ev) {
-            if (menuCanceledOnPress) {
-                WindowsLookAndFeel.setMnemonicHidden(true);
-                WindowsGraphicsUtils.repaintMnemonicsInWindow(winAncestor);
-                return;
-            }
-
-            MenuSelectionManager msm =
-                MenuSelectionManager.defaultManager();
-            if (msm.getSelectedPath().length == 0) {
-                // if no menu is active, we try activating the menubar
-
-                JMenuBar mbar = root != null ? root.getJMenuBar() : null;
-                if(mbar == null && winAncestor instanceof JFrame) {
-                    mbar = ((JFrame)winAncestor).getJMenuBar();
-                }
-                JMenu menu = mbar != null ? mbar.getMenu(0) : null;
-
-                // It might happen that the altRelease event is processed
-                // with a reasonable delay since it has been generated.
-                // Here we check the last deactivation time of the containing
-                // window. If this time appears to be greater than the altRelease
-                // event time the event is skipped to avoid unexpected menu
-                // activation. See 7121442.
-                // Also we must ensure that original source of key event belongs
-                // to the same window object as winAncestor. See 8001633.
-                boolean skip = false;
-                Toolkit tk = Toolkit.getDefaultToolkit();
-                if (tk instanceof SunToolkit) {
-                    Component originalSource = AWTAccessor.getKeyEventAccessor()
-                            .getOriginalSource(ev);
-                    skip = SunToolkit.getContainingWindow(originalSource) != winAncestor ||
-                            ev.getWhen() <= ((SunToolkit) tk).getWindowDeactivationTime(winAncestor);
-                }
-
-                if (menu != null && !skip) {
-                    MenuElement[] path = new MenuElement[2];
-                    path[0] = mbar;
-                    path[1] = menu;
-                    msm.setSelectedPath(path);
-                } else if(!WindowsLookAndFeel.isMnemonicHidden()) {
-                    WindowsLookAndFeel.setMnemonicHidden(true);
-                    WindowsGraphicsUtils.repaintMnemonicsInWindow(winAncestor);
-                }
-            } else {
-                if((msm.getSelectedPath())[0] instanceof ComboPopup) {
-                    WindowsLookAndFeel.setMnemonicHidden(true);
-                    WindowsGraphicsUtils.repaintMnemonicsInWindow(winAncestor);
-                }
-            }
-
-        }
-
-        public boolean postProcessKeyEvent(KeyEvent ev) {
-            if(ev.isConsumed() && ev.getKeyCode() != KeyEvent.VK_ALT) {
-                // mnemonic combination, it's consumed, but we need
-                // set altKeyPressed to false, otherwise after selection
-                // component by mnemonic combination a menu will be open
-                altKeyPressed = false;
-                return false;
-            }
-            if (ev.getKeyCode() == KeyEvent.VK_ALT) {
-                root = SwingUtilities.getRootPane(ev.getComponent());
-                winAncestor = (root == null ? null :
-                        SwingUtilities.getWindowAncestor(root));
-
-                if (ev.getID() == KeyEvent.KEY_PRESSED) {
-                    if (!altKeyPressed) {
-                        altPressed(ev);
-                    }
-                    altKeyPressed = true;
-                    return true;
-                } else if (ev.getID() == KeyEvent.KEY_RELEASED) {
-                    if (altKeyPressed) {
-                        altReleased(ev);
-                    } else {
-                        MenuSelectionManager msm =
-                            MenuSelectionManager.defaultManager();
-                        MenuElement[] path = msm.getSelectedPath();
-                        if (path.length <= 0) {
-                            WindowsLookAndFeel.setMnemonicHidden(true);
-                            WindowsGraphicsUtils.repaintMnemonicsInWindow(winAncestor);
-                        }
-                    }
-                    altKeyPressed = false;
-                }
-                root = null;
-                winAncestor = null;
-            } else {
-                if (WindowsLookAndFeel.isMnemonicHidden() && ev.isAltDown()) {
-                    WindowsLookAndFeel.setMnemonicHidden(false);
-                    WindowsGraphicsUtils.repaintMnemonicsInWindow(winAncestor);
-                }
-                altKeyPressed = false;
-            }
-            return false;
-        }
-    }
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsScrollBarUI.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,503 +0,0 @@
-/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import java.awt.*;
-import java.awt.event.*;
-import java.awt.image.*;
-import java.lang.ref.*;
-import java.util.*;
-import javax.swing.plaf.basic.*;
-import javax.swing.*;
-import javax.swing.plaf.ComponentUI;
-
-import static com.sun.java.swing.plaf.windows.TMSchema.*;
-import static com.sun.java.swing.plaf.windows.XPStyle.Skin;
-
-
-/**
- * Windows rendition of the component.
- * <p>
- * <strong>Warning:</strong>
- * Serialized objects of this class will not be compatible with
- * future Swing releases.  The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing.  A future release of Swing will provide support for
- * long term persistence.
- */
-public class WindowsScrollBarUI extends BasicScrollBarUI {
-    private Grid thumbGrid;
-    private Grid highlightGrid;
-    private Dimension horizontalThumbSize;
-    private Dimension verticalThumbSize;
-
-    /**
-     * Creates a UI for a JScrollBar.
-     *
-     * @param c the text field
-     * @return the UI
-     */
-    public static ComponentUI createUI(JComponent c) {
-        return new WindowsScrollBarUI();
-    }
-
-    protected void installDefaults() {
-        super.installDefaults();
-
-        XPStyle xp = XPStyle.getXP();
-        if (xp != null) {
-            scrollbar.setBorder(null);
-            horizontalThumbSize = getSize(scrollbar, xp, Part.SBP_THUMBBTNHORZ);
-            verticalThumbSize = getSize(scrollbar, xp, Part.SBP_THUMBBTNVERT);
-        } else {
-            horizontalThumbSize = null;
-            verticalThumbSize = null;
-        }
-    }
-
-    private static Dimension getSize(Component component, XPStyle xp, Part part) {
-        Skin skin = xp.getSkin(component, part);
-        return new Dimension(skin.getWidth(), skin.getHeight());
-    }
-
-    @Override
-    protected Dimension getMinimumThumbSize() {
-        if ((horizontalThumbSize == null) || (verticalThumbSize == null)) {
-            return super.getMinimumThumbSize();
-        }
-        return JScrollBar.HORIZONTAL == scrollbar.getOrientation()
-                ? horizontalThumbSize
-                : verticalThumbSize;
-    }
-
-    public void uninstallUI(JComponent c) {
-        super.uninstallUI(c);
-        thumbGrid = highlightGrid = null;
-    }
-
-    protected void configureScrollBarColors() {
-        super.configureScrollBarColors();
-        Color color = UIManager.getColor("ScrollBar.trackForeground");
-        if (color != null && trackColor != null) {
-            thumbGrid = Grid.getGrid(color, trackColor);
-        }
-
-        color = UIManager.getColor("ScrollBar.trackHighlightForeground");
-        if (color != null && trackHighlightColor != null) {
-            highlightGrid = Grid.getGrid(color, trackHighlightColor);
-        }
-    }
-
-    protected JButton createDecreaseButton(int orientation)  {
-        return new WindowsArrowButton(orientation,
-                                    UIManager.getColor("ScrollBar.thumb"),
-                                    UIManager.getColor("ScrollBar.thumbShadow"),
-                                    UIManager.getColor("ScrollBar.thumbDarkShadow"),
-                                    UIManager.getColor("ScrollBar.thumbHighlight"));
-    }
-
-    protected JButton createIncreaseButton(int orientation)  {
-        return new WindowsArrowButton(orientation,
-                                    UIManager.getColor("ScrollBar.thumb"),
-                                    UIManager.getColor("ScrollBar.thumbShadow"),
-                                    UIManager.getColor("ScrollBar.thumbDarkShadow"),
-                                    UIManager.getColor("ScrollBar.thumbHighlight"));
-    }
-
-    /**
-     * {@inheritDoc}
-     * @since 1.6
-     */
-    @Override
-    protected ArrowButtonListener createArrowButtonListener(){
-        // we need to repaint the entire scrollbar because state change for each
-        // button causes a state change for the thumb and other button on Vista
-        if(XPStyle.isVista()) {
-            return new ArrowButtonListener() {
-                public void mouseEntered(MouseEvent evt) {
-                    repaint();
-                    super.mouseEntered(evt);
-                }
-                public void mouseExited(MouseEvent evt) {
-                    repaint();
-                    super.mouseExited(evt);
-                }
-                private void repaint() {
-                    scrollbar.repaint();
-                }
-            };
-        } else {
-            return super.createArrowButtonListener();
-        }
-    }
-
-    protected void paintTrack(Graphics g, JComponent c, Rectangle trackBounds){
-        boolean v = (scrollbar.getOrientation() == JScrollBar.VERTICAL);
-
-        XPStyle xp = XPStyle.getXP();
-        if (xp != null) {
-            JScrollBar sb = (JScrollBar)c;
-            State state = State.NORMAL;
-            // Pending: Implement rollover (hot) and pressed
-            if (!sb.isEnabled()) {
-                state = State.DISABLED;
-            }
-            Part part = v ? Part.SBP_LOWERTRACKVERT : Part.SBP_LOWERTRACKHORZ;
-            xp.getSkin(sb, part).paintSkin(g, trackBounds, state);
-        } else if (thumbGrid == null) {
-            super.paintTrack(g, c, trackBounds);
-        }
-        else {
-            thumbGrid.paint(g, trackBounds.x, trackBounds.y, trackBounds.width,
-                            trackBounds.height);
-            if (trackHighlight == DECREASE_HIGHLIGHT) {
-                paintDecreaseHighlight(g);
-            }
-            else if (trackHighlight == INCREASE_HIGHLIGHT) {
-                paintIncreaseHighlight(g);
-            }
-        }
-    }
-
-    protected void paintThumb(Graphics g, JComponent c, Rectangle thumbBounds) {
-        boolean v = (scrollbar.getOrientation() == JScrollBar.VERTICAL);
-
-        XPStyle xp = XPStyle.getXP();
-        if (xp != null) {
-            JScrollBar sb = (JScrollBar)c;
-            State state = State.NORMAL;
-            if (!sb.isEnabled()) {
-                state = State.DISABLED;
-            } else if (isDragging) {
-                state = State.PRESSED;
-            } else if (isThumbRollover()) {
-                state = State.HOT;
-            } else if (XPStyle.isVista()) {
-                if ((incrButton != null && incrButton.getModel().isRollover()) ||
-                    (decrButton != null && decrButton.getModel().isRollover())) {
-                    state = State.HOVER;
-                }
-            }
-            // Paint thumb
-            Part thumbPart = v ? Part.SBP_THUMBBTNVERT : Part.SBP_THUMBBTNHORZ;
-            xp.getSkin(sb, thumbPart).paintSkin(g, thumbBounds, state);
-            // Paint gripper
-            Part gripperPart = v ? Part.SBP_GRIPPERVERT : Part.SBP_GRIPPERHORZ;
-            Skin skin = xp.getSkin(sb, gripperPart);
-            Insets gripperInsets = xp.getMargin(c, thumbPart, null, Prop.CONTENTMARGINS);
-            if (gripperInsets == null ||
-                (v && (thumbBounds.height - gripperInsets.top -
-                       gripperInsets.bottom >= skin.getHeight())) ||
-                (!v && (thumbBounds.width - gripperInsets.left -
-                        gripperInsets.right >= skin.getWidth()))) {
-                skin.paintSkin(g,
-                               thumbBounds.x + (thumbBounds.width  - skin.getWidth()) / 2,
-                               thumbBounds.y + (thumbBounds.height - skin.getHeight()) / 2,
-                               skin.getWidth(), skin.getHeight(), state);
-            }
-        } else {
-            super.paintThumb(g, c, thumbBounds);
-        }
-    }
-
-
-    protected void paintDecreaseHighlight(Graphics g) {
-        if (highlightGrid == null) {
-            super.paintDecreaseHighlight(g);
-        }
-        else {
-            Insets insets = scrollbar.getInsets();
-            Rectangle thumbR = getThumbBounds();
-            int x, y, w, h;
-
-            if (scrollbar.getOrientation() == JScrollBar.VERTICAL) {
-                x = insets.left;
-                y = decrButton.getY() + decrButton.getHeight();
-                w = scrollbar.getWidth() - (insets.left + insets.right);
-                h = thumbR.y - y;
-            }
-            else {
-                x = decrButton.getX() + decrButton.getHeight();
-                y = insets.top;
-                w = thumbR.x - x;
-                h = scrollbar.getHeight() - (insets.top + insets.bottom);
-            }
-            highlightGrid.paint(g, x, y, w, h);
-        }
-    }
-
-
-    protected void paintIncreaseHighlight(Graphics g) {
-        if (highlightGrid == null) {
-            super.paintDecreaseHighlight(g);
-        }
-        else {
-            Insets insets = scrollbar.getInsets();
-            Rectangle thumbR = getThumbBounds();
-            int x, y, w, h;
-
-            if (scrollbar.getOrientation() == JScrollBar.VERTICAL) {
-                x = insets.left;
-                y = thumbR.y + thumbR.height;
-                w = scrollbar.getWidth() - (insets.left + insets.right);
-                h = incrButton.getY() - y;
-            }
-            else {
-                x = thumbR.x + thumbR.width;
-                y = insets.top;
-                w = incrButton.getX() - x;
-                h = scrollbar.getHeight() - (insets.top + insets.bottom);
-            }
-            highlightGrid.paint(g, x, y, w, h);
-        }
-    }
-
-
-    /**
-     * {@inheritDoc}
-     * @since 1.6
-     */
-    @Override
-    protected void setThumbRollover(boolean active) {
-        boolean old = isThumbRollover();
-        super.setThumbRollover(active);
-        // we need to repaint the entire scrollbar because state change for thumb
-        // causes state change for incr and decr buttons on Vista
-        if(XPStyle.isVista() && active != old) {
-            scrollbar.repaint();
-        }
-    }
-
-    /**
-     * WindowsArrowButton is used for the buttons to position the
-     * document up/down. It differs from BasicArrowButton in that the
-     * preferred size is always a square.
-     */
-    @SuppressWarnings("serial") // Superclass is not serializable across versions
-    private class WindowsArrowButton extends BasicArrowButton {
-
-        public WindowsArrowButton(int direction, Color background, Color shadow,
-                         Color darkShadow, Color highlight) {
-            super(direction, background, shadow, darkShadow, highlight);
-        }
-
-        public WindowsArrowButton(int direction) {
-            super(direction);
-        }
-
-        public void paint(Graphics g) {
-            XPStyle xp = XPStyle.getXP();
-            if (xp != null) {
-                ButtonModel model = getModel();
-                Skin skin = xp.getSkin(this, Part.SBP_ARROWBTN);
-                State state = null;
-
-                boolean jointRollover = XPStyle.isVista() && (isThumbRollover() ||
-                    (this == incrButton && decrButton.getModel().isRollover()) ||
-                    (this == decrButton && incrButton.getModel().isRollover()));
-
-                // normal, rollover, pressed, disabled
-                if (model.isArmed() && model.isPressed()) {
-                    switch (direction) {
-                        case NORTH: state = State.UPPRESSED;    break;
-                        case SOUTH: state = State.DOWNPRESSED;  break;
-                        case WEST:  state = State.LEFTPRESSED;  break;
-                        case EAST:  state = State.RIGHTPRESSED; break;
-                    }
-                } else if (!model.isEnabled()) {
-                    switch (direction) {
-                        case NORTH: state = State.UPDISABLED;    break;
-                        case SOUTH: state = State.DOWNDISABLED;  break;
-                        case WEST:  state = State.LEFTDISABLED;  break;
-                        case EAST:  state = State.RIGHTDISABLED; break;
-                    }
-                } else if (model.isRollover() || model.isPressed()) {
-                    switch (direction) {
-                        case NORTH: state = State.UPHOT;    break;
-                        case SOUTH: state = State.DOWNHOT;  break;
-                        case WEST:  state = State.LEFTHOT;  break;
-                        case EAST:  state = State.RIGHTHOT; break;
-                    }
-                } else if (jointRollover) {
-                    switch (direction) {
-                        case NORTH: state = State.UPHOVER;    break;
-                        case SOUTH: state = State.DOWNHOVER;  break;
-                        case WEST:  state = State.LEFTHOVER;  break;
-                        case EAST:  state = State.RIGHTHOVER; break;
-                    }
-                } else {
-                    switch (direction) {
-                        case NORTH: state = State.UPNORMAL;    break;
-                        case SOUTH: state = State.DOWNNORMAL;  break;
-                        case WEST:  state = State.LEFTNORMAL;  break;
-                        case EAST:  state = State.RIGHTNORMAL; break;
-                    }
-                }
-
-                skin.paintSkin(g, 0, 0, getWidth(), getHeight(), state);
-            } else {
-                super.paint(g);
-            }
-        }
-
-        public Dimension getPreferredSize() {
-            int size = 16;
-            if (scrollbar != null) {
-                switch (scrollbar.getOrientation()) {
-                case JScrollBar.VERTICAL:
-                    size = scrollbar.getWidth();
-                    break;
-                case JScrollBar.HORIZONTAL:
-                    size = scrollbar.getHeight();
-                    break;
-                }
-                size = Math.max(size, 5);
-            }
-            return new Dimension(size, size);
-        }
-    }
-
-
-    /**
-     * This should be pulled out into its own class if more classes need to
-     * use it.
-     * <p>
-     * Grid is used to draw the track for windows scrollbars. Grids
-     * are cached in a HashMap, with the key being the rgb components
-     * of the foreground/background colors. Further the Grid is held through
-     * a WeakRef so that it can be freed when no longer needed. As the
-     * Grid is rather expensive to draw, it is drawn in a BufferedImage.
-     */
-    private static class Grid {
-        private static final int BUFFER_SIZE = 64;
-        private static HashMap<String, WeakReference<Grid>> map;
-
-        private BufferedImage image;
-
-        static {
-            map = new HashMap<String, WeakReference<Grid>>();
-        }
-
-        public static Grid getGrid(Color fg, Color bg) {
-            String key = fg.getRGB() + " " + bg.getRGB();
-            WeakReference<Grid> ref = map.get(key);
-            Grid grid = (ref == null) ? null : ref.get();
-            if (grid == null) {
-                grid = new Grid(fg, bg);
-                map.put(key, new WeakReference<Grid>(grid));
-            }
-            return grid;
-        }
-
-        public Grid(Color fg, Color bg) {
-            int cmap[] = { fg.getRGB(), bg.getRGB() };
-            IndexColorModel icm = new IndexColorModel(8, 2, cmap, 0, false, -1,
-                                                      DataBuffer.TYPE_BYTE);
-            image = new BufferedImage(BUFFER_SIZE, BUFFER_SIZE,
-                                      BufferedImage.TYPE_BYTE_INDEXED, icm);
-            Graphics g = image.getGraphics();
-            try {
-                g.setClip(0, 0, BUFFER_SIZE, BUFFER_SIZE);
-                paintGrid(g, fg, bg);
-            }
-            finally {
-                g.dispose();
-            }
-        }
-
-        /**
-         * Paints the grid into the specified Graphics at the specified
-         * location.
-         */
-        public void paint(Graphics g, int x, int y, int w, int h) {
-            Rectangle clipRect = g.getClipBounds();
-            int minX = Math.max(x, clipRect.x);
-            int minY = Math.max(y, clipRect.y);
-            int maxX = Math.min(clipRect.x + clipRect.width, x + w);
-            int maxY = Math.min(clipRect.y + clipRect.height, y + h);
-
-            if (maxX <= minX || maxY <= minY) {
-                return;
-            }
-            int xOffset = (minX - x) % 2;
-            for (int xCounter = minX; xCounter < maxX;
-                 xCounter += BUFFER_SIZE) {
-                int yOffset = (minY - y) % 2;
-                int width = Math.min(BUFFER_SIZE - xOffset,
-                                     maxX - xCounter);
-
-                for (int yCounter = minY; yCounter < maxY;
-                     yCounter += BUFFER_SIZE) {
-                    int height = Math.min(BUFFER_SIZE - yOffset,
-                                          maxY - yCounter);
-
-                    g.drawImage(image, xCounter, yCounter,
-                                xCounter + width, yCounter + height,
-                                xOffset, yOffset,
-                                xOffset + width, yOffset + height, null);
-                    if (yOffset != 0) {
-                        yCounter -= yOffset;
-                        yOffset = 0;
-                    }
-                }
-                if (xOffset != 0) {
-                    xCounter -= xOffset;
-                    xOffset = 0;
-                }
-            }
-        }
-
-        /**
-         * Actually renders the grid into the Graphics <code>g</code>.
-         */
-        private void paintGrid(Graphics g, Color fg, Color bg) {
-            Rectangle clipRect = g.getClipBounds();
-            g.setColor(bg);
-            g.fillRect(clipRect.x, clipRect.y, clipRect.width,
-                       clipRect.height);
-            g.setColor(fg);
-            g.translate(clipRect.x, clipRect.y);
-            int width = clipRect.width;
-            int height = clipRect.height;
-            int xCounter = clipRect.x % 2;
-            for (int end = width - height; xCounter < end; xCounter += 2) {
-                g.drawLine(xCounter, 0, xCounter + height, height);
-            }
-            for (int end = width; xCounter < end; xCounter += 2) {
-                g.drawLine(xCounter, 0, width, width - xCounter);
-            }
-
-            int yCounter = ((clipRect.x % 2) == 0) ? 2 : 1;
-            for (int end = height - width; yCounter < end; yCounter += 2) {
-                g.drawLine(0, yCounter, width, yCounter + width);
-            }
-            for (int end = height; yCounter < end; yCounter += 2) {
-                g.drawLine(0, yCounter, height - yCounter, height);
-            }
-            g.translate(-clipRect.x, -clipRect.y);
-        }
-    }
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsScrollPaneUI.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import javax.swing.plaf.basic.*;
-import javax.swing.*;
-
-
-
-/**
- * Windows rendition of the component.
- * <p>
- * <strong>Warning:</strong>
- * Serialized objects of this class will not be compatible with
- * future Swing releases.  The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing.  A future release of Swing will provide support for
- * long term persistence.
- */
-public class WindowsScrollPaneUI extends BasicScrollPaneUI
-{}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsSeparatorUI.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import javax.swing.plaf.basic.*;
-
-/**
- * Windows Separator.
- */
-public class WindowsSeparatorUI extends BasicSeparatorUI { }
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsSliderUI.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,233 +0,0 @@
-/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import java.awt.*;
-import java.awt.event.MouseEvent;
-
-import javax.swing.plaf.*;
-import javax.swing.plaf.basic.*;
-import javax.swing.*;
-
-import static com.sun.java.swing.plaf.windows.TMSchema.*;
-import static com.sun.java.swing.plaf.windows.XPStyle.Skin;
-
-
-/**
- * Windows rendition of the component.
- * <p>
- * <strong>Warning:</strong>
- * Serialized objects of this class will not be compatible with
- * future Swing releases.  The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing.  A future release of Swing will provide support for
- * long term persistence.
- */
-public class WindowsSliderUI extends BasicSliderUI
-{
-    private boolean rollover = false;
-    private boolean pressed = false;
-
-    public WindowsSliderUI(JSlider b){
-        super(b);
-    }
-
-    public static ComponentUI createUI(JComponent b) {
-        return new WindowsSliderUI((JSlider)b);
-    }
-
-
-    /**
-     * Overrides to return a private track listener subclass which handles
-     * the HOT, PRESSED, and FOCUSED states.
-     * @since 1.6
-     */
-    protected TrackListener createTrackListener(JSlider slider) {
-        return new WindowsTrackListener();
-    }
-
-    private class WindowsTrackListener extends TrackListener {
-
-        public void mouseMoved(MouseEvent e) {
-            updateRollover(thumbRect.contains(e.getX(), e.getY()));
-            super.mouseMoved(e);
-        }
-
-        public void mouseEntered(MouseEvent e) {
-            updateRollover(thumbRect.contains(e.getX(), e.getY()));
-            super.mouseEntered(e);
-        }
-
-        public void mouseExited(MouseEvent e) {
-            updateRollover(false);
-            super.mouseExited(e);
-        }
-
-        public void mousePressed(MouseEvent e) {
-            updatePressed(thumbRect.contains(e.getX(), e.getY()));
-            super.mousePressed(e);
-        }
-
-        public void mouseReleased(MouseEvent e) {
-            updatePressed(false);
-            super.mouseReleased(e);
-        }
-
-        public void updatePressed(boolean newPressed) {
-            // You can't press a disabled slider
-            if (!slider.isEnabled()) {
-                return;
-            }
-            if (pressed != newPressed) {
-                pressed = newPressed;
-                slider.repaint(thumbRect);
-            }
-        }
-
-        public void updateRollover(boolean newRollover) {
-            // You can't have a rollover on a disabled slider
-            if (!slider.isEnabled()) {
-                return;
-            }
-            if (rollover != newRollover) {
-                rollover = newRollover;
-                slider.repaint(thumbRect);
-            }
-        }
-
-    }
-
-
-    public void paintTrack(Graphics g)  {
-        XPStyle xp = XPStyle.getXP();
-        if (xp != null) {
-            boolean vertical = (slider.getOrientation() == JSlider.VERTICAL);
-            Part part = vertical ? Part.TKP_TRACKVERT : Part.TKP_TRACK;
-            Skin skin = xp.getSkin(slider, part);
-
-            if (vertical) {
-                int x = (trackRect.width - skin.getWidth()) / 2;
-                skin.paintSkin(g, trackRect.x + x, trackRect.y,
-                               skin.getWidth(), trackRect.height, null);
-            } else {
-                int y = (trackRect.height - skin.getHeight()) / 2;
-                skin.paintSkin(g, trackRect.x, trackRect.y + y,
-                               trackRect.width, skin.getHeight(), null);
-            }
-        } else {
-            super.paintTrack(g);
-        }
-    }
-
-
-    protected void paintMinorTickForHorizSlider( Graphics g, Rectangle tickBounds, int x ) {
-        XPStyle xp = XPStyle.getXP();
-        if (xp != null) {
-            g.setColor(xp.getColor(slider, Part.TKP_TICS, null, Prop.COLOR, Color.black));
-        }
-        super.paintMinorTickForHorizSlider(g, tickBounds, x);
-    }
-
-    protected void paintMajorTickForHorizSlider( Graphics g, Rectangle tickBounds, int x ) {
-        XPStyle xp = XPStyle.getXP();
-        if (xp != null) {
-            g.setColor(xp.getColor(slider, Part.TKP_TICS, null, Prop.COLOR, Color.black));
-        }
-        super.paintMajorTickForHorizSlider(g, tickBounds, x);
-    }
-
-    protected void paintMinorTickForVertSlider( Graphics g, Rectangle tickBounds, int y ) {
-        XPStyle xp = XPStyle.getXP();
-        if (xp != null) {
-            g.setColor(xp.getColor(slider, Part.TKP_TICSVERT, null, Prop.COLOR, Color.black));
-        }
-        super.paintMinorTickForVertSlider(g, tickBounds, y);
-    }
-
-    protected void paintMajorTickForVertSlider( Graphics g, Rectangle tickBounds, int y ) {
-        XPStyle xp = XPStyle.getXP();
-        if (xp != null) {
-            g.setColor(xp.getColor(slider, Part.TKP_TICSVERT, null, Prop.COLOR, Color.black));
-        }
-        super.paintMajorTickForVertSlider(g, tickBounds, y);
-    }
-
-
-    public void paintThumb(Graphics g)  {
-        XPStyle xp = XPStyle.getXP();
-        if (xp != null) {
-            Part part = getXPThumbPart();
-            State state = State.NORMAL;
-
-            if (slider.hasFocus()) {
-                state = State.FOCUSED;
-            }
-            if (rollover) {
-                state = State.HOT;
-            }
-            if (pressed) {
-                state = State.PRESSED;
-            }
-            if(!slider.isEnabled()) {
-                state = State.DISABLED;
-            }
-
-            xp.getSkin(slider, part).paintSkin(g, thumbRect.x, thumbRect.y, state);
-        } else {
-            super.paintThumb(g);
-        }
-    }
-
-    protected Dimension getThumbSize() {
-        XPStyle xp = XPStyle.getXP();
-        if (xp != null) {
-            Dimension size = new Dimension();
-            Skin s = xp.getSkin(slider, getXPThumbPart());
-            size.width = s.getWidth();
-            size.height = s.getHeight();
-            return size;
-        } else {
-            return super.getThumbSize();
-        }
-    }
-
-    private Part getXPThumbPart() {
-        Part part;
-        boolean vertical = (slider.getOrientation() == JSlider.VERTICAL);
-        boolean leftToRight = slider.getComponentOrientation().isLeftToRight();
-        Boolean paintThumbArrowShape =
-                (Boolean)slider.getClientProperty("Slider.paintThumbArrowShape");
-        if ((!slider.getPaintTicks() && paintThumbArrowShape == null) ||
-            paintThumbArrowShape == Boolean.FALSE) {
-                part = vertical ? Part.TKP_THUMBVERT
-                                : Part.TKP_THUMB;
-        } else {
-                part = vertical ? (leftToRight ? Part.TKP_THUMBRIGHT : Part.TKP_THUMBLEFT)
-                                : Part.TKP_THUMBBOTTOM;
-        }
-        return part;
-    }
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsSpinnerUI.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +0,0 @@
-/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import java.awt.*;
-import java.awt.event.*;
-
-import javax.swing.plaf.basic.*;
-import javax.swing.plaf.*;
-import javax.swing.*;
-
-import static com.sun.java.swing.plaf.windows.TMSchema.Part;
-import static com.sun.java.swing.plaf.windows.TMSchema.State;
-import static com.sun.java.swing.plaf.windows.XPStyle.Skin;
-
-
-public class WindowsSpinnerUI extends BasicSpinnerUI {
-    public static ComponentUI createUI(JComponent c) {
-        return new WindowsSpinnerUI();
-    }
-
-    /**
-     * {@inheritDoc}
-     * @since 1.6
-     */
-    public void paint(Graphics g, JComponent c) {
-        if (XPStyle.getXP() != null) {
-            paintXPBackground(g, c);
-        }
-        super.paint(g,c);
-    }
-
-    private State getXPState(JComponent c) {
-        State state = State.NORMAL;
-        if (!c.isEnabled()) {
-            state = State.DISABLED;
-        }
-        return state;
-    }
-
-    private void paintXPBackground(Graphics g, JComponent c) {
-        XPStyle xp = XPStyle.getXP();
-        if (xp == null) {
-            return;
-        }
-        Skin skin = xp.getSkin(c, Part.EP_EDIT);
-        State state = getXPState(c);
-        skin.paintSkin(g, 0, 0, c.getWidth(), c.getHeight(), state);
-    }
-
-    protected Component createPreviousButton() {
-        if (XPStyle.getXP() != null) {
-            JButton xpButton = new XPStyle.GlyphButton(spinner, Part.SPNP_DOWN);
-            Dimension size = UIManager.getDimension("Spinner.arrowButtonSize");
-            xpButton.setPreferredSize(size);
-            xpButton.setRequestFocusEnabled(false);
-            installPreviousButtonListeners(xpButton);
-            return xpButton;
-        }
-        return super.createPreviousButton();
-    }
-
-    protected Component createNextButton() {
-        if (XPStyle.getXP() != null) {
-            JButton xpButton = new XPStyle.GlyphButton(spinner, Part.SPNP_UP);
-            Dimension size = UIManager.getDimension("Spinner.arrowButtonSize");
-            xpButton.setPreferredSize(size);
-            xpButton.setRequestFocusEnabled(false);
-            installNextButtonListeners(xpButton);
-            return xpButton;
-        }
-        return super.createNextButton();
-    }
-
-    private UIResource getUIResource(Object[] listeners) {
-        for (int counter = 0; counter < listeners.length; counter++) {
-            if (listeners[counter] instanceof UIResource) {
-                return (UIResource)listeners[counter];
-            }
-        }
-        return null;
-    }
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsSplitPaneDivider.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import java.awt.*;
-import javax.swing.JSplitPane;
-import javax.swing.UIManager;
-import javax.swing.plaf.basic.BasicSplitPaneUI;
-import javax.swing.plaf.basic.BasicSplitPaneDivider;
-
-
-/**
- * Divider used for Windows split pane.
- * <p>
- * <strong>Warning:</strong>
- * Serialized objects of this class will not be compatible with
- * future Swing releases.  The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing.  A future release of Swing will provide support for
- * long term persistence.
- *
- * @author Jeff Dinkins
- */
-@SuppressWarnings("serial") // Superclass is not serializable across versions
-public class WindowsSplitPaneDivider extends BasicSplitPaneDivider
-{
-
-    /**
-     * Creates a new Windows SplitPaneDivider
-     */
-    public WindowsSplitPaneDivider(BasicSplitPaneUI ui) {
-        super(ui);
-    }
-
-    /**
-      * Paints the divider.
-      */
-    public void paint(Graphics g) {
-        Color bgColor = (splitPane.hasFocus()) ?
-                            UIManager.getColor("SplitPane.shadow") :
-                            getBackground();
-        Dimension size = getSize();
-
-        if(bgColor != null) {
-            g.setColor(bgColor);
-            g.fillRect(0, 0, size.width, size.height);
-        }
-        super.paint(g);
-    }
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsSplitPaneUI.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import javax.swing.plaf.basic.*;
-import javax.swing.*;
-
-import javax.swing.plaf.basic.BasicSplitPaneUI;
-import javax.swing.plaf.basic.BasicSplitPaneDivider;
-import javax.swing.plaf.*;
-
-
-/**
- * Windows rendition of the component.
- * <p>
- * <strong>Warning:</strong>
- * Serialized objects of this class will not be compatible with
- * future Swing releases.  The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing.  A future release of Swing will provide support for
- * long term persistence.
- */
-public class WindowsSplitPaneUI extends BasicSplitPaneUI
-{
-
-    public WindowsSplitPaneUI() {
-        super();
-    }
-
-    /**
-      * Creates a new WindowsSplitPaneUI instance
-      */
-    public static ComponentUI createUI(JComponent x) {
-        return new WindowsSplitPaneUI();
-    }
-
-    /**
-      * Creates the default divider.
-      */
-    public BasicSplitPaneDivider createDefaultDivider() {
-        return new WindowsSplitPaneDivider(this);
-    }
-
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsTabbedPaneUI.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,228 +0,0 @@
-/*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import java.awt.*;
-
-import javax.swing.plaf.basic.*;
-import javax.swing.plaf.*;
-import javax.swing.*;
-import java.util.Set;
-import java.util.HashSet;
-import java.awt.event.*;
-
-import static com.sun.java.swing.plaf.windows.TMSchema.*;
-import static com.sun.java.swing.plaf.windows.XPStyle.Skin;
-
-
-/**
- * Windows rendition of the component.
- * <p>
- * <strong>Warning:</strong>
- * Serialized objects of this class will not be compatible with
- * future Swing releases.  The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing.  A future release of Swing will provide support for
- * long term persistence.
- */
-public class WindowsTabbedPaneUI extends BasicTabbedPaneUI {
-    /**
-     * Keys to use for forward focus traversal when the JComponent is
-     * managing focus.
-     */
-    private static Set<KeyStroke> managingFocusForwardTraversalKeys;
-
-    /**
-     * Keys to use for backward focus traversal when the JComponent is
-     * managing focus.
-     */
-    private static Set<KeyStroke> managingFocusBackwardTraversalKeys;
-
-    private boolean contentOpaque = true;
-
-    @SuppressWarnings("deprecation")
-    protected void installDefaults() {
-        super.installDefaults();
-        contentOpaque = UIManager.getBoolean("TabbedPane.contentOpaque");
-
-        // focus forward traversal key
-        if (managingFocusForwardTraversalKeys==null) {
-            managingFocusForwardTraversalKeys = new HashSet<KeyStroke>();
-            managingFocusForwardTraversalKeys.add(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0));
-        }
-        tabPane.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, managingFocusForwardTraversalKeys);
-        // focus backward traversal key
-        if (managingFocusBackwardTraversalKeys==null) {
-            managingFocusBackwardTraversalKeys = new HashSet<KeyStroke>();
-            managingFocusBackwardTraversalKeys.add( KeyStroke.getKeyStroke(KeyEvent.VK_TAB, InputEvent.SHIFT_MASK));
-        }
-        tabPane.setFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, managingFocusBackwardTraversalKeys);
-    }
-
-    protected void uninstallDefaults() {
-        // sets the focus forward and backward traversal keys to null
-        // to restore the defaults
-        tabPane.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, null);
-        tabPane.setFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, null);
-        super.uninstallDefaults();
-    }
-
-    public static ComponentUI createUI(JComponent c) {
-        return new WindowsTabbedPaneUI();
-    }
-
-    protected void setRolloverTab(int index) {
-        // Rollover is only supported on XP
-        if (XPStyle.getXP() != null) {
-            int oldRolloverTab = getRolloverTab();
-            super.setRolloverTab(index);
-            Rectangle r1 = null;
-            Rectangle r2 = null;
-            if ( (oldRolloverTab >= 0) && (oldRolloverTab < tabPane.getTabCount()) ) {
-                r1 = getTabBounds(tabPane, oldRolloverTab);
-            }
-            if (index >= 0) {
-                r2 = getTabBounds(tabPane, index);
-            }
-            if (r1 != null) {
-                if (r2 != null) {
-                    tabPane.repaint(r1.union(r2));
-                } else {
-                    tabPane.repaint(r1);
-                }
-            } else if (r2 != null) {
-                tabPane.repaint(r2);
-            }
-        }
-    }
-
-    protected void paintContentBorder(Graphics g, int tabPlacement, int selectedIndex) {
-        XPStyle xp = XPStyle.getXP();
-        if (xp != null && (contentOpaque || tabPane.isOpaque())) {
-            Skin skin = xp.getSkin(tabPane, Part.TABP_PANE);
-            if (skin != null) {
-                Insets insets = tabPane.getInsets();
-                // Note: don't call getTabAreaInsets(), because it causes rotation.
-                // Make sure "TabbedPane.tabsOverlapBorder" is set to true in WindowsLookAndFeel
-                Insets tabAreaInsets = UIManager.getInsets("TabbedPane.tabAreaInsets");
-                int x = insets.left;
-                int y = insets.top;
-                int w = tabPane.getWidth() - insets.right - insets.left;
-                int h = tabPane.getHeight() - insets.top - insets.bottom;
-
-                // Expand area by tabAreaInsets.bottom to allow tabs to overlap onto the border.
-                if (tabPlacement == LEFT || tabPlacement == RIGHT) {
-                    int tabWidth = calculateTabAreaWidth(tabPlacement, runCount, maxTabWidth);
-                    if (tabPlacement == LEFT) {
-                        x += (tabWidth - tabAreaInsets.bottom);
-                    }
-                    w -= (tabWidth - tabAreaInsets.bottom);
-                } else {
-                    int tabHeight = calculateTabAreaHeight(tabPlacement, runCount, maxTabHeight);
-                    if (tabPlacement == TOP) {
-                        y += (tabHeight - tabAreaInsets.bottom);
-                    }
-                    h -= (tabHeight - tabAreaInsets.bottom);
-                }
-
-                paintRotatedSkin(g, skin, tabPlacement, x, y, w, h, null);
-                return;
-            }
-        }
-        super.paintContentBorder(g, tabPlacement, selectedIndex);
-    }
-
-    protected void paintTabBackground(Graphics g, int tabPlacement, int tabIndex,
-                                      int x, int y, int w, int h, boolean isSelected ) {
-        if (XPStyle.getXP() == null) {
-            super.paintTabBackground(g, tabPlacement, tabIndex, x, y, w, h, isSelected);
-        }
-    }
-
-    protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex,
-                                  int x, int y, int w, int h, boolean isSelected ) {
-        XPStyle xp = XPStyle.getXP();
-        if (xp != null) {
-            Part part;
-
-            int tabCount = tabPane.getTabCount();
-            int tabRun = getRunForTab(tabCount, tabIndex);
-            if (tabRuns[tabRun] == tabIndex) {
-                part = Part.TABP_TABITEMLEFTEDGE;
-            } else if (tabCount > 1 && lastTabInRun(tabCount, tabRun) == tabIndex) {
-                part = Part.TABP_TABITEMRIGHTEDGE;
-                if (isSelected) {
-                    // Align with right edge
-                    if (tabPlacement == TOP || tabPlacement == BOTTOM) {
-                        w++;
-                    } else {
-                        h++;
-                    }
-                }
-            } else {
-                part = Part.TABP_TABITEM;
-            }
-
-            State state = State.NORMAL;
-            if (isSelected) {
-                state = State.SELECTED;
-            } else if (tabIndex == getRolloverTab()) {
-                state = State.HOT;
-            }
-
-            paintRotatedSkin(g, xp.getSkin(tabPane, part), tabPlacement, x, y, w, h, state);
-        } else {
-            super.paintTabBorder(g, tabPlacement, tabIndex, x, y, w, h, isSelected);
-        }
-    }
-
-    private void paintRotatedSkin(Graphics g, Skin skin, int tabPlacement,
-                                  int x, int y, int w, int h, State state) {
-        Graphics2D g2d = (Graphics2D)g.create();
-        g2d.translate(x, y);
-        switch (tabPlacement) {
-           case RIGHT:  g2d.translate(w, 0);
-                        g2d.rotate(Math.toRadians(90.0));
-                        skin.paintSkin(g2d, 0, 0, h, w, state);
-                        break;
-
-           case LEFT:   g2d.scale(-1.0, 1.0);
-                        g2d.rotate(Math.toRadians(90.0));
-                        skin.paintSkin(g2d, 0, 0, h, w, state);
-                        break;
-
-           case BOTTOM: g2d.translate(0, h);
-                        g2d.scale(-1.0, 1.0);
-                        g2d.rotate(Math.toRadians(180.0));
-                        skin.paintSkin(g2d, 0, 0, w, h, state);
-                        break;
-
-           case TOP:
-           default:     skin.paintSkin(g2d, 0, 0, w, h, state);
-        }
-        g2d.dispose();
-    }
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsTableHeaderUI.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,247 +0,0 @@
-/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import java.awt.*;
-import javax.swing.*;
-import javax.swing.border.*;
-import javax.swing.plaf.*;
-import javax.swing.plaf.basic.*;
-import javax.swing.table.*;
-
-import static com.sun.java.swing.plaf.windows.TMSchema.*;
-import static com.sun.java.swing.plaf.windows.XPStyle.*;
-import sun.swing.table.*;
-import sun.swing.SwingUtilities2;
-
-
-public class WindowsTableHeaderUI extends BasicTableHeaderUI {
-    private TableCellRenderer originalHeaderRenderer;
-
-    public static ComponentUI createUI(JComponent h) {
-        return new WindowsTableHeaderUI();
-    }
-
-    public void installUI(JComponent c) {
-        super.installUI(c);
-
-        if (XPStyle.getXP() != null) {
-            originalHeaderRenderer = header.getDefaultRenderer();
-            if (originalHeaderRenderer instanceof UIResource) {
-                header.setDefaultRenderer(new XPDefaultRenderer());
-            }
-        }
-    }
-
-    public void uninstallUI(JComponent c) {
-        if (header.getDefaultRenderer() instanceof XPDefaultRenderer) {
-            header.setDefaultRenderer(originalHeaderRenderer);
-        }
-        super.uninstallUI(c);
-    }
-
-    @Override
-    protected void rolloverColumnUpdated(int oldColumn, int newColumn) {
-        if (XPStyle.getXP() != null) {
-            header.repaint(header.getHeaderRect(oldColumn));
-            header.repaint(header.getHeaderRect(newColumn));
-        }
-    }
-
-    @SuppressWarnings("serial") // JDK-implementation class
-    private class XPDefaultRenderer extends DefaultTableCellHeaderRenderer {
-        Skin skin;
-        boolean isSelected, hasFocus, hasRollover;
-        int column;
-
-        XPDefaultRenderer() {
-            setHorizontalAlignment(LEADING);
-        }
-
-        public Component getTableCellRendererComponent(JTable table, Object value,
-                                                       boolean isSelected, boolean hasFocus,
-                                                       int row, int column) {
-            super.getTableCellRendererComponent(table, value, isSelected,
-                                                hasFocus, row, column);
-            this.isSelected = isSelected;
-            this.hasFocus = hasFocus;
-            this.column = column;
-            this.hasRollover = (column == getRolloverColumn());
-            if (skin == null) {
-                XPStyle xp = XPStyle.getXP();
-                skin = (xp != null) ? xp.getSkin(header, Part.HP_HEADERITEM) : null;
-            }
-            Insets margins = (skin != null) ? skin.getContentMargin() : null;
-            Border border = null;
-            int contentTop = 0;
-            int contentLeft = 0;
-            int contentBottom = 0;
-            int contentRight = 0;
-            if (margins != null) {
-                contentTop = margins.top;
-                contentLeft = margins.left;
-                contentBottom = margins.bottom;
-                contentRight = margins.right;
-            }
-            /* idk:
-             * Both on Vista and XP there is some offset to the
-             * HP_HEADERITEM content. It does not seem to come from
-             * Prop.CONTENTMARGINS. Do not know where it is defined.
-             * using some hardcoded values.
-             */
-            contentLeft += 5;
-            contentBottom += 4;
-            contentRight += 5;
-
-            /* On Vista sortIcon is painted above the header's text.
-             * We use border to paint it.
-             */
-            Icon sortIcon;
-            if (WindowsLookAndFeel.isOnVista()
-                && ((sortIcon = getIcon()) instanceof javax.swing.plaf.UIResource
-                    || sortIcon == null)) {
-                contentTop += 1;
-                setIcon(null);
-                sortIcon = null;
-                SortOrder sortOrder =
-                    getColumnSortOrder(table, column);
-                if (sortOrder != null) {
-                    switch (sortOrder) {
-                    case ASCENDING:
-                        sortIcon =
-                            UIManager.getIcon("Table.ascendingSortIcon");
-                        break;
-                    case DESCENDING:
-                        sortIcon =
-                            UIManager.getIcon("Table.descendingSortIcon");
-                        break;
-                    }
-                }
-                if (sortIcon != null) {
-                    contentBottom = sortIcon.getIconHeight();
-                    border = new IconBorder(sortIcon, contentTop, contentLeft,
-                                            contentBottom, contentRight);
-                } else {
-                    sortIcon =
-                        UIManager.getIcon("Table.ascendingSortIcon");
-                    int sortIconHeight =
-                        (sortIcon != null) ? sortIcon.getIconHeight() : 0;
-                    if (sortIconHeight != 0) {
-                        contentBottom = sortIconHeight;
-                    }
-                    border =
-                        new EmptyBorder(
-                            sortIconHeight + contentTop, contentLeft,
-                            contentBottom, contentRight);
-                }
-            } else {
-                contentTop += 3;
-                border = new EmptyBorder(contentTop, contentLeft,
-                                         contentBottom, contentRight);
-            }
-            setBorder(border);
-            return this;
-        }
-
-        public void paint(Graphics g) {
-            Dimension size = getSize();
-            State state = State.NORMAL;
-            TableColumn draggedColumn = header.getDraggedColumn();
-            if (draggedColumn != null &&
-                    column == SwingUtilities2.convertColumnIndexToView(
-                            header.getColumnModel(), draggedColumn.getModelIndex())) {
-                state = State.PRESSED;
-            } else if (isSelected || hasFocus || hasRollover) {
-                state = State.HOT;
-            }
-            /* on Vista there are more states for sorted columns */
-            if (WindowsLookAndFeel.isOnVista()) {
-                SortOrder sortOrder = getColumnSortOrder(header.getTable(), column);
-                if (sortOrder != null) {
-                     switch(sortOrder) {
-                     case ASCENDING:
-                     case DESCENDING:
-                         switch (state) {
-                         case NORMAL:
-                             state = State.SORTEDNORMAL;
-                             break;
-                         case PRESSED:
-                             state = State.SORTEDPRESSED;
-                             break;
-                         case HOT:
-                             state = State.SORTEDHOT;
-                             break;
-                         default:
-                             /* do nothing */
-                         }
-                         break;
-                     default :
-                         /* do nothing */
-                     }
-                }
-            }
-            skin.paintSkin(g, 0, 0, size.width-1, size.height-1, state);
-            super.paint(g);
-        }
-    }
-
-    /**
-     * A border with an Icon at the middle of the top side.
-     * Outer insets can be provided for this border.
-     */
-    private static class IconBorder implements Border, UIResource{
-        private final Icon icon;
-        private final int top;
-        private final int left;
-        private final int bottom;
-        private final int right;
-        /**
-         * Creates this border;
-         * @param icon - icon to paint for this border
-         * @param top, left, bottom, right - outer insets for this border
-         */
-        public IconBorder(Icon icon, int top, int left,
-                          int bottom, int right) {
-            this.icon = icon;
-            this.top = top;
-            this.left = left;
-            this.bottom = bottom;
-            this.right = right;
-        }
-        public Insets getBorderInsets(Component c) {
-            return new Insets(icon.getIconHeight() + top, left, bottom, right);
-        }
-        public boolean isBorderOpaque() {
-            return false;
-        }
-        public void paintBorder(Component c, Graphics g, int x, int y,
-                                int width, int height) {
-            icon.paintIcon(c, g,
-                x + left + (width - left - right - icon.getIconWidth()) / 2,
-                y + top);
-        }
-    }
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsTextAreaUI.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import javax.swing.plaf.*;
-import javax.swing.plaf.basic.*;
-import javax.swing.*;
-import javax.swing.text.Caret;
-
-
-
-/**
- * Windows rendition of the component.
- * <p>
- * <strong>Warning:</strong>
- * Serialized objects of this class will not be compatible with
- * future Swing releases.  The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing.  A future release of Swing will provide support for
- * long term persistence.
- */
-public class WindowsTextAreaUI extends BasicTextAreaUI {
-    /**
-     * Creates the object to use for a caret.  By default an
-     * instance of WindowsCaret is created.  This method
-     * can be redefined to provide something else that implements
-     * the InputPosition interface or a subclass of DefaultCaret.
-     *
-     * @return the caret object
-     */
-    protected Caret createCaret() {
-        return new WindowsTextUI.WindowsCaret();
-    }
-
-    /**
-     * Creates a UI for a JTextField.
-     *
-     * @param c the text field
-     * @return the UI
-     */
-    public static ComponentUI createUI(JComponent c) {
-        return new WindowsTextAreaUI();
-    }
-
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsTextFieldUI.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,177 +0,0 @@
-/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import java.awt.*;
-import java.awt.event.*;
-import java.beans.PropertyChangeEvent;
-import javax.swing.plaf.*;
-import javax.swing.plaf.basic.BasicTextFieldUI;
-import javax.swing.text.*;
-import javax.swing.*;
-import javax.swing.plaf.UIResource;
-import sun.swing.DefaultLookup;
-
-
-
-/**
- * Provides the Windows look and feel for a text field.  This
- * is basically the following customizations to the default
- * look-and-feel.
- * <ul>
- * <li>The border is beveled (using the standard control color).
- * <li>The background is white by default.
- * <li>The highlight color is a dark color, blue by default.
- * <li>The foreground color is high contrast in the selected
- *  area, white by default.  The unselected foreground is black.
- * <li>The cursor blinks at about 1/2 second intervals.
- * <li>The entire value is selected when focus is gained.
- * <li>Shift-left-arrow and shift-right-arrow extend selection
- * <li>Ctrl-left-arrow and ctrl-right-arrow act like home and
- *   end respectively.
- * </ul>
- * <p>
- * <strong>Warning:</strong>
- * Serialized objects of this class will not be compatible with
- * future Swing releases.  The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing.  A future release of Swing will provide support for
- * long term persistence.
- *
- * @author  Timothy Prinzing
- */
-public class WindowsTextFieldUI extends BasicTextFieldUI
-{
-    /**
-     * Creates a UI for a JTextField.
-     *
-     * @param c the text field
-     * @return the UI
-     */
-    public static ComponentUI createUI(JComponent c) {
-        return new WindowsTextFieldUI();
-    }
-
-    /**
-     * Paints a background for the view.  This will only be
-     * called if isOpaque() on the associated component is
-     * true.  The default is to paint the background color
-     * of the component.
-     *
-     * @param g the graphics context
-     */
-    protected void paintBackground(Graphics g) {
-        super.paintBackground(g);
-    }
-
-    /**
-     * Creates the caret for a field.
-     *
-     * @return the caret
-     */
-    protected Caret createCaret() {
-        return new WindowsFieldCaret();
-    }
-
-    /**
-     * WindowsFieldCaret has different scrolling behavior than
-     * DefaultCaret.
-     */
-    @SuppressWarnings("serial") // Superclass is not serializable across versions
-    static class WindowsFieldCaret extends DefaultCaret implements UIResource {
-
-        public WindowsFieldCaret() {
-            super();
-        }
-
-        /**
-         * Adjusts the visibility of the caret according to
-         * the windows feel which seems to be to move the
-         * caret out into the field by about a quarter of
-         * a field length if not visible.
-         */
-        protected void adjustVisibility(Rectangle r) {
-            SwingUtilities.invokeLater(new SafeScroller(r));
-        }
-
-        /**
-         * Gets the painter for the Highlighter.
-         *
-         * @return the painter
-         */
-        protected Highlighter.HighlightPainter getSelectionPainter() {
-            return WindowsTextUI.WindowsPainter;
-        }
-
-
-        private class SafeScroller implements Runnable {
-            SafeScroller(Rectangle r) {
-                this.r = r;
-            }
-
-            @SuppressWarnings("deprecation")
-            public void run() {
-                JTextField field = (JTextField) getComponent();
-                if (field != null) {
-                    TextUI ui = field.getUI();
-                    int dot = getDot();
-                    // PENDING: We need to expose the bias in DefaultCaret.
-                    Position.Bias bias = Position.Bias.Forward;
-                    Rectangle startRect = null;
-                    try {
-                        startRect = ui.modelToView(field, dot, bias);
-                    } catch (BadLocationException ble) {}
-
-                    Insets i = field.getInsets();
-                    BoundedRangeModel vis = field.getHorizontalVisibility();
-                    int x = r.x + vis.getValue() - i.left;
-                    int quarterSpan = vis.getExtent() / 4;
-                    if (r.x < i.left) {
-                        vis.setValue(x - quarterSpan);
-                    } else if (r.x + r.width > i.left + vis.getExtent()) {
-                        vis.setValue(x - (3 * quarterSpan));
-                    }
-                    // If we scroll, our visual location will have changed,
-                    // but we won't have updated our internal location as
-                    // the model hasn't changed. This checks for the change,
-                    // and if necessary, resets the internal location.
-                    if (startRect != null) {
-                        try {
-                            Rectangle endRect;
-                            endRect = ui.modelToView(field, dot, bias);
-                            if (endRect != null && !endRect.equals(startRect)){
-                                damage(endRect);
-                            }
-                        } catch (BadLocationException ble) {}
-                    }
-                }
-            }
-
-            private Rectangle r;
-        }
-    }
-
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsTextPaneUI.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import javax.swing.plaf.*;
-import javax.swing.plaf.basic.*;
-import javax.swing.*;
-import javax.swing.text.Caret;
-
-
-/**
- * Windows rendition of the component.
- * <p>
- * <strong>Warning:</strong>
- * Serialized objects of this class will not be compatible with
- * future Swing releases.  The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing.  A future release of Swing will provide support for
- * long term persistence.
- */
-public class WindowsTextPaneUI extends BasicTextPaneUI
-{
-    /**
-     * Creates a UI for a JTextPane.
-     *
-     * @param c the styled text component
-     * @return the UI
-     */
-    public static ComponentUI createUI(JComponent c) {
-        return new WindowsTextPaneUI();
-    }
-
-    /**
-     * Creates the object to use for a caret.  By default an
-     * instance of WindowsCaret is created.  This method
-     * can be redefined to provide something else that implements
-     * the InputPosition interface or a subclass of DefaultCaret.
-     *
-     * @return the caret object
-     */
-    protected Caret createCaret() {
-        return new WindowsTextUI.WindowsCaret();
-    }
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsTextUI.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,238 +0,0 @@
-/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import java.awt.Color;
-import java.awt.Graphics;
-import java.awt.Rectangle;
-import java.awt.Shape;
-import javax.swing.plaf.basic.*;
-import javax.swing.*;
-import javax.swing.plaf.TextUI;
-import javax.swing.plaf.UIResource;
-import javax.swing.text.*;
-
-/**
- * Windows text rendering.
- * <p>
- * <strong>Warning:</strong>
- * Serialized objects of this class will not be compatible with
- * future Swing releases.  The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing.  A future release of Swing will provide support for
- * long term persistence.
- */
-public abstract class WindowsTextUI extends BasicTextUI {
-    /**
-     * Creates the object to use for a caret.  By default an
-     * instance of WindowsCaret is created.  This method
-     * can be redefined to provide something else that implements
-     * the InputPosition interface or a subclass of DefaultCaret.
-     *
-     * @return the caret object
-     */
-    protected Caret createCaret() {
-        return new WindowsCaret();
-    }
-
-    /* public */
-    static LayeredHighlighter.LayerPainter WindowsPainter = new WindowsHighlightPainter(null);
-
-    /* public */
-    @SuppressWarnings("serial") // Superclass is not serializable across versions
-    static class WindowsCaret extends DefaultCaret
-                     implements UIResource {
-        /**
-         * Gets the painter for the Highlighter.
-         *
-         * @return the painter
-         */
-        protected Highlighter.HighlightPainter getSelectionPainter() {
-            return WindowsTextUI.WindowsPainter;
-        }
-    }
-
-    /* public */
-    static class WindowsHighlightPainter extends
-                     DefaultHighlighter.DefaultHighlightPainter {
-        WindowsHighlightPainter(Color c) {
-            super(c);
-        }
-
-        // --- HighlightPainter methods ---------------------------------------
-
-        /**
-         * Paints a highlight.
-         *
-         * @param g the graphics context
-         * @param offs0 the starting model offset >= 0
-         * @param offs1 the ending model offset >= offs1
-         * @param bounds the bounding box for the highlight
-         * @param c the editor
-         */
-        @SuppressWarnings("deprecation")
-        public void paint(Graphics g, int offs0, int offs1, Shape bounds, JTextComponent c) {
-            Rectangle alloc = bounds.getBounds();
-            try {
-                // --- determine locations ---
-                TextUI mapper = c.getUI();
-                Rectangle p0 = mapper.modelToView(c, offs0);
-                Rectangle p1 = mapper.modelToView(c, offs1);
-
-                // --- render ---
-                Color color = getColor();
-
-                if (color == null) {
-                    g.setColor(c.getSelectionColor());
-                }
-                else {
-                    g.setColor(color);
-                }
-                boolean firstIsDot = false;
-                boolean secondIsDot = false;
-                if (c.isEditable()) {
-                    int dot = c.getCaretPosition();
-                    firstIsDot = (offs0 == dot);
-                    secondIsDot = (offs1 == dot);
-                }
-                if (p0.y == p1.y) {
-                    // same line, render a rectangle
-                    Rectangle r = p0.union(p1);
-                    if (r.width > 0) {
-                        if (firstIsDot) {
-                            r.x++;
-                            r.width--;
-                        }
-                        else if (secondIsDot) {
-                            r.width--;
-                        }
-                    }
-                    g.fillRect(r.x, r.y, r.width, r.height);
-                } else {
-                    // different lines
-                    int p0ToMarginWidth = alloc.x + alloc.width - p0.x;
-                    if (firstIsDot && p0ToMarginWidth > 0) {
-                        p0.x++;
-                        p0ToMarginWidth--;
-                    }
-                    g.fillRect(p0.x, p0.y, p0ToMarginWidth, p0.height);
-                    if ((p0.y + p0.height) != p1.y) {
-                        g.fillRect(alloc.x, p0.y + p0.height, alloc.width,
-                                   p1.y - (p0.y + p0.height));
-                    }
-                    if (secondIsDot && p1.x > alloc.x) {
-                        p1.x--;
-                    }
-                    g.fillRect(alloc.x, p1.y, (p1.x - alloc.x), p1.height);
-                }
-            } catch (BadLocationException e) {
-                // can't render
-            }
-        }
-
-        // --- LayerPainter methods ----------------------------
-        /**
-         * Paints a portion of a highlight.
-         *
-         * @param g the graphics context
-         * @param offs0 the starting model offset >= 0
-         * @param offs1 the ending model offset >= offs1
-         * @param bounds the bounding box of the view, which is not
-         *        necessarily the region to paint.
-         * @param c the editor
-         * @param view View painting for
-         * @return region drawing occurred in
-         */
-        public Shape paintLayer(Graphics g, int offs0, int offs1,
-                                Shape bounds, JTextComponent c, View view) {
-            Color color = getColor();
-
-            if (color == null) {
-                g.setColor(c.getSelectionColor());
-            }
-            else {
-                g.setColor(color);
-            }
-            boolean firstIsDot = false;
-            boolean secondIsDot = false;
-            if (c.isEditable()) {
-                int dot = c.getCaretPosition();
-                firstIsDot = (offs0 == dot);
-                secondIsDot = (offs1 == dot);
-            }
-            if (offs0 == view.getStartOffset() &&
-                offs1 == view.getEndOffset()) {
-                // Contained in view, can just use bounds.
-                Rectangle alloc;
-                if (bounds instanceof Rectangle) {
-                    alloc = (Rectangle)bounds;
-                }
-                else {
-                    alloc = bounds.getBounds();
-                }
-                if (firstIsDot && alloc.width > 0) {
-                    g.fillRect(alloc.x + 1, alloc.y, alloc.width - 1,
-                               alloc.height);
-                }
-                else if (secondIsDot && alloc.width > 0) {
-                    g.fillRect(alloc.x, alloc.y, alloc.width - 1,
-                               alloc.height);
-                }
-                else {
-                    g.fillRect(alloc.x, alloc.y, alloc.width, alloc.height);
-                }
-                return alloc;
-            }
-            else {
-                // Should only render part of View.
-                try {
-                    // --- determine locations ---
-                    Shape shape = view.modelToView(offs0, Position.Bias.Forward,
-                                                   offs1,Position.Bias.Backward,
-                                                   bounds);
-                    Rectangle r = (shape instanceof Rectangle) ?
-                                  (Rectangle)shape : shape.getBounds();
-                    if (firstIsDot && r.width > 0) {
-                        g.fillRect(r.x + 1, r.y, r.width - 1, r.height);
-                    }
-                    else if (secondIsDot && r.width > 0) {
-                        g.fillRect(r.x, r.y, r.width - 1, r.height);
-                    }
-                    else {
-                        g.fillRect(r.x, r.y, r.width, r.height);
-                    }
-                    return r;
-                } catch (BadLocationException e) {
-                    // can't render
-                }
-            }
-            // Only if exception
-            return null;
-        }
-
-    }
-
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsToggleButtonUI.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,181 +0,0 @@
-/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import sun.awt.AppContext;
-
-import javax.swing.plaf.basic.*;
-import javax.swing.border.*;
-import javax.swing.plaf.*;
-import javax.swing.*;
-
-import java.awt.*;
-import java.beans.PropertyChangeEvent;
-
-
-
-/**
- * A Windows toggle button.
- * <p>
- * <strong>Warning:</strong>
- * Serialized objects of this class will not be compatible with
- * future Swing releases.  The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing.  A future release of Swing will provide support for
- * long term persistence.
- *
- * @author Jeff Dinkins
- */
-public class WindowsToggleButtonUI extends BasicToggleButtonUI
-{
-    protected int dashedRectGapX;
-    protected int dashedRectGapY;
-    protected int dashedRectGapWidth;
-    protected int dashedRectGapHeight;
-
-    protected Color focusColor;
-
-    private static final Object WINDOWS_TOGGLE_BUTTON_UI_KEY = new Object();
-
-    private boolean defaults_initialized = false;
-
-    public static ComponentUI createUI(JComponent b) {
-        AppContext appContext = AppContext.getAppContext();
-        WindowsToggleButtonUI windowsToggleButtonUI =
-                (WindowsToggleButtonUI) appContext.get(WINDOWS_TOGGLE_BUTTON_UI_KEY);
-        if (windowsToggleButtonUI == null) {
-            windowsToggleButtonUI = new WindowsToggleButtonUI();
-            appContext.put(WINDOWS_TOGGLE_BUTTON_UI_KEY, windowsToggleButtonUI);
-        }
-        return windowsToggleButtonUI;
-    }
-
-
-    // ********************************
-    //            Defaults
-    // ********************************
-    protected void installDefaults(AbstractButton b) {
-        super.installDefaults(b);
-        if(!defaults_initialized) {
-            String pp = getPropertyPrefix();
-            dashedRectGapX = ((Integer)UIManager.get("Button.dashedRectGapX")).intValue();
-            dashedRectGapY = ((Integer)UIManager.get("Button.dashedRectGapY")).intValue();
-            dashedRectGapWidth = ((Integer)UIManager.get("Button.dashedRectGapWidth")).intValue();
-            dashedRectGapHeight = ((Integer)UIManager.get("Button.dashedRectGapHeight")).intValue();
-            focusColor = UIManager.getColor(pp + "focus");
-            defaults_initialized = true;
-        }
-
-        XPStyle xp = XPStyle.getXP();
-        if (xp != null) {
-            b.setBorder(xp.getBorder(b, WindowsButtonUI.getXPButtonType(b)));
-            LookAndFeel.installProperty(b, "opaque", Boolean.FALSE);
-            LookAndFeel.installProperty(b, "rolloverEnabled", Boolean.TRUE);
-        }
-    }
-
-    protected void uninstallDefaults(AbstractButton b) {
-        super.uninstallDefaults(b);
-        defaults_initialized = false;
-    }
-
-
-    protected Color getFocusColor() {
-        return focusColor;
-    }
-
-
-    // ********************************
-    //         Paint Methods
-    // ********************************
-
-    private transient Color cachedSelectedColor = null;
-    private transient Color cachedBackgroundColor = null;
-    private transient Color cachedHighlightColor = null;
-
-    protected void paintButtonPressed(Graphics g, AbstractButton b) {
-        if (XPStyle.getXP() == null && b.isContentAreaFilled()) {
-            Color oldColor = g.getColor();
-            Color c1 = b.getBackground();
-            Color c2 = UIManager.getColor("ToggleButton.highlight");
-            if (c1 != cachedBackgroundColor || c2 != cachedHighlightColor) {
-                int r1 = c1.getRed(), r2 = c2.getRed();
-                int g1 = c1.getGreen(), g2 = c2.getGreen();
-                int b1 = c1.getBlue(), b2 = c2.getBlue();
-                cachedSelectedColor = new Color(
-                        Math.min(r1, r2) + Math.abs(r1 - r2) / 2,
-                        Math.min(g1, g2) + Math.abs(g1 - g2) / 2,
-                        Math.min(b1, b2) + Math.abs(b1 - b2) / 2
-                );
-                cachedBackgroundColor = c1;
-                cachedHighlightColor = c2;
-            }
-            g.setColor(cachedSelectedColor);
-            g.fillRect(0, 0, b.getWidth(), b.getHeight());
-            g.setColor(oldColor);
-        }
-    }
-
-    public void paint(Graphics g, JComponent c) {
-        if (XPStyle.getXP() != null) {
-            WindowsButtonUI.paintXPButtonBackground(g, c);
-        }
-        super.paint(g, c);
-    }
-
-
-    /**
-     * Overridden method to render the text without the mnemonic
-     */
-    protected void paintText(Graphics g, AbstractButton b, Rectangle textRect, String text) {
-        WindowsGraphicsUtils.paintText(g, b, textRect, text, getTextShiftOffset());
-    }
-
-    protected void paintFocus(Graphics g, AbstractButton b,
-                              Rectangle viewRect, Rectangle textRect, Rectangle iconRect) {
-        g.setColor(getFocusColor());
-        BasicGraphicsUtils.drawDashedRect(g, dashedRectGapX, dashedRectGapY,
-                                          b.getWidth() - dashedRectGapWidth,
-                                          b.getHeight() - dashedRectGapHeight);
-    }
-
-    // ********************************
-    //          Layout Methods
-    // ********************************
-    public Dimension getPreferredSize(JComponent c) {
-        Dimension d = super.getPreferredSize(c);
-
-        /* Ensure that the width and height of the button is odd,
-         * to allow for the focus line if focus is painted
-         */
-        AbstractButton b = (AbstractButton)c;
-        if (d != null && b.isFocusPainted()) {
-            if(d.width % 2 == 0) { d.width += 1; }
-            if(d.height % 2 == 0) { d.height += 1; }
-        }
-        return d;
-    }
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsToolBarSeparatorUI.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,123 +0,0 @@
-/*
- * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import java.awt.*;
-
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.basic.*;
-import javax.swing.*;
-
-import static com.sun.java.swing.plaf.windows.TMSchema.Part;
-import static com.sun.java.swing.plaf.windows.XPStyle.Skin;
-
-
-/**
- * Draws Windows toolbar separators.
- *
- * @author Mark Davidson
- */
-public class WindowsToolBarSeparatorUI extends BasicToolBarSeparatorUI {
-
-    public static ComponentUI createUI( JComponent c ) {
-        return new WindowsToolBarSeparatorUI();
-    }
-
-    public Dimension getPreferredSize(JComponent c) {
-        Dimension size = ((JToolBar.Separator)c).getSeparatorSize();
-
-        if (size != null) {
-            size = size.getSize();
-        } else {
-            size = new Dimension(6, 6);
-            XPStyle xp = XPStyle.getXP();
-            if (xp != null) {
-                boolean vertical = ((JSeparator)c).getOrientation() == SwingConstants.VERTICAL;
-                Part part = vertical ? Part.TP_SEPARATOR : Part.TP_SEPARATORVERT;
-                Skin skin = xp.getSkin(c, part);
-                size.width = skin.getWidth();
-                size.height = skin.getHeight();
-            }
-
-            if (((JSeparator)c).getOrientation() == SwingConstants.VERTICAL) {
-                size.height = 0;
-            } else {
-                size.width = 0;
-            }
-        }
-        return size;
-    }
-
-    public Dimension getMaximumSize(JComponent c) {
-        Dimension pref = getPreferredSize(c);
-        if (((JSeparator)c).getOrientation() == SwingConstants.VERTICAL) {
-            return new Dimension(pref.width, Short.MAX_VALUE);
-        } else {
-            return new Dimension(Short.MAX_VALUE, pref.height);
-        }
-    }
-
-    public void paint( Graphics g, JComponent c ) {
-        boolean vertical = ((JSeparator)c).getOrientation() == SwingConstants.VERTICAL;
-        Dimension size = c.getSize();
-
-        XPStyle xp = XPStyle.getXP();
-        if (xp != null) {
-            Part part = vertical ? Part.TP_SEPARATOR : Part.TP_SEPARATORVERT;
-            Skin skin = xp.getSkin(c, part);
-
-            int dx = vertical ? (size.width - skin.getWidth()) / 2 : 0;
-            int dy = vertical ? 0 : (size.height - skin.getHeight()) / 2;
-            int dw = vertical ? skin.getWidth() : size.width;
-            int dh = vertical ? size.height : skin.getHeight();
-            skin.paintSkin(g, dx, dy, dw, dh, null);
-        } else {
-
-        Color temp = g.getColor();
-
-        UIDefaults table = UIManager.getLookAndFeelDefaults();
-
-        Color shadow = table.getColor("ToolBar.shadow");
-        Color highlight = table.getColor("ToolBar.highlight");
-
-        if (vertical) {
-            int x = (size.width / 2) - 1;
-            g.setColor(shadow);
-            g.drawLine(x, 2, x, size.height - 2);
-
-            g.setColor(highlight);
-            g.drawLine(x + 1, 2, x + 1, size.height - 2);
-        } else {
-            int y = (size.height / 2) - 1;
-            g.setColor(shadow);
-            g.drawLine(2, y, size.width - 2, y);
-            g.setColor(highlight);
-            g.drawLine(2, y + 1, size.width - 2, y + 1);
-        }
-        g.setColor(temp);
-        }
-    }
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsToolBarUI.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,99 +0,0 @@
-/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import java.awt.*;
-
-import javax.swing.AbstractButton;
-import javax.swing.JComponent;
-import javax.swing.JToggleButton;
-import javax.swing.UIDefaults;
-import javax.swing.UIManager;
-
-import javax.swing.border.Border;
-import javax.swing.border.CompoundBorder;
-import javax.swing.border.EmptyBorder;
-
-import javax.swing.plaf.*;
-
-import javax.swing.plaf.basic.BasicBorders;
-import javax.swing.plaf.basic.BasicToolBarUI;
-
-import static com.sun.java.swing.plaf.windows.TMSchema.Part;
-
-
-public class WindowsToolBarUI extends BasicToolBarUI {
-
-    public static ComponentUI createUI(JComponent c) {
-        return new WindowsToolBarUI();
-    }
-
-    protected void installDefaults() {
-        if (XPStyle.getXP() != null) {
-            setRolloverBorders(true);
-        }
-        super.installDefaults();
-    }
-
-    protected Border createRolloverBorder() {
-        if (XPStyle.getXP() != null) {
-            return new EmptyBorder(3, 3, 3, 3);
-        } else {
-            return super.createRolloverBorder();
-        }
-    }
-
-    protected Border createNonRolloverBorder() {
-        if (XPStyle.getXP() != null) {
-            return new EmptyBorder(3, 3, 3, 3);
-        } else {
-            return super.createNonRolloverBorder();
-        }
-    }
-
-    public void paint(Graphics g, JComponent c) {
-        XPStyle xp = XPStyle.getXP();
-        if (xp != null) {
-            xp.getSkin(c, Part.TP_TOOLBAR).paintSkin(g, 0, 0,
-                        c.getWidth(), c.getHeight(), null, true);
-        } else {
-            super.paint(g, c);
-        }
-    }
-
-    /**
-     * {@inheritDoc}
-     * @since 1.6
-     */
-    protected Border getRolloverBorder(AbstractButton b) {
-        XPStyle xp = XPStyle.getXP();
-        if (xp != null) {
-            return xp.getBorder(b, WindowsButtonUI.getXPButtonType(b));
-        } else {
-            return super.getRolloverBorder(b);
-        }
-    }
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsTreeUI.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,245 +0,0 @@
-/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import java.awt.*;
-import java.awt.event.*;
-
-import java.io.*;
-import java.util.*;
-
-import javax.swing.plaf.basic.*;
-import javax.swing.*;
-import javax.swing.plaf.*;
-
-import javax.swing.tree.*;
-
-import static com.sun.java.swing.plaf.windows.TMSchema.*;
-import static com.sun.java.swing.plaf.windows.XPStyle.Skin;
-
-
-/**
- * A Windows tree.
- * <p>
- * <strong>Warning:</strong>
- * Serialized objects of this class will not be compatible with
- * future Swing releases.  The current serialization support is appropriate
- * for short term storage or RMI between applications running the same
- * version of Swing.  A future release of Swing will provide support for
- * long term persistence.
- *
- * @author Scott Violet
- */
-public class WindowsTreeUI extends BasicTreeUI {
-
-    public static ComponentUI createUI( JComponent c )
-      {
-        return new WindowsTreeUI();
-      }
-
-
-    /**
-      * Ensures that the rows identified by beginRow through endRow are
-      * visible.
-      */
-    protected void ensureRowsAreVisible(int beginRow, int endRow) {
-        if(tree != null && beginRow >= 0 && endRow < getRowCount(tree)) {
-            Rectangle visRect = tree.getVisibleRect();
-            if(beginRow == endRow) {
-                Rectangle     scrollBounds = getPathBounds(tree, getPathForRow
-                                                           (tree, beginRow));
-
-                if(scrollBounds != null) {
-                    scrollBounds.x = visRect.x;
-                    scrollBounds.width = visRect.width;
-                    tree.scrollRectToVisible(scrollBounds);
-                }
-            }
-            else {
-                Rectangle   beginRect = getPathBounds(tree, getPathForRow
-                                                      (tree, beginRow));
-                if (beginRect != null) {
-                    Rectangle   testRect = beginRect;
-                    int         beginY = beginRect.y;
-                    int         maxY = beginY + visRect.height;
-
-                    for(int counter = beginRow + 1; counter <= endRow; counter++) {
-                        testRect = getPathBounds(tree,
-                                                 getPathForRow(tree, counter));
-                        if(testRect != null && (testRect.y + testRect.height) > maxY) {
-                            counter = endRow;
-                        }
-                    }
-
-                    if (testRect == null) {
-                        return;
-                    }
-
-                    tree.scrollRectToVisible(new Rectangle(visRect.x, beginY, 1,
-                                                      testRect.y + testRect.height-
-                                                      beginY));
-                }
-            }
-        }
-    }
-
-    protected static final int HALF_SIZE = 4;
-    protected static final int SIZE = 9;
-
-    /**
-     * Returns the default cell renderer that is used to do the
-     * stamping of each node.
-     */
-    protected TreeCellRenderer createDefaultCellRenderer() {
-        return new WindowsTreeCellRenderer();
-    }
-
-    /**
-     * The minus sign button icon
-     * <p>
-     * <strong>Warning:</strong>
-     * Serialized objects of this class will not be compatible with
-     * future Swing releases.  The current serialization support is appropriate
-     * for short term storage or RMI between applications running the same
-     * version of Swing.  A future release of Swing will provide support for
-     * long term persistence.
-     */
-    @SuppressWarnings("serial") // Same-version serialization only
-    public static class ExpandedIcon implements Icon, Serializable {
-
-        public static Icon createExpandedIcon() {
-            return new ExpandedIcon();
-        }
-
-        Skin getSkin(Component c) {
-            XPStyle xp = XPStyle.getXP();
-            return (xp != null) ? xp.getSkin(c, Part.TVP_GLYPH) : null;
-        }
-
-        public void paintIcon(Component c, Graphics g, int x, int y) {
-            Skin skin = getSkin(c);
-            if (skin != null) {
-                skin.paintSkin(g, x, y, State.OPENED);
-                return;
-            }
-
-            Color     backgroundColor = c.getBackground();
-
-            if(backgroundColor != null)
-                g.setColor(backgroundColor);
-            else
-                g.setColor(Color.white);
-            g.fillRect(x, y, SIZE-1, SIZE-1);
-            g.setColor(Color.gray);
-            g.drawRect(x, y, SIZE-1, SIZE-1);
-            g.setColor(Color.black);
-            g.drawLine(x + 2, y + HALF_SIZE, x + (SIZE - 3), y + HALF_SIZE);
-        }
-
-        public int getIconWidth() {
-            Skin skin = getSkin(null);
-            return (skin != null) ? skin.getWidth() : SIZE;
-        }
-
-        public int getIconHeight() {
-            Skin skin = getSkin(null);
-            return (skin != null) ? skin.getHeight() : SIZE;
-        }
-    }
-
-    /**
-     * The plus sign button icon
-     * <p>
-     * <strong>Warning:</strong>
-     * Serialized objects of this class will not be compatible with
-     * future Swing releases.  The current serialization support is appropriate
-     * for short term storage or RMI between applications running the same
-     * version of Swing.  A future release of Swing will provide support for
-     * long term persistence.
-     */
-    @SuppressWarnings("serial") // Superclass is not serializable across versions
-    public static class CollapsedIcon extends ExpandedIcon {
-        public static Icon createCollapsedIcon() {
-            return new CollapsedIcon();
-        }
-
-        public void paintIcon(Component c, Graphics g, int x, int y) {
-            Skin skin = getSkin(c);
-            if (skin != null) {
-                skin.paintSkin(g, x, y, State.CLOSED);
-            } else {
-            super.paintIcon(c, g, x, y);
-            g.drawLine(x + HALF_SIZE, y + 2, x + HALF_SIZE, y + (SIZE - 3));
-            }
-        }
-    }
-
-    @SuppressWarnings("serial") // Superclass is not serializable across versions
-    public class WindowsTreeCellRenderer extends DefaultTreeCellRenderer {
-
-        /**
-         * Configures the renderer based on the passed in components.
-         * The value is set from messaging the tree with
-         * <code>convertValueToText</code>, which ultimately invokes
-         * <code>toString</code> on <code>value</code>.
-         * The foreground color is set based on the selection and the icon
-         * is set based on on leaf and expanded.
-         */
-        public Component getTreeCellRendererComponent(JTree tree, Object value,
-                                                      boolean sel,
-                                                      boolean expanded,
-                                                      boolean leaf, int row,
-                                                      boolean hasFocus) {
-            super.getTreeCellRendererComponent(tree, value, sel,
-                                               expanded, leaf, row,
-                                               hasFocus);
-            // Windows displays the open icon when the tree item selected.
-            if (!tree.isEnabled()) {
-                setEnabled(false);
-                if (leaf) {
-                    setDisabledIcon(getLeafIcon());
-                } else if (sel) {
-                    setDisabledIcon(getOpenIcon());
-                } else {
-                    setDisabledIcon(getClosedIcon());
-                }
-            }
-            else {
-                setEnabled(true);
-                if (leaf) {
-                    setIcon(getLeafIcon());
-                } else if (sel) {
-                    setIcon(getOpenIcon());
-                } else {
-                    setIcon(getClosedIcon());
-                }
-            }
-            return this;
-        }
-
-    }
-
-}
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/XPStyle.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,774 +0,0 @@
-/*
- * 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * <p>These classes are designed to be used while the
- * corresponding <code>LookAndFeel</code> class has been installed
- * (<code>UIManager.setLookAndFeel(new <i>XXX</i>LookAndFeel())</code>).
- * Using them while a different <code>LookAndFeel</code> is installed
- * may produce unexpected results, including exceptions.
- * Additionally, changing the <code>LookAndFeel</code>
- * maintained by the <code>UIManager</code> without updating the
- * corresponding <code>ComponentUI</code> of any
- * <code>JComponent</code>s may also produce unexpected results,
- * such as the wrong colors showing up, and is generally not
- * encouraged.
- *
- */
-
-package com.sun.java.swing.plaf.windows;
-
-import java.awt.*;
-import java.awt.image.*;
-import java.security.AccessController;
-import java.util.*;
-
-import javax.swing.*;
-import javax.swing.border.*;
-import javax.swing.plaf.*;
-import javax.swing.text.JTextComponent;
-
-import sun.awt.image.SunWritableRaster;
-import sun.awt.windows.ThemeReader;
-import sun.security.action.GetPropertyAction;
-import sun.swing.CachedPainter;
-
-import static com.sun.java.swing.plaf.windows.TMSchema.*;
-
-
-/**
- * Implements Windows XP Styles for the Windows Look and Feel.
- *
- * @author Leif Samuelsson
- */
-class XPStyle {
-    // Singleton instance of this class
-    private static XPStyle xp;
-
-    // Singleton instance of SkinPainter
-    private static SkinPainter skinPainter = new SkinPainter();
-
-    private static Boolean themeActive = null;
-
-    private HashMap<String, Border> borderMap;
-    private HashMap<String, Color>  colorMap;
-
-    private boolean flatMenus;
-
-    static {
-        invalidateStyle();
-    }
-
-    /** Static method for clearing the hashmap and loading the
-     * current XP style and theme
-     */
-    static synchronized void invalidateStyle() {
-        xp = null;
-        themeActive = null;
-        skinPainter.flush();
-    }
-
-    /** Get the singleton instance of this class
-     *
-     * @return the singleton instance of this class or null if XP styles
-     * are not active or if this is not Windows XP
-     */
-    static synchronized XPStyle getXP() {
-        if (themeActive == null) {
-            Toolkit toolkit = Toolkit.getDefaultToolkit();
-            themeActive =
-                (Boolean)toolkit.getDesktopProperty("win.xpstyle.themeActive");
-            if (themeActive == null) {
-                themeActive = Boolean.FALSE;
-            }
-            if (themeActive.booleanValue()) {
-                GetPropertyAction propertyAction =
-                    new GetPropertyAction("swing.noxp");
-                if (AccessController.doPrivileged(propertyAction) == null &&
-                    ThemeReader.isThemed() &&
-                    !(UIManager.getLookAndFeel()
-                      instanceof WindowsClassicLookAndFeel)) {
-
-                    xp = new XPStyle();
-                }
-            }
-        }
-        return ThemeReader.isXPStyleEnabled() ? xp : null;
-    }
-
-    static boolean isVista() {
-        XPStyle xp = XPStyle.getXP();
-        return (xp != null && xp.isSkinDefined(null, Part.CP_DROPDOWNBUTTONRIGHT));
-    }
-
-    /** Get a named <code>String</code> value from the current style
-     *
-     * @param part a <code>Part</code>
-     * @param state a <code>String</code>
-     * @param prop a <code>String</code>
-     * @return a <code>String</code> or null if key is not found
-     *    in the current style
-     *
-     * This is currently only used by WindowsInternalFrameTitlePane for painting
-     * title foregound and can be removed when no longer needed
-     */
-    String getString(Component c, Part part, State state, Prop prop) {
-        return getTypeEnumName(c, part, state, prop);
-    }
-
-    TypeEnum getTypeEnum(Component c, Part part, State state, Prop prop) {
-        int enumValue = ThemeReader.getEnum(part.getControlName(c), part.getValue(),
-                                            State.getValue(part, state),
-                                            prop.getValue());
-        return TypeEnum.getTypeEnum(prop, enumValue);
-    }
-
-    private static String getTypeEnumName(Component c, Part part, State state, Prop prop) {
-        int enumValue = ThemeReader.getEnum(part.getControlName(c), part.getValue(),
-                                            State.getValue(part, state),
-                                            prop.getValue());
-        if (enumValue == -1) {
-            return null;
-        }
-        return TypeEnum.getTypeEnum(prop, enumValue).getName();
-    }
-
-
-
-
-    /** Get a named <code>int</code> value from the current style
-     *
-     * @param part a <code>Part</code>
-     * @return an <code>int</code> or null if key is not found
-     *    in the current style
-     */
-    int getInt(Component c, Part part, State state, Prop prop, int fallback) {
-        return ThemeReader.getInt(part.getControlName(c), part.getValue(),
-                                  State.getValue(part, state),
-                                  prop.getValue());
-    }
-
-    /** Get a named <code>Dimension</code> value from the current style
-     *
-     * @return a <code>Dimension</code> or null if key is not found
-     *    in the current style
-     *
-     * This is currently only used by WindowsProgressBarUI and the value
-     * should probably be cached there instead of here.
-     */
-    Dimension getDimension(Component c, Part part, State state, Prop prop) {
-        Dimension d = ThemeReader.getPosition(part.getControlName(c), part.getValue(),
-                                              State.getValue(part, state),
-                                              prop.getValue());
-        return (d != null) ? d : new Dimension();
-    }
-
-    /** Get a named <code>Point</code> (e.g. a location or an offset) value
-     *  from the current style
-     *
-     * @return a <code>Point</code> or null if key is not found
-     *    in the current style
-     *
-     * This is currently only used by WindowsInternalFrameTitlePane for painting
-     * title foregound and can be removed when no longer needed
-     */
-    Point getPoint(Component c, Part part, State state, Prop prop) {
-        Dimension d = ThemeReader.getPosition(part.getControlName(c), part.getValue(),
-                                              State.getValue(part, state),
-                                              prop.getValue());
-        return (d != null) ? new Point(d.width, d.height) : new Point();
-    }
-
-    /** Get a named <code>Insets</code> value from the current style
-     *
-     * @return an <code>Insets</code> object or null if key is not found
-     *    in the current style
-     *
-     * This is currently only used to create borders and by
-     * WindowsInternalFrameTitlePane for painting title foregound.
-     * The return value is already cached in those places.
-     */
-    Insets getMargin(Component c, Part part, State state, Prop prop) {
-        Insets insets = ThemeReader.getThemeMargins(part.getControlName(c), part.getValue(),
-                                                    State.getValue(part, state),
-                                                    prop.getValue());
-        return (insets != null) ? insets : new Insets(0, 0, 0, 0);
-    }
-
-
-    /** Get a named <code>Color</code> value from the current style
-     *
-     * @return a <code>Color</code> or null if key is not found
-     *    in the current style
-     */
-    synchronized Color getColor(Skin skin, Prop prop, Color fallback) {
-        String key = skin.toString() + "." + prop.name();
-        Part part = skin.part;
-        Color color = colorMap.get(key);
-        if (color == null) {
-            color = ThemeReader.getColor(part.getControlName(null), part.getValue(),
-                                         State.getValue(part, skin.state),
-                                         prop.getValue());
-            if (color != null) {
-                color = new ColorUIResource(color);
-                colorMap.put(key, color);
-            }
-        }
-        return (color != null) ? color : fallback;
-    }
-
-    Color getColor(Component c, Part part, State state, Prop prop, Color fallback) {
-        return getColor(new Skin(c, part, state), prop, fallback);
-    }
-
-
-
-    /** Get a named <code>Border</code> value from the current style
-     *
-     * @param part a <code>Part</code>
-     * @return a <code>Border</code> or null if key is not found
-     *    in the current style or if the style for the particular
-     *    part is not defined as "borderfill".
-     */
-    synchronized Border getBorder(Component c, Part part) {
-        if (part == Part.MENU) {
-            // Special case because XP has no skin for menus
-            if (flatMenus) {
-                // TODO: The classic border uses this color, but we should
-                // create a new UI property called "PopupMenu.borderColor"
-                // instead.
-                return new XPFillBorder(UIManager.getColor("InternalFrame.borderShadow"),
-                                        1);
-            } else {
-                return null;    // Will cause L&F to use classic border
-            }
-        }
-        Skin skin = new Skin(c, part, null);
-        Border border = borderMap.get(skin.string);
-        if (border == null) {
-            String bgType = getTypeEnumName(c, part, null, Prop.BGTYPE);
-            if ("borderfill".equalsIgnoreCase(bgType)) {
-                int thickness = getInt(c, part, null, Prop.BORDERSIZE, 1);
-                Color color = getColor(skin, Prop.BORDERCOLOR, Color.black);
-                border = new XPFillBorder(color, thickness);
-                if (part == Part.CP_COMBOBOX) {
-                    border = new XPStatefulFillBorder(color, thickness, part, Prop.BORDERCOLOR);
-                }
-            } else if ("imagefile".equalsIgnoreCase(bgType)) {
-                Insets m = getMargin(c, part, null, Prop.SIZINGMARGINS);
-                if (m != null) {
-                    if (getBoolean(c, part, null, Prop.BORDERONLY)) {
-                        border = new XPImageBorder(c, part);
-                    } else if (part == Part.CP_COMBOBOX) {
-                        border = new EmptyBorder(1, 1, 1, 1);
-                    } else {
-                        if(part == Part.TP_BUTTON) {
-                            border = new XPEmptyBorder(new Insets(3,3,3,3));
-                        } else {
-                            border = new XPEmptyBorder(m);
-                        }
-                    }
-                }
-            }
-            if (border != null) {
-                borderMap.put(skin.string, border);
-            }
-        }
-        return border;
-    }
-
-    @SuppressWarnings("serial") // Superclass is not serializable across versions
-    private class XPFillBorder extends LineBorder implements UIResource {
-        XPFillBorder(Color color, int thickness) {
-            super(color, thickness);
-        }
-
-        public Insets getBorderInsets(Component c, Insets insets)       {
-            Insets margin = null;
-            //
-            // Ideally we'd have an interface defined for classes which
-            // support margins (to avoid this hackery), but we've
-            // decided against it for simplicity
-            //
-           if (c instanceof AbstractButton) {
-               margin = ((AbstractButton)c).getMargin();
-           } else if (c instanceof JToolBar) {
-               margin = ((JToolBar)c).getMargin();
-           } else if (c instanceof JTextComponent) {
-               margin = ((JTextComponent)c).getMargin();
-           }
-           insets.top    = (margin != null? margin.top : 0)    + thickness;
-           insets.left   = (margin != null? margin.left : 0)   + thickness;
-           insets.bottom = (margin != null? margin.bottom : 0) + thickness;
-           insets.right =  (margin != null? margin.right : 0)  + thickness;
-
-           return insets;
-        }
-    }
-
-    @SuppressWarnings("serial") // Superclass is not serializable across versions
-    private class XPStatefulFillBorder extends XPFillBorder {
-        private final Part part;
-        private final Prop prop;
-        XPStatefulFillBorder(Color color, int thickness, Part part, Prop prop) {
-            super(color, thickness);
-            this.part = part;
-            this.prop = prop;
-        }
-
-        public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
-            State state = State.NORMAL;
-            // special casing for comboboxes.
-            // there may be more special cases in the future
-            if(c instanceof JComboBox) {
-                JComboBox<?> cb = (JComboBox)c;
-                // note. in the future this should be replaced with a call
-                // to BasicLookAndFeel.getUIOfType()
-                if(cb.getUI() instanceof WindowsComboBoxUI) {
-                    WindowsComboBoxUI wcb = (WindowsComboBoxUI)cb.getUI();
-                    state = wcb.getXPComboBoxState(cb);
-                }
-            }
-            lineColor = getColor(c, part, state, prop, Color.black);
-            super.paintBorder(c, g, x, y, width, height);
-        }
-    }
-
-    @SuppressWarnings("serial") // Superclass is not serializable across versions
-    private class XPImageBorder extends AbstractBorder implements UIResource {
-        Skin skin;
-
-        XPImageBorder(Component c, Part part) {
-            this.skin = getSkin(c, part);
-        }
-
-        public void paintBorder(Component c, Graphics g,
-                                int x, int y, int width, int height) {
-            skin.paintSkin(g, x, y, width, height, null);
-        }
-
-        public Insets getBorderInsets(Component c, Insets insets)       {
-            Insets margin = null;
-            Insets borderInsets = skin.getContentMargin();
-            if(borderInsets == null) {
-                borderInsets = new Insets(0, 0, 0, 0);
-            }
-            //
-            // Ideally we'd have an interface defined for classes which
-            // support margins (to avoid this hackery), but we've
-            // decided against it for simplicity
-            //
-           if (c instanceof AbstractButton) {
-               margin = ((AbstractButton)c).getMargin();
-           } else if (c instanceof JToolBar) {
-               margin = ((JToolBar)c).getMargin();
-           } else if (c instanceof JTextComponent) {
-               margin = ((JTextComponent)c).getMargin();
-           }
-           insets.top    = (margin != null? margin.top : 0)    + borderInsets.top;
-           insets.left   = (margin != null? margin.left : 0)   + borderInsets.left;
-           insets.bottom = (margin != null? margin.bottom : 0) + borderInsets.bottom;
-           insets.right  = (margin != null? margin.right : 0)  + borderInsets.right;
-
-           return insets;
-        }
-    }
-
-    @SuppressWarnings("serial") // Superclass is not serializable across versions
-    private class XPEmptyBorder extends EmptyBorder implements UIResource {
-        XPEmptyBorder(Insets m) {
-            super(m.top+2, m.left+2, m.bottom+2, m.right+2);
-        }
-
-        public Insets getBorderInsets(Component c, Insets insets)       {
-            insets = super.getBorderInsets(c, insets);
-
-            Insets margin = null;
-            if (c instanceof AbstractButton) {
-                Insets m = ((AbstractButton)c).getMargin();
-                // if this is a toolbar button then ignore getMargin()
-                // and subtract the padding added by the constructor
-                if(c.getParent() instanceof JToolBar
-                   && ! (c instanceof JRadioButton)
-                   && ! (c instanceof JCheckBox)
-                   && m instanceof InsetsUIResource) {
-                    insets.top -= 2;
-                    insets.left -= 2;
-                    insets.bottom -= 2;
-                    insets.right -= 2;
-                } else {
-                    margin = m;
-                }
-            } else if (c instanceof JToolBar) {
-                margin = ((JToolBar)c).getMargin();
-            } else if (c instanceof JTextComponent) {
-                margin = ((JTextComponent)c).getMargin();
-            }
-            if (margin != null) {
-                insets.top    = margin.top + 2;
-                insets.left   = margin.left + 2;
-                insets.bottom = margin.bottom + 2;
-                insets.right  = margin.right + 2;
-            }
-            return insets;
-        }
-    }
-    boolean isSkinDefined(Component c, Part part) {
-        return (part.getValue() == 0)
-            || ThemeReader.isThemePartDefined(
-                   part.getControlName(c), part.getValue(), 0);
-    }
-
-
-    /** Get a <code>Skin</code> object from the current style
-     * for a named part (component type)
-     *
-     * @param part a <code>Part</code>
-     * @return a <code>Skin</code> object
-     */
-    synchronized Skin getSkin(Component c, Part part) {
-        assert isSkinDefined(c, part) : "part " + part + " is not defined";
-        return new Skin(c, part, null);
-    }
-
-
-    long getThemeTransitionDuration(Component c, Part part, State stateFrom,
-                                    State stateTo, Prop prop) {
-         return ThemeReader.getThemeTransitionDuration(part.getControlName(c),
-                                          part.getValue(),
-                                          State.getValue(part, stateFrom),
-                                          State.getValue(part, stateTo),
-                                          (prop != null) ? prop.getValue() : 0);
-    }
-
-
-    /** A class which encapsulates attributes for a given part
-     * (component type) and which provides methods for painting backgrounds
-     * and glyphs
-     */
-    static class Skin {
-        final Component component;
-        final Part part;
-        final State state;
-
-        private final String string;
-        private Dimension size = null;
-        private boolean switchStates = false;
-
-        Skin(Component component, Part part) {
-            this(component, part, null);
-        }
-
-        Skin(Part part, State state) {
-            this(null, part, state);
-        }
-
-        Skin(Component component, Part part, State state) {
-            this.component = component;
-            this.part  = part;
-            this.state = state;
-
-            String str = part.getControlName(component) +"." + part.name();
-            if (state != null) {
-                str += "("+state.name()+")";
-            }
-            string = str;
-        }
-
-        Insets getContentMargin() {
-            /* idk: it seems margins are the same for all 'big enough'
-             * bounding rectangles.
-             */
-            int boundingWidth = 100;
-            int boundingHeight = 100;
-
-            Insets insets = ThemeReader.getThemeBackgroundContentMargins(
-                part.getControlName(null), part.getValue(),
-                0, boundingWidth, boundingHeight);
-            return (insets != null) ? insets : new Insets(0, 0, 0, 0);
-        }
-
-        boolean haveToSwitchStates() {
-            return switchStates;
-        }
-
-        void switchStates(boolean b) {
-            switchStates = b;
-        }
-
-        private int getWidth(State state) {
-            if (size == null) {
-                size = getPartSize(part, state);
-            }
-            return (size != null) ? size.width : 0;
-        }
-
-        int getWidth() {
-            return getWidth((state != null) ? state : State.NORMAL);
-        }
-
-        private int getHeight(State state) {
-            if (size == null) {
-                size = getPartSize(part, state);
-            }
-            return (size != null) ? size.height : 0;
-        }
-
-        int getHeight() {
-            return getHeight((state != null) ? state : State.NORMAL);
-        }
-
-        public String toString() {
-            return string;
-        }
-
-        public boolean equals(Object obj) {
-            return (obj instanceof Skin && ((Skin)obj).string.equals(string));
-        }
-
-        public int hashCode() {
-            return string.hashCode();
-        }
-
-        /** Paint a skin at x, y.
-         *
-         * @param g   the graphics context to use for painting
-         * @param dx  the destination <i>x</i> coordinate
-         * @param dy  the destination <i>y</i> coordinate
-         * @param state which state to paint
-         */
-        void paintSkin(Graphics g, int dx, int dy, State state) {
-            if (state == null) {
-                state = this.state;
-            }
-            paintSkin(g, dx, dy, getWidth(state), getHeight(state), state);
-        }
-
-        /** Paint a skin in an area defined by a rectangle.
-         *
-         * @param g the graphics context to use for painting
-         * @param r     a <code>Rectangle</code> defining the area to fill,
-         *                     may cause the image to be stretched or tiled
-         * @param state which state to paint
-         */
-        void paintSkin(Graphics g, Rectangle r, State state) {
-            paintSkin(g, r.x, r.y, r.width, r.height, state);
-        }
-
-        /** Paint a skin at a defined position and size
-         *  This method supports animation.
-         *
-         * @param g   the graphics context to use for painting
-         * @param dx  the destination <i>x</i> coordinate
-         * @param dy  the destination <i>y</i> coordinate
-         * @param dw  the width of the area to fill, may cause
-         *                  the image to be stretched or tiled
-         * @param dh  the height of the area to fill, may cause
-         *                  the image to be stretched or tiled
-         * @param state which state to paint
-         */
-        void paintSkin(Graphics g, int dx, int dy, int dw, int dh, State state) {
-            if (XPStyle.getXP() == null) {
-                return;
-            }
-            if (ThemeReader.isGetThemeTransitionDurationDefined()
-                  && component instanceof JComponent
-                  && SwingUtilities.getAncestorOfClass(CellRendererPane.class,
-                                                       component) == null) {
-                AnimationController.paintSkin((JComponent) component, this,
-                                              g, dx, dy, dw, dh, state);
-            } else {
-                paintSkinRaw(g, dx, dy, dw, dh, state);
-            }
-        }
-
-        /** Paint a skin at a defined position and size. This method
-         *  does not trigger animation. It is needed for the animation
-         *  support.
-         *
-         * @param g   the graphics context to use for painting
-         * @param dx  the destination <i>x</i> coordinate.
-         * @param dy  the destination <i>y</i> coordinate.
-         * @param dw  the width of the area to fill, may cause
-         *                  the image to be stretched or tiled
-         * @param dh  the height of the area to fill, may cause
-         *                  the image to be stretched or tiled
-         * @param state which state to paint
-         */
-        void paintSkinRaw(Graphics g, int dx, int dy, int dw, int dh, State state) {
-            if (XPStyle.getXP() == null) {
-                return;
-            }
-            skinPainter.paint(null, g, dx, dy, dw, dh, this, state);
-        }
-
-        /** Paint a skin at a defined position and size
-         *
-         * @param g   the graphics context to use for painting
-         * @param dx  the destination <i>x</i> coordinate
-         * @param dy  the destination <i>y</i> coordinate
-         * @param dw  the width of the area to fill, may cause
-         *                  the image to be stretched or tiled
-         * @param dh  the height of the area to fill, may cause
-         *                  the image to be stretched or tiled
-         * @param state which state to paint
-         * @param borderFill should test if the component uses a border fill
-                            and skip painting if it is
-         */
-        void paintSkin(Graphics g, int dx, int dy, int dw, int dh, State state,
-                boolean borderFill) {
-            if (XPStyle.getXP() == null) {
-                return;
-            }
-            if(borderFill && "borderfill".equals(getTypeEnumName(component, part,
-                    state, Prop.BGTYPE))) {
-                return;
-            }
-            skinPainter.paint(null, g, dx, dy, dw, dh, this, state);
-        }
-    }
-
-    private static class SkinPainter extends CachedPainter {
-        SkinPainter() {
-            super(30);
-            flush();
-        }
-
-        public void flush() {
-            super.flush();
-        }
-
-        protected void paintToImage(Component c, Image image, Graphics g,
-                                    int w, int h, Object[] args) {
-            Skin skin = (Skin)args[0];
-            Part part = skin.part;
-            State state = (State)args[1];
-            if (state == null) {
-                state = skin.state;
-            }
-            if (c == null) {
-                c = skin.component;
-            }
-            BufferedImage bi = (BufferedImage)image;
-            w = bi.getWidth();
-            h = bi.getHeight();
-
-            WritableRaster raster = bi.getRaster();
-            DataBufferInt dbi = (DataBufferInt)raster.getDataBuffer();
-            // Note that stealData() requires a markDirty() afterwards
-            // since we modify the data in it.
-            ThemeReader.paintBackground(SunWritableRaster.stealData(dbi, 0),
-                                        part.getControlName(c), part.getValue(),
-                                        State.getValue(part, state),
-                                        0, 0, w, h, w);
-            SunWritableRaster.markDirty(dbi);
-        }
-
-        protected Image createImage(Component c, int w, int h,
-                                    GraphicsConfiguration config, Object[] args) {
-            return new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
-        }
-    }
-
-    @SuppressWarnings("serial") // Superclass is not serializable across versions
-    static class GlyphButton extends JButton {
-        protected Skin skin;
-
-        public GlyphButton(Component parent, Part part) {
-            XPStyle xp = getXP();
-            skin = xp != null ? xp.getSkin(parent, part) : null;
-            setBorder(null);
-            setContentAreaFilled(false);
-            setMinimumSize(new Dimension(5, 5));
-            setPreferredSize(new Dimension(16, 16));
-            setMaximumSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE));
-        }
-
-        @SuppressWarnings("deprecation")
-        public boolean isFocusTraversable() {
-            return false;
-        }
-
-        protected State getState() {
-            State state = State.NORMAL;
-            if (!isEnabled()) {
-                state = State.DISABLED;
-            } else if (getModel().isPressed()) {
-                state = State.PRESSED;
-            } else if (getModel().isRollover()) {
-                state = State.HOT;
-            }
-            return state;
-        }
-
-        public void paintComponent(Graphics g) {
-            if (XPStyle.getXP() == null || skin == null) {
-                return;
-            }
-            Dimension d = getSize();
-            skin.paintSkin(g, 0, 0, d.width, d.height, getState());
-        }
-
-        public void setPart(Component parent, Part part) {
-            XPStyle xp = getXP();
-            skin = xp != null ? xp.getSkin(parent, part) : null;
-            revalidate();
-            repaint();
-        }
-
-        protected void paintBorder(Graphics g) {
-        }
-
-
-    }
-
-    // Private constructor
-    private XPStyle() {
-        flatMenus = getSysBoolean(Prop.FLATMENUS);
-
-        colorMap  = new HashMap<String, Color>();
-        borderMap = new HashMap<String, Border>();
-        // Note: All further access to the maps must be synchronized
-    }
-
-
-    private boolean getBoolean(Component c, Part part, State state, Prop prop) {
-        return ThemeReader.getBoolean(part.getControlName(c), part.getValue(),
-                                      State.getValue(part, state),
-                                      prop.getValue());
-    }
-
-
-
-    static Dimension getPartSize(Part part, State state) {
-        return ThemeReader.getPartSize(part.getControlName(null), part.getValue(),
-                                       State.getValue(part, state));
-    }
-
-    private static boolean getSysBoolean(Prop prop) {
-        // We can use any widget name here, I guess.
-        return ThemeReader.getSysBoolean("window", prop.getValue());
-    }
-}
Binary file src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/icons/Computer.gif has changed
Binary file src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/icons/DetailsView.gif has changed
Binary file src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/icons/Directory.gif has changed
Binary file src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/icons/Error.gif has changed
Binary file src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/icons/File.gif has changed
Binary file src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/icons/FloppyDrive.gif has changed
Binary file src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/icons/HardDrive.gif has changed
Binary file src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/icons/HomeFolder.gif has changed
Binary file src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/icons/Inform.gif has changed
Binary file src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/icons/JavaCup32.png has changed
Binary file src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/icons/ListView.gif has changed
Binary file src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/icons/NewFolder.gif has changed
Binary file src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/icons/Question.gif has changed
Binary file src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/icons/TreeClosed.gif has changed
Binary file src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/icons/TreeLeaf.gif has changed
Binary file src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/icons/TreeOpen.gif has changed
Binary file src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/icons/UpFolder.gif has changed
Binary file src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/icons/Warn.gif has changed
Binary file src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/icons/image-delayed.png has changed
Binary file src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/icons/image-failed.png has changed
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/resources/windows.properties	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-# This properties file is used to create a PropertyResourceBundle
-# It contains Locale specific strings used be the Windows Look and Feel.
-# Currently, the following components need this for support:
-#
-#    FileChooser
-#
-# When this file is read in, the strings are put into the 
-# defaults table.  This is an implementation detail of the current
-# workings of Swing.  DO NOT DEPEND ON THIS.  
-# This may change in future versions of Swing as we improve localization 
-# support.
-#
-# Refer to the note in basic.properties for a description as to what
-# the mnemonics correspond to and how to calculate them.
-#
-# @author Steve Wilson
-
-
-############ FILE CHOOSER STRINGS #############
-
-FileChooser.lookInLabel.textAndMnemonic=Look &in:
-FileChooser.saveInLabel.textAndMnemonic=Save in:
-FileChooser.fileNameLabel.textAndMnemonic=File &name:
-FileChooser.folderNameLabel.textAndMnemonic=Folder &name:
-FileChooser.filesOfTypeLabel.textAndMnemonic=Files of &type:
-FileChooser.upFolderToolTip.textAndMnemonic=Up One Level
-FileChooser.upFolderAccessibleName=Up
-FileChooser.homeFolderToolTip.textAndMnemonic=Home
-FileChooser.homeFolderAccessibleName=Home
-FileChooser.newFolderToolTip.textAndMnemonic=Create New Folder
-FileChooser.newFolderAccessibleName=New Folder
-FileChooser.newFolderActionLabel.textAndMnemonic=New Folder
-FileChooser.listViewButtonToolTip.textAndMnemonic=List
-FileChooser.listViewButtonAccessibleName=List
-FileChooser.listViewActionLabel.textAndMnemonic=List
-FileChooser.detailsViewButtonToolTip.textAndMnemonic=Details
-FileChooser.detailsViewButtonAccessibleName=Details
-FileChooser.viewMenuButtonToolTipText = View Menu
-FileChooser.viewMenuButtonAccessibleName = View Menu
-FileChooser.detailsViewActionLabel.textAndMnemonic=Details
-FileChooser.refreshActionLabel.textAndMnemonic=Refresh
-FileChooser.viewMenuLabel.textAndMnemonic=View
-FileChooser.fileNameHeader.textAndMnemonic=Name
-FileChooser.fileSizeHeader.textAndMnemonic=Size
-FileChooser.fileTypeHeader.textAndMnemonic=Type
-FileChooser.fileDateHeader.textAndMnemonic=Modified
-FileChooser.fileAttrHeader.textAndMnemonic=Attributes
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/resources/windows_de.properties	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-# This properties file is used to create a PropertyResourceBundle
-# It contains Locale specific strings used be the Windows Look and Feel.
-# Currently, the following components need this for support:
-#
-#    FileChooser
-#
-# When this file is read in, the strings are put into the 
-# defaults table.  This is an implementation detail of the current
-# workings of Swing.  DO NOT DEPEND ON THIS.  
-# This may change in future versions of Swing as we improve localization 
-# support.
-#
-# Refer to the note in basic.properties for a description as to what
-# the mnemonics correspond to and how to calculate them.
-#
-# @author Steve Wilson
-
-
-############ FILE CHOOSER STRINGS #############
-
-FileChooser.lookInLabel.textAndMnemonic=Suchen &in:
-FileChooser.saveInLabel.textAndMnemonic=Speichern in:
-FileChooser.fileNameLabel.textAndMnemonic=&Dateiname:
-FileChooser.folderNameLabel.textAndMnemonic=Ordner&name:
-FileChooser.filesOfTypeLabel.textAndMnemonic=Datei&typ:
-FileChooser.upFolderToolTip.textAndMnemonic=Eine Ebene h\u00F6her
-FileChooser.upFolderAccessibleName=Nach oben
-FileChooser.homeFolderToolTip.textAndMnemonic=Home
-FileChooser.homeFolderAccessibleName=Home
-FileChooser.newFolderToolTip.textAndMnemonic=Neuen Ordner erstellen
-FileChooser.newFolderAccessibleName=Neuer Ordner
-FileChooser.newFolderActionLabel.textAndMnemonic=Neuer Ordner
-FileChooser.listViewButtonToolTip.textAndMnemonic=Liste
-FileChooser.listViewButtonAccessibleName=Liste
-FileChooser.listViewActionLabel.textAndMnemonic=Liste
-FileChooser.detailsViewButtonToolTip.textAndMnemonic=Details
-FileChooser.detailsViewButtonAccessibleName=Details
-FileChooser.viewMenuButtonToolTipText = Ansichtsmen\u00FC
-FileChooser.viewMenuButtonAccessibleName = Ansichtsmen\u00FC
-FileChooser.detailsViewActionLabel.textAndMnemonic=Details
-FileChooser.refreshActionLabel.textAndMnemonic=Aktualisieren
-FileChooser.viewMenuLabel.textAndMnemonic=Ansicht
-FileChooser.fileNameHeader.textAndMnemonic=Name
-FileChooser.fileSizeHeader.textAndMnemonic=Gr\u00F6\u00DFe
-FileChooser.fileTypeHeader.textAndMnemonic=Typ
-FileChooser.fileDateHeader.textAndMnemonic=Ge\u00E4ndert
-FileChooser.fileAttrHeader.textAndMnemonic=Attribute
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/resources/windows_es.properties	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-# This properties file is used to create a PropertyResourceBundle
-# It contains Locale specific strings used be the Windows Look and Feel.
-# Currently, the following components need this for support:
-#
-#    FileChooser
-#
-# When this file is read in, the strings are put into the 
-# defaults table.  This is an implementation detail of the current
-# workings of Swing.  DO NOT DEPEND ON THIS.  
-# This may change in future versions of Swing as we improve localization 
-# support.
-#
-# Refer to the note in basic.properties for a description as to what
-# the mnemonics correspond to and how to calculate them.
-#
-# @author Steve Wilson
-
-
-############ FILE CHOOSER STRINGS #############
-
-FileChooser.lookInLabel.textAndMnemonic=&Buscar en:
-FileChooser.saveInLabel.textAndMnemonic=Guardar en:
-FileChooser.fileNameLabel.textAndMnemonic=&Nombre de archivo:
-FileChooser.folderNameLabel.textAndMnemonic=&Nombre de carpeta:
-FileChooser.filesOfTypeLabel.textAndMnemonic=Archivos de &tipo:
-FileChooser.upFolderToolTip.textAndMnemonic=Subir un Nivel
-FileChooser.upFolderAccessibleName=Arriba
-FileChooser.homeFolderToolTip.textAndMnemonic=Inicio
-FileChooser.homeFolderAccessibleName=Inicio
-FileChooser.newFolderToolTip.textAndMnemonic=Crear Nueva Carpeta
-FileChooser.newFolderAccessibleName=Nueva Carpeta
-FileChooser.newFolderActionLabel.textAndMnemonic=Nueva Carpeta
-FileChooser.listViewButtonToolTip.textAndMnemonic=Lista
-FileChooser.listViewButtonAccessibleName=Lista
-FileChooser.listViewActionLabel.textAndMnemonic=Lista
-FileChooser.detailsViewButtonToolTip.textAndMnemonic=Detalles
-FileChooser.detailsViewButtonAccessibleName=Detalles
-FileChooser.viewMenuButtonToolTipText = Men\u00FA Ver
-FileChooser.viewMenuButtonAccessibleName = Men\u00FA Ver
-FileChooser.detailsViewActionLabel.textAndMnemonic=Detalles
-FileChooser.refreshActionLabel.textAndMnemonic=Refrescar
-FileChooser.viewMenuLabel.textAndMnemonic=Ver
-FileChooser.fileNameHeader.textAndMnemonic=Nombre
-FileChooser.fileSizeHeader.textAndMnemonic=Tama\u00F1o
-FileChooser.fileTypeHeader.textAndMnemonic=Tipo
-FileChooser.fileDateHeader.textAndMnemonic=Modificado
-FileChooser.fileAttrHeader.textAndMnemonic=Atributos
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/resources/windows_fr.properties	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-# This properties file is used to create a PropertyResourceBundle
-# It contains Locale specific strings used be the Windows Look and Feel.
-# Currently, the following components need this for support:
-#
-#    FileChooser
-#
-# When this file is read in, the strings are put into the 
-# defaults table.  This is an implementation detail of the current
-# workings of Swing.  DO NOT DEPEND ON THIS.  
-# This may change in future versions of Swing as we improve localization 
-# support.
-#
-# Refer to the note in basic.properties for a description as to what
-# the mnemonics correspond to and how to calculate them.
-#
-# @author Steve Wilson
-
-
-############ FILE CHOOSER STRINGS #############
-
-FileChooser.lookInLabel.textAndMnemonic=Rechercher &dans :
-FileChooser.saveInLabel.textAndMnemonic=Enregistrer dans :
-FileChooser.fileNameLabel.textAndMnemonic=&Nom du fichier :
-FileChooser.folderNameLabel.textAndMnemonic=&Nom du dossier :
-FileChooser.filesOfTypeLabel.textAndMnemonic=&Type de fichier :
-FileChooser.upFolderToolTip.textAndMnemonic=Remonte d'un niveau.
-FileChooser.upFolderAccessibleName=Monter
-FileChooser.homeFolderToolTip.textAndMnemonic=R\u00E9pertoire de base
-FileChooser.homeFolderAccessibleName=R\u00E9pertoire de base
-FileChooser.newFolderToolTip.textAndMnemonic=Cr\u00E9e un dossier.
-FileChooser.newFolderAccessibleName=Nouveau dossier
-FileChooser.newFolderActionLabel.textAndMnemonic=Nouveau dossier
-FileChooser.listViewButtonToolTip.textAndMnemonic=Liste
-FileChooser.listViewButtonAccessibleName=Liste
-FileChooser.listViewActionLabel.textAndMnemonic=Liste
-FileChooser.detailsViewButtonToolTip.textAndMnemonic=D\u00E9tails
-FileChooser.detailsViewButtonAccessibleName=D\u00E9tails
-FileChooser.viewMenuButtonToolTipText = Menu Affichage
-FileChooser.viewMenuButtonAccessibleName = Menu Affichage
-FileChooser.detailsViewActionLabel.textAndMnemonic=D\u00E9tails
-FileChooser.refreshActionLabel.textAndMnemonic=Actualiser
-FileChooser.viewMenuLabel.textAndMnemonic=Affichage
-FileChooser.fileNameHeader.textAndMnemonic=Nom
-FileChooser.fileSizeHeader.textAndMnemonic=Taille
-FileChooser.fileTypeHeader.textAndMnemonic=Type
-FileChooser.fileDateHeader.textAndMnemonic=Modifi\u00E9
-FileChooser.fileAttrHeader.textAndMnemonic=Attributs
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/resources/windows_it.properties	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-# This properties file is used to create a PropertyResourceBundle
-# It contains Locale specific strings used be the Windows Look and Feel.
-# Currently, the following components need this for support:
-#
-#    FileChooser
-#
-# When this file is read in, the strings are put into the 
-# defaults table.  This is an implementation detail of the current
-# workings of Swing.  DO NOT DEPEND ON THIS.  
-# This may change in future versions of Swing as we improve localization 
-# support.
-#
-# Refer to the note in basic.properties for a description as to what
-# the mnemonics correspond to and how to calculate them.
-#
-# @author Steve Wilson
-
-
-############ FILE CHOOSER STRINGS #############
-
-FileChooser.lookInLabel.textAndMnemonic=Cerca &in:
-FileChooser.saveInLabel.textAndMnemonic=Salva in:
-FileChooser.fileNameLabel.textAndMnemonic=&Nome file:
-FileChooser.folderNameLabel.textAndMnemonic=&Nome cartella:
-FileChooser.filesOfTypeLabel.textAndMnemonic=&Tipo file:
-FileChooser.upFolderToolTip.textAndMnemonic=Cartella superiore
-FileChooser.upFolderAccessibleName=Superiore
-FileChooser.homeFolderToolTip.textAndMnemonic=Home
-FileChooser.homeFolderAccessibleName=Home
-FileChooser.newFolderToolTip.textAndMnemonic=Crea nuova cartella
-FileChooser.newFolderAccessibleName=Nuova cartella
-FileChooser.newFolderActionLabel.textAndMnemonic=Nuova cartella
-FileChooser.listViewButtonToolTip.textAndMnemonic=Lista
-FileChooser.listViewButtonAccessibleName=Lista
-FileChooser.listViewActionLabel.textAndMnemonic=Lista
-FileChooser.detailsViewButtonToolTip.textAndMnemonic=Dettagli
-FileChooser.detailsViewButtonAccessibleName=Dettagli
-FileChooser.viewMenuButtonToolTipText = Visualizza menu
-FileChooser.viewMenuButtonAccessibleName = Visualizza menu
-FileChooser.detailsViewActionLabel.textAndMnemonic=Dettagli
-FileChooser.refreshActionLabel.textAndMnemonic=Aggiorna
-FileChooser.viewMenuLabel.textAndMnemonic=Visualizza
-FileChooser.fileNameHeader.textAndMnemonic=Nome
-FileChooser.fileSizeHeader.textAndMnemonic=Dimensioni
-FileChooser.fileTypeHeader.textAndMnemonic=Tipo
-FileChooser.fileDateHeader.textAndMnemonic=Modificato
-FileChooser.fileAttrHeader.textAndMnemonic=Attributi
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/resources/windows_ja.properties	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-# This properties file is used to create a PropertyResourceBundle
-# It contains Locale specific strings used be the Windows Look and Feel.
-# Currently, the following components need this for support:
-#
-#    FileChooser
-#
-# When this file is read in, the strings are put into the 
-# defaults table.  This is an implementation detail of the current
-# workings of Swing.  DO NOT DEPEND ON THIS.  
-# This may change in future versions of Swing as we improve localization 
-# support.
-#
-# Refer to the note in basic.properties for a description as to what
-# the mnemonics correspond to and how to calculate them.
-#
-# @author Steve Wilson
-
-
-############ FILE CHOOSER STRINGS #############
-
-FileChooser.lookInLabel.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u306E\u5834\u6240(&I):
-FileChooser.saveInLabel.textAndMnemonic=\u4FDD\u5B58:
-FileChooser.fileNameLabel.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u540D(&N):
-FileChooser.folderNameLabel.textAndMnemonic=\u30D5\u30A9\u30EB\u30C0\u540D(&N):
-FileChooser.filesOfTypeLabel.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u306E\u30BF\u30A4\u30D7(&T):
-FileChooser.upFolderToolTip.textAndMnemonic=1\u30EC\u30D9\u30EB\u4E0A\u3078
-FileChooser.upFolderAccessibleName=\u4E0A\u3078
-FileChooser.homeFolderToolTip.textAndMnemonic=\u30DB\u30FC\u30E0
-FileChooser.homeFolderAccessibleName=\u30DB\u30FC\u30E0
-FileChooser.newFolderToolTip.textAndMnemonic=\u65B0\u898F\u30D5\u30A9\u30EB\u30C0\u306E\u4F5C\u6210
-FileChooser.newFolderAccessibleName=\u65B0\u898F\u30D5\u30A9\u30EB\u30C0
-FileChooser.newFolderActionLabel.textAndMnemonic=\u65B0\u898F\u30D5\u30A9\u30EB\u30C0
-FileChooser.listViewButtonToolTip.textAndMnemonic=\u30EA\u30B9\u30C8
-FileChooser.listViewButtonAccessibleName=\u30EA\u30B9\u30C8
-FileChooser.listViewActionLabel.textAndMnemonic=\u30EA\u30B9\u30C8
-FileChooser.detailsViewButtonToolTip.textAndMnemonic=\u8A73\u7D30
-FileChooser.detailsViewButtonAccessibleName=\u8A73\u7D30
-FileChooser.viewMenuButtonToolTipText = \u8868\u793A\u30E1\u30CB\u30E5\u30FC
-FileChooser.viewMenuButtonAccessibleName = \u8868\u793A\u30E1\u30CB\u30E5\u30FC
-FileChooser.detailsViewActionLabel.textAndMnemonic=\u8A73\u7D30
-FileChooser.refreshActionLabel.textAndMnemonic=\u30EA\u30D5\u30EC\u30C3\u30B7\u30E5
-FileChooser.viewMenuLabel.textAndMnemonic=\u8868\u793A
-FileChooser.fileNameHeader.textAndMnemonic=\u540D\u524D
-FileChooser.fileSizeHeader.textAndMnemonic=\u30B5\u30A4\u30BA
-FileChooser.fileTypeHeader.textAndMnemonic=\u30BF\u30A4\u30D7
-FileChooser.fileDateHeader.textAndMnemonic=\u4FEE\u6B63\u65E5
-FileChooser.fileAttrHeader.textAndMnemonic=\u5C5E\u6027
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/resources/windows_ko.properties	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-# This properties file is used to create a PropertyResourceBundle
-# It contains Locale specific strings used be the Windows Look and Feel.
-# Currently, the following components need this for support:
-#
-#    FileChooser
-#
-# When this file is read in, the strings are put into the 
-# defaults table.  This is an implementation detail of the current
-# workings of Swing.  DO NOT DEPEND ON THIS.  
-# This may change in future versions of Swing as we improve localization 
-# support.
-#
-# Refer to the note in basic.properties for a description as to what
-# the mnemonics correspond to and how to calculate them.
-#
-# @author Steve Wilson
-
-
-############ FILE CHOOSER STRINGS #############
-
-FileChooser.lookInLabel.textAndMnemonic=\uCC3E\uB294 \uC704\uCE58(&I):
-FileChooser.saveInLabel.textAndMnemonic=\uC800\uC7A5 \uC704\uCE58:
-FileChooser.fileNameLabel.textAndMnemonic=\uD30C\uC77C \uC774\uB984(&N):
-FileChooser.folderNameLabel.textAndMnemonic=\uD3F4\uB354 \uC774\uB984(&N):
-FileChooser.filesOfTypeLabel.textAndMnemonic=\uD30C\uC77C \uC720\uD615(&T):
-FileChooser.upFolderToolTip.textAndMnemonic=\uD55C \uB808\uBCA8 \uC704\uB85C
-FileChooser.upFolderAccessibleName=\uC704\uB85C
-FileChooser.homeFolderToolTip.textAndMnemonic=\uD648
-FileChooser.homeFolderAccessibleName=\uD648
-FileChooser.newFolderToolTip.textAndMnemonic=\uC0C8 \uD3F4\uB354 \uC0DD\uC131
-FileChooser.newFolderAccessibleName=\uC0C8 \uD3F4\uB354
-FileChooser.newFolderActionLabel.textAndMnemonic=\uC0C8 \uD3F4\uB354
-FileChooser.listViewButtonToolTip.textAndMnemonic=\uBAA9\uB85D
-FileChooser.listViewButtonAccessibleName=\uBAA9\uB85D
-FileChooser.listViewActionLabel.textAndMnemonic=\uBAA9\uB85D
-FileChooser.detailsViewButtonToolTip.textAndMnemonic=\uC138\uBD80\uC815\uBCF4
-FileChooser.detailsViewButtonAccessibleName=\uC138\uBD80\uC815\uBCF4
-FileChooser.viewMenuButtonToolTipText = \uBCF4\uAE30 \uBA54\uB274
-FileChooser.viewMenuButtonAccessibleName = \uBCF4\uAE30 \uBA54\uB274
-FileChooser.detailsViewActionLabel.textAndMnemonic=\uC138\uBD80\uC815\uBCF4
-FileChooser.refreshActionLabel.textAndMnemonic=\uC0C8\uB85C\uACE0\uCE68
-FileChooser.viewMenuLabel.textAndMnemonic=\uBCF4\uAE30
-FileChooser.fileNameHeader.textAndMnemonic=\uC774\uB984
-FileChooser.fileSizeHeader.textAndMnemonic=\uD06C\uAE30
-FileChooser.fileTypeHeader.textAndMnemonic=\uC720\uD615
-FileChooser.fileDateHeader.textAndMnemonic=\uC218\uC815 \uB0A0\uC9DC
-FileChooser.fileAttrHeader.textAndMnemonic=\uC18D\uC131
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/resources/windows_pt_BR.properties	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-# This properties file is used to create a PropertyResourceBundle
-# It contains Locale specific strings used be the Windows Look and Feel.
-# Currently, the following components need this for support:
-#
-#    FileChooser
-#
-# When this file is read in, the strings are put into the 
-# defaults table.  This is an implementation detail of the current
-# workings of Swing.  DO NOT DEPEND ON THIS.  
-# This may change in future versions of Swing as we improve localization 
-# support.
-#
-# Refer to the note in basic.properties for a description as to what
-# the mnemonics correspond to and how to calculate them.
-#
-# @author Steve Wilson
-
-
-############ FILE CHOOSER STRINGS #############
-
-FileChooser.lookInLabel.textAndMnemonic=Pesquisar &em:
-FileChooser.saveInLabel.textAndMnemonic=Salvar em:
-FileChooser.fileNameLabel.textAndMnemonic=&Nome do arquivo:
-FileChooser.folderNameLabel.textAndMnemonic=&Nome da pasta:
-FileChooser.filesOfTypeLabel.textAndMnemonic=Arquivos do &tipo:
-FileChooser.upFolderToolTip.textAndMnemonic=Um N\u00EDvel Acima
-FileChooser.upFolderAccessibleName=Acima
-FileChooser.homeFolderToolTip.textAndMnemonic=In\u00EDcio
-FileChooser.homeFolderAccessibleName=In\u00EDcio
-FileChooser.newFolderToolTip.textAndMnemonic=Criar Nova Pasta
-FileChooser.newFolderAccessibleName=Nova Pasta
-FileChooser.newFolderActionLabel.textAndMnemonic=Nova Pasta
-FileChooser.listViewButtonToolTip.textAndMnemonic=Lista
-FileChooser.listViewButtonAccessibleName=Lista
-FileChooser.listViewActionLabel.textAndMnemonic=Lista
-FileChooser.detailsViewButtonToolTip.textAndMnemonic=Detalhes
-FileChooser.detailsViewButtonAccessibleName=Detalhes
-FileChooser.viewMenuButtonToolTipText = Exibir Menu
-FileChooser.viewMenuButtonAccessibleName = Exibir Menu
-FileChooser.detailsViewActionLabel.textAndMnemonic=Detalhes
-FileChooser.refreshActionLabel.textAndMnemonic=Atualizar
-FileChooser.viewMenuLabel.textAndMnemonic=Exibir
-FileChooser.fileNameHeader.textAndMnemonic=Nome
-FileChooser.fileSizeHeader.textAndMnemonic=Tamanho
-FileChooser.fileTypeHeader.textAndMnemonic=Tipo
-FileChooser.fileDateHeader.textAndMnemonic=Modificado
-FileChooser.fileAttrHeader.textAndMnemonic=Atributos
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/resources/windows_sv.properties	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-# This properties file is used to create a PropertyResourceBundle
-# It contains Locale specific strings used be the Windows Look and Feel.
-# Currently, the following components need this for support:
-#
-#    FileChooser
-#
-# When this file is read in, the strings are put into the 
-# defaults table.  This is an implementation detail of the current
-# workings of Swing.  DO NOT DEPEND ON THIS.  
-# This may change in future versions of Swing as we improve localization 
-# support.
-#
-# Refer to the note in basic.properties for a description as to what
-# the mnemonics correspond to and how to calculate them.
-#
-# @author Steve Wilson
-
-
-############ FILE CHOOSER STRINGS #############
-
-FileChooser.lookInLabel.textAndMnemonic=Leta &i:
-FileChooser.saveInLabel.textAndMnemonic=Spara i:
-FileChooser.fileNameLabel.textAndMnemonic=Fil&namn:
-FileChooser.folderNameLabel.textAndMnemonic=Mapp&namn:
-FileChooser.filesOfTypeLabel.textAndMnemonic=Filer av &typen:
-FileChooser.upFolderToolTip.textAndMnemonic=Upp en niv\u00E5
-FileChooser.upFolderAccessibleName=Upp
-FileChooser.homeFolderToolTip.textAndMnemonic=Hem
-FileChooser.homeFolderAccessibleName=Hem
-FileChooser.newFolderToolTip.textAndMnemonic=Skapa ny mapp
-FileChooser.newFolderAccessibleName=Ny mapp
-FileChooser.newFolderActionLabel.textAndMnemonic=Ny mapp
-FileChooser.listViewButtonToolTip.textAndMnemonic=Lista
-FileChooser.listViewButtonAccessibleName=Lista
-FileChooser.listViewActionLabel.textAndMnemonic=Lista
-FileChooser.detailsViewButtonToolTip.textAndMnemonic=Detaljer
-FileChooser.detailsViewButtonAccessibleName=Detaljer
-FileChooser.viewMenuButtonToolTipText = Menyn Visa
-FileChooser.viewMenuButtonAccessibleName = Menyn Visa
-FileChooser.detailsViewActionLabel.textAndMnemonic=Detaljer
-FileChooser.refreshActionLabel.textAndMnemonic=F\u00F6rnya
-FileChooser.viewMenuLabel.textAndMnemonic=Vy
-FileChooser.fileNameHeader.textAndMnemonic=Namn
-FileChooser.fileSizeHeader.textAndMnemonic=Storlek
-FileChooser.fileTypeHeader.textAndMnemonic=Typ
-FileChooser.fileDateHeader.textAndMnemonic=\u00C4ndrad
-FileChooser.fileAttrHeader.textAndMnemonic=Attribut
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/resources/windows_zh_CN.properties	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-# This properties file is used to create a PropertyResourceBundle
-# It contains Locale specific strings used be the Windows Look and Feel.
-# Currently, the following components need this for support:
-#
-#    FileChooser
-#
-# When this file is read in, the strings are put into the 
-# defaults table.  This is an implementation detail of the current
-# workings of Swing.  DO NOT DEPEND ON THIS.  
-# This may change in future versions of Swing as we improve localization 
-# support.
-#
-# Refer to the note in basic.properties for a description as to what
-# the mnemonics correspond to and how to calculate them.
-#
-# @author Steve Wilson
-
-
-############ FILE CHOOSER STRINGS #############
-
-FileChooser.lookInLabel.textAndMnemonic=\u67E5\u627E(&I):
-FileChooser.saveInLabel.textAndMnemonic=\u4FDD\u5B58: 
-FileChooser.fileNameLabel.textAndMnemonic=\u6587\u4EF6\u540D(&N):
-FileChooser.folderNameLabel.textAndMnemonic=\u6587\u4EF6\u5939\u540D(&N):
-FileChooser.filesOfTypeLabel.textAndMnemonic=\u6587\u4EF6\u7C7B\u578B(&T):
-FileChooser.upFolderToolTip.textAndMnemonic=\u5411\u4E0A\u4E00\u7EA7
-FileChooser.upFolderAccessibleName=\u5411\u4E0A
-FileChooser.homeFolderToolTip.textAndMnemonic=\u4E3B\u76EE\u5F55
-FileChooser.homeFolderAccessibleName=\u4E3B\u76EE\u5F55
-FileChooser.newFolderToolTip.textAndMnemonic=\u521B\u5EFA\u65B0\u6587\u4EF6\u5939
-FileChooser.newFolderAccessibleName=\u65B0\u5EFA\u6587\u4EF6\u5939
-FileChooser.newFolderActionLabel.textAndMnemonic=\u65B0\u5EFA\u6587\u4EF6\u5939
-FileChooser.listViewButtonToolTip.textAndMnemonic=\u5217\u8868
-FileChooser.listViewButtonAccessibleName=\u5217\u8868
-FileChooser.listViewActionLabel.textAndMnemonic=\u5217\u8868
-FileChooser.detailsViewButtonToolTip.textAndMnemonic=\u8BE6\u7EC6\u4FE1\u606F
-FileChooser.detailsViewButtonAccessibleName=\u8BE6\u7EC6\u4FE1\u606F
-FileChooser.viewMenuButtonToolTipText = \u67E5\u770B\u83DC\u5355
-FileChooser.viewMenuButtonAccessibleName = \u67E5\u770B\u83DC\u5355
-FileChooser.detailsViewActionLabel.textAndMnemonic=\u8BE6\u7EC6\u4FE1\u606F
-FileChooser.refreshActionLabel.textAndMnemonic=\u5237\u65B0
-FileChooser.viewMenuLabel.textAndMnemonic=\u89C6\u56FE
-FileChooser.fileNameHeader.textAndMnemonic=\u540D\u79F0
-FileChooser.fileSizeHeader.textAndMnemonic=\u5927\u5C0F
-FileChooser.fileTypeHeader.textAndMnemonic=\u7C7B\u578B
-FileChooser.fileDateHeader.textAndMnemonic=\u4FEE\u6539\u65E5\u671F
-FileChooser.fileAttrHeader.textAndMnemonic=\u5C5E\u6027
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/resources/windows_zh_TW.properties	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-# This properties file is used to create a PropertyResourceBundle
-# It contains Locale specific strings used be the Windows Look and Feel.
-# Currently, the following components need this for support:
-#
-#    FileChooser
-#
-# When this file is read in, the strings are put into the 
-# defaults table.  This is an implementation detail of the current
-# workings of Swing.  DO NOT DEPEND ON THIS.  
-# This may change in future versions of Swing as we improve localization 
-# support.
-#
-# Refer to the note in basic.properties for a description as to what
-# the mnemonics correspond to and how to calculate them.
-#
-# @author Steve Wilson
-
-
-############ FILE CHOOSER STRINGS #############
-
-FileChooser.lookInLabel.textAndMnemonic=\u67E5\u8A62(&I):
-FileChooser.saveInLabel.textAndMnemonic=\u5132\u5B58\u65BC: 
-FileChooser.fileNameLabel.textAndMnemonic=\u6A94\u6848\u540D\u7A31(&N):
-FileChooser.folderNameLabel.textAndMnemonic=\u8CC7\u6599\u593E\u540D\u7A31(&N):
-FileChooser.filesOfTypeLabel.textAndMnemonic=\u6A94\u6848\u985E\u578B(&T):
-FileChooser.upFolderToolTip.textAndMnemonic=\u5F80\u4E0A\u4E00\u5C64
-FileChooser.upFolderAccessibleName=\u5F80\u4E0A
-FileChooser.homeFolderToolTip.textAndMnemonic=\u4E3B\u76EE\u9304
-FileChooser.homeFolderAccessibleName=\u4E3B\u76EE\u9304
-FileChooser.newFolderToolTip.textAndMnemonic=\u5EFA\u7ACB\u65B0\u8CC7\u6599\u593E
-FileChooser.newFolderAccessibleName=\u65B0\u8CC7\u6599\u593E
-FileChooser.newFolderActionLabel.textAndMnemonic=\u65B0\u8CC7\u6599\u593E
-FileChooser.listViewButtonToolTip.textAndMnemonic=\u6E05\u55AE
-FileChooser.listViewButtonAccessibleName=\u6E05\u55AE
-FileChooser.listViewActionLabel.textAndMnemonic=\u6E05\u55AE
-FileChooser.detailsViewButtonToolTip.textAndMnemonic=\u8A73\u7D30\u8CC7\u8A0A
-FileChooser.detailsViewButtonAccessibleName=\u8A73\u7D30\u8CC7\u8A0A
-FileChooser.viewMenuButtonToolTipText = \u6AA2\u8996\u529F\u80FD\u8868
-FileChooser.viewMenuButtonAccessibleName = \u6AA2\u8996\u529F\u80FD\u8868
-FileChooser.detailsViewActionLabel.textAndMnemonic=\u8A73\u7D30\u8CC7\u8A0A
-FileChooser.refreshActionLabel.textAndMnemonic=\u91CD\u65B0\u6574\u7406
-FileChooser.viewMenuLabel.textAndMnemonic=\u6AA2\u8996
-FileChooser.fileNameHeader.textAndMnemonic=\u540D\u7A31
-FileChooser.fileSizeHeader.textAndMnemonic=\u5927\u5C0F
-FileChooser.fileTypeHeader.textAndMnemonic=\u985E\u578B
-FileChooser.fileDateHeader.textAndMnemonic=\u4FEE\u6539\u65E5\u671F
-FileChooser.fileAttrHeader.textAndMnemonic=\u5C6C\u6027
--- a/src/java.desktop/share/classes/com/sun/media/sound/AiffFileWriter.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/com/sun/media/sound/AiffFileWriter.java	Wed Dec 13 10:25:38 2017 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2016, 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
@@ -113,10 +113,11 @@
         AiffFileFormat aiffFileFormat = (AiffFileFormat)getAudioFileFormat(fileType, stream);
 
         // first write the file without worrying about length fields
-        FileOutputStream fos = new FileOutputStream( out );     // throws IOException
-        BufferedOutputStream bos = new BufferedOutputStream( fos, bisBufferSize );
-        int bytesWritten = writeAiffFile(stream, aiffFileFormat, bos );
-        bos.close();
+        final int bytesWritten;
+        try (final FileOutputStream fos = new FileOutputStream(out);
+             final BufferedOutputStream bos = new BufferedOutputStream(fos)) {
+            bytesWritten = writeAiffFile(stream, aiffFileFormat, bos);
+        }
 
         // now, if length fields were not specified, calculate them,
         // open as a random access file, write the appropriate fields,
@@ -134,20 +135,19 @@
             long dataSize=ssndChunkSize-16;
             //TODO possibly incorrect round
             int numFrames = (int) (dataSize / ssndBlockSize);
-
-            RandomAccessFile raf=new RandomAccessFile(out, "rw");
-            // skip FORM magic
-            raf.skipBytes(4);
-            raf.writeInt(aiffLength-8);
-            // skip aiff2 magic, fver chunk, comm magic, comm size, channel count,
-            raf.skipBytes(4+aiffFileFormat.getFverChunkSize()+4+4+2);
-            // write frame count
-            raf.writeInt(numFrames);
-            // skip sample size, samplerate, SSND magic
-            raf.skipBytes(2+10+4);
-            raf.writeInt(ssndChunkSize-8);
-            // that's all
-            raf.close();
+            try (final RandomAccessFile raf = new RandomAccessFile(out, "rw")) {
+                // skip FORM magic
+                raf.skipBytes(4);
+                raf.writeInt(aiffLength - 8);
+                // skip aiff2 magic, fver chunk, comm magic, comm size, channel count,
+                raf.skipBytes(4 + aiffFileFormat.getFverChunkSize() + 4 + 4 + 2);
+                // write frame count
+                raf.writeInt(numFrames);
+                // skip sample size, samplerate, SSND magic
+                raf.skipBytes(2 + 10 + 4);
+                raf.writeInt(ssndChunkSize - 8);
+                // that's all
+            }
         }
 
         return bytesWritten;
@@ -289,10 +289,6 @@
         int compCode = AiffFileFormat.AIFC_PCM;
 
         byte header[] = null;
-        ByteArrayInputStream headerStream = null;
-        ByteArrayOutputStream baos = null;
-        DataOutputStream dos = null;
-        SequenceInputStream aiffStream = null;
         InputStream codedAudioStream = audioStream;
 
         // if we need to do any format conversion, do it here....
@@ -343,52 +339,39 @@
 
 
         // Now create an AIFF stream header...
-        baos = new ByteArrayOutputStream();
-        dos = new DataOutputStream(baos);
-
-        // Write the outer FORM chunk
-        dos.writeInt(AiffFileFormat.AIFF_MAGIC);
-        dos.writeInt( (aiffLength-8) );
-        dos.writeInt(AiffFileFormat.AIFF_MAGIC2);
-
-        // Write a FVER chunk - only for AIFC
-        //dos.writeInt(FVER_MAGIC);
-        //dos.writeInt( (fverChunkSize-8) );
-        //dos.writeInt(FVER_TIMESTAMP);
-
-        // Write a COMM chunk
-        dos.writeInt(AiffFileFormat.COMM_MAGIC);
-        dos.writeInt( (commChunkSize-8) );
-        dos.writeShort(channels);
-        dos.writeInt(numFrames);
-        dos.writeShort(sampleSize);
-        write_ieee_extended(dos, sampleFramesPerSecond);   // 10 bytes
-
-        //Only for AIFC
-        //dos.writeInt(compCode);
-        //dos.writeInt(compCode);
-        //dos.writeShort(0);
-
-        // Write the SSND chunk header
-        dos.writeInt(AiffFileFormat.SSND_MAGIC);
-        dos.writeInt( (ssndChunkSize-8) );
-        // ssndOffset and ssndBlockSize set to 0 upon
-        // recommendation in "Sound Manager" chapter in
-        // "Inside Macintosh Sound", pp 2-87  (from Babu)
-        dos.writeInt(0);        // ssndOffset
-        dos.writeInt(0);        // ssndBlockSize
-
-        // Concat this with the audioStream and return it
-
-        dos.close();
-        header = baos.toByteArray();
-        headerStream = new ByteArrayInputStream( header );
-
-        aiffStream = new SequenceInputStream(headerStream,
-                            new NoCloseInputStream(codedAudioStream));
-
-        return aiffStream;
-
+        try (final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+             final DataOutputStream dos = new DataOutputStream(baos)) {
+            // Write the outer FORM chunk
+            dos.writeInt(AiffFileFormat.AIFF_MAGIC);
+            dos.writeInt((aiffLength - 8));
+            dos.writeInt(AiffFileFormat.AIFF_MAGIC2);
+            // Write a FVER chunk - only for AIFC
+            //dos.writeInt(FVER_MAGIC);
+            //dos.writeInt( (fverChunkSize-8) );
+            //dos.writeInt(FVER_TIMESTAMP);
+            // Write a COMM chunk
+            dos.writeInt(AiffFileFormat.COMM_MAGIC);
+            dos.writeInt((commChunkSize - 8));
+            dos.writeShort(channels);
+            dos.writeInt(numFrames);
+            dos.writeShort(sampleSize);
+            write_ieee_extended(dos, sampleFramesPerSecond);   // 10 bytes
+            //Only for AIFC
+            //dos.writeInt(compCode);
+            //dos.writeInt(compCode);
+            //dos.writeShort(0);
+            // Write the SSND chunk header
+            dos.writeInt(AiffFileFormat.SSND_MAGIC);
+            dos.writeInt((ssndChunkSize - 8));
+            // ssndOffset and ssndBlockSize set to 0 upon
+            // recommendation in "Sound Manager" chapter in
+            // "Inside Macintosh Sound", pp 2-87  (from Babu)
+            dos.writeInt(0);        // ssndOffset
+            dos.writeInt(0);        // ssndBlockSize
+            header = baos.toByteArray();
+        }
+        return new SequenceInputStream(new ByteArrayInputStream(header),
+                                       new NoCloseInputStream(codedAudioStream));
     }
 
     // HELPER METHODS
--- a/src/java.desktop/share/classes/com/sun/media/sound/AuFileWriter.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/com/sun/media/sound/AuFileWriter.java	Wed Dec 13 10:25:38 2017 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2016, 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
@@ -111,10 +111,11 @@
         AuFileFormat auFileFormat = (AuFileFormat)getAudioFileFormat(fileType, stream);
 
         // first write the file without worrying about length fields
-        FileOutputStream fos = new FileOutputStream( out );     // throws IOException
-        BufferedOutputStream bos = new BufferedOutputStream( fos, bisBufferSize );
-        int bytesWritten = writeAuFile(stream, auFileFormat, bos );
-        bos.close();
+        final int bytesWritten;
+        try (final FileOutputStream fos = new FileOutputStream(out);
+             final BufferedOutputStream bos = new BufferedOutputStream(fos)) {
+            bytesWritten = writeAuFile(stream, auFileFormat, bos);
+        }
 
         // now, if length fields were not specified, calculate them,
         // open as a random access file, write the appropriate fields,
@@ -123,14 +124,14 @@
 
             // $$kk: 10.22.99: jan: please either implement this or throw an exception!
             // $$fb: 2001-07-13: done. Fixes Bug 4479981
-            RandomAccessFile raf=new RandomAccessFile(out, "rw");
-            if (raf.length()<=0x7FFFFFFFl) {
-                // skip AU magic and data offset field
-                raf.skipBytes(8);
-                raf.writeInt(bytesWritten-AuFileFormat.AU_HEADERSIZE);
-                // that's all
+            try (final RandomAccessFile raf = new RandomAccessFile(out, "rw")) {
+                if (raf.length() <= 0x7FFFFFFFl) {
+                    // skip AU magic and data offset field
+                    raf.skipBytes(8);
+                    raf.writeInt(bytesWritten - AuFileFormat.AU_HEADERSIZE);
+                    // that's all
+                }
             }
-            raf.close();
         }
 
         return bytesWritten;
@@ -191,39 +192,29 @@
         int sampleRate     = (int)format.getSampleRate();
         int channels       = format.getChannels();
 
-        byte header[] = null;
-        ByteArrayInputStream headerStream = null;
-        ByteArrayOutputStream baos = null;
-        DataOutputStream dos = null;
-        SequenceInputStream auStream = null;
-
         // if we need to do any format conversion, we do it here.
         //$$ fb 2001-07-13: Bug 4391108
         audioStream = AudioSystem.getAudioInputStream(format, audioStream);
 
-        baos = new ByteArrayOutputStream();
-        dos = new DataOutputStream(baos);
-
-        dos.writeInt(AuFileFormat.AU_SUN_MAGIC);
-        dos.writeInt(headerSize);
-        dos.writeInt((int)dataSizeInBytes);
-        dos.writeInt(auType);
-        dos.writeInt(sampleRate);
-        dos.writeInt(channels);
-
+        final byte[] header;
+        try (ByteArrayOutputStream baos = new ByteArrayOutputStream();
+             DataOutputStream dos = new DataOutputStream(baos)) {
+            dos.writeInt(AuFileFormat.AU_SUN_MAGIC);
+            dos.writeInt(headerSize);
+            dos.writeInt((int) dataSizeInBytes);
+            dos.writeInt(auType);
+            dos.writeInt(sampleRate);
+            dos.writeInt(channels);
+            header = baos.toByteArray();
+        }
         // Now create a new InputStream from headerStream and the InputStream
         // in audioStream
-
-        dos.close();
-        header = baos.toByteArray();
-        headerStream = new ByteArrayInputStream( header );
-        auStream = new SequenceInputStream(headerStream,
-                        new NoCloseInputStream(audioStream));
-
-        return auStream;
+        return new SequenceInputStream(new ByteArrayInputStream(header),
+                                       new NoCloseInputStream(audioStream));
     }
 
-    private int writeAuFile(AudioInputStream in, AuFileFormat auFileFormat, OutputStream out) throws IOException {
+    private int writeAuFile(AudioInputStream in, AuFileFormat auFileFormat,
+                            OutputStream out) throws IOException {
 
         int bytesRead = 0;
         int bytesWritten = 0;
--- a/src/java.desktop/share/classes/com/sun/media/sound/WaveFileWriter.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/com/sun/media/sound/WaveFileWriter.java	Wed Dec 13 10:25:38 2017 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2016, 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
@@ -113,10 +113,11 @@
         WaveFileFormat waveFileFormat = (WaveFileFormat)getAudioFileFormat(fileType, stream);
 
         // first write the file without worrying about length fields
-        FileOutputStream fos = new FileOutputStream( out );     // throws IOException
-        BufferedOutputStream bos = new BufferedOutputStream( fos, bisBufferSize );
-        int bytesWritten = writeWaveFile(stream, waveFileFormat, bos );
-        bos.close();
+        final int bytesWritten;
+        try (final FileOutputStream fos = new FileOutputStream(out);
+             final BufferedOutputStream bos = new BufferedOutputStream(fos)) {
+            bytesWritten = writeWaveFile(stream, waveFileFormat, bos);
+        }
 
         // now, if length fields were not specified, calculate them,
         // open as a random access file, write the appropriate fields,
@@ -125,16 +126,16 @@
 
             int dataLength=bytesWritten-waveFileFormat.getHeaderSize();
             int riffLength=dataLength + waveFileFormat.getHeaderSize() - 8;
-
-            RandomAccessFile raf=new RandomAccessFile(out, "rw");
-            // skip RIFF magic
-            raf.skipBytes(4);
-            raf.writeInt(big2little( riffLength ));
-            // skip WAVE magic, fmt_ magic, fmt_ length, fmt_ chunk, data magic
-            raf.skipBytes(4+4+4+WaveFileFormat.getFmtChunkSize(waveFileFormat.getWaveType())+4);
-            raf.writeInt(big2little( dataLength ));
-            // that's all
-            raf.close();
+            try (final RandomAccessFile raf = new RandomAccessFile(out, "rw")) {
+                // skip RIFF magic
+                raf.skipBytes(4);
+                raf.writeInt(big2little(riffLength));
+                // skip WAVE magic, fmt_ magic, fmt_ length, fmt_ chunk, data magic
+                raf.skipBytes(4 + 4 + 4 + WaveFileFormat.getFmtChunkSize(
+                        waveFileFormat.getWaveType()) + 4);
+                raf.writeInt(big2little(dataLength));
+                // that's all
+            }
         }
 
         return bytesWritten;
@@ -262,12 +263,6 @@
         int length                         = waveFileFormat.getByteLength();
         int riffLength = dataLength + headerLength - 8;
 
-        byte header[] = null;
-        ByteArrayInputStream headerStream = null;
-        ByteArrayOutputStream baos = null;
-        DataOutputStream dos = null;
-        SequenceInputStream waveStream = null;
-
         AudioFormat audioStreamFormat = null;
         AudioFormat.Encoding encoding = null;
         InputStream codedAudioStream = audioStream;
@@ -314,37 +309,31 @@
 
 
         // Now push the header into a stream, concat, and return the new SequenceInputStream
-
-        baos = new ByteArrayOutputStream();
-        dos = new DataOutputStream(baos);
-
-        // we write in littleendian...
-        dos.writeInt(riffMagic);
-        dos.writeInt(big2little( riffLength ));
-        dos.writeInt(waveMagic);
-        dos.writeInt(fmtMagic);
-        dos.writeInt(big2little(fmtLength));
-        dos.writeShort(big2littleShort(wav_type));
-        dos.writeShort(big2littleShort(channels));
-        dos.writeInt(big2little(sampleRate));
-        dos.writeInt(big2little(avgBytesPerSec));
-        dos.writeShort(big2littleShort(blockAlign));
-        dos.writeShort(big2littleShort(sampleSizeInBits));
-        //$$fb 2002-04-16: Fix for 4636355: RIFF audio headers could be _more_ spec compliant
-        if (wav_type != WaveFileFormat.WAVE_FORMAT_PCM) {
-            // add length 0 for "codec specific data length"
-            dos.writeShort(0);
+        final byte[] header;
+        try (final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+             final DataOutputStream dos = new DataOutputStream(baos)) {
+            // we write in littleendian...
+            dos.writeInt(riffMagic);
+            dos.writeInt(big2little(riffLength));
+            dos.writeInt(waveMagic);
+            dos.writeInt(fmtMagic);
+            dos.writeInt(big2little(fmtLength));
+            dos.writeShort(big2littleShort(wav_type));
+            dos.writeShort(big2littleShort(channels));
+            dos.writeInt(big2little(sampleRate));
+            dos.writeInt(big2little(avgBytesPerSec));
+            dos.writeShort(big2littleShort(blockAlign));
+            dos.writeShort(big2littleShort(sampleSizeInBits));
+            //$$fb 2002-04-16: Fix for 4636355: RIFF audio headers could be _more_ spec compliant
+            if (wav_type != WaveFileFormat.WAVE_FORMAT_PCM) {
+                // add length 0 for "codec specific data length"
+                dos.writeShort(0);
+            }
+            dos.writeInt(dataMagic);
+            dos.writeInt(big2little(dataLength));
+            header = baos.toByteArray();
         }
-
-        dos.writeInt(dataMagic);
-        dos.writeInt(big2little(dataLength));
-
-        dos.close();
-        header = baos.toByteArray();
-        headerStream = new ByteArrayInputStream( header );
-        waveStream = new SequenceInputStream(headerStream,
-                            new NoCloseInputStream(codedAudioStream));
-
-        return waveStream;
+        return new SequenceInputStream(new ByteArrayInputStream(header),
+                                       new NoCloseInputStream(codedAudioStream));
     }
 }
--- a/src/java.desktop/share/classes/com/sun/media/sound/WaveFloatFileWriter.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/com/sun/media/sound/WaveFloatFileWriter.java	Wed Dec 13 10:25:38 2017 -0800
@@ -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
@@ -69,24 +69,23 @@
 
     public void write(AudioInputStream stream, RIFFWriter writer)
             throws IOException {
-
-        RIFFWriter fmt_chunk = writer.writeChunk("fmt ");
-
-        AudioFormat format = stream.getFormat();
-        fmt_chunk.writeUnsignedShort(3); // WAVE_FORMAT_IEEE_FLOAT
-        fmt_chunk.writeUnsignedShort(format.getChannels());
-        fmt_chunk.writeUnsignedInt((int) format.getSampleRate());
-        fmt_chunk.writeUnsignedInt(((int) format.getFrameRate())
-                * format.getFrameSize());
-        fmt_chunk.writeUnsignedShort(format.getFrameSize());
-        fmt_chunk.writeUnsignedShort(format.getSampleSizeInBits());
-        fmt_chunk.close();
-        RIFFWriter data_chunk = writer.writeChunk("data");
-        byte[] buff = new byte[1024];
-        int len;
-        while ((len = stream.read(buff, 0, buff.length)) != -1)
-            data_chunk.write(buff, 0, len);
-        data_chunk.close();
+        try (final RIFFWriter fmt_chunk = writer.writeChunk("fmt ")) {
+            AudioFormat format = stream.getFormat();
+            fmt_chunk.writeUnsignedShort(3); // WAVE_FORMAT_IEEE_FLOAT
+            fmt_chunk.writeUnsignedShort(format.getChannels());
+            fmt_chunk.writeUnsignedInt((int) format.getSampleRate());
+            fmt_chunk.writeUnsignedInt(((int) format.getFrameRate())
+                                               * format.getFrameSize());
+            fmt_chunk.writeUnsignedShort(format.getFrameSize());
+            fmt_chunk.writeUnsignedShort(format.getSampleSizeInBits());
+        }
+        try (RIFFWriter data_chunk = writer.writeChunk("data")) {
+            byte[] buff = new byte[1024];
+            int len;
+            while ((len = stream.read(buff, 0, buff.length)) != -1) {
+                data_chunk.write(buff, 0, len);
+            }
+        }
     }
 
     private static final class NoCloseOutputStream extends OutputStream {
@@ -136,11 +135,11 @@
         checkFormat(fileType, stream);
         if (stream.getFormat().isBigEndian())
             stream = toLittleEndian(stream);
-        RIFFWriter writer = new RIFFWriter(new NoCloseOutputStream(out), "WAVE");
-        write(stream, writer);
-        int fpointer = (int) writer.getFilePointer();
-        writer.close();
-        return fpointer;
+        try (final RIFFWriter writer = new RIFFWriter(
+                new NoCloseOutputStream(out), "WAVE")) {
+            write(stream, writer);
+            return (int) writer.getFilePointer();
+        }
     }
 
     @Override
@@ -153,10 +152,9 @@
         checkFormat(fileType, stream);
         if (stream.getFormat().isBigEndian())
             stream = toLittleEndian(stream);
-        RIFFWriter writer = new RIFFWriter(out, "WAVE");
-        write(stream, writer);
-        int fpointer = (int) writer.getFilePointer();
-        writer.close();
-        return fpointer;
+        try (final RIFFWriter writer = new RIFFWriter(out, "WAVE")) {
+            write(stream, writer);
+            return (int) writer.getFilePointer();
+        }
     }
 }
--- a/src/java.desktop/share/classes/java/awt/AWTEvent.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/java/awt/AWTEvent.java	Wed Dec 13 10:25:38 2017 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2014, 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
@@ -25,16 +25,24 @@
 
 package java.awt;
 
-import java.util.EventObject;
-import java.awt.event.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.AdjustmentEvent;
+import java.awt.event.ComponentEvent;
+import java.awt.event.FocusEvent;
+import java.awt.event.InputEvent;
+import java.awt.event.InputMethodEvent;
+import java.awt.event.ItemEvent;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseEvent;
+import java.awt.event.TextEvent;
+import java.awt.event.WindowEvent;
 import java.awt.peer.ComponentPeer;
 import java.awt.peer.LightweightPeer;
-import java.lang.reflect.Field;
-import sun.awt.AWTAccessor;
-import sun.util.logging.PlatformLogger;
-
 import java.security.AccessControlContext;
 import java.security.AccessController;
+import java.util.EventObject;
+
+import sun.awt.AWTAccessor;
 
 /**
  * The root event class for all AWT events.
@@ -78,7 +86,7 @@
  * @since 1.1
  */
 public abstract class AWTEvent extends EventObject {
-    private static final PlatformLogger log = PlatformLogger.getLogger("java.awt.AWTEvent");
+
     private byte bdata[];
 
     /**
@@ -241,9 +249,6 @@
      */
     public static final int RESERVED_ID_MAX = 1999;
 
-    // security stuff
-    private static Field inputEvent_CanAccessSystemClipboard_Field = null;
-
     /*
      * JDK 1.1 serialVersionUID
      */
--- a/src/java.desktop/share/classes/java/awt/Font.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/java/awt/Font.java	Wed Dec 13 10:25:38 2017 -0800
@@ -56,6 +56,7 @@
 import sun.font.Font2D;
 import sun.font.Font2DHandle;
 import sun.font.FontAccess;
+import sun.font.FontDesignMetrics;
 import sun.font.FontManager;
 import sun.font.FontManagerFactory;
 import sun.font.FontUtilities;
@@ -2603,9 +2604,8 @@
         }
 
         if (simple) {
-            GlyphVector gv = new StandardGlyphVector(this, chars, beginIndex,
-                                                     limit - beginIndex, frc);
-            return gv.getLogicalBounds();
+            FontDesignMetrics metrics = FontDesignMetrics.getMetrics(this, frc);
+            return metrics.getSimpleBounds(chars, beginIndex, limit-beginIndex);
         } else {
             // need char array constructor on textlayout
             String str = new String(chars, beginIndex, limit - beginIndex);
--- a/src/java.desktop/share/classes/java/awt/MenuBar.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/java/awt/MenuBar.java	Wed Dec 13 10:25:38 2017 -0800
@@ -377,7 +377,6 @@
      * keydown).  Returns true if there is an associated
      * keyboard event.
      */
-    @SuppressWarnings("deprecation")
     boolean handleShortcut(KeyEvent e) {
         // Is it a key event?
         int id = e.getID();
@@ -386,8 +385,8 @@
         }
 
         // Is the accelerator modifier key pressed?
-        int accelKey = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
-        if ((e.getModifiers() & accelKey) == 0) {
+        int accelKey = Toolkit.getDefaultToolkit().getMenuShortcutKeyMaskEx();
+        if ((e.getModifiersEx() & accelKey) == 0) {
             return false;
         }
 
--- a/src/java.desktop/share/classes/java/awt/MenuShortcut.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/java/awt/MenuShortcut.java	Wed Dec 13 10:25:38 2017 -0800
@@ -24,6 +24,7 @@
  */
 package java.awt;
 
+import java.awt.event.InputEvent;
 import java.awt.event.KeyEvent;
 
 /**
@@ -51,7 +52,7 @@
  * only work if the current keyboard layout produces a corresponding letter.
  * <p>
  * The accelerator key is platform-dependent and may be obtained
- * via {@link Toolkit#getMenuShortcutKeyMask}.
+ * via {@link Toolkit#getMenuShortcutKeyMaskEx()}.
  *
  * @author Thomas Ball
  * @since 1.1
@@ -180,16 +181,15 @@
      * @return a string representation of this MenuShortcut.
      * @since 1.1
      */
-    @SuppressWarnings("deprecation")
     public String toString() {
         int modifiers = 0;
         if (!GraphicsEnvironment.isHeadless()) {
-            modifiers = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
+            modifiers = Toolkit.getDefaultToolkit().getMenuShortcutKeyMaskEx();
         }
         if (usesShiftModifier()) {
-            modifiers |= Event.SHIFT_MASK;
+            modifiers |= InputEvent.SHIFT_DOWN_MASK;
         }
-        return KeyEvent.getKeyModifiersText(modifiers) + "+" +
+        return InputEvent.getModifiersExText(modifiers) + "+" +
                KeyEvent.getKeyText(key);
     }
 
--- a/src/java.desktop/share/classes/java/awt/Toolkit.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/java/awt/Toolkit.java	Wed Dec 13 10:25:38 2017 -0800
@@ -29,7 +29,23 @@
 import java.awt.dnd.DragGestureListener;
 import java.awt.dnd.DragGestureRecognizer;
 import java.awt.dnd.DragSource;
-import java.awt.event.*;
+import java.awt.event.AWTEventListener;
+import java.awt.event.AWTEventListenerProxy;
+import java.awt.event.ActionEvent;
+import java.awt.event.AdjustmentEvent;
+import java.awt.event.ComponentEvent;
+import java.awt.event.ContainerEvent;
+import java.awt.event.FocusEvent;
+import java.awt.event.HierarchyEvent;
+import java.awt.event.InputEvent;
+import java.awt.event.InputMethodEvent;
+import java.awt.event.InvocationEvent;
+import java.awt.event.ItemEvent;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseEvent;
+import java.awt.event.PaintEvent;
+import java.awt.event.TextEvent;
+import java.awt.event.WindowEvent;
 import java.awt.im.InputMethodHighlight;
 import java.awt.image.ColorModel;
 import java.awt.image.ImageObserver;
@@ -40,15 +56,22 @@
 import java.io.File;
 import java.io.FileInputStream;
 import java.net.URL;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.EventListener;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.MissingResourceException;
 import java.util.Properties;
 import java.util.ResourceBundle;
-import java.util.StringTokenizer;
+import java.util.ServiceLoader;
+import java.util.Set;
 import java.util.WeakHashMap;
+import java.util.stream.Collectors;
+
+import javax.accessibility.AccessibilityProvider;
 
 import sun.awt.AWTAccessor;
 import sun.awt.AWTPermissions;
@@ -57,14 +80,6 @@
 import sun.awt.PeerEvent;
 import sun.awt.SunToolkit;
 
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.Arrays;
-import java.util.ServiceLoader;
-import java.util.Set;
-import java.util.stream.Collectors;
-import javax.accessibility.AccessibilityProvider;
-
 /**
  * This class is the abstract superclass of all actual
  * implementations of the Abstract Window Toolkit. Subclasses of
@@ -1065,9 +1080,11 @@
      * @see       java.awt.GraphicsEnvironment#isHeadless
      * @see       java.awt.MenuBar
      * @see       java.awt.MenuShortcut
+     * @deprecated It is recommended that extended modifier keys and
+     *             {@link #getMenuShortcutKeyMaskEx()} be used instead
      * @since     1.1
      */
-    @SuppressWarnings("deprecation")
+    @Deprecated(since = "10")
     public int getMenuShortcutKeyMask() throws HeadlessException {
         GraphicsEnvironment.checkHeadless();
 
@@ -1075,6 +1092,32 @@
     }
 
     /**
+     * Determines which extended modifier key is the appropriate accelerator
+     * key for menu shortcuts.
+     * <p>
+     * Menu shortcuts, which are embodied in the {@code MenuShortcut} class, are
+     * handled by the {@code MenuBar} class.
+     * <p>
+     * By default, this method returns {@code InputEvent.CTRL_DOWN_MASK}.
+     * Toolkit implementations should override this method if the
+     * <b>Control</b> key isn't the correct key for accelerators.
+     *
+     * @return the modifier mask on the {@code InputEvent} class that is used
+     *         for menu shortcuts on this toolkit
+     * @throws HeadlessException if GraphicsEnvironment.isHeadless() returns
+     *         true
+     * @see java.awt.GraphicsEnvironment#isHeadless
+     * @see java.awt.MenuBar
+     * @see java.awt.MenuShortcut
+     * @since 10
+     */
+    public int getMenuShortcutKeyMaskEx() throws HeadlessException {
+        GraphicsEnvironment.checkHeadless();
+
+        return InputEvent.CTRL_DOWN_MASK;
+    }
+
+    /**
      * Returns whether the given locking key on the keyboard is currently in
      * its "on" state.
      * Valid key codes are
--- a/src/java.desktop/share/classes/java/awt/doc-files/AWTThreadIssues.html	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/java/awt/doc-files/AWTThreadIssues.html	Wed Dec 13 10:25:38 2017 -0800
@@ -1,5 +1,11 @@
+<!doctype html>
+<html lang="en">
+<head>
+  <meta charset="utf-8"/>
+  <title>AWT Threading Issues</title>
+</head>
 <!--
- 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
@@ -23,16 +29,11 @@
  questions.
 -->
 
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title></title>
-</head>
-<body bgcolor=white>
+<body>
 
-<h1 align=center>AWT Threading Issues</h1>
+<h1>AWT Threading Issues</h1>
 
-<a name="ListenersThreads"></a>
+<a id="ListenersThreads"></a>
 <h2>Listeners and threads</h2>
 
 Unless otherwise noted all AWT listeners are notified on the event
@@ -41,7 +42,7 @@
 <br>For example, if a key listeners is added from another key listener, the
 newly added listener is only notified on subsequent key events.
 
-<a name="Autoshutdown"></a>
+<a id="Autoshutdown"></a>
 <h2>Auto-shutdown</h2>
 
 According to
@@ -53,7 +54,7 @@
 one of two things happens:
 <ul>
   <li> All the threads that are not daemon threads terminate.
-  <li> Some thread invokes the <code>exit</code> method of class 
+  <li> Some thread invokes the <code>exit</code> method of class
   <code>Runtime</code> or class <code>System</code>, and the exit
   operation is permitted by the security manager.
 </ul>
@@ -84,13 +85,15 @@
        posted to the <code>EventQueue</code> can be coalesced) are
        dispatched:
        <ul>
-           <li> Sequentially.
-           <dl><dd> That is, it is not permitted that several events from
+           <li>
+           <dl><dt>Sequentially.
+             <dd> That is, it is not permitted that several events from
 	        this queue are dispatched simultaneously. </dd></dl>
-           <li> In the same order as they are enqueued.
-           <dl><dd> That is, if <code>AWTEvent</code>&nbsp;A is enqueued
+           <li>
+           <dl><dt>In the same order as they are enqueued.
+             <dd> That is, if <code>AWTEvent</code>&nbsp;A is enqueued
 	        to the <code>EventQueue</code> before
-		<code>AWTEvent</code>&nbsp;B then event B will not be 
+		<code>AWTEvent</code>&nbsp;B then event B will not be
                 dispatched before event A.</dd></dl>
        </ul>
   <li> There is at least one alive non-daemon thread while there is at
@@ -98,7 +101,7 @@
        application (see
        <a href="../Component.html#isDisplayable()"><code>Component.isDisplayable</code></a>).
 </ul>
-The implications of the third restriction are as follows: 
+The implications of the third restriction are as follows:
 <ul>
   <li> The JVM will exit if some thread invokes the <code>exit</code>
   method of class <code>Runtime</code> or class <code>System</code>
@@ -108,8 +111,8 @@
   displayable component.
 </ul>
 It depends on the implementation if and when the non-daemon helper
-threads are terminated once all components are made undisplayable. 
-The implementation-specific details are given below. 
+threads are terminated once all components are made undisplayable.
+The implementation-specific details are given below.
 
 <h3>
 Implementation-dependent behavior.
@@ -147,7 +150,7 @@
 </ul>
 Note, that while an application following these recommendations will
 exit cleanly under normal conditions, it is not guaranteed that it
-will exit cleanly in all cases. Two examples: 
+will exit cleanly in all cases. Two examples:
 <ul>
   <li> Other packages can create displayable components for internal
        needs and never make them undisplayable. See
@@ -156,7 +159,7 @@
 <a href="http://bugs.sun.com/view_bug.do?bug_id=4671025">
 4671025</a>, and
 <a href="http://bugs.sun.com/view_bug.do?bug_id=4465537">
-4465537</a>. 
+4465537</a>.
   <li> Both Microsoft Windows and X11 allow an application to send native
        events to windows that belong to another application. With this
        feature it is possible to write a malicious program that will
@@ -165,10 +168,10 @@
 </ul>
 On the other hand, if you require the JVM to continue running even after
 the application has made all components undisplayable you should start a
-non-daemon thread that blocks forever. 
+non-daemon thread that blocks forever.
 
 <pre>
-        <...>
+        &lt;...&gt;
         Runnable r = new Runnable() {
             public void run() {
                 Object o = new Object();
@@ -183,7 +186,7 @@
         Thread t = new Thread(r);
         t.setDaemon(false);
         t.start();
-        <...>
+        &lt;...&gt;
 </pre>
 
 <cite>The Java&trade; Virtual Machine Specification</cite>
--- a/src/java.desktop/share/classes/java/awt/doc-files/DesktopProperties.html	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/java/awt/doc-files/DesktopProperties.html	Wed Dec 13 10:25:38 2017 -0800
@@ -1,5 +1,11 @@
+<!doctype html>
+<html lang="en">
+<head>
+  <meta charset="utf-8"/>
+  <title>AWT Desktop Properties</title>
+</head>
 <!--
- Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2005, 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,14 +29,9 @@
  questions.
 -->
 
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title></title>
-</head>
-<body bgcolor=white>
+<body>
 
-<h1 align=center>AWT Desktop Properties</h1>
+<h1>AWT Desktop Properties</h1>
 
 The following refers to standard AWT desktop properties that
 may be obtained via the
@@ -76,7 +77,7 @@
 </table>
 
 <h2>Desktop Font Rendering Hints</h2>
-<b>Desktop Property: <A name="awt.font.desktophints">"awt.font.desktophints"</A></b>
+<b>Desktop Property: <a id="awt.font.desktophints">"awt.font.desktophints"</A></b>
 <p>
 Modern desktops support various forms of text antialiasing (font smoothing).
 <p>
@@ -116,7 +117,7 @@
 using a <a href="../../beans/PropertyChangeListener.html">
 <code>PropertyChangeListener</code></a> :
 <pre><code>
-tk.addPropertyChangeListener("awt.font.desktophints", pcl); 
+tk.addPropertyChangeListener("awt.font.desktophints", pcl);
 </code></pre>
 Listening for changes is recommended as users can, on rare occasions,
 reconfigure a desktop environment whilst applications are running
@@ -194,7 +195,7 @@
 and dynamic updates will not be available. This is a typical behaviour if
 the JDK does not recognise the desktop environment, or it is one which
 has no such settings. The <b>Headless</b> toolkit is one such example.
-Therefore it is important to test against null before using the map. 
+Therefore it is important to test against null before using the map.
 <br><br>
 <li>If non-null the value will be a <code>Map</code> of
 <code>RenderingHints</code> such that every key is an instance of
@@ -229,7 +230,7 @@
 the per-device property name.
 </ul>
 <h2>Mouse Functionality</h2>
-<b>Desktop Property: <A name="sun.awt.enableExtraMouseButtons">"sun.awt.enableExtraMouseButtons"</A></b>
+<b>Desktop Property: <a id="sun.awt.enableExtraMouseButtons">"sun.awt.enableExtraMouseButtons"</A></b>
 <p>
 This property determines if events from extra mouse buttons (if they are exist and are
 enabled by the underlying operating system) are allowed to be processed and posted into
@@ -245,7 +246,7 @@
 Current value could also be queried using getDesktopProperty("sun.awt.enableExtraMouseButtons")
 method.
 <br>
-If the property is set to {@code true} then 
+If the property is set to {@code true} then
 <ul>
 <li> it is still legal to create {@code MouseEvent} objects with
 standard buttons and, if the mouse has more
@@ -256,13 +257,13 @@
 and {@code Robot.mouseRelease()} methods and, if the mouse has more then three buttons,
 it is also legal to use masks for existing extended mouse buttons.
 That way, if there are more then three buttons on the mouse then it is allowed to
-use button masks corresponding to the buttons 
+use button masks corresponding to the buttons
 in the range from 1 up to {@link java.awt.MouseInfo#getNumberOfButtons() getNumberOfButtons()}
 </ul>
 <br>
-If the property is set to {@code false} then 
+If the property is set to {@code false} then
 <ul>
-<li> it is legal to create {@code MouseEvent} objects with standard buttons 
+<li> it is legal to create {@code MouseEvent} objects with standard buttons
 only: {@code NOBUTTON}, {@code BUTTON1}, {@code BUTTON2} and
 {@code BUTTON3}
 <li> it is legal to use standard button masks only:
--- a/src/java.desktop/share/classes/java/awt/doc-files/FocusSpec.html	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/java/awt/doc-files/FocusSpec.html	Wed Dec 13 10:25:38 2017 -0800
@@ -1,5 +1,11 @@
+<!doctype html>
+<html lang="en">
+<head>
+  <meta charset="utf-8"/>
+  <title>The AWT Focus Subsystem</title>
+</head>
 <!--
- Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2001, 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,15 +29,8 @@
  questions.
 -->
 
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-
-<html>
-    <head>
-       <title>The AWT Focus Subsystem</title>
-    </head>
-
-    <body bgcolor="white">
-      <h1 align=center>The AWT Focus Subsystem</h1>
+    <body>
+      <h1>The AWT Focus Subsystem</h1>
 
     <p>
       Prior to Java 2 Standard Edition, JDK 1.4, the AWT focus subsystem
@@ -57,8 +56,8 @@
       determining the "opposite" Component involved in the focus or
       activation change. For example, when a Component received a FOCUS_LOST
       event, it had no way of knowing which Component was gaining
-      focus. Since Microsoft Windows provides this functionality for free, 
-      developers migrating from Microsoft Windows C/C++ or Visual Basic to 
+      focus. Since Microsoft Windows provides this functionality for free,
+      developers migrating from Microsoft Windows C/C++ or Visual Basic to
       Java had been frustrated by the omission.
     <p>
       To address these and other deficiencies, we have designed a new focus
@@ -101,7 +100,7 @@
       <li><a href=#Incompatibilities>Incompatibilities with Previous Releases</a>
      </ul>
 
-      <a name="Overview"></a>
+      <a id="Overview"></a>
       <h3>Overview of KeyboardFocusManager</h3>
     <p>
       The focus model is centralized around a single class,
@@ -160,7 +159,7 @@
           define new focus cycle but only modifies the order by which its
           children are traversed "forward" and "backward". Focus traversal
           policy provider can be set using
-          <code>setFocusTraversalPolicyProvider</code> on the Container. 
+          <code>setFocusTraversalPolicyProvider</code> on the Container.
     </ol>
 
     <p>
@@ -180,7 +179,7 @@
       descendants.
 
      <p>
-     Here is an example:<br> <img src="FocusCycle.gif" align=middle 
+     Here is an example:<br> <img src="FocusCycle.gif"
      alt="Three groups as described below: ABCF BDE and DGH. "><br>
 
      <p>Assume the following:
@@ -193,7 +192,7 @@
         <li><b>G</b>, <b>H</b>, <b>E</b>, and <b>F</b> are all
             <code>Component</code>s.
       </ul>
-  
+
      There are a total of three focus cycle roots in this example:
 
       <ol>
@@ -213,7 +212,7 @@
 implementation in the <code>DefaultKeyboardFocusManager</code> class.
 
 
-<a name="BrowserContexts"></a>
+<a id="BrowserContexts"></a>
 <h3>KeyboardFocusManager and Browser Contexts</h3>
 <p>
 Some browsers partition applets in different code bases into separate
@@ -229,7 +228,7 @@
 owner, focused Window, or active Window, per ClassLoader.
 
 
-<a name="KeyEventDispatcher"></a>
+<a id="KeyEventDispatcher"></a>
 <h3>KeyEventDispatcher and KeyEventPostProcessor</h3>
 <p>
 While the user's KeyEvents should generally be delivered to the focus
@@ -272,7 +271,7 @@
 KeyEventPostProcessor, and similar restrictions apply to its use in
 that capacity.
 
-<a name="FocusEventAndWindowEvent"></a>
+<a id="FocusEventAndWindowEvent"></a>
 <h3>FocusEvent and WindowEvent</h3>
 <p>
 The AWT defines the following six event types central to the focus
@@ -296,7 +295,7 @@
         not a Frame or Dialog) when it is no longer the active Window.
   </ol>
 
-<a name="EventDelivery"></a>
+<a id="EventDelivery"></a>
 <h3>Event Delivery</h3>
 <p>
 If the focus is not in java application and the user clicks on a focusable
@@ -347,7 +346,7 @@
 and VetoableChangeListener</a>.
 
 
-<a name="OppositeComponents"></a>
+<a id="OppositeComponents"></a>
 <h3>Opposite Components and Windows</h3>
 <p>
 Each event includes information about the "opposite" Component or
@@ -371,7 +370,7 @@
 using the opposite Component of a focus change that occurred within a
 top-level Window.
 
-<a name="TemporaryFocusEvents"></a>
+<a id="TemporaryFocusEvents"></a>
 <h3>Temporary FocusEvents</h3>
 <p>
 <code>FOCUS_GAINED</code> and <code>FOCUS_LOST</code> events are
@@ -380,7 +379,7 @@
 Temporary <code>FOCUS_LOST</code> events are sent when a Component is
 losing the focus, but will regain the focus shortly. These events
 can be useful when focus changes are used as triggers for validation
-of data. For instance, a text Component may want to commit its 
+of data. For instance, a text Component may want to commit its
 contents when the user begins interacting with another Component,
 and can accomplish this by responding to <code>FOCUS_LOST</code> events.
 However, if the <code>FocusEvent</code> received is temporary,
@@ -402,8 +401,8 @@
 When a Component receives a temporary <code>FOCUS_LOST</code> event,
 the event's opposite Component (if any) may receive a temporary
 <code>FOCUS_GAINED</code> event, but could also receive a permanent
-<code>FOCUS_GAINED</code> event. Showing a Menu or PopupMenu, or 
-clicking or dragging a Scrollbar, should generate a temporary 
+<code>FOCUS_GAINED</code> event. Showing a Menu or PopupMenu, or
+clicking or dragging a Scrollbar, should generate a temporary
 <code>FOCUS_GAINED</code> event. Changing the focused Window,
 however, will yield a permanent <code>FOCUS_GAINED</code> event
 for the new focus owner.
@@ -416,7 +415,7 @@
 Components. This method is not intended for general use, but exists
 instead as a hook for lightweight Component libraries, such as Swing.
 
-<a name="FocusTraversal"></a>
+<a id="FocusTraversal"></a>
 <h3>Focus Traversal</h3>
 <p>
 Each Component defines its own Set of focus traversal keys for a given
@@ -428,11 +427,11 @@
 recursively inherits a Set from its parent, and ultimately from a
 context-wide default set on the current <code>KeyboardFocusManager</code>.
 <p>
-Using the <code>AWTKeyStroke</code> API, client code can specify 
-on which of two specific KeyEvents, <code>KEY_PRESSED</code> or 
+Using the <code>AWTKeyStroke</code> API, client code can specify
+on which of two specific KeyEvents, <code>KEY_PRESSED</code> or
 <code>KEY_RELEASED</code>, the focus traversal operation will occur.
 Regardless of which KeyEvent is specified, however, all KeyEvents
-related to the focus traversal key, including the associated 
+related to the focus traversal key, including the associated
 <code>KEY_TYPED</code> event, will be consumed, and will not be
 dispatched to any Component. It is a runtime error to specify a
 <code>KEY_TYPED</code> event as mapping to a focus traversal operation,
@@ -475,7 +474,7 @@
 normal focus traversal. Thus, the current
 <code>KeyboardFocusManager</code> maintains a reference to the
 "current" focus cycle root, which is global across all contexts. The
-current focus cycle root is used to resolve the ambiguity.  
+current focus cycle root is used to resolve the ambiguity.
 <p>
 For up-cycle traversal, the focus owner is set to the current focus
 owner's focus cycle root, and the current focus cycle root is set to
@@ -491,10 +490,10 @@
 root, then no focus traversal operation occurs.
 
 
-<a name="FocusTraversalPolicy"></a>
+<a id="FocusTraversalPolicy"></a>
 <h3>FocusTraversalPolicy</h3>
 <p>
-  
+
 A <code>FocusTraversalPolicy</code> defines the order in which Components within
 a particular focus cycle root or focus traversal policy provider are
 traversed. Instances of <code>FocusTraversalPolicy</code> can be shared across
@@ -524,7 +523,7 @@
   </ol>
 
 <p>
-A <code>FocusTraversalPolicy</code> may optionally provide an 
+A <code>FocusTraversalPolicy</code> may optionally provide an
 algorithm for the following:
   <blockquote>
   Given a Window, the "initial" Component in that Window. The initial
@@ -551,7 +550,7 @@
 ancestor. Top-levels initialize their focus traversal policies using the context
 default policy. The context default policy is established by using
 KeyboardFocusManager.  <code>setDefaultFocusTraversalPolicy</code>.
-  
+
 <p>
 AWT provides two standard <code>FocusTraversalPolicy</code>
 implementations for use by client code.
@@ -573,14 +572,14 @@
     <li><code>DefaultFocusTraversalPolicy</code>: A subclass of
         <code>ContainerOrderFocusTraversalPolicy</code> which redefines
         the fitness test.  If client code has explicitly set the
-        focusability of a Component by either overriding 
+        focusability of a Component by either overriding
         <code>Component.isFocusTraversable()</code> or
         <code>Component.isFocusable()</code>, or by calling
-        <code>Component.setFocusable(boolean)</code>, then a 
+        <code>Component.setFocusable(boolean)</code>, then a
         <code>DefaultFocusTraversalPolicy</code> behaves exactly
         like a <code>ContainerOrderFocusTraversalPolicy</code>. If,
         however, the Component is relying on default focusability, then a
-        <code>DefaultFocusTraversalPolicy</code> will reject all 
+        <code>DefaultFocusTraversalPolicy</code> will reject all
         Components with non-focusable peers.
         <br>
         The focusability of a peer is implementation-dependent. Sun
@@ -627,7 +626,7 @@
   </ol>
 <p>
 The figure below shows an implicit focus transfer:
-<br><img src="ImplicitFocusTransfer.gif" align=middle alt="Implicit focus transfer."><br>
+<br><img src="ImplicitFocusTransfer.gif" alt="Implicit focus transfer."><br>
 
 Assume the following:
  <ul>
@@ -653,7 +652,7 @@
 All other applications, including pure AWT applications, will use
 <code>DefaultFocusTraversalPolicy</code> by default.
 
-<a name="FocusTraversalPolicyProviders"></a>
+<a id="FocusTraversalPolicyProviders"></a>
 <h3>Focus Traversal Policy Providers</h3>
 <p>
   A Container that isn't a focus cycle root has an option to provide a
@@ -674,7 +673,7 @@
   If focus traversal policy provider property is set on a focus cycle root, it
   isn't considered a focus traversal policy provider and behaves just like any
   other focus cycle root.
-  
+
 <p>
   The main difference between focus cycle roots and focus traversal policy
   providers is that the latter allow focus to enter and leave them just as all other
@@ -740,7 +739,7 @@
         </ul>
   </ul>
 
-<a name="ProgrammaticTraversal"></a>
+<a id="ProgrammaticTraversal"></a>
 <h3>Programmatic Traversal</h3>
 <p>
 In addition to user-initiated focus traversal, client code can
@@ -811,7 +810,7 @@
 unchanged.
 
 
-<a name="Focusability"></a>
+<a id="Focusability"></a>
 <h3>Focusability</h3>
 <p>
 A focusable Component can become the focus owner ("focusability") and
@@ -825,7 +824,7 @@
 change this default by calling Component.setFocusable(boolean).
 
 
-<a name="FocusableWindows"></a>
+<a id="FocusableWindows"></a>
 <h3>Focusable Windows</h3>
 <p>
 To support palette windows and input methods, client code can prevent
@@ -877,7 +876,7 @@
 all such focus change requests will fail. In this case, the global
 focus owner will be cleared and the focused Window will remain unchanged.
 
-<a name="RequestingFocus"></a>
+<a id="RequestingFocus"></a>
 <h3>Requesting Focus</h3>
 
 <p>
@@ -949,7 +948,7 @@
 a temporary state.
 See <a href="#TemporaryFocusEvents">Temporary FocusEvents</a>
 
-<a name="FocusAndPropertyChangeListener"></a>
+<a id="FocusAndPropertyChangeListener"></a>
 <h3>Focus and PropertyChangeListener</h3>
 <p>
 Client code can listen to changes in context-wide focus state, or to
@@ -957,7 +956,7 @@
 PropertyChangeListeners.
 <p>
 The <code>KeyboardFocusManager</code> supports the following properties:
-  
+
   <ol>
     <li><code>focusOwner</code>: the focus owner
     <li><code>focusedWindow</code>: the focused Window
@@ -977,7 +976,7 @@
 <p>
 A <code>PropertyChangeListener</code> installed on the current
 <code>KeyboardFocusManager</code> will only see these changes within
-the <code>KeyboardFocusManager</code>'s context, even though the 
+the <code>KeyboardFocusManager</code>'s context, even though the
 focus owner, focused Window, active Window, and current focus cycle
 root comprise the global focus state shared by all contexts.
 We believe this is less intrusive than requiring client code to pass
@@ -1001,7 +1000,7 @@
 following focus-related properties:
 
   <ol>
-    <li><code>downCycleFocusTraversalKeys</code>: the Container's Set of 
+    <li><code>downCycleFocusTraversalKeys</code>: the Container's Set of
         <code>DOWN_CYCLE_TRAVERSAL_KEYS</code>
     <li><code>focusTraversalPolicy</code>: the Container's focus
         traversal policy
@@ -1020,10 +1019,10 @@
 <code>focusCycleRoot</code> property.
 A Window is always a focus cycle root; this property cannot change.
 <p>
-<a name="FocusAndVetoableChangeListener"></a>
+<a id="FocusAndVetoableChangeListener"></a>
 <h3>Focus and VetoableChangeListener</h3>
 <p>
-The <code>KeyboardFocusManager</code> also supports 
+The <code>KeyboardFocusManager</code> also supports
 <code>VetoableChangeListener</code>s for the following properties:
 
   <ol>
@@ -1054,13 +1053,13 @@
 <code>KeyboardFocusManager</code> is free to attempt to
 dispatch this event and it is the responsibility of the
 <code>VetoableChangeListener</code> to veto it as well. In addition,
-during processing of the <code>FOCUS_GAINED</code> event, the 
+during processing of the <code>FOCUS_GAINED</code> event, the
 <code>KeyboardFocusManager</code> may attempt to resync the global
 focus state by synthesizing another <code>FOCUS_LOST</code> event.
 This event must be vetoed just as the first <code>FOCUS_LOST</code> event was.
 <p>
-A <code>KeyboardFocusManager</code> may not hold any locks while 
-notifying <code>PropertyChangeListener</code>s of a state change. 
+A <code>KeyboardFocusManager</code> may not hold any locks while
+notifying <code>PropertyChangeListener</code>s of a state change.
 This requirement is relaxed for <code>VetoableChangeListeners</code>,
 however. Therefore, client-definied <code>VetoableChangeListener</code>s
 should avoid acquiring additional locks inside
@@ -1089,13 +1088,13 @@
 vetoed focus changes and recovery attempts.
 
 
-<a name="ZOrder"></a>
+<a id="ZOrder"></a>
 <h3>Z-Order</h3>
 <p>
 On some native windowing systems, the Z-order of a Window can affect
-its focused or active (if applicable) state. On Microsoft Windows, the 
-top-most Window is naturally the focused Window as well. However, on 
-Solaris, many window managers use a point-to-focus model that ignores 
+its focused or active (if applicable) state. On Microsoft Windows, the
+top-most Window is naturally the focused Window as well. However, on
+Solaris, many window managers use a point-to-focus model that ignores
 Z-order in determining the focused Window.
 
 When focusing or activating Windows, the AWT adheres to the UI
@@ -1114,8 +1113,8 @@
 Microsoft Windows and Solaris is as follows:
   <ul>
      <li><code>Window.toFront()</code>:<br>
-        <b>Microsoft Windows</b>: The Window is moved to front, if possible. 
-        While we will always be able to move this Window in front of other 
+        <b>Microsoft Windows</b>: The Window is moved to front, if possible.
+        While we will always be able to move this Window in front of other
         Windows in the same VM, Windows 98 and Windows 2000 do not allow an
         application to bring any of its windows to the front unless one
         of that application's windows is already in the foreground. In
@@ -1129,15 +1128,15 @@
         window manager, the focused Window will remain unchanged.
 
      <li><code>Window.toBack()</code>:<br>
-        <b>Microsoft Windows</b>: The Window is moved to back. Note however 
-        that Microsoft Windows insists that an owned Window always be in 
-        front of all of its recursive owners. Thus, after the completion of 
-        this operation, the Window may not be the lowest Java Window in the 
-        Z-order. If the Window, or any of its owners, was the focused Window, 
+        <b>Microsoft Windows</b>: The Window is moved to back. Note however
+        that Microsoft Windows insists that an owned Window always be in
+        front of all of its recursive owners. Thus, after the completion of
+        this operation, the Window may not be the lowest Java Window in the
+        Z-order. If the Window, or any of its owners, was the focused Window,
         then the focused Window is reset to the top-most Window in the VM.
       <br>
-        <b>Solaris</b>: The Window is moved to back. Like Microsoft Windows, 
-        some window managers insist than an owned Window always be in front 
+        <b>Solaris</b>: The Window is moved to back. Like Microsoft Windows,
+        some window managers insist than an owned Window always be in front
         of all of its recursive owners. Thus, after the completion of this
         operation, the Window may not be the lowest Java Window in the
         Z-order. If the Window was the focused Window, it will lose
@@ -1156,7 +1155,7 @@
 
      <li><code>Window.hide()/Window.setVisible(false)/Window.dispose()/
     Frame.setState(ICONIFIED)</code>:<br>
-        <b>Microsoft Windows</b>: If the Window was the focused Window, the focused 
+        <b>Microsoft Windows</b>: If the Window was the focused Window, the focused
         Window is reset to a window chosen by the OS, or to no window. The
         window may be in a native application, or a Java application in
         another VM.
@@ -1169,7 +1168,7 @@
         application in another VM.
   </ul>
 
-<a name="ReplacingDefaultKeyboardFocusManager"></a>
+<a id="ReplacingDefaultKeyboardFocusManager"></a>
 <h3>Replacing DefaultKeyboardFocusManager</h3>
 <p>
 <code>KeyboardFocusManager</code>s are pluggable at the browser context
@@ -1238,7 +1237,7 @@
           heavyweight Container, not the focus owner.
       <li>A <code>FOCUS_LOST</code> event must be retargeted to the focus
           owner. Again, this is necessary because the peer layer is
-          unaware of lightweight Components. 
+          unaware of lightweight Components.
       <li>A <code>WINDOW_LOST_FOCUS</code> event must be retargeted to
           the focused Window. The implementation of the Window class
           may cause the native focused Window to differ from the Java
@@ -1269,7 +1268,7 @@
           to set the global focus owner to a non-focusable Component.
       <li>If the <code>KeyboardFocusManager</code> attempts
           to set the global focused Window to a non-focusable Window.
-      <li>If the change is rejected by an installed 
+      <li>If the change is rejected by an installed
           <code>VetoableChangeListener</code>.
     </ul>
 <p>
@@ -1302,13 +1301,13 @@
           recent focus owner.
       <li>The <code>KeyboardFocusManager</code> must ensure that the
           opposite Component or Window are as accurate as the native
-          windowing platform permits. For example, the 
+          windowing platform permits. For example, the
           <code>KeyboardFocusManager</code> may need to
           retarget the opposite Component to a lightweight child of the
           heavyweight initially specified by the peer layer.
           <br>
           If the peer layer states that the opposite Component or Window is
-          <code>null</code>, it is acceptable for the 
+          <code>null</code>, it is acceptable for the
           <code>KeyboardFocusManager</code> to propagate
           this value. <code>null</code> indicates that it is highly
           probably that no other Component or Window was involved
@@ -1325,7 +1324,7 @@
           events.
     </ul>
 
-<a name="Incompatibilities"></a>
+<a id="Incompatibilities"></a>
 <h3>Incompatibilities with Previous Releases</h3>
   <p><b>Cross-platform changes:</b>
     <ol>
@@ -1343,7 +1342,7 @@
       <li>KeyListeners installed on <code>Component</code>s
           will no longer see <code>KeyEvent</code>s that map to focus
           traversal operations, and
-          <code>Component.handleEvent()</code> will no longer be invoked 
+          <code>Component.handleEvent()</code> will no longer be invoked
           for such events. Previously, AWT Components saw these events
           and had an opportunity to consume them before AWT
           initiated focus traversal. Code that requires this
@@ -1352,7 +1351,7 @@
           itself. Alternately, the code can use an
           <code>AWTEventListener</code> or
           <code>KeyEventDispatcher</code> to pre-listen to all
-          <code>KeyEvent</code>s. 
+          <code>KeyEvent</code>s.
     </ol>
   <p><b>Changes specific to Microsoft Windows:</b>
     <ol>
--- a/src/java.desktop/share/classes/java/awt/doc-files/Modality.html	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/java/awt/doc-files/Modality.html	Wed Dec 13 10:25:38 2017 -0800
@@ -1,5 +1,11 @@
+<!doctype html>
+<html lang="en">
+<head>
+  <meta charset="utf-8"/>
+  <title>The AWT Modality</title>
+</head>
 <!--
- Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2005, 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,19 +29,9 @@
  questions.
 -->
 
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-
-<html>
-
-<head>
+<body>
 
-    <title>The AWT Modality</title>
-
-</head>
-
-<body bgcolor="white">
-
-    <h1 align="center">The AWT Modality</h1>
+    <h1>The AWT Modality</h1>
 
     <p>
       This document, together with the API documentation for modality-related
@@ -53,7 +49,7 @@
       <li><a href="#Examples">Examples</a></li>
     </ul>
 
-    <a name="Definitions"></a>
+    <a id="Definitions"></a>
     <h3>Definitions</h3>
 
     <p>
@@ -63,7 +59,7 @@
       Every window belongs to some document &mdash; its root can be found as
       the closest ancestor window without an owner.
     </p><p>
-      <a name="ModalBlocked"></a>
+      <a id="ModalBlocked"></a>
       <u>Modal blocked window</u> - a window, that:
       </p><ul>
         <li>doesn't receive any user input events
@@ -73,7 +69,7 @@
       <blockquote>
         <hr>
           <b>Warning!</b> Some window managers allow users to change the window
-          Z-order in an arbitrary way &mdash; in that case the last requirement 
+          Z-order in an arbitrary way &mdash; in that case the last requirement
           may not be met.
         <hr>
       </blockquote>
@@ -87,7 +83,7 @@
       then all its owned windows and child components are also excluded.
     </p><p>
       <u>Scope of blocking (SB)</u> - the set of windows (instances of
-      <code>java.awt.Window</code> and all derived classes) that are blocked by 
+      <code>java.awt.Window</code> and all derived classes) that are blocked by
       the modal dialog while it is visible.
      <blockquote><hr>
       <b>Note</b>: Everywhere in this document the notion of "window" is equal
@@ -95,7 +91,7 @@
       an instance of <code>java.awt.Window</code> or any descendant class.
       <hr></blockquote>
 
-    <a name="ModalityTypes"></a>
+    <a id="ModalityTypes"></a>
     <h3>Modality types</h3>
 
     <p>
@@ -159,7 +155,7 @@
       dialog may have no effect until it is hidden and then shown again.
       <hr></blockquote>
 
-    <a name="ShowHideBlocking"></a>
+    <a id="ShowHideBlocking"></a>
     <h3>Show/hide blocking</h3>
 
     <p>
@@ -171,7 +167,7 @@
     </p><p>
       <u>Showing the modal dialog: "M"</u><br>
       When modal dialog M is shown, all the visible windows fall into one of
-      three distinct groups: 
+      three distinct groups:
       <ul>
       <li>Blockers of M (modal dialogs that block M and
       either are in M's child hierarchy, or are not blocked by M, or have
@@ -260,11 +256,11 @@
       If M was blocked by any other modal dialog, for example, "N",
       it becomes unblocked and
       is removed from N's blocked windows list. Then, all the windows and dialogs
-      blocked by M become unblocked, and after that the same checks 
+      blocked by M become unblocked, and after that the same checks
       (as in Showing the modal dialog: "M")
       are performed for each of them in the order they were initially shown.
 
-    <a name="ModalExclusion"></a>
+    <a id="ModalExclusion"></a>
     </p><h3>Modal exclusion</h3>
 
     <p>
@@ -290,7 +286,7 @@
         may have no effect until it is hidden and then shown again.
     </blockquote>
 
-    <a name="Related"></a>
+    <a id="Related"></a>
     <h3>Related AWT features</h3>
 
     <p>
@@ -333,21 +329,21 @@
       </li></ol>
       If the modal dialog to be hidden does not have focus, the active window remains
       unchanged.
-    
-    <a name="Security"></a>
+
+    <a id="Security"></a>
     <h3>Security</h3>
 
     <p>
       A special <code>AWTPermission</code>, <code>"toolkitModality"</code>,
       is required to show toolkit-modal
-      dialogs. This would prevent, for example, blocking a browser or 
+      dialogs. This would prevent, for example, blocking a browser or
       Java Web Start (JWS) by modal dialogs shown from applets.
     </p><p>
       The same permission is required to exclude a window from toolkit modality.
       This would prevent, for example, a dialog shown from an applet not to be
       blocked by a browser's or JWS's modal dialog.
 
-    <a name="PlatformSupport"></a>
+    <a id="PlatformSupport"></a>
     </p><h3>Platform support</h3>
 
     <p>
@@ -366,18 +362,18 @@
 	  and a window is marked as E-excluded, this has no effect.
       </li></ul>
 
-    <a name="Compatibility"></a>
+    <a id="Compatibility"></a>
     <h3>Compatibility</h3>
 
     <p>
       The default modality type is application-modal. It is used by the API
-      calls: <code>Dialog.setModal(true)</code>, 
+      calls: <code>Dialog.setModal(true)</code>,
       <code>Dialog(owner, true)</code>, etc. Prior to JDK 6
       the default type was toolkit-modal,
       but the only distinction between application- and toolkit-modality is for
       applets and applications launched from Java Web Start.
 
-    <a name="Examples"></a>
+    <a id="Examples"></a>
     </p><h3>Examples</h3>
 
     <table border="0">
@@ -429,7 +425,7 @@
 	      it's in the same application<br>
           <li>D<sub>i</sub> is shown<br>
           <li>D<sub>i</sub> becomes blocked by D<sub>ii</sub> &mdash; it's its owner<br>
-          <li>D<sub>iii</sub> remains unblocked &mdash; it blocks D<sub>ii</sub> and 
+          <li>D<sub>iii</sub> remains unblocked &mdash; it blocks D<sub>ii</sub> and
 	      D<sub>ii</sub> blocks D<sub>i</sub><br>
 	  </ol>
           <br>
--- a/src/java.desktop/share/classes/java/awt/image/FilteredImageSource.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/java/awt/image/FilteredImageSource.java	Wed Dec 13 10:25:38 2017 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2014, 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
@@ -35,7 +35,8 @@
 /**
  * This class is an implementation of the ImageProducer interface which
  * takes an existing image and a filter object and uses them to produce
- * image data for a new filtered version of the original image.
+ * image data for a new filtered version of the original image. Furthermore,
+ * {@code FilteredImageSource} is safe for use by multiple threads.
  * Here is an example which filters an image by swapping the red and
  * blue components:
  * <pre>
@@ -171,7 +172,7 @@
      * @param ic  the consumer for the filtered image
      * @see ImageConsumer
      */
-    public void startProduction(ImageConsumer ic) {
+    public synchronized void startProduction(ImageConsumer ic) {
         if (proxies == null) {
             proxies = new Hashtable<>();
         }
@@ -198,7 +199,7 @@
      *
      * @see ImageConsumer
      */
-    public void requestTopDownLeftRightResend(ImageConsumer ic) {
+    public synchronized void requestTopDownLeftRightResend(ImageConsumer ic) {
         if (proxies != null) {
             ImageFilter imgf = proxies.get(ic);
             if (imgf != null) {
--- a/src/java.desktop/share/classes/javax/imageio/metadata/doc-files/bmp_metadata.html	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/javax/imageio/metadata/doc-files/bmp_metadata.html	Wed Dec 13 10:25:38 2017 -0800
@@ -1,8 +1,11 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
+<!doctype html>
+<html lang="en">
 <head>
+  <meta charset="utf-8"/>
+  <title>BMP Metadata Format Specification</title>
+</head>
 <!--
-Copyright (c) 2003, 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
@@ -26,13 +29,8 @@
 questions.
 -->
 
-<title>BMP Metadata Format Specification</title>
-</head>
-
 <body>
-<center><h1>
-BMP Metadata Format Specification
-</h1></center>
+<h1>BMP Metadata Format Specification</h1>
 
 The XML schema for the native image metadata format is as follows:
 
@@ -108,7 +106,7 @@
 	&lt;/xsd:element&gt;
 
         &lt;!-- Color space  --&gt;
-        &lt;xsd:element name="ColorSpaceType" type="xsd:unsignedInt" 
+        &lt;xsd:element name="ColorSpaceType" type="xsd:unsignedInt"
 		     minOccurs="0"/&gt;
 
 	&lt;!-- CIE XYZ for the LCS_CALIBRATED_RGB color space --&gt;
--- a/src/java.desktop/share/classes/javax/imageio/metadata/doc-files/gif_metadata.html	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/javax/imageio/metadata/doc-files/gif_metadata.html	Wed Dec 13 10:25:38 2017 -0800
@@ -1,8 +1,11 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
+<!doctype html>
+<html lang="en">
 <head>
+  <meta charset="utf-8"/>
+  <title>GIF Metadata Format Specification</title>
+</head>
 <!--
-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
@@ -26,18 +29,11 @@
 questions.
 -->
 
-<title>GIF Metadata Format Specification</title>
-</head>
-
-<body bgcolor="white">
+<body>
 
-<center><h1>
-GIF Metadata Format Specification
-</h1></center>
-<a name="gif_stream_metadata_format"></a>
-<center><h2>
-GIF Stream Metadata Format Specification
-</h2></center>
+<h1>GIF Metadata Format Specification</h1>
+<a id="gif_stream_metadata_format"></a>
+<h2>GIF Stream Metadata Format Specification</h2>
 
 <p>
 
@@ -59,7 +55,7 @@
 <pre>
 &lt;!DOCTYPE "javax_imageio_gif_stream_1.0" [
 
-  &lt;!ELEMENT "javax_imageio_gif_stream_1.0" (Version?, 
+  &lt;!ELEMENT "javax_imageio_gif_stream_1.0" (Version?,
     LogicalScreenDescriptor?, GlobalColorTable?)&gt;
 
     &lt;!ELEMENT "Version" EMPTY&gt;
@@ -98,7 +94,7 @@
       &lt;!-- The global color table --&gt;
       &lt;!-- Min children: 2 --&gt;
       &lt;!-- Max children: 256 --&gt;
-      &lt;!ATTLIST "GlobalColorTable" "sizeOfGlobalColorTable" ("2" | 
+      &lt;!ATTLIST "GlobalColorTable" "sizeOfGlobalColorTable" ("2" |
         "4" | "8" | "16" | "32" | "64" | "128" | "256") #REQUIRED&gt;
         &lt;!-- The number of entries in the global color table --&gt;
       &lt;!ATTLIST "GlobalColorTable" "backgroundColorIndex" #CDATA
@@ -135,10 +131,8 @@
           &lt;!-- Max value: 255 (inclusive) --&gt;
 ]&gt;
 </pre>
-<a name="gif_image_metadata_format"></a>
-<center><h2>
-GIF Image Metadata Format Specification
-</h2></center>
+<a id="gif_image_metadata_format"></a>
+<h2>GIF Image Metadata Format Specification</h2>
 <p>
 
 The GIF image metadata format encodes the image descriptor, local
@@ -180,8 +174,8 @@
 <pre>
 &lt;!DOCTYPE "javax_imageio_gif_image_1.0" [
 
-  &lt;!ELEMENT "javax_imageio_gif_image_1.0" (ImageDescriptor?, 
-    LocalColorTable?, GraphicControlExtension?, PlainTextExtension?, 
+  &lt;!ELEMENT "javax_imageio_gif_image_1.0" (ImageDescriptor?,
+    LocalColorTable?, GraphicControlExtension?, PlainTextExtension?,
     ApplicationExtensions?, CommentExtensions?)&gt;
 
     &lt;!ELEMENT "ImageDescriptor" EMPTY&gt;
@@ -214,7 +208,7 @@
       &lt;!-- The local color table --&gt;
       &lt;!-- Min children: 2 --&gt;
       &lt;!-- Max children: 256 --&gt;
-      &lt;!ATTLIST "LocalColorTable" "sizeOfLocalColorTable" ("2" | 
+      &lt;!ATTLIST "LocalColorTable" "sizeOfLocalColorTable" ("2" |
         "4" | "8" | "16" | "32" | "64" | "128" | "256") #REQUIRED&gt;
         &lt;!-- The number of entries in the local color table --&gt;
       &lt;!ATTLIST "LocalColorTable" "sortFlag" ("TRUE" | "FALSE")
@@ -246,13 +240,13 @@
 
     &lt;!ELEMENT "GraphicControlExtension" EMPTY&gt;
       &lt;!-- A graphic control extension --&gt;
-      &lt;!ATTLIST "GraphicControlExtension" "disposalMethod" ("none" | 
-        "doNotDispose" | "restoreToBackgroundColor" | 
-        "restoreToPrevious" | "undefinedDisposalMethod4" | 
-        "undefinedDisposalMethod5" | "undefinedDisposalMethod6" | 
+      &lt;!ATTLIST "GraphicControlExtension" "disposalMethod" ("none" |
+        "doNotDispose" | "restoreToBackgroundColor" |
+        "restoreToPrevious" | "undefinedDisposalMethod4" |
+        "undefinedDisposalMethod5" | "undefinedDisposalMethod6" |
         "undefinedDisposalMethod7") #REQUIRED&gt;
         &lt;!-- The disposal method for this frame --&gt;
-      &lt;!ATTLIST "GraphicControlExtension" "userInputFlag" ("TRUE" | 
+      &lt;!ATTLIST "GraphicControlExtension" "userInputFlag" ("TRUE" |
         "FALSE") #REQUIRED&gt;
         &lt;!-- True if the frame should be advanced based on user input --&gt;
       &lt;!ATTLIST "GraphicControlExtension" "transparentColorFlag" (
@@ -350,8 +344,7 @@
 </pre>
 
 <p>
-<a name="mapping"></a>
-<center>
+<a id="mapping"></a>
 <table border=1>
 <caption><b>Mapping of Standard to GIF Native Stream Metadata</b></caption>
 <tr>
@@ -399,9 +392,7 @@
 <td>/Version@value</td>
 </tr>
 </table>
-</center>
 
-<center>
 <table border=1>
 <caption><b>Mapping of Standard to GIF Native Image Metadata</b></caption>
 <tr>
@@ -443,7 +434,6 @@
 "TRUE")</td>
 </tr>
 </table>
-</center>
 
 </body>
 </html>
--- a/src/java.desktop/share/classes/javax/imageio/metadata/doc-files/jpeg_metadata.html	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/javax/imageio/metadata/doc-files/jpeg_metadata.html	Wed Dec 13 10:25:38 2017 -0800
@@ -1,8 +1,11 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
+<!doctype html>
+<html lang="en">
 <head>
+  <meta charset="utf-8"/>
+  <title>JPEG Metadata Format Specification and Usage Notes</title>
+</head>
 <!--
-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
@@ -26,14 +29,9 @@
 questions.
 -->
 
-<title>JPEG Metadata Format Specification and Usage Notes</title>
-</head>
+<body>
 
-<body bgcolor="white">
-
-<center><h1>
-JPEG Metadata Format Specification and Usage Notes
-</h1></center>
+<h1>JPEG Metadata Format Specification and Usage Notes</h1>
 
 <p>
 <a href=#metadata>JPEG Metadata</a><br>
@@ -46,11 +44,11 @@
 <a href=#image>Image Metadata DTD</a><br>
 <a href=#stream>Stream Metadata DTD</a>
 <p>
-<b>NOTE</b>: It is important to call <code>dispose()</code> 
-on the JPEG reader and writer objects when they are no longer needed, as 
-they consume significant native resources which are not adequately recovered 
-by garbage collection.  Both reader and writer call <code>dispose()</code> 
-in their finalizers, but those finalizers may not be called before the native 
+<b>NOTE</b>: It is important to call <code>dispose()</code>
+on the JPEG reader and writer objects when they are no longer needed, as
+they consume significant native resources which are not adequately recovered
+by garbage collection.  Both reader and writer call <code>dispose()</code>
+in their finalizers, but those finalizers may not be called before the native
 code has exhausted native memory.
 
 <p>
@@ -58,45 +56,45 @@
 The JPEG writer does not support replacing pixels.
 
 <h2>
-<a name=metadata>JPEG Metadata</a>
+<a id=metadata>JPEG Metadata</a>
 </h2>
 JPEG metadata consists of the data contained in marker segments in a JPEG
 stream.  The image metadata object returned from a read describes the
-contents of the marker segments between the <code>SOI</code> marker and 
-the <code>EOI</code> marker for that image.  The image metadata object 
-passed into a write determines the contents of the stream between the 
-<code>SOI</code> marker and the <code>EOI</code> marker for that image, 
+contents of the marker segments between the <code>SOI</code> marker and
+the <code>EOI</code> marker for that image.  The image metadata object
+passed into a write determines the contents of the stream between the
+<code>SOI</code> marker and the <code>EOI</code> marker for that image,
 subject to the controls in any <code>ImageWriteParam</code>.
 
 <p>
-Stream metadata is used only for tables-only images found (or to be 
-placed) at the beginning of a stream containing abbreviated images.  
-Tables-only images are not treated as images and do not consume an 
+Stream metadata is used only for tables-only images found (or to be
+placed) at the beginning of a stream containing abbreviated images.
+Tables-only images are not treated as images and do not consume an
 image index.  The stream metadata object returned from a read describes the
-contents of the marker segments between the <code>SOI</code> marker and 
-the <code>EOI</code> marker for the single tables-only image at the 
-beginning of the stream, if one is present.  If no tables-only image is 
-present at the front of the stream, the <code>getStreamMetadata</code> 
-method of <code>ImageReader</code> returns <code>null</code>.  If 
-stream metadata is provided to the writer, a single tables-only image 
-containing the tables from the stream metadata object will be written at 
+contents of the marker segments between the <code>SOI</code> marker and
+the <code>EOI</code> marker for the single tables-only image at the
+beginning of the stream, if one is present.  If no tables-only image is
+present at the front of the stream, the <code>getStreamMetadata</code>
+method of <code>ImageReader</code> returns <code>null</code>.  If
+stream metadata is provided to the writer, a single tables-only image
+containing the tables from the stream metadata object will be written at
 the beginning of the stream.  If the stream metadata object contains no
 tables, default tables will be written.  As the sole purpose of stream
-metadata is for specifying tables-only images at the front of abbreviated 
-streams, the stream metadata argument is useful only on the 
-<code>ImageWriter.prepareWriteSequence</code> method.  It is ignored on all 
+metadata is for specifying tables-only images at the front of abbreviated
+streams, the stream metadata argument is useful only on the
+<code>ImageWriter.prepareWriteSequence</code> method.  It is ignored on all
 other methods.
 
-<p> 
-The <code>ImageWriter.getDefaultStreamMetadata</code> method returns an 
-object containing the tables from the <code>ImageWriteParam</code> argument, 
-if it is a <code>JPEGImageWriteParam</code> and contains tables.  Otherwise, 
+<p>
+The <code>ImageWriter.getDefaultStreamMetadata</code> method returns an
+object containing the tables from the <code>ImageWriteParam</code> argument,
+if it is a <code>JPEGImageWriteParam</code> and contains tables.  Otherwise,
 the returned object will contain default tables.
 
-<p>The <code>ImageWriter.getDefaultImageMetadata</code> method returns a 
-metadata object containing <b>no</b> tables if the 
-<code>ImageWriteParam</code> argument contains tables.  Otherwise the 
-returned metadata object will contain default visually lossless tables.  
+<p>The <code>ImageWriter.getDefaultImageMetadata</code> method returns a
+metadata object containing <b>no</b> tables if the
+<code>ImageWriteParam</code> argument contains tables.  Otherwise the
+returned metadata object will contain default visually lossless tables.
 Of course, only a <code>JPEGImageWriteParam</code> may contain tables.
 
 <p>
@@ -105,59 +103,59 @@
 metadata will.
 
 <h2>
-<a name=abbrev>Abbreviated Streams</a>
+<a id=abbrev>Abbreviated Streams</a>
 </h2>
-Both the reader and the writer retain their tables from one operation to the 
-next, thus permitting the use of abbreviated streams quite naturally, with a 
-few minor restrictions:  
+Both the reader and the writer retain their tables from one operation to the
+next, thus permitting the use of abbreviated streams quite naturally, with a
+few minor restrictions:
 <ol>
-  <li> Abbreviated streams may contain only one tables-only image, which must 
+  <li> Abbreviated streams may contain only one tables-only image, which must
        come first in the stream.  Subsequent tables-only images will cause
        undefined behavior.</li>
   <li> Abbreviated streams must be read fully and in order.  No random access
-       is allowed, in either direction.  The same image may be read multiple 
+       is allowed, in either direction.  The same image may be read multiple
        times.  If a call is made with an image index that is not the same as
        or one greater than the most recent call (or 0 if no calls have been
        made), then an <code>IllegalArgumentException</code> is thrown.</li>
 </ol>
-These restrictions mean that streams may contain abbreviated images 
+These restrictions mean that streams may contain abbreviated images
 interspersed with images containing tables.  As required by JPEG, any tables
 appearing in the stream override previous tables, regardless of the source
-of the previous tables.  
+of the previous tables.
 
 <p>
 Note that once a tables-only image has been read, it's contents is available
 as stream metadata from the reader until either another tables-only image
 is read from another stream or the reader is reset.  Changing the input does
 not reset the stream metadata.  This is useful for reading the tables from
-one file, then changing the input to read an abbreviated stream containing 
+one file, then changing the input to read an abbreviated stream containing
 a sequence of images.  The tables will be used automatically, and will remain
 available as "stream" metadata.
 
 <p>
-Abbreviated streams are written using the sequence methods of 
-<code>ImageWriter</code>.  Stream metadata is used to write a tables-only 
+Abbreviated streams are written using the sequence methods of
+<code>ImageWriter</code>.  Stream metadata is used to write a tables-only
 image at the beginning of the stream, and the tables are set up for use, using
-<code>ImageWriter.prepareWriteSequence</code>.  If no stream metadata is 
-supplied to <code>ImageWriter.prepareWriteSequence</code>, then no 
+<code>ImageWriter.prepareWriteSequence</code>.  If no stream metadata is
+supplied to <code>ImageWriter.prepareWriteSequence</code>, then no
 tables-only image is written.  If stream metadata containing no tables is
 supplied to <code>ImageWriter.prepareWriteSequence</code>, then a tables-only
 image containing default visually lossless tables is written.
 
 <h2>
-<a name=tables>Sources of Tables</a>
+<a id=tables>Sources of Tables</a>
 </h2>
 <p>
-Images are written with tables if tables are present in their metadata objects 
+Images are written with tables if tables are present in their metadata objects
 or without them if no tables are present in their metadata objects.  If no
-metadata object is present then the tables are written.  The tables used for 
-compression are taken from one of the following sources, which are consulted 
-in order: 
+metadata object is present then the tables are written.  The tables used for
+compression are taken from one of the following sources, which are consulted
+in order:
 <ol>
   <li> If there is an <code>ImageWriteParam</code> and the compression mode is
        set to <code>EXPLICIT</code>, default tables constructed using the
-       quality setting are used.  They are written only if the metadata 
-       contains tables or if there is no metadata, but they replace the 
+       quality setting are used.  They are written only if the metadata
+       contains tables or if there is no metadata, but they replace the
        tables in the metadata.</li>
   <li> If there is an <code>ImageWriteParam</code> and the compression mode is
        set to <code>DEFAULT</code>, default visually lossles tables are used.
@@ -176,39 +174,39 @@
   </li>
 </ol>
 
-This ordering implements the design intention that tables should be included 
-in <code>JPEGImageWriteParam</code>s only as a means of specifying tables 
+This ordering implements the design intention that tables should be included
+in <code>JPEGImageWriteParam</code>s only as a means of specifying tables
 when no other source is available, and this can occur only when writing to an
-abbreviated stream without tables using known non-standard tables for 
+abbreviated stream without tables using known non-standard tables for
 compression.
 
 <p>
-When reading, tables in a <code>JPEGImageReadParam</code> are consulted only 
-if tables have not been set by any previous read.  Tables set from a 
-<code>JPEGImageReadParam</code> are overridden by any tables present in the 
+When reading, tables in a <code>JPEGImageReadParam</code> are consulted only
+if tables have not been set by any previous read.  Tables set from a
+<code>JPEGImageReadParam</code> are overridden by any tables present in the
 stream being read.
 
 <p>
-Note that if no image metadata object is specified for a particular image, a 
+Note that if no image metadata object is specified for a particular image, a
 default object is used, which includes default tables.
 
 <h2>
-<a name=color>Colorspace Transformations and Conventional Markers</a>
+<a id=color>Colorspace Transformations and Conventional Markers</a>
 </h2>
 Colorspace transformations are controlled by the destination type for
 both reading and writing of images.  When <code>Raster</code>s are
-read, no colorspace transformation is performed, and any destination type 
-is ignored.  A warning is sent to any listeners if a destination type is 
-specified in this case.  When <code>Raster</code>s are written, any 
+read, no colorspace transformation is performed, and any destination type
+is ignored.  A warning is sent to any listeners if a destination type is
+specified in this case.  When <code>Raster</code>s are written, any
 destination type is used to interpret the bands.  This might result in a
-JFIF or Adobe header being written, or different component ids being written 
-to the frame and scan headers.  If values present in a metadata object do not 
-match the destination type, the destination type is used and a warning is sent 
+JFIF or Adobe header being written, or different component ids being written
+to the frame and scan headers.  If values present in a metadata object do not
+match the destination type, the destination type is used and a warning is sent
 to any listeners.
 
 <p>
 
-<a name=optcolor><b>Optional ColorSpace support:</b></a>
+<a id=optcolor><b>Optional ColorSpace support:</b></a>
 Handling of PhotoYCC (YCC), PhotoYCCA (YCCA), RGBA and YCbCrA color spaces
 by the standard plugin, as described below, is dependent on capabilities
 of the libraries used to interpret the JPEG data. Thus all consequential
@@ -219,7 +217,7 @@
 When writing, an Exception may be thrown if no suitable conversion
 can be applied before encoding.
 But where the support for these color spaces is available, the behavior
-must be as documented. 
+must be as documented.
 <p>
 
 When reading, the contents of the stream are interpreted by the usual
@@ -232,7 +230,7 @@
        the YCbCr is converted to RGB according to the formulas given in the
        JFIF spec, and the ICC profile is assumed to refer to the resulting RGB
        space.
-  <li> If an Adobe <code>APP14</code> marker segment is present, the 
+  <li> If an Adobe <code>APP14</code> marker segment is present, the
        colorspace is determined by consulting the <code>transform</code> flag.
        The <code>transform</code> flag takes one of three values:
     <ul>
@@ -242,7 +240,7 @@
       <li> 1 - The image is encoded as YCbCr (implicitly converted from RGB
            on encoding).
 
-      <li> 0 - Unknown.  3-channel images are assumed to be RGB, 4-channel 
+      <li> 0 - Unknown.  3-channel images are assumed to be RGB, 4-channel
            images are assumed to be CMYK.
     </ul>
   <li> If neither marker segment is present, the following procedure is
@@ -253,9 +251,9 @@
        YCbCr. Subject to the availability of the
        <a href=#optcolor>optional color space support</a>
        described above, if these values are 1-4 for a 4-channel image,
-       then the image is assumed to be YCbCrA. 
-       If these values are > 4, they are checked 
-       against the ASCII codes for 'R', 'G', 'B', 'A', 'C', 'c'.  These can 
+       then the image is assumed to be YCbCrA.
+       If these values are > 4, they are checked
+       against the ASCII codes for 'R', 'G', 'B', 'A', 'C', 'c'.  These can
        encode the following colorspaces:
        <p>
        <br>RGB
@@ -263,28 +261,28 @@
        <br>YCC (as 'Y','C','c'), assumed to be PhotoYCC
        <br>YCCA (as 'Y','C','c','A'), assumed to be PhotoYCCA
        <p>
-       Otherwise, 3-channel subsampled images are assumed to be YCbCr, 
-       3-channel non-subsampled images are assumed to be RGB, 4-channel 
+       Otherwise, 3-channel subsampled images are assumed to be YCbCr,
+       3-channel non-subsampled images are assumed to be RGB, 4-channel
        subsampled images are assumed to be YCCK, and 4-channel, non-subsampled
        images are assumed to be CMYK.
 
   <li> All other images are declared uninterpretable and an exception is
-       thrown if an attempt is made to read one as a 
-       <code>BufferedImage</code>.  Such an image may be read only as a 
+       thrown if an attempt is made to read one as a
+       <code>BufferedImage</code>.  Such an image may be read only as a
        <code>Raster</code>.  If an image is interpretable but there is no Java
-       <code>ColorSpace</code> available corresponding to the encoded 
-       colorspace (<i>e.g.</i> YCbCr), then 
+       <code>ColorSpace</code> available corresponding to the encoded
+       colorspace (<i>e.g.</i> YCbCr), then
        <code>ImageReader.getRawImageType</code> will return <code>null</code>.
 </ul>
 
-Once an encoded colorspace is determined, then the target colorspace is 
+Once an encoded colorspace is determined, then the target colorspace is
 determined as follows:
 
 <ul>
   <li> If a destination type is not set, then the following default
-       transformations take place after upsampling: YCbCr (and YCbCrA) images 
+       transformations take place after upsampling: YCbCr (and YCbCrA) images
        are converted to RGB (and RGBA) using the conversion provided by the
-       underlying IJG library and either the built-in sRGB 
+       underlying IJG library and either the built-in sRGB
        <code>ColorSpace</code> or a custom RGB <code>ColorSpace</code> object
        based on an embedded ICC profile is used to create the output
        <code>ColorModel</code>.  PhotoYCC and PhotoYCCA images are not
@@ -292,16 +290,16 @@
 
   <li> If a destination image or type is set, it is used as follows:
        If the IJG library provides an appropriate conversion, it is used.
-       Otherwise the default library conversion is followed by a colorspace 
+       Otherwise the default library conversion is followed by a colorspace
        conversion in Java.</li>
 
-  <li> Bands are selected AFTER any library colorspace conversion.  If a 
-       subset of either source or destination bands is used, then the default 
+  <li> Bands are selected AFTER any library colorspace conversion.  If a
+       subset of either source or destination bands is used, then the default
        library conversions are used with no further conversion in Java,
        regardless of any destination type.</li>
 
-  <li> An exception is thrown if an attempt is made to read an image in an 
-       unsupported jpeg colorspace as a <code>BufferedImage</code> 
+  <li> An exception is thrown if an attempt is made to read an image in an
+       unsupported jpeg colorspace as a <code>BufferedImage</code>
        (<i>e.g.</i> CMYK).  Such images may be read as
        <code>Raster</code>s.  If an image colorspace is unsupported or
        uninterpretable, then <code>ImageReader.getImageTypes</code> will
@@ -315,26 +313,26 @@
 follows:
 
 <p>
-If a subset of the source bands is to be written, no color conversion is 
-performed.  Any destination, if set, must match the number of bands that will 
-be written, and serves as an interpretation of the selected bands, rather than 
-a conversion request.  This behavior is identical to that for 
-<code>Raster</code>s.  If all the bands are to be written and an image 
-(as opposed to a <code>Raster</code>) is being written, any destination type 
+If a subset of the source bands is to be written, no color conversion is
+performed.  Any destination, if set, must match the number of bands that will
+be written, and serves as an interpretation of the selected bands, rather than
+a conversion request.  This behavior is identical to that for
+<code>Raster</code>s.  If all the bands are to be written and an image
+(as opposed to a <code>Raster</code>) is being written, any destination type
 is ignored and a warning is sent to any listeners.
 
 <p>
-If a destination type is used and any aspect of the metadata object, if there 
-is one, is not compatible with that type, the destination type is used, the 
-metadata written is modified from that provided, and a warning is sent to 
-listeners.  This includes the <code>app0JFIF</code> and 
-<code>app14Adobe</code> nodes.  The component ids in the <code>sof</code> and 
-<code>sos</code> nodes are not modified, however, as unless a 
+If a destination type is used and any aspect of the metadata object, if there
+is one, is not compatible with that type, the destination type is used, the
+metadata written is modified from that provided, and a warning is sent to
+listeners.  This includes the <code>app0JFIF</code> and
+<code>app14Adobe</code> nodes.  The component ids in the <code>sof</code> and
+<code>sos</code> nodes are not modified, however, as unless a
 <code>app0JFIF</code> node is present, any values may be used.
 <p>
 
-When a full image is written, a destination colorspace will be 
-chosen based on the image contents and the metadata settings, according to 
+When a full image is written, a destination colorspace will be
+chosen based on the image contents and the metadata settings, according to
 the following algorithm:
 
 <p>
@@ -351,9 +349,9 @@
        channels by half both vertically and horizontally, and written with a
        JFIF <code>APP0</code> marker segment.  If the <code>ColorSpace</code>
        of the image is based on an <code>ICCProfile</code> (it is an instance
-       of <code>ICC_ColorSpace</code>, but is not one of the standard built-in 
-       <code>ColorSpaces</code>), then that profile is embedded in an 
-       <code>APP2</code> marker segment.  As required by JFIF, the 
+       of <code>ICC_ColorSpace</code>, but is not one of the standard built-in
+       <code>ColorSpaces</code>), then that profile is embedded in an
+       <code>APP2</code> marker segment.  As required by JFIF, the
        component ids in the frame and scan headers are set to 1, 2, and 3.
 
 
@@ -361,7 +359,7 @@
         described above,
        RGBA images are converted to YCbCrA, subsampled in the
        chrominance channels by half both vertically and horizontally, and
-       written without any special marker segments.  The component ids 
+       written without any special marker segments.  The component ids
        in the frame and scan headers are set to 1, 2, 3, and 4.
 
   <li> Subject to the <a href=#optcolor>optional library support</a>
@@ -378,16 +376,16 @@
 <p>
 
 If a metadata object is specified, then the number of channels in the
-frame and scan headers must always match the number of bands to be 
-written, or an exception is thrown.  <code>app0JFIF</code> and 
-<code>app14Adobe</code> nodes may appear in the same metadata object only 
-if the <code>app14Adobe</code> node indicates YCbCr, and the component ids 
-are JFIF compatible (0-2).  The various image types are processed in the 
+frame and scan headers must always match the number of bands to be
+written, or an exception is thrown.  <code>app0JFIF</code> and
+<code>app14Adobe</code> nodes may appear in the same metadata object only
+if the <code>app14Adobe</code> node indicates YCbCr, and the component ids
+are JFIF compatible (0-2).  The various image types are processed in the
 following ways:
 
 <br>
 
-(All multi-channel images are subsampled according to the sampling factors 
+(All multi-channel images are subsampled according to the sampling factors
 in the frame header node of the metadata object, regardless of color space.)
 
 <ul>
@@ -395,10 +393,10 @@
     <ul>
       <li> If an <code>app0JFIF</code> node is present in the metadata object,
            a JFIF <code>APP0</code> marker segment is written.
-      <li> If an <code>app14Adobe</code> node is present in the metadata 
+      <li> If an <code>app14Adobe</code> node is present in the metadata
            object, it is checked for validity (<code>transform</code> must be
            <code>UNKNOWN</code>) and written.
-      <li> If neither node is present in the metadata object, no special 
+      <li> If neither node is present in the metadata object, no special
            marker segment is written.
     </ul>
 
@@ -412,14 +410,14 @@
            <code>UNKNOWN</code>) and written.  If <code>transform</code> is
            not <code>UNKNOWN</code>, a warning is sent to listeners and the
            correct transform is written.
-      <li> If neither node is present in the metadata object, no special 
+      <li> If neither node is present in the metadata object, no special
            marker segment is written.
     </ul>
 
   <li> RGB Images:
     <ul>
       <li> If an <code>app0JFIF</code> node is present in the metadata object,
-           the image is converted to YCbCr and written with a JFIF 
+           the image is converted to YCbCr and written with a JFIF
            <code>APP0</code> marker segment.  If the <code>ColorSpace</code>
            of the image is based on a non-standard ICC Profile, then that
            profile is embedded in an <code>APP2</code> marker segment.  If the
@@ -439,7 +437,7 @@
 
       <li> If neither node is present, the component ids in the frame
            header are consulted.  If these indicate a colorspace as described
-           above, then the image is converted to that colorspace if possible.  
+           above, then the image is converted to that colorspace if possible.
            If the component ids do not indicate a colorspace, then the
            sampling factors are consulted.  If the image is to be subsampled,
            it is converted to YCbCr first.  If the image is not to be
@@ -459,7 +457,7 @@
            object, the image is written with an Adobe <code>APP14</code> marker
            segment.  No colorspace conversion is performed.  Component ids
            are written just as they appear in the frame and scan  headers.
-           The color transform must be <code>UNKNOWN</code>.  If it is 
+           The color transform must be <code>UNKNOWN</code>.  If it is
            not, a warning is sent to listeners.
 
       <li> If no <code>app14Adobe</code> node is present, the component ids in
@@ -509,16 +507,16 @@
 </ul>
 
 <h2>
-<a name=thumbs>Thumbnail Images</a>
+<a id=thumbs>Thumbnail Images</a>
 </h2>
 Thumbnails are supported by the use of JFIF and JFIF extension marker segments.
-Thumbnails provided on the write methods determine the thumbnails that will be 
-included.  <code>app0JFIF</code> and <code>app0JFXX</code> nodes present in 
-the metadata do not contain any thumbnail pixel data.  However, the kinds of 
-thumbnails written depend on the contents of the metadata object, as follows.  
-Any thumbnail which is to be written as an indexed or RGB image and which is 
-larger than 255 by 255 will be clipped, not scaled, to 255 by 255.  Thumbnails 
-written as JPEG images may be any size.  A warning is sent to any listeners 
+Thumbnails provided on the write methods determine the thumbnails that will be
+included.  <code>app0JFIF</code> and <code>app0JFXX</code> nodes present in
+the metadata do not contain any thumbnail pixel data.  However, the kinds of
+thumbnails written depend on the contents of the metadata object, as follows.
+Any thumbnail which is to be written as an indexed or RGB image and which is
+larger than 255 by 255 will be clipped, not scaled, to 255 by 255.  Thumbnails
+written as JPEG images may be any size.  A warning is sent to any listeners
 whenever a thumbnail is clipped.
 <ul>
   <li> If there is a single thumbnail, it is processed as follows:
@@ -534,14 +532,14 @@
           <li> If the first <code>app0JFXX</code> node present in the metadata
                contains another thumbnail form (RGB or JPEG), the palette
                image is expanded to RGB and the indicated thumbnail form is
-               written.  
+               written.
         </ul>
 
       <li> If the thumbnail image is an RGB image, it is processed as follows:
         <ul>
           <li> If no <code>app0JFXX</code> node is present in the metadata,
                the thumbnail is written as part of the JFIF <code>APP0</code>
-               marker segment. 
+               marker segment.
           <li> If the first <code>app0JFXX</code> node present in the metadata
                contains a <code>JFIFthumbRGB</code> element, an
                RGB thumbnail is written in a JFXX <code>APP0</code> marker
@@ -561,7 +559,7 @@
         <ul>
           <li> If no <code>app0JFXX</code> node is present in the metadata,
                the thumbnail is expanded to RGB and written as part of the
-               JFIF <code>APP0</code> marker segment. 
+               JFIF <code>APP0</code> marker segment.
           <li> If the first <code>app0JFXX</code> node present in the metadata
                contains a <code>JFIFthumbRGB</code> element, the thumbnail is
                expanded to RGB and written in a separate <code>JFXX</code> RGB
@@ -587,50 +585,50 @@
        sequence as the thumbnail.  <i>I.e.</i> the first
        <code>app0JFXX</code> node applies to the first thumbnail, the second
        node to the second thumbnail, and so on.  If there are fewer
-       <code>app0JFXX</code> nodes in the metadata than thumbnails, then 
+       <code>app0JFXX</code> nodes in the metadata than thumbnails, then
        those thumbnails are considered to have no matching
        <code>app0JFXX</code> node.  An RGB thumbnail with no matching
        <code>app0JFXX</code> node is written in a JFXX <code>APP0</code> marker
        segment.  A grayscale thumbnail with no matching
-       <code>app0JFXX</code> node is written as a JPEG image to a JFXX 
+       <code>app0JFXX</code> node is written as a JPEG image to a JFXX
        <code>APP0</code> marker segment.
 </ul>
 <p>
 
 Note that as the only mechanism for storing thumbnails is via the
-JFIF or JFIF extension marker segments, only grayscale or RGB images 
-may have thumbnails.  If thumbnails are present when writing any other type 
+JFIF or JFIF extension marker segments, only grayscale or RGB images
+may have thumbnails.  If thumbnails are present when writing any other type
 of image, the thumbnails are ignored and a warning is sent to any warning
 listeners.
 
 <h2>
-<a name=prog>Progressive Encoding</a>
+<a id=prog>Progressive Encoding</a>
 </h2>
 
 Progressive encoding must be enabled on the <code>ImageWriteParam</code>
 passed in to a write operation, or the image will be written sequentially,
-regardless of the scan headers included in the metadata object.  If 
+regardless of the scan headers included in the metadata object.  If
 progressive encoding is enabled and set to copy from metadata, then
-the sequence of scan headers from the metadata is used to write the 
-image.  If progressive encoding is enabled and set to use a default, 
-then the scans in the metadata are ignored and a default set of scans 
+the sequence of scan headers from the metadata is used to write the
+image.  If progressive encoding is enabled and set to use a default,
+then the scans in the metadata are ignored and a default set of scans
 is used.  Progressive encoding always forces optimized Huffman tables to
 be used.  Any Huffman tables present in the metadata will be ignored,
 and a warning will be sent to any warning listeners.
 
 If Huffman-table optimization is requested on the <code>ImageWriteParam</code>,
-all Huffman tables in the metadata or in the <code>ImageWriteParam</code> 
-itself are ignored, and a warning will be sent to any warning listeners if 
+all Huffman tables in the metadata or in the <code>ImageWriteParam</code>
+itself are ignored, and a warning will be sent to any warning listeners if
 any such tables are present.
 
 <h2>
-<a name=tree>Native Metadata Format Tree Structure and Editing</a>
+<a id=tree>Native Metadata Format Tree Structure and Editing</a>
 </h2>
 
 The DTDs below describe just the trees of metadata objects actually returned
-by the <code>IIOMetadata</code> object.  They do not include nodes 
-corresponding to <code>SOI</code>, <code>EOI</code>, or <code>RST</code> 
-markers, as these parsing delimiters do not carry any meaningful metadata.  
+by the <code>IIOMetadata</code> object.  They do not include nodes
+corresponding to <code>SOI</code>, <code>EOI</code>, or <code>RST</code>
+markers, as these parsing delimiters do not carry any meaningful metadata.
 <p>
 
 The first node is always a <code>JPEGvariety</code> node.  In the
@@ -659,60 +657,60 @@
 
 <p>
 
-On reading, <code>JFXX</code> and <code>app2ICC</code> nodes occur as 
+On reading, <code>JFXX</code> and <code>app2ICC</code> nodes occur as
 children of an <code>app0JFIF</code> node.
-This is true regardless of where the JFXX <code>APP0</code> and 
-<code>APP2</code> marker segments actually occur in the stream.  The ordering 
-of nodes within the <code>markerSequence</code> node corresponds to the 
+This is true regardless of where the JFXX <code>APP0</code> and
+<code>APP2</code> marker segments actually occur in the stream.  The ordering
+of nodes within the <code>markerSequence</code> node corresponds to the
 ordering of marker segments found in the JPEG stream.
 <p>
-On writing, any <code>JFXX</code> and <code>app2ICC</code> nodes must 
-occur as children of an <code>app0JFIF</code> node, itself a child of a 
+On writing, any <code>JFXX</code> and <code>app2ICC</code> nodes must
+occur as children of an <code>app0JFIF</code> node, itself a child of a
 <code>JPEGvariety</code> node, which must always be the first node.
 (If the stream is not to be JFIF compliant, no <code>app0JFIF</code> node
 should be provided, and the <code>JPEGvariety</code> node should have no
-children.)  Any 
-JFIF <code>APP0</code>, JFXX <code>APP0</code>, and <code>APP2</code> marker 
-segments are written first, followed by all Adobe <code>APP14</code>, 
-<code>APPn</code>, <code>COM</code> and unknown segments in the 
-order in which their corresponding nodes appear in the 
-<code>markerSequence</code> node, followed by <code>DQT</code> (and 
-<code>DHT</code> for non-progressive writes) marker segments, followed by the 
+children.)  Any
+JFIF <code>APP0</code>, JFXX <code>APP0</code>, and <code>APP2</code> marker
+segments are written first, followed by all Adobe <code>APP14</code>,
+<code>APPn</code>, <code>COM</code> and unknown segments in the
+order in which their corresponding nodes appear in the
+<code>markerSequence</code> node, followed by <code>DQT</code> (and
+<code>DHT</code> for non-progressive writes) marker segments, followed by the
 <code>SOF</code> and <code>SOS</code> marker segments.  For progressive writes
-using metadata to control progression, the <code>SOS</code> segments are used 
-in the order in which their corresponding nodes occur in the 
+using metadata to control progression, the <code>SOS</code> segments are used
+in the order in which their corresponding nodes occur in the
 <code>markerSequence</code> node.
 <p>
 
-The <code>reset</code>, <code>mergeTree</code> and <code>setFromTree</code> 
+The <code>reset</code>, <code>mergeTree</code> and <code>setFromTree</code>
 operations have the following semantics for the JPEG plug-in metadata object:
 
-<p> <code>reset</code> - A call to <code>reset</code> will restore the 
-metadata object to the same state it had immediately after creation, whether 
-this came about from reading a stream or by obtaining a default object from 
-the <code>ImageWriter</code>.  This is true regardless of how many times the 
+<p> <code>reset</code> - A call to <code>reset</code> will restore the
+metadata object to the same state it had immediately after creation, whether
+this came about from reading a stream or by obtaining a default object from
+the <code>ImageWriter</code>.  This is true regardless of how many times the
 metadata object has been modified since creation.
 
 <p> <code>mergeTree</code> - Native Format
-<br> The <code>mergeTree</code> operation accepts valid trees conforming to 
-the DTD below, and merges the nodes using the following ordering rules.  In 
-all cases, only data present in the new node is changed in a corresponding 
-existing node, if any.  This means that nodes cannot be removed using 
-<code>mergeTree</code>.  To remove nodes, use <code>setFromTree</code>.  The 
+<br> The <code>mergeTree</code> operation accepts valid trees conforming to
+the DTD below, and merges the nodes using the following ordering rules.  In
+all cases, only data present in the new node is changed in a corresponding
+existing node, if any.  This means that nodes cannot be removed using
+<code>mergeTree</code>.  To remove nodes, use <code>setFromTree</code>.  The
 tree must consist of <code>IIOMetadataNode</code>s.
 <ul>
   <li> <code>app0JFIF</code>
         <ul>
-          <li> If an <code>app0JFIF</code> node already exists, the contents 
-               of the new one modify the existing one. 
+          <li> If an <code>app0JFIF</code> node already exists, the contents
+               of the new one modify the existing one.
           <li> If there is no such node, a new one is created and inserted in
                the appropriate position.
-        </ul>    
+        </ul>
   <li> <code>dqt</code>
         <ul>
           <li> If there already exist <code>dqt</code> nodes in the sequence,
                then each table in the node replaces the first table, in any
-               <code>dqt</code> node, with the same table id.  
+               <code>dqt</code> node, with the same table id.
           <li> If none of the existing <code>dqt</code> nodes contain a table
                with the same id, then the table is added to the last existing
                <code>dqt</code> node.
@@ -720,10 +718,10 @@
                created and added as follows:
             <ul>
               <li> If there are <code>dht</code> nodes, the new
-                   <code>dqt</code> node is inserted before the first one.  
+                   <code>dqt</code> node is inserted before the first one.
               <li> If there are no <code>dht</code> nodes, the new
                    <code>dqt</code> node is inserted  before an
-                   <code>sof</code> node, if there is one. 
+                   <code>sof</code> node, if there is one.
               <li> If there is no <code>sof</code> node, the new
                    <code>dqt</code> node is inserted before the first
                    <code>sos</code> node, if there is one.
@@ -747,7 +745,7 @@
                    last <code>dqt</code> node.
               <li> If there are no <code>dqt</code> nodes, the new
                    <code>dht</code> node is inserted before an
-                   <code>sof</code> node, if there is one. 
+                   <code>sof</code> node, if there is one.
               <li> If there is no <code>sof</code> node, the new
                    <code>dht</code> node is inserted before the first
                    <code>sos</code> node, if there is one.
@@ -757,7 +755,7 @@
         </ul>
   <li> <code>dri</code>
         <ul>
-          <li> If there already exists a <code>dri</code> node, the restart 
+          <li> If there already exists a <code>dri</code> node, the restart
                interval value is updated.
           <li> If there is no <code>dri</code> node, then a new one is created
                and added as follows:
@@ -785,11 +783,11 @@
         </ul>
   <li> <code>app14Adobe</code>
         <ul>
-          <li> If there already exists an <code>app14Adobe</code> node, then 
+          <li> If there already exists an <code>app14Adobe</code> node, then
                its attributes are updated from the node.
-          <li> If there is no <code>app14Adobe</code> node, then a new one is 
+          <li> If there is no <code>app14Adobe</code> node, then a new one is
                created and  added as follows:
-            <ul> 
+            <ul>
               <li> The new <code>app14Adobe</code> node is inserted after the
                    last <code>unknown</code> node, if there are any.
               <li> If there are no <code>unknown</code> nodes, the new
@@ -838,13 +836,13 @@
 
 <p> <code>mergeTree</code> - Standard Format
 <br>
-The <code>mergeTree</code> operation, when given a tree in the standard 
+The <code>mergeTree</code> operation, when given a tree in the standard
 format, will modify the native tree in the following ways:
 <ul>
    <li> <code>Chroma</code> - The <code>ColorSpaceType</code> subnode of a
         <code>Chroma</code> node may change the target colorspace of the
         compressed image.  The selection of a new colorspace can cause a number
-        of changes, in keeping with the algorithms described above: 
+        of changes, in keeping with the algorithms described above:
         <code>app0JFIF</code> and <code>app14Adobe</code> nodes may be added
         or removed, subsampling may be added or removed, component ids may
         be changed, and <code>sof</code> and <code>sos</code> nodes will be
@@ -871,17 +869,17 @@
 
 <p> <code>setFromTree</code> - Native Format
 <br>
-The <code>setFromTree</code> operation, when given a tree in the native 
-format described below, will simply replace the existing tree in its entirety 
+The <code>setFromTree</code> operation, when given a tree in the native
+format described below, will simply replace the existing tree in its entirety
 with the new one.  The tree must consist of <code>IIOMetadataNode</code>s.
 
 <p> <code>setFromTree</code> - Standard Format
 <br>
-The <code>setFromTree</code> operation, when given a tree in the standard 
+The <code>setFromTree</code> operation, when given a tree in the standard
 format, performs a <code>reset</code> followed by a merge of the new tree.
 
 <h2>
-<a name=image>Image Metadata DTD</a>
+<a id=image>Image Metadata DTD</a>
 </h2>
 
 <pre>
@@ -891,39 +889,39 @@
 
     &lt;!ELEMENT "JPEGvariety" (app0JFIF)&gt;
       &lt;!-- A node grouping all marker segments specific to the variety of
-              stream being read/written (e.g. JFIF) - may be empty --&gt; 
+              stream being read/written (e.g. JFIF) - may be empty --&gt;
 
       &lt;!ELEMENT "app0JFIF" (JFXX?, app2ICC?)&gt;
         &lt;!ATTLIST "app0JFIF" "majorVersion" #CDATA "1"&gt;
-          &lt;!-- The major JFIF version number --&gt; 
+          &lt;!-- The major JFIF version number --&gt;
           &lt;!-- Data type: Integer --&gt;
           &lt;!-- Min value: 0 (inclusive) --&gt;
           &lt;!-- Max value: 255 (inclusive) --&gt;
         &lt;!ATTLIST "app0JFIF" "minorVersion" #CDATA "2"&gt;
-          &lt;!-- The minor JFIF version number --&gt; 
+          &lt;!-- The minor JFIF version number --&gt;
           &lt;!-- Data type: Integer --&gt;
           &lt;!-- Min value: 0 (inclusive) --&gt;
           &lt;!-- Max value: 255 (inclusive) --&gt;
         &lt;!ATTLIST "app0JFIF" "resUnits" ("0" | "1" | "2") "0"&gt;
-          &lt;!-- The resolution units for Xdensisty and Ydensity (0 = no 
-               units, just aspect ratio; 1 = dots/inch; 2 = dots/cm) --&gt; 
+          &lt;!-- The resolution units for Xdensisty and Ydensity (0 = no
+               units, just aspect ratio; 1 = dots/inch; 2 = dots/cm) --&gt;
         &lt;!ATTLIST "app0JFIF" "Xdensity" #CDATA "1"&gt;
-          &lt;!-- The horizontal density or aspect ratio numerator --&gt; 
+          &lt;!-- The horizontal density or aspect ratio numerator --&gt;
           &lt;!-- Data type: Integer --&gt;
           &lt;!-- Min value: 1 (inclusive) --&gt;
           &lt;!-- Max value: 65535 (inclusive) --&gt;
         &lt;!ATTLIST "app0JFIF" "Ydensity" #CDATA "1"&gt;
-          &lt;!-- The vertical density or aspect ratio denominator --&gt; 
+          &lt;!-- The vertical density or aspect ratio denominator --&gt;
           &lt;!-- Data type: Integer --&gt;
           &lt;!-- Min value: 1 (inclusive) --&gt;
           &lt;!-- Max value: 65535 (inclusive) --&gt;
         &lt;!ATTLIST "app0JFIF" "thumbWidth" #CDATA "0"&gt;
-          &lt;!-- The width of the thumbnail, or 0 if there isn't one --&gt; 
+          &lt;!-- The width of the thumbnail, or 0 if there isn't one --&gt;
           &lt;!-- Data type: Integer --&gt;
           &lt;!-- Min value: 0 (inclusive) --&gt;
           &lt;!-- Max value: 255 (inclusive) --&gt;
         &lt;!ATTLIST "app0JFIF" "thumbHeight" #CDATA "0"&gt;
-          &lt;!-- The height of the thumbnail, or 0 if there isn't one --&gt; 
+          &lt;!-- The height of the thumbnail, or 0 if there isn't one --&gt;
           &lt;!-- Data type: Integer --&gt;
           &lt;!-- Min value: 0 (inclusive) --&gt;
           &lt;!-- Max value: 255 (inclusive) --&gt;
@@ -931,233 +929,233 @@
         &lt;!ELEMENT "JFXX" (app0JFXX)*&gt;
           &lt;!-- Min children: 1 --&gt;
 
-        &lt;!ELEMENT "app0JFXX" (JFIFthumbJPEG | JFIFthumbPalette | 
+        &lt;!ELEMENT "app0JFXX" (JFIFthumbJPEG | JFIFthumbPalette |
           JFIFthumbRGB)&gt;
-          &lt;!-- A JFIF extension marker segment --&gt; 
+          &lt;!-- A JFIF extension marker segment --&gt;
           &lt;!ATTLIST "app0JFXX" "extensionCode" ("16" | "17" | "19")
              #IMPLIED&gt;
-            &lt;!-- The JFXX extension code identifying thumbnail type: (16 = 
-                 JPEG, 17 = indexed, 19 = RGB --&gt; 
+            &lt;!-- The JFXX extension code identifying thumbnail type: (16 =
+                 JPEG, 17 = indexed, 19 = RGB --&gt;
 
           &lt;!ELEMENT "JFIFthumbJPEG" (markerSequence?)&gt;
-            &lt;!-- A JFIF thumbnail in JPEG format (no JFIF segments 
-                 permitted) --&gt; 
+            &lt;!-- A JFIF thumbnail in JPEG format (no JFIF segments
+                 permitted) --&gt;
 
           &lt;!ELEMENT "JFIFthumbPalette" EMPTY&gt;
-            &lt;!-- A JFIF thumbnail as an RGB indexed image --&gt; 
+            &lt;!-- A JFIF thumbnail as an RGB indexed image --&gt;
             &lt;!ATTLIST "JFIFthumbPalette" "thumbWidth" #CDATA #IMPLIED&gt;
-              &lt;!-- The width of the thumbnail --&gt; 
+              &lt;!-- The width of the thumbnail --&gt;
               &lt;!-- Data type: Integer --&gt;
               &lt;!-- Min value: 0 (inclusive) --&gt;
               &lt;!-- Max value: 255 (inclusive) --&gt;
             &lt;!ATTLIST "JFIFthumbPalette" "thumbHeight" #CDATA #IMPLIED&gt;
-              &lt;!-- The height of the thumbnail --&gt; 
+              &lt;!-- The height of the thumbnail --&gt;
               &lt;!-- Data type: Integer --&gt;
               &lt;!-- Min value: 0 (inclusive) --&gt;
               &lt;!-- Max value: 255 (inclusive) --&gt;
 
           &lt;!ELEMENT "JFIFthumbRGB" EMPTY&gt;
-            &lt;!-- A JFIF thumbnail as an RGB image --&gt; 
+            &lt;!-- A JFIF thumbnail as an RGB image --&gt;
             &lt;!ATTLIST "JFIFthumbRGB" "thumbWidth" #CDATA #IMPLIED&gt;
-              &lt;!-- The width of the thumbnail --&gt; 
+              &lt;!-- The width of the thumbnail --&gt;
               &lt;!-- Data type: Integer --&gt;
               &lt;!-- Min value: 0 (inclusive) --&gt;
               &lt;!-- Max value: 255 (inclusive) --&gt;
             &lt;!ATTLIST "JFIFthumbRGB" "thumbHeight" #CDATA #IMPLIED&gt;
-              &lt;!-- The height of the thumbnail --&gt; 
+              &lt;!-- The height of the thumbnail --&gt;
               &lt;!-- Data type: Integer --&gt;
               &lt;!-- Min value: 0 (inclusive) --&gt;
               &lt;!-- Max value: 255 (inclusive) --&gt;
 
         &lt;!ELEMENT "app2ICC" EMPTY&gt;
-          &lt;!-- An ICC profile APP2 marker segment --&gt; 
+          &lt;!-- An ICC profile APP2 marker segment --&gt;
           &lt;!-- Optional User object: java.awt.color.ICC_Profile --&gt;
 
-    &lt;!ELEMENT "markerSequence" (dqt | dht | dri | com | unknown | 
+    &lt;!ELEMENT "markerSequence" (dqt | dht | dri | com | unknown |
       app14Adobe | sof | sos)*&gt;
-      &lt;!-- A node grouping all non-jfif marker segments --&gt; 
+      &lt;!-- A node grouping all non-jfif marker segments --&gt;
 
       &lt;!ELEMENT "dqt" (dqtable)*&gt;
-        &lt;!-- A Define Quantization Table(s) marker segment --&gt; 
+        &lt;!-- A Define Quantization Table(s) marker segment --&gt;
         &lt;!-- Min children: 1 --&gt;
         &lt;!-- Max children: 4 --&gt;
 
         &lt;!ELEMENT "dqtable" EMPTY&gt;
-          &lt;!-- A single quantization table --&gt; 
+          &lt;!-- A single quantization table --&gt;
           &lt;!-- User object: javax.imageio.plugins.jpeg.JPEGQTable --&gt;
           &lt;!ATTLIST "dqtable" "elementPrecision" #CDATA "0"&gt;
-            &lt;!-- The number of bits in each table element (0 = 8, 1 = 16) 
-                 --&gt; 
+            &lt;!-- The number of bits in each table element (0 = 8, 1 = 16)
+                 --&gt;
             &lt;!-- Data type: Integer --&gt;
           &lt;!ATTLIST "dqtable" "qtableId" ("0" | "1" | "2" | "3") #REQUIRED&gt;
 
       &lt;!ELEMENT "dht" (dhtable)*&gt;
-        &lt;!-- A Define Huffman Table(s) marker segment --&gt; 
+        &lt;!-- A Define Huffman Table(s) marker segment --&gt;
         &lt;!-- Min children: 1 --&gt;
         &lt;!-- Max children: 4 --&gt;
 
         &lt;!ELEMENT "dhtable" EMPTY&gt;
-          &lt;!-- A single Huffman table --&gt; 
+          &lt;!-- A single Huffman table --&gt;
           &lt;!-- User object: javax.imageio.plugins.jpeg.JPEGHuffmanTable --&gt;
           &lt;!ATTLIST "dhtable" "class" ("0" | "1") #REQUIRED&gt;
-            &lt;!-- Indicates whether this is a DC (0) or an AC (1) table --&gt; 
+            &lt;!-- Indicates whether this is a DC (0) or an AC (1) table --&gt;
           &lt;!ATTLIST "dhtable" "htableId" ("0" | "1" | "2" | "3") #REQUIRED&gt;
-            &lt;!-- The table id --&gt; 
+            &lt;!-- The table id --&gt;
 
       &lt;!ELEMENT "dri" EMPTY&gt;
-        &lt;!-- A Define Restart Interval marker segment --&gt; 
+        &lt;!-- A Define Restart Interval marker segment --&gt;
         &lt;!ATTLIST "dri" "interval" #CDATA #REQUIRED&gt;
-          &lt;!-- The restart interval in MCUs --&gt; 
+          &lt;!-- The restart interval in MCUs --&gt;
           &lt;!-- Data type: Integer --&gt;
           &lt;!-- Min value: 0 (inclusive) --&gt;
           &lt;!-- Max value: 65535 (inclusive) --&gt;
 
       &lt;!ELEMENT "com" EMPTY&gt;
-        &lt;!-- A Comment marker segment. The user object contains the actual 
-             bytes. --&gt; 
+        &lt;!-- A Comment marker segment. The user object contains the actual
+             bytes. --&gt;
         &lt;!-- User object: array of [B --&gt;
         &lt;!-- Min length: 1 --&gt;
         &lt;!-- Max length: 65533 --&gt;
         &lt;!ATTLIST "com" "comment" #CDATA #IMPLIED&gt;
-          &lt;!-- The comment as a string (used only if user object is null) 
-               --&gt; 
+          &lt;!-- The comment as a string (used only if user object is null)
+               --&gt;
           &lt;!-- Data type: String --&gt;
 
       &lt;!ELEMENT "unknown" EMPTY&gt;
-        &lt;!-- An unrecognized marker segment. The user object contains the 
-             data not including length. --&gt; 
+        &lt;!-- An unrecognized marker segment. The user object contains the
+             data not including length. --&gt;
         &lt;!-- User object: array of [B --&gt;
         &lt;!-- Min length: 1 --&gt;
         &lt;!-- Max length: 65533 --&gt;
         &lt;!ATTLIST "unknown" "MarkerTag" #CDATA #REQUIRED&gt;
-          &lt;!-- The tag identifying this marker segment --&gt; 
+          &lt;!-- The tag identifying this marker segment --&gt;
           &lt;!-- Data type: Integer --&gt;
           &lt;!-- Min value: 0 (inclusive) --&gt;
           &lt;!-- Max value: 255 (inclusive) --&gt;
 
       &lt;!ELEMENT "app14Adobe" EMPTY&gt;
-        &lt;!-- An Adobe APP14 marker segment --&gt; 
+        &lt;!-- An Adobe APP14 marker segment --&gt;
         &lt;!ATTLIST "app14Adobe" "version" #CDATA "100"&gt;
-          &lt;!-- The version of Adobe APP14 marker segment --&gt; 
+          &lt;!-- The version of Adobe APP14 marker segment --&gt;
           &lt;!-- Data type: Integer --&gt;
           &lt;!-- Min value: 100 (inclusive) --&gt;
           &lt;!-- Max value: 255 (inclusive) --&gt;
         &lt;!ATTLIST "app14Adobe" "flags0" #CDATA "0"&gt;
-          &lt;!-- The flags0 variable of an APP14 marker segment --&gt; 
+          &lt;!-- The flags0 variable of an APP14 marker segment --&gt;
           &lt;!-- Data type: Integer --&gt;
           &lt;!-- Min value: 0 (inclusive) --&gt;
           &lt;!-- Max value: 65535 (inclusive) --&gt;
         &lt;!ATTLIST "app14Adobe" "flags1" #CDATA "0"&gt;
-          &lt;!-- The flags1 variable of an APP14 marker segment --&gt; 
+          &lt;!-- The flags1 variable of an APP14 marker segment --&gt;
           &lt;!-- Data type: Integer --&gt;
           &lt;!-- Min value: 0 (inclusive) --&gt;
           &lt;!-- Max value: 65535 (inclusive) --&gt;
         &lt;!ATTLIST "app14Adobe" "transform" ("0" | "1" | "2") #REQUIRED&gt;
-          &lt;!-- The color transform applied to the image (0 = Unknown, 1 = 
-               YCbCr, 2 = YCCK) --&gt; 
+          &lt;!-- The color transform applied to the image (0 = Unknown, 1 =
+               YCbCr, 2 = YCCK) --&gt;
 
       &lt;!ELEMENT "sof" (componentSpec)*&gt;
-        &lt;!-- A Start Of Frame marker segment --&gt; 
+        &lt;!-- A Start Of Frame marker segment --&gt;
         &lt;!-- Min children: 1 --&gt;
         &lt;!-- Max children: 4 --&gt;
         &lt;!ATTLIST "sof" "process" ("0" | "1" | "2") #IMPLIED&gt;
-          &lt;!-- The JPEG process (0 = Baseline sequential, 1 = Extended 
-               sequential, 2 = Progressive) --&gt; 
+          &lt;!-- The JPEG process (0 = Baseline sequential, 1 = Extended
+               sequential, 2 = Progressive) --&gt;
         &lt;!ATTLIST "sof" "samplePrecision" #CDATA "8"&gt;
-          &lt;!-- The number of bits per sample --&gt; 
+          &lt;!-- The number of bits per sample --&gt;
           &lt;!-- Data type: Integer --&gt;
         &lt;!ATTLIST "sof" "numLines" #CDATA #IMPLIED&gt;
-          &lt;!-- The number of lines in the image --&gt; 
+          &lt;!-- The number of lines in the image --&gt;
           &lt;!-- Data type: Integer --&gt;
           &lt;!-- Min value: 0 (inclusive) --&gt;
           &lt;!-- Max value: 65535 (inclusive) --&gt;
         &lt;!ATTLIST "sof" "samplesPerLine" #CDATA #IMPLIED&gt;
-          &lt;!-- The number of samples per line --&gt; 
+          &lt;!-- The number of samples per line --&gt;
           &lt;!-- Data type: Integer --&gt;
           &lt;!-- Min value: 0 (inclusive) --&gt;
           &lt;!-- Max value: 65535 (inclusive) --&gt;
         &lt;!ATTLIST "sof" "numFrameComponents" ("1" | "2" | "3" | "4")
            #IMPLIED&gt;
-          &lt;!-- The number of components in the image --&gt; 
+          &lt;!-- The number of components in the image --&gt;
 
         &lt;!ELEMENT "componentSpec" EMPTY&gt;
-          &lt;!-- A component specification for a frame --&gt; 
+          &lt;!-- A component specification for a frame --&gt;
           &lt;!ATTLIST "componentSpec" "componentId" #CDATA #REQUIRED&gt;
-            &lt;!-- The id for this component --&gt; 
+            &lt;!-- The id for this component --&gt;
             &lt;!-- Data type: Integer --&gt;
             &lt;!-- Min value: 0 (inclusive) --&gt;
             &lt;!-- Max value: 255 (inclusive) --&gt;
           &lt;!ATTLIST "componentSpec" "HsamplingFactor" #CDATA #REQUIRED&gt;
-            &lt;!-- The horizontal sampling factor for this component --&gt; 
+            &lt;!-- The horizontal sampling factor for this component --&gt;
             &lt;!-- Data type: Integer --&gt;
             &lt;!-- Min value: 1 (inclusive) --&gt;
             &lt;!-- Max value: 255 (inclusive) --&gt;
           &lt;!ATTLIST "componentSpec" "VsamplingFactor" #CDATA #REQUIRED&gt;
-            &lt;!-- The vertical sampling factor for this component --&gt; 
+            &lt;!-- The vertical sampling factor for this component --&gt;
             &lt;!-- Data type: Integer --&gt;
             &lt;!-- Min value: 1 (inclusive) --&gt;
             &lt;!-- Max value: 255 (inclusive) --&gt;
-          &lt;!ATTLIST "componentSpec" "QtableSelector" ("0" | "1" | "2" | 
+          &lt;!ATTLIST "componentSpec" "QtableSelector" ("0" | "1" | "2" |
             "3") #REQUIRED&gt;
-            &lt;!-- The quantization table to use for this component --&gt; 
+            &lt;!-- The quantization table to use for this component --&gt;
 
       &lt;!ELEMENT "sos" (scanComponentSpec)*&gt;
-        &lt;!-- A Start Of Scan marker segment --&gt; 
+        &lt;!-- A Start Of Scan marker segment --&gt;
         &lt;!-- Min children: 1 --&gt;
         &lt;!-- Max children: 4 --&gt;
         &lt;!ATTLIST "sos" "numScanComponents" ("1" | "2" | "3" | "4")
            #REQUIRED&gt;
-          &lt;!-- The number of components in the scan --&gt; 
+          &lt;!-- The number of components in the scan --&gt;
         &lt;!ATTLIST "sos" "startSpectralSelection" #CDATA "0"&gt;
-          &lt;!-- The first spectral band included in this scan --&gt; 
+          &lt;!-- The first spectral band included in this scan --&gt;
           &lt;!-- Data type: Integer --&gt;
           &lt;!-- Min value: 0 (inclusive) --&gt;
           &lt;!-- Max value: 63 (inclusive) --&gt;
         &lt;!ATTLIST "sos" "endSpectralSelection" #CDATA "63"&gt;
-          &lt;!-- The last spectral band included in this scan --&gt; 
+          &lt;!-- The last spectral band included in this scan --&gt;
           &lt;!-- Data type: Integer --&gt;
           &lt;!-- Min value: 0 (inclusive) --&gt;
           &lt;!-- Max value: 63 (inclusive) --&gt;
         &lt;!ATTLIST "sos" "approxHigh" #CDATA "0"&gt;
-          &lt;!-- The highest bit position included in this scan --&gt; 
+          &lt;!-- The highest bit position included in this scan --&gt;
           &lt;!-- Data type: Integer --&gt;
           &lt;!-- Min value: 0 (inclusive) --&gt;
           &lt;!-- Max value: 15 (inclusive) --&gt;
         &lt;!ATTLIST "sos" "approxLow" #CDATA "0"&gt;
-          &lt;!-- The lowest bit position included in this scan --&gt; 
+          &lt;!-- The lowest bit position included in this scan --&gt;
           &lt;!-- Data type: Integer --&gt;
           &lt;!-- Min value: 0 (inclusive) --&gt;
           &lt;!-- Max value: 15 (inclusive) --&gt;
 
         &lt;!ELEMENT "scanComponentSpec" EMPTY&gt;
-          &lt;!-- A component specification for a scan --&gt; 
+          &lt;!-- A component specification for a scan --&gt;
           &lt;!ATTLIST "scanComponentSpec" "componentSelector" #CDATA
              #REQUIRED&gt;
-            &lt;!-- The id of this component --&gt; 
+            &lt;!-- The id of this component --&gt;
             &lt;!-- Data type: Integer --&gt;
             &lt;!-- Min value: 0 (inclusive) --&gt;
             &lt;!-- Max value: 255 (inclusive) --&gt;
-          &lt;!ATTLIST "scanComponentSpec" "dcHuffTable" ("0" | "1" | "2" | 
+          &lt;!ATTLIST "scanComponentSpec" "dcHuffTable" ("0" | "1" | "2" |
             "3") #REQUIRED&gt;
-            &lt;!-- The huffman table to use for encoding DC coefficients --&gt; 
-          &lt;!ATTLIST "scanComponentSpec" "acHuffTable" ("0" | "1" | "2" | 
+            &lt;!-- The huffman table to use for encoding DC coefficients --&gt;
+          &lt;!ATTLIST "scanComponentSpec" "acHuffTable" ("0" | "1" | "2" |
             "3") #REQUIRED&gt;
-            &lt;!-- The huffman table to use for encoding AC coefficients --&gt; 
+            &lt;!-- The huffman table to use for encoding AC coefficients --&gt;
 ]&gt;
 </pre>
 
 <h2>
-<a name=stream>Stream Metadata DTD</a>
+<a id=stream>Stream Metadata DTD</a>
 </h2>
 
 <pre>
 &lt;!DOCTYPE "javax_imageio_jpeg_stream_1.0" [
   &lt;!ELEMENT "javax_imageio_jpeg_stream_1.0" (dqt |
-                      dht | 
-                      dri | 
-                      com | 
+                      dht |
+                      dri |
+                      com |
                       unknown)*&gt;
-   
+
   &lt;!-- All elements are as defined above for image metadata --&gt;
 ]&gt;
 </pre>
--- a/src/java.desktop/share/classes/javax/imageio/metadata/doc-files/png_metadata.html	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/javax/imageio/metadata/doc-files/png_metadata.html	Wed Dec 13 10:25:38 2017 -0800
@@ -1,8 +1,11 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
+<!doctype html>
+<html lang="en">
 <head>
+  <meta charset="utf-8"/>
+  <title>PNG Metadata Format Specification</title>
+</head>
 <!--
-Copyright (c) 2000, 2005, 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
@@ -26,14 +29,9 @@
 questions.
 -->
 
-<title>PNG Metadata Format Specification</title>
-</head>
+<body>
 
-<body bgcolor="white">
-
-<center><h1>
-PNG Metadata Format Specification
-</h1></center>
+<h1>PNG Metadata Format Specification</h1>
 
 <p>
 
@@ -59,7 +57,7 @@
 type set in the metadata is "Palette", palette color will be used.
 
 <p>
- 
+
 If no metadata is supplied when encoding an image, the header is
 initialized from the image being encoded, and no optional chunks are
 included.
@@ -85,7 +83,7 @@
 The child nodes of the <code>bKGD</code>, <code>sBIT</code>, and
 <code>tRNS</code> chunks must match the image's color type.
 
-<p> 
+<p>
 
 Certain chunks may meaningfully appear multiple times in a PNG file,
 in particular the text-related chunks.  In order to simplify the
@@ -104,8 +102,8 @@
 <pre>
 &lt;!DOCTYPE "javax_imageio_png_1.0" [
 
-  &lt;!ELEMENT "javax_imageio_png_1.0" (IHDR?, PLTE?, bKGD?, cHRM?, 
-    gAMA?, hIST?, iCCP?, iTXt?, pHYS?, sBIT?, sPLT?, sRGB?, tEXt?, 
+  &lt;!ELEMENT "javax_imageio_png_1.0" (IHDR?, PLTE?, bKGD?, cHRM?,
+    gAMA?, hIST?, iCCP?, iTXt?, pHYS?, sBIT?, sPLT?, sRGB?, tEXt?,
     tIME?, tRNS?, zTXt?, UnknownChunks?)&gt;
 
     &lt;!ELEMENT "IHDR" EMPTY&gt;
@@ -123,7 +121,7 @@
       &lt;!ATTLIST "IHDR" "bitDepth" ("1" | "2" | "4" | "8" | "16")
          #REQUIRED&gt;
         &lt;!-- The bit depth of the image samples --&gt;
-      &lt;!ATTLIST "IHDR" "colorType" ("Grayscale" | "RGB" | "Palette" | 
+      &lt;!ATTLIST "IHDR" "colorType" ("Grayscale" | "RGB" | "Palette" |
         "GrayAlpha" | "RGBAlpha") #REQUIRED&gt;
         &lt;!-- The color type of the image --&gt;
       &lt;!ATTLIST "IHDR" "compressionMethod" ("deflate") #REQUIRED&gt;
@@ -318,7 +316,7 @@
       &lt;!ATTLIST "pHYS" "unitSpecifier" ("unknown" | "meter") #REQUIRED&gt;
         &lt;!-- The unit specifier for this chunk (i.e., meters) --&gt;
 
-    &lt;!ELEMENT "sBIT" (sBIT_Grayscale | sBIT_GrayAlpha | sBIT_RGB | 
+    &lt;!ELEMENT "sBIT" (sBIT_Grayscale | sBIT_GrayAlpha | sBIT_RGB |
       sBIT_RGBAlpha | sBIT_Palette)&gt;
       &lt;!-- The sBIT chunk, containing significant bit information --&gt;
 
@@ -437,8 +435,8 @@
 
     &lt;!ELEMENT "sRGB" EMPTY&gt;
       &lt;!-- The sRGB chunk, containing rendering intent information --&gt;
-      &lt;!ATTLIST "sRGB" "renderingIntent" ("Perceptual" | 
-        "Relative colorimetric" | "Saturation" | 
+      &lt;!ATTLIST "sRGB" "renderingIntent" ("Perceptual" |
+        "Relative colorimetric" | "Saturation" |
         "Absolute colorimetric") #REQUIRED&gt;
         &lt;!-- The rendering intent --&gt;
 
--- a/src/java.desktop/share/classes/javax/imageio/metadata/doc-files/standard_metadata.html	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/javax/imageio/metadata/doc-files/standard_metadata.html	Wed Dec 13 10:25:38 2017 -0800
@@ -1,8 +1,11 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
+<!doctype html>
+<html lang="en">
 <head>
+  <meta charset="utf-8"/>
+  <title>Standard Metadata Format Specification</title>
+</head>
 <!--
-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
@@ -26,14 +29,9 @@
 questions.
 -->
 
-<title>Standard Metadata Format Specification</title>
-</head>
+<body>
 
-<body bgcolor="white">
-
-<center><h1>
-Standard (Plug-in Neutral) Metadata Format Specification
-</h1></center>
+<h1>Standard (Plug-in Neutral) Metadata Format Specification</h1>
 
 <p> The plug-in neutral "javax_imageio_1.0" format consists
 of a root node named "javax_imageio_1.0" which has child
@@ -44,355 +42,355 @@
 <pre>
 &lt;!DOCTYPE "javax_imageio_1.0" [
 
-  &lt;!ELEMENT "javax_imageio_1.0" (Chroma?, Compression?, Data?, Dimension?, 
+  &lt;!ELEMENT "javax_imageio_1.0" (Chroma?, Compression?, Data?, Dimension?,
     Document?, Text?, Transparency?)&gt;
 
-    &lt;!ELEMENT "Chroma" (ColorSpaceType?, NumChannels?, Gamma?, 
+    &lt;!ELEMENT "Chroma" (ColorSpaceType?, NumChannels?, Gamma?,
       BlackIsZero?, Palette?, BackgroundIndex?, BackgroundColor?)&gt;
-      &lt;!-- Chroma (color) information --&gt; 
+      &lt;!-- Chroma (color) information --&gt;
 
       &lt;!ELEMENT "ColorSpaceType" EMPTY&gt;
-        &lt;!-- The raw color space of the image --&gt; 
-        &lt;!ATTLIST "ColorSpaceType" "name" ("XYZ" | "Lab" | "Luv" | 
-          "YCbCr" | "Yxy" | "YCCK" | "PhotoYCC" | "RGB" | "GRAY" | "HSV" | 
-          "HLS" | "CMYK" | "CMY" | "2CLR" | "3CLR" | "4CLR" | "5CLR" | 
-          "6CLR" | "7CLR" | "8CLR" | "9CLR" | "ACLR" | "BCLR" | "CCLR" | 
+        &lt;!-- The raw color space of the image --&gt;
+        &lt;!ATTLIST "ColorSpaceType" "name" ("XYZ" | "Lab" | "Luv" |
+          "YCbCr" | "Yxy" | "YCCK" | "PhotoYCC" | "RGB" | "GRAY" | "HSV" |
+          "HLS" | "CMYK" | "CMY" | "2CLR" | "3CLR" | "4CLR" | "5CLR" |
+          "6CLR" | "7CLR" | "8CLR" | "9CLR" | "ACLR" | "BCLR" | "CCLR" |
           "DCLR" | "ECLR" | "FCLR") #REQUIRED&gt;
 
       &lt;!ELEMENT "NumChannels" EMPTY&gt;
-        &lt;!-- The number of channels in the raw image, including alpha --&gt; 
+        &lt;!-- The number of channels in the raw image, including alpha --&gt;
         &lt;!ATTLIST "NumChannels" "value" #CDATA #REQUIRED&gt;
           &lt;!-- Data type: List of Integer --&gt;
 
       &lt;!ELEMENT "Gamma" EMPTY&gt;
-        &lt;!-- The image gamma --&gt; 
+        &lt;!-- The image gamma --&gt;
         &lt;!ATTLIST "Gamma" "value" #CDATA #REQUIRED&gt;
           &lt;!-- Data type: Float --&gt;
 
       &lt;!ELEMENT "BlackIsZero" EMPTY&gt;
-        &lt;!-- True if smaller values represent darker shades --&gt; 
+        &lt;!-- True if smaller values represent darker shades --&gt;
         &lt;!ATTLIST "BlackIsZero" "value" ("TRUE" | "FALSE") "TRUE"&gt;
 
       &lt;!ELEMENT "Palette" (PaletteEntry)*&gt;
-        &lt;!-- Palette-color information --&gt; 
+        &lt;!-- Palette-color information --&gt;
 
         &lt;!ELEMENT "PaletteEntry" EMPTY&gt;
-          &lt;!-- A palette entry --&gt; 
+          &lt;!-- A palette entry --&gt;
           &lt;!ATTLIST "PaletteEntry" "index" #CDATA #REQUIRED&gt;
-            &lt;!-- The index of the palette entry --&gt; 
+            &lt;!-- The index of the palette entry --&gt;
             &lt;!-- Data type: Integer --&gt;
           &lt;!ATTLIST "PaletteEntry" "red" #CDATA #REQUIRED&gt;
-            &lt;!-- The red value for the palette entry --&gt; 
+            &lt;!-- The red value for the palette entry --&gt;
             &lt;!-- Data type: Integer --&gt;
           &lt;!ATTLIST "PaletteEntry" "green" #CDATA #REQUIRED&gt;
-            &lt;!-- The green value for the palette entry --&gt; 
+            &lt;!-- The green value for the palette entry --&gt;
             &lt;!-- Data type: Integer --&gt;
           &lt;!ATTLIST "PaletteEntry" "blue" #CDATA #REQUIRED&gt;
-            &lt;!-- The blue value for the palette entry --&gt; 
+            &lt;!-- The blue value for the palette entry --&gt;
             &lt;!-- Data type: Integer --&gt;
           &lt;!ATTLIST "PaletteEntry" "alpha" #CDATA "255"&gt;
-            &lt;!-- The alpha value for the palette entry --&gt; 
+            &lt;!-- The alpha value for the palette entry --&gt;
             &lt;!-- Data type: Integer --&gt;
 
       &lt;!ELEMENT "BackgroundIndex" EMPTY&gt;
-        &lt;!-- A palette index to be used as a background --&gt; 
+        &lt;!-- A palette index to be used as a background --&gt;
         &lt;!ATTLIST "BackgroundIndex" "value" #CDATA #REQUIRED&gt;
           &lt;!-- Data type: Integer --&gt;
 
       &lt;!ELEMENT "BackgroundColor" EMPTY&gt;
-        &lt;!-- An RGB triple to be used as a background --&gt; 
+        &lt;!-- An RGB triple to be used as a background --&gt;
         &lt;!ATTLIST "BackgroundColor" "red" #CDATA #REQUIRED&gt;
-          &lt;!-- The red background value --&gt; 
+          &lt;!-- The red background value --&gt;
           &lt;!-- Data type: Integer --&gt;
         &lt;!ATTLIST "BackgroundColor" "green" #CDATA #REQUIRED&gt;
-          &lt;!-- The green background value --&gt; 
+          &lt;!-- The green background value --&gt;
           &lt;!-- Data type: Integer --&gt;
         &lt;!ATTLIST "BackgroundColor" "blue" #CDATA #REQUIRED&gt;
-          &lt;!-- The blue background value --&gt; 
+          &lt;!-- The blue background value --&gt;
           &lt;!-- Data type: Integer --&gt;
 
-    &lt;!ELEMENT "Compression" (CompressionTypeName?, Lossless?, 
+    &lt;!ELEMENT "Compression" (CompressionTypeName?, Lossless?,
       NumProgressiveScans?, BitRate?)&gt;
-      &lt;!-- Compression information --&gt; 
+      &lt;!-- Compression information --&gt;
 
       &lt;!ELEMENT "CompressionTypeName" EMPTY&gt;
-        &lt;!-- The name of the compression scheme in use --&gt; 
+        &lt;!-- The name of the compression scheme in use --&gt;
         &lt;!ATTLIST "CompressionTypeName" "value" #CDATA #REQUIRED&gt;
           &lt;!-- Data type: String --&gt;
 
       &lt;!ELEMENT "Lossless" EMPTY&gt;
-        &lt;!-- True if the compression scheme is lossless --&gt; 
+        &lt;!-- True if the compression scheme is lossless --&gt;
         &lt;!ATTLIST "Lossless" "value" ("TRUE" | "FALSE") "TRUE"&gt;
 
       &lt;!ELEMENT "NumProgressiveScans" EMPTY&gt;
-        &lt;!-- The number of progressive scans used in the image encoding --&gt; 
+        &lt;!-- The number of progressive scans used in the image encoding --&gt;
         &lt;!ATTLIST "NumProgressiveScans" "value" #CDATA #REQUIRED&gt;
           &lt;!-- Data type: Integer --&gt;
 
       &lt;!ELEMENT "BitRate" EMPTY&gt;
-        &lt;!-- The estimated bit rate of the compression scheme --&gt; 
+        &lt;!-- The estimated bit rate of the compression scheme --&gt;
         &lt;!ATTLIST "BitRate" "value" #CDATA #REQUIRED&gt;
           &lt;!-- Data type: Float --&gt;
 
-    &lt;!ELEMENT "Data" (PlanarConfiguration?, SampleFormat?, BitsPerSample?, 
+    &lt;!ELEMENT "Data" (PlanarConfiguration?, SampleFormat?, BitsPerSample?,
       SignificantBitsPerSample?, SampleMSB?)&gt;
-      &lt;!-- Information on the image layout --&gt; 
+      &lt;!-- Information on the image layout --&gt;
 
       &lt;!ELEMENT "PlanarConfiguration" EMPTY&gt;
-        &lt;!-- The organization of image samples in the stream --&gt; 
-        &lt;!ATTLIST "PlanarConfiguration" "value" ("PixelInterleaved" | 
+        &lt;!-- The organization of image samples in the stream --&gt;
+        &lt;!ATTLIST "PlanarConfiguration" "value" ("PixelInterleaved" |
           "PlaneInterleaved" | "LineInterleaved" | "TileInterleaved")
            #REQUIRED&gt;
 
       &lt;!ELEMENT "SampleFormat" EMPTY&gt;
-        &lt;!-- The numeric format of image samples --&gt; 
-        &lt;!ATTLIST "SampleFormat" "value" ("SignedIntegral" | 
+        &lt;!-- The numeric format of image samples --&gt;
+        &lt;!ATTLIST "SampleFormat" "value" ("SignedIntegral" |
           "UnsignedIntegral" | "Real" | "Index") #REQUIRED&gt;
 
       &lt;!ELEMENT "BitsPerSample" EMPTY&gt;
-        &lt;!-- The number of bits per sample --&gt; 
+        &lt;!-- The number of bits per sample --&gt;
         &lt;!ATTLIST "BitsPerSample" "value" #CDATA #REQUIRED&gt;
-          &lt;!-- A list of integers, one per channel --&gt; 
+          &lt;!-- A list of integers, one per channel --&gt;
           &lt;!-- Data type: List of Integer --&gt;
           &lt;!-- Min length: 1 --&gt;
 
       &lt;!ELEMENT "SignificantBitsPerSample" EMPTY&gt;
-        &lt;!-- The number of significant bits per sample --&gt; 
+        &lt;!-- The number of significant bits per sample --&gt;
         &lt;!ATTLIST "SignificantBitsPerSample" "value" #CDATA #REQUIRED&gt;
-          &lt;!-- A list of integers, one per channel --&gt; 
+          &lt;!-- A list of integers, one per channel --&gt;
           &lt;!-- Data type: List of Integer --&gt;
           &lt;!-- Min length: 1 --&gt;
 
       &lt;!ELEMENT "SampleMSB" EMPTY&gt;
-        &lt;!-- The position of the most significant bit of each sample --&gt; 
+        &lt;!-- The position of the most significant bit of each sample --&gt;
         &lt;!ATTLIST "SampleMSB" "value" #CDATA #REQUIRED&gt;
-          &lt;!-- A list of integers, one per channel --&gt; 
+          &lt;!-- A list of integers, one per channel --&gt;
           &lt;!-- Data type: List of Integer --&gt;
           &lt;!-- Min length: 1 --&gt;
 
-    &lt;!ELEMENT "Dimension" (PixelAspectRatio?, ImageOrientation?, 
-      HorizontalPixelSize?, VerticalPixelSize?, 
-      HorizontalPhysicalPixelSpacing?, VerticalPhysicalPixelSpacing?, 
-      HorizontalPosition?, VerticalPosition?, HorizontalPixelOffset?, 
+    &lt;!ELEMENT "Dimension" (PixelAspectRatio?, ImageOrientation?,
+      HorizontalPixelSize?, VerticalPixelSize?,
+      HorizontalPhysicalPixelSpacing?, VerticalPhysicalPixelSpacing?,
+      HorizontalPosition?, VerticalPosition?, HorizontalPixelOffset?,
       VerticalPixelOffset?, HorizontalScreenSize?, VerticalScreenSize?)&gt;
-      &lt;!-- Dimension information --&gt; 
+      &lt;!-- Dimension information --&gt;
 
       &lt;!ELEMENT "PixelAspectRatio" EMPTY&gt;
-        &lt;!-- The width of a pixel divided by its height --&gt; 
+        &lt;!-- The width of a pixel divided by its height --&gt;
         &lt;!ATTLIST "PixelAspectRatio" "value" #CDATA #REQUIRED&gt;
           &lt;!-- Data type: Float --&gt;
 
       &lt;!ELEMENT "ImageOrientation" EMPTY&gt;
-        &lt;!-- The desired orientation of the image in terms of flips and 
-             counter-clockwise rotations --&gt; 
-        &lt;!ATTLIST "ImageOrientation" "value" ("Normal" | "Rotate90" | 
-          "Rotate180" | "Rotate270" | "FlipH" | "FlipV" | 
+        &lt;!-- The desired orientation of the image in terms of flips and
+             counter-clockwise rotations --&gt;
+        &lt;!ATTLIST "ImageOrientation" "value" ("Normal" | "Rotate90" |
+          "Rotate180" | "Rotate270" | "FlipH" | "FlipV" |
           "FlipHRotate90" | "FlipVRotate90") #REQUIRED&gt;
 
       &lt;!ELEMENT "HorizontalPixelSize" EMPTY&gt;
-        &lt;!-- The width of a pixel, in millimeters, as it should be rendered 
-             on media --&gt; 
+        &lt;!-- The width of a pixel, in millimeters, as it should be rendered
+             on media --&gt;
         &lt;!ATTLIST "HorizontalPixelSize" "value" #CDATA #REQUIRED&gt;
           &lt;!-- Data type: Float --&gt;
 
       &lt;!ELEMENT "VerticalPixelSize" EMPTY&gt;
-        &lt;!-- The height of a pixel, in millimeters, as it should be 
-             rendered on media --&gt; 
+        &lt;!-- The height of a pixel, in millimeters, as it should be
+             rendered on media --&gt;
         &lt;!ATTLIST "VerticalPixelSize" "value" #CDATA #REQUIRED&gt;
           &lt;!-- Data type: Float --&gt;
 
       &lt;!ELEMENT "HorizontalPhysicalPixelSpacing" EMPTY&gt;
-        &lt;!-- The horizontal distance in the subject of the image, in 
-             millimeters, represented by one pixel at the center of the 
-             image --&gt; 
+        &lt;!-- The horizontal distance in the subject of the image, in
+             millimeters, represented by one pixel at the center of the
+             image --&gt;
         &lt;!ATTLIST "HorizontalPhysicalPixelSpacing" "value" #CDATA #REQUIRED&gt;
           &lt;!-- Data type: Float --&gt;
 
       &lt;!ELEMENT "VerticalPhysicalPixelSpacing" EMPTY&gt;
-        &lt;!-- The vertical distance in the subject of the image, in 
-             millimeters, represented by one pixel at the center of the 
-             image --&gt; 
+        &lt;!-- The vertical distance in the subject of the image, in
+             millimeters, represented by one pixel at the center of the
+             image --&gt;
         &lt;!ATTLIST "VerticalPhysicalPixelSpacing" "value" #CDATA #REQUIRED&gt;
           &lt;!-- Data type: Float --&gt;
 
       &lt;!ELEMENT "HorizontalPosition" EMPTY&gt;
-        &lt;!-- The horizontal position, in millimeters, where the image 
-             should be rendered on media --&gt; 
+        &lt;!-- The horizontal position, in millimeters, where the image
+             should be rendered on media --&gt;
         &lt;!ATTLIST "HorizontalPosition" "value" #CDATA #REQUIRED&gt;
           &lt;!-- Data type: Float --&gt;
 
       &lt;!ELEMENT "VerticalPosition" EMPTY&gt;
-        &lt;!-- The vertical position, in millimeters, where the image should 
-             be rendered on media --&gt; 
+        &lt;!-- The vertical position, in millimeters, where the image should
+             be rendered on media --&gt;
         &lt;!ATTLIST "VerticalPosition" "value" #CDATA #REQUIRED&gt;
           &lt;!-- Data type: Float --&gt;
 
       &lt;!ELEMENT "HorizontalPixelOffset" EMPTY&gt;
-        &lt;!-- The horizontal position, in pixels, where the image should be 
-             rendered onto a raster display --&gt; 
+        &lt;!-- The horizontal position, in pixels, where the image should be
+             rendered onto a raster display --&gt;
         &lt;!ATTLIST "HorizontalPixelOffset" "value" #CDATA #REQUIRED&gt;
           &lt;!-- Data type: Integer --&gt;
 
       &lt;!ELEMENT "VerticalPixelOffset" EMPTY&gt;
-        &lt;!-- The vertical position, in pixels, where the image should be 
-             rendered onto a raster display --&gt; 
+        &lt;!-- The vertical position, in pixels, where the image should be
+             rendered onto a raster display --&gt;
         &lt;!ATTLIST "VerticalPixelOffset" "value" #CDATA #REQUIRED&gt;
           &lt;!-- Data type: Integer --&gt;
 
       &lt;!ELEMENT "HorizontalScreenSize" EMPTY&gt;
-        &lt;!-- The width, in pixels, of the raster display into which the 
-             image should be rendered --&gt; 
+        &lt;!-- The width, in pixels, of the raster display into which the
+             image should be rendered --&gt;
         &lt;!ATTLIST "HorizontalScreenSize" "value" #CDATA #REQUIRED&gt;
           &lt;!-- Data type: Integer --&gt;
 
       &lt;!ELEMENT "VerticalScreenSize" EMPTY&gt;
-        &lt;!-- The height, in pixels, of the raster display into which the 
-             image should be rendered --&gt; 
+        &lt;!-- The height, in pixels, of the raster display into which the
+             image should be rendered --&gt;
         &lt;!ATTLIST "VerticalScreenSize" "value" #CDATA #REQUIRED&gt;
           &lt;!-- Data type: Integer --&gt;
 
-    &lt;!ELEMENT "Document" (FormatVersion?, SubimageInterpretation?, 
+    &lt;!ELEMENT "Document" (FormatVersion?, SubimageInterpretation?,
       ImageCreationTime?, ImageModificationTime?)&gt;
-      &lt;!-- Document information --&gt; 
+      &lt;!-- Document information --&gt;
 
       &lt;!ELEMENT "FormatVersion" EMPTY&gt;
-        &lt;!-- The version of the format used by the stream --&gt; 
+        &lt;!-- The version of the format used by the stream --&gt;
         &lt;!ATTLIST "FormatVersion" "value" #CDATA #REQUIRED&gt;
           &lt;!-- Data type: String --&gt;
 
       &lt;!ELEMENT "SubimageInterpretation" EMPTY&gt;
-        &lt;!-- The interpretation of this image in relation to the other 
-             images stored in the same stream --&gt; 
-        &lt;!ATTLIST "SubimageInterpretation" "value" ("Standalone" | 
-          "SinglePage" | "FullResolution" | "ReducedResolution" | 
-          "PyramidLayer" | "Preview" | "VolumeSlice" | "ObjectView" | 
-          "Panorama" | "AnimationFrame" | "TransparencyMask" | 
+        &lt;!-- The interpretation of this image in relation to the other
+             images stored in the same stream --&gt;
+        &lt;!ATTLIST "SubimageInterpretation" "value" ("Standalone" |
+          "SinglePage" | "FullResolution" | "ReducedResolution" |
+          "PyramidLayer" | "Preview" | "VolumeSlice" | "ObjectView" |
+          "Panorama" | "AnimationFrame" | "TransparencyMask" |
           "CompositingLayer" | "SpectralSlice" | "Unknown") #REQUIRED&gt;
 
       &lt;!ELEMENT "ImageCreationTime" EMPTY&gt;
-        &lt;!-- The time of image creation --&gt; 
+        &lt;!-- The time of image creation --&gt;
         &lt;!ATTLIST "ImageCreationTime" "year" #CDATA #REQUIRED&gt;
-          &lt;!-- The full year (e.g., 1967, not 67) --&gt; 
+          &lt;!-- The full year (e.g., 1967, not 67) --&gt;
           &lt;!-- Data type: Integer --&gt;
         &lt;!ATTLIST "ImageCreationTime" "month" #CDATA #REQUIRED&gt;
-          &lt;!-- The month, with January = 1 --&gt; 
+          &lt;!-- The month, with January = 1 --&gt;
           &lt;!-- Data type: Integer --&gt;
           &lt;!-- Min value: 1 (inclusive) --&gt;
           &lt;!-- Max value: 12 (inclusive) --&gt;
         &lt;!ATTLIST "ImageCreationTime" "day" #CDATA #REQUIRED&gt;
-          &lt;!-- The day of the month --&gt; 
+          &lt;!-- The day of the month --&gt;
           &lt;!-- Data type: Integer --&gt;
           &lt;!-- Min value: 1 (inclusive) --&gt;
           &lt;!-- Max value: 31 (inclusive) --&gt;
         &lt;!ATTLIST "ImageCreationTime" "hour" #CDATA "0"&gt;
-          &lt;!-- The hour from 0 to 23 --&gt; 
+          &lt;!-- The hour from 0 to 23 --&gt;
           &lt;!-- Data type: Integer --&gt;
           &lt;!-- Min value: 0 (inclusive) --&gt;
           &lt;!-- Max value: 23 (inclusive) --&gt;
         &lt;!ATTLIST "ImageCreationTime" "minute" #CDATA "0"&gt;
-          &lt;!-- The minute from 0 to 59 --&gt; 
+          &lt;!-- The minute from 0 to 59 --&gt;
           &lt;!-- Data type: Integer --&gt;
           &lt;!-- Min value: 0 (inclusive) --&gt;
           &lt;!-- Max value: 59 (inclusive) --&gt;
         &lt;!ATTLIST "ImageCreationTime" "second" #CDATA "0"&gt;
-          &lt;!-- The second from 0 to 60 (60 = leap second) --&gt; 
+          &lt;!-- The second from 0 to 60 (60 = leap second) --&gt;
           &lt;!-- Data type: Integer --&gt;
           &lt;!-- Min value: 0 (inclusive) --&gt;
           &lt;!-- Max value: 60 (inclusive) --&gt;
 
       &lt;!ELEMENT "ImageModificationTime" EMPTY&gt;
-        &lt;!-- The time of the last image modification --&gt; 
+        &lt;!-- The time of the last image modification --&gt;
         &lt;!ATTLIST "ImageModificationTime" "year" #CDATA #REQUIRED&gt;
-          &lt;!-- The full year (e.g., 1967, not 67) --&gt; 
+          &lt;!-- The full year (e.g., 1967, not 67) --&gt;
           &lt;!-- Data type: Integer --&gt;
         &lt;!ATTLIST "ImageModificationTime" "month" #CDATA #REQUIRED&gt;
-          &lt;!-- The month, with January = 1 --&gt; 
+          &lt;!-- The month, with January = 1 --&gt;
           &lt;!-- Data type: Integer --&gt;
           &lt;!-- Min value: 1 (inclusive) --&gt;
           &lt;!-- Max value: 12 (inclusive) --&gt;
         &lt;!ATTLIST "ImageModificationTime" "day" #CDATA #REQUIRED&gt;
-          &lt;!-- The day of the month --&gt; 
+          &lt;!-- The day of the month --&gt;
           &lt;!-- Data type: Integer --&gt;
           &lt;!-- Min value: 1 (inclusive) --&gt;
           &lt;!-- Max value: 31 (inclusive) --&gt;
         &lt;!ATTLIST "ImageModificationTime" "hour" #CDATA "0"&gt;
-          &lt;!-- The hour from 0 to 23 --&gt; 
+          &lt;!-- The hour from 0 to 23 --&gt;
           &lt;!-- Data type: Integer --&gt;
           &lt;!-- Min value: 0 (inclusive) --&gt;
           &lt;!-- Max value: 23 (inclusive) --&gt;
         &lt;!ATTLIST "ImageModificationTime" "minute" #CDATA "0"&gt;
-          &lt;!-- The minute from 0 to 59 --&gt; 
+          &lt;!-- The minute from 0 to 59 --&gt;
           &lt;!-- Data type: Integer --&gt;
           &lt;!-- Min value: 0 (inclusive) --&gt;
           &lt;!-- Max value: 59 (inclusive) --&gt;
         &lt;!ATTLIST "ImageModificationTime" "second" #CDATA "0"&gt;
-          &lt;!-- The second from 0 to 60 (60 = leap second) --&gt; 
+          &lt;!-- The second from 0 to 60 (60 = leap second) --&gt;
           &lt;!-- Data type: Integer --&gt;
           &lt;!-- Min value: 0 (inclusive) --&gt;
           &lt;!-- Max value: 60 (inclusive) --&gt;
 
     &lt;!ELEMENT "Text" (TextEntry)*&gt;
-      &lt;!-- Text information --&gt; 
+      &lt;!-- Text information --&gt;
 
       &lt;!ELEMENT "TextEntry" EMPTY&gt;
-        &lt;!-- A text entry --&gt; 
+        &lt;!-- A text entry --&gt;
         &lt;!ATTLIST "TextEntry" "keyword" #CDATA #IMPLIED&gt;
-          &lt;!-- A keyword associated with the text entry --&gt; 
+          &lt;!-- A keyword associated with the text entry --&gt;
           &lt;!-- Data type: String --&gt;
         &lt;!ATTLIST "TextEntry" "value" #CDATA #REQUIRED&gt;
-          &lt;!-- the text entry --&gt; 
+          &lt;!-- the text entry --&gt;
           &lt;!-- Data type: String --&gt;
         &lt;!ATTLIST "TextEntry" "language" #CDATA #IMPLIED&gt;
-          &lt;!-- The language of the text --&gt; 
+          &lt;!-- The language of the text --&gt;
           &lt;!-- Data type: String --&gt;
         &lt;!ATTLIST "TextEntry" "encoding" #CDATA #IMPLIED&gt;
-          &lt;!-- The encoding of the text --&gt; 
+          &lt;!-- The encoding of the text --&gt;
           &lt;!-- Data type: String --&gt;
-        &lt;!ATTLIST "TextEntry" "compression" ("none" | "lzw" | "zip" | 
+        &lt;!ATTLIST "TextEntry" "compression" ("none" | "lzw" | "zip" |
           "bzip" | "other") "none"&gt;
-          &lt;!-- The method used to compress the text --&gt; 
+          &lt;!-- The method used to compress the text --&gt;
 
-    &lt;!ELEMENT "Transparency" (Alpha?, TransparentIndex?, 
+    &lt;!ELEMENT "Transparency" (Alpha?, TransparentIndex?,
       TransparentColor?, TileTransparencies?, TileOpacities?)&gt;
-      &lt;!-- Transparency information --&gt; 
+      &lt;!-- Transparency information --&gt;
 
       &lt;!ELEMENT "Alpha" EMPTY&gt;
-        &lt;!-- The type of alpha information contained in the image --&gt; 
-        &lt;!ATTLIST "Alpha" "value" ("none" | "premultiplied" | 
+        &lt;!-- The type of alpha information contained in the image --&gt;
+        &lt;!ATTLIST "Alpha" "value" ("none" | "premultiplied" |
           "nonpremultiplied") "none"&gt;
 
       &lt;!ELEMENT "TransparentIndex" EMPTY&gt;
-        &lt;!-- A palette index to be treated as transparent --&gt; 
+        &lt;!-- A palette index to be treated as transparent --&gt;
         &lt;!ATTLIST "TransparentIndex" "value" #CDATA #REQUIRED&gt;
           &lt;!-- Data type: Integer --&gt;
 
       &lt;!ELEMENT "TransparentColor" EMPTY&gt;
-        &lt;!-- An RGB color to be treated as transparent --&gt; 
+        &lt;!-- An RGB color to be treated as transparent --&gt;
         &lt;!ATTLIST "TransparentColor" "value" #CDATA #REQUIRED&gt;
           &lt;!-- Data type: List of Integer --&gt;
 
       &lt;!ELEMENT "TileTransparencies" (TransparentTile)*&gt;
-        &lt;!-- A list of completely transparent tiles --&gt; 
+        &lt;!-- A list of completely transparent tiles --&gt;
 
         &lt;!ELEMENT "TransparentTile" EMPTY&gt;
-          &lt;!-- The index of a completely transparent tile --&gt; 
+          &lt;!-- The index of a completely transparent tile --&gt;
           &lt;!ATTLIST "TransparentTile" "x" #CDATA #REQUIRED&gt;
-            &lt;!-- The tile's X index --&gt; 
+            &lt;!-- The tile's X index --&gt;
             &lt;!-- Data type: Integer --&gt;
           &lt;!ATTLIST "TransparentTile" "y" #CDATA #REQUIRED&gt;
-            &lt;!-- The tile's Y index --&gt; 
+            &lt;!-- The tile's Y index --&gt;
             &lt;!-- Data type: Integer --&gt;
 
       &lt;!ELEMENT "TileOpacities" (OpaqueTile)*&gt;
-        &lt;!-- A list of completely opaque tiles --&gt; 
+        &lt;!-- A list of completely opaque tiles --&gt;
 
         &lt;!ELEMENT "OpaqueTile" EMPTY&gt;
-          &lt;!-- The index of a completely opaque tile --&gt; 
+          &lt;!-- The index of a completely opaque tile --&gt;
           &lt;!ATTLIST "OpaqueTile" "x" #CDATA #REQUIRED&gt;
-            &lt;!-- The tile's X index --&gt; 
+            &lt;!-- The tile's X index --&gt;
             &lt;!-- Data type: Integer --&gt;
           &lt;!ATTLIST "OpaqueTile" "y" #CDATA #REQUIRED&gt;
-            &lt;!-- The tile's Y index --&gt; 
+            &lt;!-- The tile's Y index --&gt;
             &lt;!-- Data type: Integer --&gt;
 ]&gt;
 </pre>
--- a/src/java.desktop/share/classes/javax/imageio/metadata/doc-files/tiff_metadata.html	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/javax/imageio/metadata/doc-files/tiff_metadata.html	Wed Dec 13 10:25:38 2017 -0800
@@ -1,8 +1,11 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
+<!doctype html>
+<html lang="en">
 <head>
+    <meta charset="utf-8"/>
+    <title>TIFF Metadata Format Specification and Usage Notes</title>
+</head>
 <!--
-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
@@ -26,66 +29,47 @@
 questions.
 -->
 
-<title>TIFF Metadata Format Specification and Usage Notes</title>
-</head>
-
-<body bgcolor="white">
+<body>
 
-<center><h1>
-TIFF Metadata Format Specification and Usage Notes
-</h1></center>
+<h1>TIFF Metadata Format Specification and Usage Notes</h1>
 
-    <p>
-<a href="#Reading">Reading Images</a><br/>
-<font size="-1">
+<a href="#Reading">Reading Images</a>
 <ul>
 <li><a href="#ColorConversionRead">Color Conversion</a></li>
 <li><a href="#ColorSpacesRead">Color Spaces</a></li>
 <li><a href="#ICCProfilesRead">ICC Profiles</a></li>
 <li><a href="#MetadataIssuesRead">Metadata Issues</a>
-<font size="-2">
 <ul>
 <li><a href="#MapNativeStandard">Native to Standard Metadata Mapping</a></li>
 </ul>
-</font>
 </li>
 <li><a href="#ExifRead">Reading Exif Images</a>
-<font size="-2">
 <ul>
 <li><a href="#ExifReadTIFF">Reading Uncompressed Exif Images</a></li>
 <li><a href="#ExifReadJPEG">Reading Compressed Exif Images</a></li>
 </ul>
-</font>
 </li>
 </ul>
-</font>
 <a href="#Writing">Writing Images</a><br/>
-<font size="-1">
 <ul>
 <li><a href="#Compression">Compression</a></li>
 <li><a href="#ColorConversionWrite">Color Conversion</a></li>
 <li><a href="#ICCProfilesWrite">ICC Profiles</a></li>
-<li><a href="#MetadataIssuesWrite">Metadata Issues</a></li>
-<font size="-2">
+<li><a href="#MetadataIssuesWrite">Metadata Issues</a>
 <ul>
 <li><a href="#MapStandardNative">Standard to Native Metadata Mapping</a></li>
 </ul>
-</font>
 <li><a href="#ExifWrite">Writing Exif Images</a>
-<font size="-2">
 <ul>
 <li><a href="#ExifWriteTIFF">Writing Uncompressed Exif Images</a></li>
 <li><a href="#ExifWriteJPEG">Writing Compressed Exif Images</a></li>
 </ul>
-</font>
 </li>
 </ul>
-</font>
 <a href="#StreamMetadata">Native Stream Metadata Format</a><br/>
 <a href="#ImageMetadata">Native Image Metadata Format</a>
-</p>
 
-<h3><a name="Reading"/>Reading Images</h3>
+<h3><a id="Reading">Reading Images</a></h3>
 
 TIFF images are read by an <a href="../../ImageReader.html">ImageReader</a>
 which may be controlled by its public interface as well as via a supplied
@@ -95,14 +79,14 @@
 
 <!-- Table? -->
 
-<h4><a name="ColorConversionRead"/>Color Conversion</h4>
+<h4><a id="ColorConversionRead">Color Conversion</a></h4>
 
 <p>If the source image data
 have photometric type CIE L*a*b* or YCbCr, and the destination color space
 type is RGB, then the source image data will be automatically converted to
 RGB using an internal color converter.</p>
 
-<h4><a name="ColorSpacesRead"/>Color Spaces</h4>
+<h4><a id="ColorSpacesRead">Color Spaces</a></h4>
 
 The raw color space assigned by default, i.e., in the absence of a
 user-supplied <a href="../../ImageTypeSpecifier.html">ImageTypeSpecifier</a>,
@@ -112,7 +96,7 @@
 <li>A color space created from the <a href="#ICCProfilesRead">ICC Profile</a>
 metadata field if it is present and compatible with the image data
 layout.</li>
-<a name="nonICCProfile"><li>sRGB if the image is monochrome/bilevel
+<li><a id="nonICCProfile"></a>sRGB if the image is monochrome/bilevel
 (a two-level color map is created internally).</li>
 <li>sRGB if the image is palette-color.</li>
 <li>Linear RGB if the image has three samples per pixel, has photometric type
@@ -136,7 +120,7 @@
 sample.</li>
 </ul>
 
-<p><a name="DefaultCMYK"/>The normalized color coordinate transformations
+<p><a id="DefaultCMYK"></a>The normalized color coordinate transformations
 used for the default CMYK color space are defined as follows:
 
 <ul>
@@ -160,9 +144,8 @@
 </pre>
 </li>
 </ul>
-</p>
 
-<p><a name="GenericCS"/>The generic color space used when no other color space
+<p><a id="GenericCS"></a>The generic color space used when no other color space
 can be inferred is provided merely to enable the data to be loaded. It is not
 intended to provide accurate conversions of any kind.</p>
 
@@ -171,7 +154,7 @@
 supplied to the reader and should be derived from a color space which is correct
 for the data in question.</p>
 
-<h4><a name="ICCProfilesRead"/>ICC Profiles</h4>
+<h4><a id="ICCProfilesRead">ICC Profiles</a></h4>
 
 If an ICC profile is contained in the image metadata
 (<a href="../../plugins/tiff/BaselineTIFFTagSet.html">
@@ -203,7 +186,6 @@
 <code>ImageReadParam.setDestinationType</code>.</li>
 <li>Pass the parameter object to the appropriate <code>read</code> method.</li>
 </ol>
-</p>
 
 <p>If the inferred color space not based on the ICC Profile field is compatible
 with the ICC profile-based color space, then a second
@@ -214,7 +196,7 @@
 more than one type, the first one will be based on the ICC profile and the
 second on the inferred color space.</p>
 
-<h4><a name="MetadataIssuesRead"/>Metadata Issues</h4>
+<h4><a id="MetadataIssuesRead">Metadata Issues</a></h4>
 
 By default all recognized fields in the TIFF image file directory (IFD) are
 loaded into the native image metadata object. Which fields are loaded may be
@@ -244,7 +226,7 @@
 object returned by the TIFF reader using the
 <code>TIFFDirectory.createFromMetadata</code> method.</p>
 
-<h5><a name="MapNativeStandard"/>
+<h5><a id="MapNativeStandard"></a>
 Mapping of TIFF Native Image Metadata to the Standard Metadata Format</h5>
 
 The derivation of standard metadata format
@@ -252,7 +234,6 @@
 elements from <a href="#ImageMetadata">TIFF native image metadata</a> is given
 in the following table.
 
-<p>
 <table border="1">
 <tr>
 <th>Standard Metadata Element</th>
@@ -261,9 +242,9 @@
 <tr>
 <td>/Chroma/ColorSpaceType@name</td>
 <td>PhotometricInterpretation: WhiteIsZero, BlackIsZero, TransparencyMask =
-"GRAY"; RGB, PaletteColor => "RGB"; CMYK => "CMYK";
-YCbCr => "YCbCr";
-CIELab, ICCLab => "Lab".</td>
+"GRAY"; RGB, PaletteColor =&gt; "RGB"; CMYK =&gt; "CMYK";
+YCbCr =&gt; "YCbCr";
+CIELab, ICCLab =&gt; "Lab".</td>
 </tr>
 <tr>
 <td>/Chroma/NumChannels@value</td>
@@ -271,7 +252,7 @@
 </tr>
 <tr>
 <td>/Chroma/BlackIsZero@value</td>
-<td>"TRUE" <=> PhotometricInterpretation => WhiteIsZero</td>
+<td>"TRUE" &lt;=&gt; PhotometricInterpretation =&gt; WhiteIsZero</td>
 </tr>
 <tr>
 <td>/Chroma/Palette</td>
@@ -279,28 +260,28 @@
 </tr>
 <tr>
 <td>/Compression/CompressionTypeName@value</td>
-<td>Compression: Uncompressed => "none"; CCITT 1D => "CCITT
+<td>Compression: Uncompressed =&gt; "none"; CCITT 1D =&gt; "CCITT
 RLE";
-Group 3 Fax => "CCITT T.4"; Group 4 Fax => "CCITT T.6";
-LZW => "LZW";
-JPEG => "Old JPEG"; New JPEG => "JPEG"; Zlib =>> "ZLib"; PackBits =>
+Group 3 Fax =&gt; "CCITT T.4"; Group 4 Fax =&gt; "CCITT T.6";
+LZW =&gt; "LZW";
+JPEG =&gt; "Old JPEG"; New JPEG =&gt; "JPEG"; Zlib =&gt;&gt; "ZLib"; PackBits =&gt;
 "PackBits";
-Deflate => "Deflate"; Exif JPEG => "JPEG".</td>
+Deflate =&gt; "Deflate"; Exif JPEG =&gt; "JPEG".</td>
 </tr>
 <tr>
 <td>/Compression/Lossless@value</td>
-<td>Compression: JPEG or New JPEG => "FALSE"; otherwise "TRUE".</td>
+<td>Compression: JPEG or New JPEG =&gt; "FALSE"; otherwise "TRUE".</td>
 </tr>
 <tr>
 <td>/Data/PlanarConfiguration@value</td>
-<td>Chunky => "PixelInterleaved"; Planar => "PlaneInterleaved".</td>
+<td>Chunky =&gt; "PixelInterleaved"; Planar =&gt; "PlaneInterleaved".</td>
 </tr>
 <tr>
 <td>/Data/SampleFormat@value</td>
-<td>PhotometricInterpretation PaletteColor => "Index";
-SampleFormat unsigned integer data => "UnsignedIntegral";
-SampleFormat two's complement signed integer data => "SignedIntegral";
-SampleFormat IEEE floating point data => "Real";
+<td>PhotometricInterpretation PaletteColor =&gt; "Index";
+SampleFormat unsigned integer data =&gt; "UnsignedIntegral";
+SampleFormat two's complement signed integer data =&gt; "SignedIntegral";
+SampleFormat IEEE floating point data =&gt; "Real";
 otherwise element not emitted.
 </td>
 </tr>
@@ -310,8 +291,8 @@
 </tr>
 <tr>
 <td>/Data/SampleMSB@value</td>
-<td>FillOrder: left-to-right => space-separated list of BitsPerSample-1;
-right-to-left => space-separated list of 0s.</td>
+<td>FillOrder: left-to-right =&gt; space-separated list of BitsPerSample-1;
+right-to-left =&gt; space-separated list of 0s.</td>
 </tr>
 <tr>
 <td>/Dimension/PixelAspectRatio@value</td>
@@ -343,9 +324,9 @@
 </tr>
 <tr>
 <td>/Document/SubimageInterpretation@value</td>
-<td>NewSubFileType: transparency => "TransparencyMask";
-reduced-resolution => "ReducedResolution";
-single page => "SinglePage".</td>
+<td>NewSubFileType: transparency =&gt; "TransparencyMask";
+reduced-resolution =&gt; "ReducedResolution";
+single page =&gt; "SinglePage".</td>
 </tr>
 <tr>
 <td>/Document/ImageCreationTime@value</td>
@@ -357,24 +338,23 @@
 Artist, HostComputer, InkNames, Copyright:
 /Text/TextEntry@keyword = field name,
 /Text/TextEntry@value = field value.<br>
-Example: TIFF Software field => /Text/TextEntry@keyword = "Software",
+Example: TIFF Software field =&gt; /Text/TextEntry@keyword = "Software",
 /Text/TextEntry@value = Name and version number of the software package(s)
 used to create the image.</td>
 </tr>
 <tr>
 <td>/Transparency/Alpha@value</td>
-<td>ExtraSamples: associated alpha => "premultiplied";
-unassociated alpha => "nonpremultiplied".</td>
+<td>ExtraSamples: associated alpha =&gt; "premultiplied";
+unassociated alpha =&gt; "nonpremultiplied".</td>
 </tr>
 </table>
-</p>
 
-<h4><a name="ExifRead"/>Reading Exif Images</h4>
+<h4><a id="ExifRead">Reading Exif Images</a></h4>
 
 The TIFF reader may be used to read an uncompressed Exif image or the
-contents of the <tt>APP1</tt> marker segment of a compressed Exif image.
+contents of the <code>APP1</code> marker segment of a compressed Exif image.
 
-<h5><a name="ExifReadTIFF"/>Reading Uncompressed Exif Images</h5>
+<h5><a id="ExifReadTIFF">Reading Uncompressed Exif Images</a></h5>
 
 An uncompressed Exif image is a one- or two-page uncompressed TIFF image
 with a specific ordering of its IFD and image data content. Each pixel
@@ -406,12 +386,12 @@
 stream and not as a thumbnail, i.e.,
 <code>tiffReader.hasThumbnails(0)</code> will return <code>false</code>.
 
-<h5><a name="ExifReadJPEG"/>Reading Compressed Exif Images</h5>
+<h5><a id="ExifReadJPEG">Reading Compressed Exif Images</a></h5>
 
 A compressed Exif image is a 3-band ISO/IEC 10918-1 baseline DCT JPEG stream
-with an inserted <tt>APP1</tt> marker segment. The parameters of the marker
+with an inserted <code>APP1</code> marker segment. The parameters of the marker
 segment after the length are the 6-byte sequence
-<code>{'E',&nbsp;'x',&nbsp;'i',&nbsp;'f',&nbsp;0x00,&nbsp;0x00}</code></code>
+<code>{'E',&nbsp;'x',&nbsp;'i',&nbsp;'f',&nbsp;0x00,&nbsp;0x00}</code>
 followed by a complete TIFF stream. The embedded TIFF stream contains a primary
 IFD describing the JPEG image optionally followed by a thumbnail IFD and
 compressed or uncompressed thumbnail image data. Note that the embedded TIFF
@@ -419,12 +399,12 @@
 nor any descriptive fields which duplicate information found in the JPEG
 stream itself.
 
-<p>The parameter content of the <tt>APP1</tt> marker segment may be obtained
+<p>The parameter content of the <code>APP1</code> marker segment may be obtained
 from the user object of the associated <code>Node</code> in a
-<tt>javax_imageio_jpeg_image_1.0</tt> native image metadata tree extracted
+<code>javax_imageio_jpeg_image_1.0</code> native image metadata tree extracted
 from the image metadata object returned by the JPEG reader. This APP1 Exif
 node will be a child of the node named "markerSequence" and will
-have name <tt>unknown</tt> and an attribute named <tt>MarkerTag</tt> with
+have name <code>unknown</code> and an attribute named <code>MarkerTag</code> with
 integral value <code>0xE1</code> (<code>String</code> value
 <code>"225"</code>). The user object of this node will be a byte array
 which starts with the six bytes <code>{'E', 'x', 'i', 'f', '0', '0'}</code>.
@@ -472,9 +452,8 @@
 images. Calling <code>tiffReader.read(0,&nbsp;readParam)</code> will throw
 an exception as the primary image in the embedded TIFF stream is always
 empty; the primary image should be obtained using the JPEG reader itself.
-</p>
 
-<h3><a name="Writing"/>Writing Images</h3>
+<h3><a id="Writing">Writing Images</a></h3>
 
 TIFF images are written by a <a href="../../ImageWriter.html">ImageWriter</a> which may be
 controlled by its public interface as well as via a supplied
@@ -482,7 +461,7 @@
 by the <code>getDefaultWriteParam()</code> method of the TIFF <code>ImageWriter</code>,
 the <code>canWriteTiles()</code> and <code>canWriteCompressed()</code> methods
 will return <code>true</code>; the <code>canOffsetTiles()</code> and
-<code>canWriteProgressive()</code> methods will return <code>false</code>.</p>
+<code>canWriteProgressive()</code> methods will return <code>false</code>.
 
 The TIFF writer supports many optional capabilities including writing tiled
 images, inserting images, writing or inserting empty images, and replacing image
@@ -497,12 +476,12 @@
 compression is being used and strips are being written, the number of
 rows per strip is rounded to a multiple of 8 times the maximum MCU over
 both dimensions.</p>
- 
+
  <!-- <h4>Supported Image Types</h4> -->
 
 <!-- Table? -->
 
-<h4><a name="Compression"/>Compression</h4>
+<h4><a id="Compression">Compression</a></h4>
 
 The compression type may be set via the <code>setCompressionType()</code> method of
 the <code>ImageWriteParam</code> after setting the compression mode to
@@ -592,21 +571,21 @@
 
 <p> If ZLib/Deflate or JPEG compression is used, the compression quality
 may be set. For ZLib/Deflate the supplied floating point quality value is
-rescaled to the range <tt>[1,&nbsp;9]</tt> and truncated to an integer
+rescaled to the range <code>[1,&nbsp;9]</code> and truncated to an integer
 to derive the Deflate compression level. For JPEG the floating point
 quality value is passed directly to the JPEG writer plug-in which
 interprets it in the usual way.</p>
 
-<h4><a name="ColorConversionWrite"/>Color Conversion</h4>
+<h4><a id="ColorConversionWrite">Color Conversion</a></h4>
 
 <p>If the source image data
 color space type is RGB, and the destination photometric type is CIE L*a*b* or
 YCbCr, then the source image data will be automatically converted from
 RGB using an internal color converter.</p>
 
-<h4><a name="ICCProfilesWrite"/>ICC Profiles</h4>
+<h4><a id="ICCProfilesWrite">ICC Profiles</a></h4>
 
-An <tt>ICC Profile</tt> field will be written if either:
+An <code>ICC Profile</code> field will be written if either:
 <ul>
 <li>one is present in the native image metadata
 <a href="../IIOMetadata.html">IIOMetadata</a> instance supplied to the writer,
@@ -614,50 +593,50 @@
 <li>the <a href="../../../../java/awt/color/ColorSpace.html">ColorSpace</a>
 of the destination <code>ImageTypeSpecifier</code> is an instance of
 <code>ICC_ColorSpace</code> which is not one of the standard
-color spaces defined by the <tt>CS_*</tt> constants in the
+color spaces defined by the <code>CS_*</code> constants in the
 <code>ColorSpace</code> class. The destination type is set via
 <code>ImageWriteParam.setDestinationType(ImageTypeSpecifier)</code> and defaults
 to the <code>ImageTypeSpecifier</code> of the image being written.
 </li>
 </ul>
 
-<h4><a name="MetadataIssuesWrite"/>Metadata Issues</h4>
+<h4><a id="MetadataIssuesWrite">Metadata Issues</a></h4>
 
 Some behavior of the writer is affected by or may affect the contents of
 the image metadata which may be supplied by the user.
 
-<p>For bilevel images, the <tt>FillOrder</tt>, and <tt>T4Options</tt>
+<p>For bilevel images, the <code>FillOrder</code>, and <code>T4Options</code>
 fields affect the output data. The data will be filled right-to-left if
-<tt>FillOrder</tt> is present with a value of 2
+<code>FillOrder</code> is present with a value of 2
 (<code>BaselineTIFFTagSet.FILL_ORDER_RIGHT_TO_LEFT</code>)
-and will be filled left-to-right otherwise. The value of <tt>T4Options</tt>
+and will be filled left-to-right otherwise. The value of <code>T4Options</code>
 specifies whether the data should be 1D- or 2D-encoded and whether EOL
 padding should be used.</p>
 
-<p>For all images the value of the <tt>RowsPerStrip</tt> field is used
+<p>For all images the value of the <code>RowsPerStrip</code> field is used
 to the set the number of rows per strip if the image is not tiled. The
 default number of rows per strip is either 8 or the number of rows which
 would fill no more than 8 kilobytes, whichever is larger.</p>
 
-<p>For all images the tile dimensions may be set using the <tt>TileWidth</tt>
-and <tt>TileLength</tt> field values if the tiling mode is
+<p>For all images the tile dimensions may be set using the <code>TileWidth</code>
+and <code>TileLength</code> field values if the tiling mode is
 <code>ImageWriteParam.MODE_COPY_FROM_METADATA</code>. If this mode
 is set but the fields are not, their respective default values are the image
 width and height.</p>
 
-<p>When using JPEG-in-TIFF compression, a <tt>JPEGTables</tt> field will be
+<p>When using JPEG-in-TIFF compression, a <code>JPEGTables</code> field will be
 written to the IFD and abbreviated JPEG streams to each strip or tile if and
-only if a <tt>JPEGTables</tt> field is contained in the metadata object
-provided to the writer. If the contents of the <tt>JPEGTables</tt> field is
+only if a <code>JPEGTables</code> field is contained in the metadata object
+provided to the writer. If the contents of the <code>JPEGTables</code> field is
 a valid tables-only JPEG stream, then it will be used; otherwise the contents
 of the field will be replaced with default visually lossless tables. If no
-such <tt>JPEGTables</tt> field is present in the metadata, then no
-<tt>JPEGTables</tt> field will be written to the output and each strip or
+such <code>JPEGTables</code> field is present in the metadata, then no
+<code>JPEGTables</code> field will be written to the output and each strip or
 tile will be written as a separate, self-contained JPEG stream.</p>
 
 <p>When using Deflate/ZLib or LZW compression, if the image has 8 bits per
 sample, a horizontal differencing predictor will be used if the
-<tt>Predictor</tt> field is present with a value of 2
+<code>Predictor</code> field is present with a value of 2
 (<code>BaselineTIFFTagSet.PREDICTOR_HORIZONTAL_DIFFERENCING</code>).
 If prediction is so requested but the image does not have
 8 bits per sample the field will be reset to have the value 1
@@ -667,30 +646,30 @@
 <p>Some fields may be added or modified:
 
 <ul>
-<li><tt>PhotometricInterpretation</tt> if not present.</li>
-<li><tt>PlanarConfiguration</tt> if this field is present with value
-<tt>Planar</tt> is is reset to <tt>Chunky</tt>.</li>
-<li><tt>Compression</tt> always.</li>
-<li><tt>BitsPerSample</tt> if the image is not bilevel.</li>
-<li><tt>SamplesPerPixel</tt> always.</li>
-<li><tt>ExtraSamples</tt> if an alpha channel is present.</li>
-<li><tt>SampleFormat</tt> if not present and the data are 16- or 32-bit
+<li><code>PhotometricInterpretation</code> if not present.</li>
+<li><code>PlanarConfiguration</code> if this field is present with value
+<code>Planar</code> is is reset to <code>Chunky</code>.</li>
+<li><code>Compression</code> always.</li>
+<li><code>BitsPerSample</code> if the image is not bilevel.</li>
+<li><code>SamplesPerPixel</code> always.</li>
+<li><code>ExtraSamples</code> if an alpha channel is present.</li>
+<li><code>SampleFormat</code> if not present and the data are 16- or 32-bit
 integers or floating point.</li>
-<li><tt>ColorMap</tt> if the <tt>PhotometricInterpretation</tt> is
-<tt>RGBPalette</tt>.</li>
-<li><tt>ImageWidth</tt> and <tt>ImageLength</tt> always.</li>
-<li><tt>TileWidth</tt>, <tt>TileLength</tt>, <tt>TileOffsets</tt>, and
-<tt>TileByteCounts</tt> if a tiled image is being written.</li>
-<li><tt>RowsPerStrip</tt>, <tt>StripOffsets</tt>, and <tt>StripByteCounts</tt>
+<li><code>ColorMap</code> if the <code>PhotometricInterpretation</code> is
+<code>RGBPalette</code>.</li>
+<li><code>ImageWidth</code> and <code>ImageLength</code> always.</li>
+<li><code>TileWidth</code>, <code>TileLength</code>, <code>TileOffsets</code>, and
+<code>TileByteCounts</code> if a tiled image is being written.</li>
+<li><code>RowsPerStrip</code>, <code>StripOffsets</code>, and <code>StripByteCounts</code>
 if a tiled image is <i>not</i> being written.</li>
-<li><tt>XResolution</tt>, <tt>YResolution</tt>, and <tt>ResolutionUnit</tt>
+<li><code>XResolution</code>, <code>YResolution</code>, and <code>ResolutionUnit</code>
 if none of these is present.</li>
-<li><tt>YCbCrSubsampling</tt> and <tt>YCbCrPositioning</tt> if the
+<li><code>YCbCrSubsampling</code> and <code>YCbCrPositioning</code> if the
 photometric interpretation is YCbCr and the compression type is not JPEG
 (only [1,&nbsp;1] subsampling and cosited positioning are supported for
 non-JPEG YCbCr output).</li>
-<li><tt>YCbCrSubsampling</tt>, <tt>YCbCrPositioning</tt>, and
-<tt>ReferenceBlackWhite</tt>: if the compression type is JPEG and the color
+<li><code>YCbCrSubsampling</code>, <code>YCbCrPositioning</code>, and
+<code>ReferenceBlackWhite</code>: if the compression type is JPEG and the color
 space is RGB these will be reset to [2,&nbsp;2] centered subsampling with no
 headroom/footroom (0:255,128:255,128:255).</li>
 </ul>
@@ -698,24 +677,23 @@
 <p>Some fields may be removed:
 
 <ul>
-<li><tt>BitsPerSample</tt> if the image is bilevel.</li>
-<li><tt>ExtraSamples</tt> if the image does not have an alpha channel.</li>
-<li><tt>ColorMap</tt> if the photometric interpretation is not
-<tt>RGBPalette</tt>.</li>
-<li><tt>TileWidth</tt>, <tt>TileLength</tt>, <tt>TileOffsets</tt>, and
-<tt>TileByteCounts</tt> if tiling <i>is not</i> being used.</li>
-<li><tt>RowsPerStrip</tt>, <tt>StripOffsets</tt>, and <tt>StripByteCounts</tt>
+<li><code>BitsPerSample</code> if the image is bilevel.</li>
+<li><code>ExtraSamples</code> if the image does not have an alpha channel.</li>
+<li><code>ColorMap</code> if the photometric interpretation is not
+<code>RGBPalette</code>.</li>
+<li><code>TileWidth</code>, <code>TileLength</code>, <code>TileOffsets</code>, and
+<code>TileByteCounts</code> if tiling <i>is not</i> being used.</li>
+<li><code>RowsPerStrip</code>, <code>StripOffsets</code>, and <code>StripByteCounts</code>
 if tiling <i>is</i> being used.</li>
-<li><tt>YCbCrSubsampling</tt>, <tt>YCbCrPositioning</tt>, and
-<tt>ReferenceBlackWhite</tt> if the compression type is JPEG and the
+<li><code>YCbCrSubsampling</code>, <code>YCbCrPositioning</code>, and
+<code>ReferenceBlackWhite</code> if the compression type is JPEG and the
 color space is grayscale.</li>
-<li><tt>JPEGProc</tt>, <tt>JPEGInterchangeFormat</tt>,
-<tt>JPEGInterchangeFormatLength</tt>, <tt>JPEGRestartInterval</tt>,
-<tt>JPEGLosslessPredictors</tt>, <tt>JPEGPointTransforms</tt>,
-<tt>JPEGQTables</tt>, <tt>JPEGDCTables</tt>, and
-<tt>JPEGACTables</tt> if the compression type is JPEG.</li>
+<li><code>JPEGProc</code>, <code>JPEGInterchangeFormat</code>,
+<code>JPEGInterchangeFormatLength</code>, <code>JPEGRestartInterval</code>,
+<code>JPEGLosslessPredictors</code>, <code>JPEGPointTransforms</code>,
+<code>JPEGQTables</code>, <code>JPEGDCTables</code>, and
+<code>JPEGACTables</code> if the compression type is JPEG.</li>
 </ul>
-</p>
 
 <p>Other fields present in the supplied metadata are uninterpreted and will
 be written as supplied.</p>
@@ -735,7 +713,7 @@
 <code>IIOMetadata</code> object so obtained may then be passed to the TIFF
 writer.</p>
 
-<h5><a name="MapStandardNative"/>
+<h5><a id="MapStandardNative"></a>
 Mapping of the Standard Metadata Format to TIFF Native Image Metadata</h5>
 
 The derivation of <a href="#ImageMetadata">TIFF native image metadata</a>
@@ -743,7 +721,6 @@
 <a href="standard_metadata.html">javax_imageio_1.0</a> is
 given in the following table.
 
-<p>
 <table border="1">
 <tr>
 <th>TIFF Field</th>
@@ -754,10 +731,10 @@
 PhotometricInterpretation
 </td>
 <td>/Chroma/ColorSpaceType@name: "GRAY" and /Chroma/BlackIsZero@value = "FALSE"
-=> WhiteIsZero; "GRAY" and /Document/SubimageInterpretation@value =
-"TransparencyMask" => TransparencyMask; "RGB" and /Chroma/Palette present =>
-PaletteColor; "GRAY" => BlackIsZero; "RGB" => RGB; "YCbCr" => YCbCr;
-"CMYK" => CMYK; "Lab" => CIELab.</td>
+=&gt; WhiteIsZero; "GRAY" and /Document/SubimageInterpretation@value =
+"TransparencyMask" =&gt; TransparencyMask; "RGB" and /Chroma/Palette present =&gt;
+PaletteColor; "GRAY" =&gt; BlackIsZero; "RGB" =&gt; RGB; "YCbCr" =&gt; YCbCr;
+"CMYK" =&gt; CMYK; "Lab" =&gt; CIELab.</td>
 </tr>
 <tr>
 <td>SamplesPerPixel</td>
@@ -769,21 +746,21 @@
 </tr>
 <tr>
 <td>Compression</td>
-<td>/Compression/CompressionTypeName@value: "none" => Uncompressed;
-"CCITT RLE" => CCITT 1D; "CCITT T.4" => Group 3 Fax; "CCITT T.6" => Group 4
-Fax; "LZW" => LZW; "Old JPEG" => JPEG; "JPEG" => New JPEG; "ZLib" => ZLib;
-"PackBits" => PackBits; "Deflate" => Deflate.</td>
+<td>/Compression/CompressionTypeName@value: "none" =&gt; Uncompressed;
+"CCITT RLE" =&gt; CCITT 1D; "CCITT T.4" =&gt; Group 3 Fax; "CCITT T.6" =&gt; Group 4
+Fax; "LZW" =&gt; LZW; "Old JPEG" =&gt; JPEG; "JPEG" =&gt; New JPEG; "ZLib" =&gt; ZLib;
+"PackBits" =&gt; PackBits; "Deflate" =&gt; Deflate.</td>
 </tr>
 <tr>
 <td>PlanarConfiguration</td>
-<td>/Data/PlanarConfiguration@value: "PixelInterleaved" => Chunky;
-"PlaneInterleaved" => Planar.</td>
+<td>/Data/PlanarConfiguration@value: "PixelInterleaved" =&gt; Chunky;
+"PlaneInterleaved" =&gt; Planar.</td>
 </tr>
 <tr>
 <td>SampleFormat</td>
-<td>/Data/SampleFormat@value: "SignedIntegral" => two's complement signed
-integer data; "UnsignedIntegral" => unsigned integer data; "Real" =>
-IEEE floating point data; "Index" => unsigned integer data.
+<td>/Data/SampleFormat@value: "SignedIntegral" =&gt; two's complement signed
+integer data; "UnsignedIntegral" =&gt; unsigned integer data; "Real" =&gt;
+IEEE floating point data; "Index" =&gt; unsigned integer data.
 </td>
 </tr>
 <tr>
@@ -792,8 +769,8 @@
 </tr>
 <tr>
 <td>FillOrder</td>
-<td>/Data/SampleMSB@value: if all values in space-separated list are 0s =>
-right-to-left; otherwise => left-to-right.
+<td>/Data/SampleMSB@value: if all values in space-separated list are 0s =&gt;
+right-to-left; otherwise =&gt; left-to-right.
 </td>
 </tr>
 <tr>
@@ -826,9 +803,9 @@
 </tr>
 <tr>
 <td>NewSubFileType</td>
-<td>/Document/SubimageInterpretation@value: "TransparencyMask" =>
-transparency mask; "ReducedResolution" => reduced-resolution;
-"SinglePage" => single page.</td>
+<td>/Document/SubimageInterpretation@value: "TransparencyMask" =&gt;
+transparency mask; "ReducedResolution" =&gt; reduced-resolution;
+"SinglePage" =&gt; single page.</td>
 </tr>
 <tr>
 <td>DateTime</td>
@@ -843,29 +820,28 @@
 </tr>
 <tr>
 <td>ExtraSamples</td>
-<td>/Transparency/Alpha@value: "premultiplied" => associated alpha, count 1;
-"nonpremultiplied" => unassociated alpha, count 1.</td>
+<td>/Transparency/Alpha@value: "premultiplied" =&gt; associated alpha, count 1;
+"nonpremultiplied" =&gt; unassociated alpha, count 1.</td>
 </tr>
 <tr>
 <td></td>
 <td></td>
 </tr>
 </table>
-</p>
 
-<h4><a name="ExifWrite"/>Writing Exif Images</h4>
+<h4><a id="ExifWrite">Writing Exif Images</a></h4>
 
 The TIFF writer may be used to write an uncompressed Exif image or the
-contents of the <tt>APP1</tt> marker segment of a compressed Exif image.
+contents of the <code>APP1</code> marker segment of a compressed Exif image.
 
-<h5><a name="ExifWriteTIFF"/>Writing Uncompressed Exif Images</h5>
+<h5><a id="ExifWriteTIFF">Writing Uncompressed Exif Images</a></h5>
 
 When writing a sequence of images each image is normally recorded as
 {IFD,&nbsp;IFD Value,&nbsp;Image Data}. The Exif specification requires
 that an uncompressed Exif image be structured as follows:
 
+<a id="ExifStructure"></a>
 <ol>
-<a name="ExifStructure"/>
 <li>Image File Header</li>
 <li>Primary IFD</li>
 <li>Primary IFD Value</li>
@@ -925,9 +901,9 @@
     }
 </code></pre>
 
-<h5><a name="ExifWriteJPEG"/>Writing Compressed Exif Images</h5>
+<h5><a id="ExifWriteJPEG">Writing Compressed Exif Images</a></h5>
 
-The structure of the embedded TIFF stream in the <tt>APP1</tt> segment of a
+The structure of the embedded TIFF stream in the <code>APP1</code> segment of a
 compressed Exif image is identical to the <a href="#ExifStructure">
 uncompressed Exif image structure</a> except that there are no primary
 image data, i.e., the primary IFD does not refer to any image data.
@@ -1013,7 +989,7 @@
     Node tree = jpegImageMetadata.getAsTree(nativeFormat);
     NodeList children = tree.getChildNodes();
     int numChildren = children.getLength();
-    for (int i = 0; i < numChildren; i++) {
+    for (int i = 0; i &lt; numChildren; i++) {
         Node child = children.item(i);
         if (child.getNodeName().equals("markerSequence")) {
             child.appendChild(app1Node);
@@ -1032,7 +1008,7 @@
 and written to the JPEG stream when the primary image is written using
 the JPEG writer.
 
-<h3><a name="StreamMetadata"/>Stream Metadata</h3>
+<h3><a id="StreamMetadata">Stream Metadata</a></h3>
 
 The DTD for the TIFF native stream metadata format is as follows:
 
@@ -1042,14 +1018,14 @@
   &lt;!ELEMENT "javax_imageio_tiff_stream_1.0" (ByteOrder)>
 
     &lt;!ELEMENT "ByteOrder" EMPTY&gt;
-      &lt;!-- The stream byte order --&gt; 
+      &lt;!-- The stream byte order --&gt;
       &lt;!ATTLIST "ByteOrder" "value" #CDATA #REQUIRED&gt;
-        &lt;!-- One of "BIG_ENDIAN" or "LITTLE_ENDIAN" --&gt; 
+        &lt;!-- One of "BIG_ENDIAN" or "LITTLE_ENDIAN" --&gt;
         &lt;!-- Data type: String --&gt;
 ]&gt;
 </pre>
 
-<h3><a name="ImageMetadata"/>Image Metadata</h3>
+<h3><a id="ImageMetadata">Image Metadata</a></h3>
 
 The DTD for the TIFF native image metadata format is as follows:
 
@@ -1059,140 +1035,140 @@
   &lt;!ELEMENT "javax_imageio_tiff_image_1.0" (TIFFIFD)*&gt;
 
     &lt;!ELEMENT "TIFFIFD" (TIFFField | TIFFIFD)*&gt;
-      &lt;!-- An IFD (directory) containing fields --&gt; 
+      &lt;!-- An IFD (directory) containing fields --&gt;
       &lt;!ATTLIST "TIFFIFD" "tagSets" #CDATA #REQUIRED&gt;
         &lt;!-- Data type: String --&gt;
       &lt;!ATTLIST "TIFFIFD" "parentTagNumber" #CDATA #IMPLIED&gt;
-        &lt;!-- The tag number of the field pointing to this IFD --&gt; 
+        &lt;!-- The tag number of the field pointing to this IFD --&gt;
         &lt;!-- Data type: Integer --&gt;
       &lt;!ATTLIST "TIFFIFD" "parentTagName" #CDATA #IMPLIED&gt;
-        &lt;!-- A mnemonic name for the field pointing to this IFD, if known 
-             --&gt; 
+        &lt;!-- A mnemonic name for the field pointing to this IFD, if known
+             --&gt;
         &lt;!-- Data type: String --&gt;
 
       &lt;!ELEMENT "TIFFField" (TIFFBytes | TIFFAsciis |
         TIFFShorts | TIFFSShorts | TIFFLongs | TIFFSLongs |
         TIFFRationals | TIFFSRationals |
         TIFFFloats | TIFFDoubles | TIFFUndefined)&gt;
-        &lt;!-- A field containing data --&gt; 
+        &lt;!-- A field containing data --&gt;
         &lt;!ATTLIST "TIFFField" "number" #CDATA #REQUIRED&gt;
-          &lt;!-- The tag number asociated with the field --&gt; 
+          &lt;!-- The tag number asociated with the field --&gt;
           &lt;!-- Data type: String --&gt;
         &lt;!ATTLIST "TIFFField" "name" #CDATA #IMPLIED&gt;
-          &lt;!-- A mnemonic name associated with the field, if known --&gt; 
+          &lt;!-- A mnemonic name associated with the field, if known --&gt;
           &lt;!-- Data type: String --&gt;
 
         &lt;!ELEMENT "TIFFBytes" (TIFFByte)*&gt;
-          &lt;!-- A sequence of TIFFByte nodes --&gt; 
+          &lt;!-- A sequence of TIFFByte nodes --&gt;
 
           &lt;!ELEMENT "TIFFByte" EMPTY&gt;
-            &lt;!-- An integral value between 0 and 255 --&gt; 
+            &lt;!-- An integral value between 0 and 255 --&gt;
             &lt;!ATTLIST "TIFFByte" "value" #CDATA #IMPLIED&gt;
-              &lt;!-- The value --&gt; 
+              &lt;!-- The value --&gt;
               &lt;!-- Data type: String --&gt;
             &lt;!ATTLIST "TIFFByte" "description" #CDATA #IMPLIED&gt;
-              &lt;!-- A description, if available --&gt; 
+              &lt;!-- A description, if available --&gt;
               &lt;!-- Data type: String --&gt;
 
         &lt;!ELEMENT "TIFFAsciis" (TIFFAscii)*&gt;
-          &lt;!-- A sequence of TIFFAscii nodes --&gt; 
+          &lt;!-- A sequence of TIFFAscii nodes --&gt;
 
           &lt;!ELEMENT "TIFFAscii" EMPTY&gt;
-            &lt;!-- A String value --&gt; 
+            &lt;!-- A String value --&gt;
             &lt;!ATTLIST "TIFFAscii" "value" #CDATA #IMPLIED&gt;
-              &lt;!-- The value --&gt; 
+              &lt;!-- The value --&gt;
               &lt;!-- Data type: String --&gt;
 
         &lt;!ELEMENT "TIFFShorts" (TIFFShort)*&gt;
-          &lt;!-- A sequence of TIFFShort nodes --&gt; 
+          &lt;!-- A sequence of TIFFShort nodes --&gt;
 
           &lt;!ELEMENT "TIFFShort" EMPTY&gt;
-            &lt;!-- An integral value between 0 and 65535 --&gt; 
+            &lt;!-- An integral value between 0 and 65535 --&gt;
             &lt;!ATTLIST "TIFFShort" "value" #CDATA #IMPLIED&gt;
-              &lt;!-- The value --&gt; 
+              &lt;!-- The value --&gt;
               &lt;!-- Data type: String --&gt;
             &lt;!ATTLIST "TIFFShort" "description" #CDATA #IMPLIED&gt;
-              &lt;!-- A description, if available --&gt; 
+              &lt;!-- A description, if available --&gt;
               &lt;!-- Data type: String --&gt;
 
         &lt;!ELEMENT "TIFFSShorts" (TIFFSShort)*&gt;
-          &lt;!-- A sequence of TIFFSShort nodes --&gt; 
+          &lt;!-- A sequence of TIFFSShort nodes --&gt;
 
           &lt;!ELEMENT "TIFFSShort" EMPTY&gt;
-            &lt;!-- An integral value between -32768 and 32767 --&gt; 
+            &lt;!-- An integral value between -32768 and 32767 --&gt;
             &lt;!ATTLIST "TIFFSShort" "value" #CDATA #IMPLIED&gt;
-              &lt;!-- The value --&gt; 
+              &lt;!-- The value --&gt;
               &lt;!-- Data type: String --&gt;
             &lt;!ATTLIST "TIFFSShort" "description" #CDATA #IMPLIED&gt;
-              &lt;!-- A description, if available --&gt; 
+              &lt;!-- A description, if available --&gt;
               &lt;!-- Data type: String --&gt;
 
         &lt;!ELEMENT "TIFFLongs" (TIFFLong)*&gt;
-          &lt;!-- A sequence of TIFFLong nodes --&gt; 
+          &lt;!-- A sequence of TIFFLong nodes --&gt;
 
           &lt;!ELEMENT "TIFFLong" EMPTY&gt;
-            &lt;!-- An integral value between 0 and 4294967295 --&gt; 
+            &lt;!-- An integral value between 0 and 4294967295 --&gt;
             &lt;!ATTLIST "TIFFLong" "value" #CDATA #IMPLIED&gt;
-              &lt;!-- The value --&gt; 
+              &lt;!-- The value --&gt;
               &lt;!-- Data type: String --&gt;
             &lt;!ATTLIST "TIFFLong" "description" #CDATA #IMPLIED&gt;
-              &lt;!-- A description, if available --&gt; 
+              &lt;!-- A description, if available --&gt;
               &lt;!-- Data type: String --&gt;
 
         &lt;!ELEMENT "TIFFSLongs" (TIFFSLong)*&gt;
-          &lt;!-- A sequence of TIFFSLong nodes --&gt; 
+          &lt;!-- A sequence of TIFFSLong nodes --&gt;
 
           &lt;!ELEMENT "TIFFSLong" EMPTY&gt;
-            &lt;!-- An integral value between -2147483648 and 2147482647 --&gt; 
+            &lt;!-- An integral value between -2147483648 and 2147482647 --&gt;
             &lt;!ATTLIST "TIFFSLong" "value" #CDATA #IMPLIED&gt;
-              &lt;!-- The value --&gt; 
+              &lt;!-- The value --&gt;
               &lt;!-- Data type: String --&gt;
             &lt;!ATTLIST "TIFFSLong" "description" #CDATA #IMPLIED&gt;
-              &lt;!-- A description, if available --&gt; 
+              &lt;!-- A description, if available --&gt;
               &lt;!-- Data type: String --&gt;
 
         &lt;!ELEMENT "TIFFRationals" (TIFFRational)*&gt;
-          &lt;!-- A sequence of TIFFRational nodes --&gt; 
+          &lt;!-- A sequence of TIFFRational nodes --&gt;
 
           &lt;!ELEMENT "TIFFRational" EMPTY&gt;
-            &lt;!-- A rational value consisting of an unsigned numerator and 
-                 denominator --&gt; 
+            &lt;!-- A rational value consisting of an unsigned numerator and
+                 denominator --&gt;
             &lt;!ATTLIST "TIFFRational" "value" #CDATA #IMPLIED&gt;
-              &lt;!-- The numerator and denominator, separated by a slash --&gt; 
+              &lt;!-- The numerator and denominator, separated by a slash --&gt;
               &lt;!-- Data type: String --&gt;
 
         &lt;!ELEMENT "TIFFSRationals" (TIFFSRational)*&gt;
-          &lt;!-- A sequence of TIFFSRational nodes --&gt; 
+          &lt;!-- A sequence of TIFFSRational nodes --&gt;
 
           &lt;!ELEMENT "TIFFSRational" EMPTY&gt;
-            &lt;!-- A rational value consisting of a signed numerator and 
-                 denominator --&gt; 
+            &lt;!-- A rational value consisting of a signed numerator and
+                 denominator --&gt;
             &lt;!ATTLIST "TIFFSRational" "value" #CDATA #IMPLIED&gt;
-              &lt;!-- The numerator and denominator, separated by a slash --&gt; 
+              &lt;!-- The numerator and denominator, separated by a slash --&gt;
               &lt;!-- Data type: String --&gt;
 
         &lt;!ELEMENT "TIFFFloats" (TIFFFloat)*&gt;
-          &lt;!-- A sequence of TIFFFloat nodes --&gt; 
+          &lt;!-- A sequence of TIFFFloat nodes --&gt;
 
           &lt;!ELEMENT "TIFFFloat" EMPTY&gt;
-            &lt;!-- A single-precision floating-point value --&gt; 
+            &lt;!-- A single-precision floating-point value --&gt;
             &lt;!ATTLIST "TIFFFloat" "value" #CDATA #IMPLIED&gt;
-              &lt;!-- The value --&gt; 
+              &lt;!-- The value --&gt;
               &lt;!-- Data type: String --&gt;
 
         &lt;!ELEMENT "TIFFDoubles" (TIFFDouble)*&gt;
-          &lt;!-- A sequence of TIFFDouble nodes --&gt; 
+          &lt;!-- A sequence of TIFFDouble nodes --&gt;
 
           &lt;!ELEMENT "TIFFDouble" EMPTY&gt;
-            &lt;!-- A double-precision floating-point value --&gt; 
+            &lt;!-- A double-precision floating-point value --&gt;
             &lt;!ATTLIST "TIFFDouble" "value" #CDATA #IMPLIED&gt;
-              &lt;!-- The value --&gt; 
+              &lt;!-- The value --&gt;
               &lt;!-- Data type: String --&gt;
 
         &lt;!ELEMENT "TIFFUndefined" EMPTY&gt;
-          &lt;!-- Uninterpreted byte data --&gt; 
+          &lt;!-- Uninterpreted byte data --&gt;
           &lt;!ATTLIST "TIFFUndefined" "value" #CDATA #IMPLIED&gt;
-            &lt;!-- A list of comma-separated byte values --&gt; 
+            &lt;!-- A list of comma-separated byte values --&gt;
             &lt;!-- Data type: String --&gt;
 ]&gt;
 </pre>
--- a/src/java.desktop/share/classes/javax/imageio/metadata/doc-files/wbmp_metadata.html	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/javax/imageio/metadata/doc-files/wbmp_metadata.html	Wed Dec 13 10:25:38 2017 -0800
@@ -1,8 +1,11 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
+<!doctype html>
+<html lang="en">
 <head>
+  <meta charset="utf-8"/>
+  <title>WBMP Metadata Format Specification</title>
+</head>
 <!--
-Copyright (c) 2003, 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
@@ -26,13 +29,8 @@
 questions.
 -->
 
-<title>WBMP Metadata Format Specification</title>
-</head>
-
 <body>
-<center><h1>
-WBMP Metadata Format Specification
-</h1></center>
+<h1>WBMP Metadata Format Specification</h1>
 
 The XML schema for the native image metadata format is as follows:
 
--- a/src/java.desktop/share/classes/javax/imageio/package-info.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/javax/imageio/package-info.java	Wed Dec 13 10:25:38 2017 -0800
@@ -113,7 +113,7 @@
  *
  * <h2> Standard Plug-in Notes</h2>
  *
- * <h3><a name="gif_plugin_notes">Standard plug-in for GIF image format</a></h3>
+ * <h3><a id="gif_plugin_notes">Standard plug-in for GIF image format</a></h3>
  * ImageIO provides {@code ImageReader} and {@code ImageWriter}plug-ins for the
  * <a href="http://www.w3.org/Graphics/GIF/spec-gif89a.txt"> Graphics
  * Interchange Format (GIF)</a> image format. These are the "standard" GIF
--- a/src/java.desktop/share/classes/javax/imageio/spi/IIORegistry.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/javax/imageio/spi/IIORegistry.java	Wed Dec 13 10:25:38 2017 -0800
@@ -56,46 +56,24 @@
 import java.util.ServiceConfigurationError;
 
 /**
- * A registry for service provider instances.  Service provider
- * classes may be detected at run time by means of meta-information in
- * the JAR files containing them.  The intent is that it be relatively
- * inexpensive to load and inspect all available service provider
- * classes.  These classes may them be used to locate and instantiate
+ * A registry for Image I/O service provider instances.  Service provider
+ * classes may be discovered at runtime by the mechanisms documented in
+ * {@link java.util.ServiceLoader ServiceLoader}.
+ *
+ * The intent is that it be relatively inexpensive to load and inspect
+ * all available Image I/O service provider classes.
+ * These classes may then be used to locate and instantiate
  * more heavyweight classes that will perform actual work, in this
  * case instances of {@code ImageReader},
  * {@code ImageWriter}, {@code ImageTranscoder},
  * {@code ImageInputStream}, and {@code ImageOutputStream}.
  *
- * Service providers found from the Java platform are automatically
+ * Service providers included in the Java runtime are automatically
  * loaded as soon as this class is instantiated.
  *
  * <p> When the {@code registerApplicationClasspathSpis} method
- * is called, service provider instances declared in the
- * meta-information section of JAR files on the application class path
- * are loaded.  To declare a service provider, a {@code services}
- * subdirectory is placed within the {@code META-INF} directory
- * that is present in every JAR file.  This directory contains a file
- * for each service provider interface that has one or more
- * implementation classes present in the JAR file.  For example, if
- * the JAR file contained a class named
- * {@code com.mycompany.imageio.MyFormatReaderSpi} which
- * implements the {@code ImageReaderSpi} interface, the JAR file
- * would contain a file named:
- *
- * <pre>
- * META-INF/services/javax.imageio.spi.ImageReaderSpi
- * </pre>
- *
- * containing the line:
- *
- * <pre>
- * com.mycompany.imageio.MyFormatReaderSpi
- * </pre>
- *
- * <p> The service provider classes are intended to be lightweight
- * and quick to load.  Implementations of these interfaces
- * should avoid complex dependencies on other classes and on
- * native code.
+ * is called, additional service provider instances will be discovered
+ * using {@link java.util.ServiceLoader ServiceLoader}.
  *
  * <p> It is also possible to manually add service providers not found
  * automatically, as well as to remove those that are using the
@@ -103,9 +81,8 @@
  * the application may customize the contents of the registry as it
  * sees fit.
  *
- * <p> For more details on declaring service providers, and the JAR
- * format in general, see the
- * <a href="{@docRoot}/../specs/jar/jar.html">JAR File Specification</a>.
+ * <p> For information on how to create and deploy service providers,
+ * refer to the documentation on {@link java.util.ServiceLoader ServiceLoader}
  */
 public final class IIORegistry extends ServiceRegistry {
 
--- a/src/java.desktop/share/classes/javax/imageio/spi/ServiceRegistry.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/javax/imageio/spi/ServiceRegistry.java	Wed Dec 13 10:25:38 2017 -0800
@@ -39,19 +39,13 @@
 import java.util.ServiceLoader;
 
 /**
- * A registry for service provider instances.
- *
- * <p> A <i>service</i> is a well-known set of interfaces and (usually
- * abstract) classes.  A <i>service provider</i> is a specific
- * implementation of a service.  The classes in a provider typically
- * implement the interface or subclass the class defined by the
- * service itself.
+ * A registry for service provider instances for Image I/O service types.
  *
  * <p> Service providers are stored in one or more <i>categories</i>,
- * each of which is defined by a class of interface (described by a
+ * each of which is defined by a class or interface (described by a
  * {@code Class} object) that all of its members must implement.
  *
- * <p>The set of categories supported is limited
+ * <p>The set of categories supported by this class is limited
  * to the following standard Image I/O service types:
  *
  * <ul>
@@ -63,9 +57,10 @@
  * </ul>
  *
  * <p>An attempt to load a provider that is not a subtype of one of the
- * above types will result in {@code IllegalArgumentException}. For
- * a general mechanism to load service providers, see
- * {@link java.util.ServiceLoader ServiceLoader}.
+ * above types will result in {@code IllegalArgumentException}.
+ * <p> For the general mechanism to load service providers, see
+ * {@link java.util.ServiceLoader ServiceLoader}, which is
+ * the underlying standard mechanism used by this class.
  *
  * <p> Only a single instance of a given leaf class (that is, the
  * actual class returned by {@code getClass()}, as opposed to any
@@ -80,24 +75,7 @@
  * the previous instance.  In practice, service provider objects are
  * usually singletons so this behavior is appropriate.
  *
- * <p> To declare a service provider, a {@code services}
- * subdirectory is placed within the {@code META-INF} directory
- * that is present in every JAR file.  This directory contains a file
- * for each service provider interface that has one or more
- * implementation classes present in the JAR file.  For example, if
- * the JAR file contained a class named
- * {@code com.mycompany.mypkg.GreenImageReaderProvider} which implements the
- * {@code javax.imageio.spi.ImageReaderSpi} interface, the JAR file
- * would contain a file named: <pre>
- * META-INF/services/javax.imageio.spi.ImageReaderSpi</pre>
- *
- * containing the line:
- *
- * <pre>
- * com.mycompany.mypkg.GreenImageReaderProvider
- * </pre>
- *
- * <p> The service provider classes should be to be lightweight and
+ * <p> The service provider classes should be lightweight and
  * quick to load.  Implementations of these interfaces should avoid
  * complex dependencies on other classes and on native code. The usual
  * pattern for more complex services is to register a lightweight
@@ -106,9 +84,8 @@
  * <p> An application may customize the contents of a registry as it
  * sees fit, so long as it has the appropriate runtime permission.
  *
- * <p> For more details on declaring service providers, and the JAR
- * format in general, see the
- * <a href="{@docRoot}/../specs/jar/jar.html">JAR File Specification</a>.
+ * <p> For information on how to create and deploy service providers,
+ * refer to the documentation on {@link java.util.ServiceLoader ServiceLoader}
  *
  * @see RegisterableService
  * @see java.util.ServiceLoader
--- a/src/java.desktop/share/classes/javax/print/attribute/package-info.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/javax/print/attribute/package-info.java	Wed Dec 13 10:25:38 2017 -0800
@@ -80,7 +80,7 @@
  * attribute category, and the {@code Copies} instance represents the attribute
  * value.
  *
- * <h4><a name="role"></a>Attribute Roles</h4>
+ * <h4><a id="role"></a>Attribute Roles</h4>
  * When submitting a print job to a printer, the client provides the attributes
  * describing the characteristics of the print data, such as the document name,
  * and how the print data should be printed, such as double-sided, five copies.
--- a/src/java.desktop/share/classes/javax/swing/DefaultListSelectionModel.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/javax/swing/DefaultListSelectionModel.java	Wed Dec 13 10:25:38 2017 -0800
@@ -95,14 +95,37 @@
      * @throws IllegalArgumentException {@inheritDoc}
      */
     public void setSelectionMode(int selectionMode) {
+        int oldMode = this.selectionMode;
         switch (selectionMode) {
-        case SINGLE_SELECTION:
-        case SINGLE_INTERVAL_SELECTION:
-        case MULTIPLE_INTERVAL_SELECTION:
-            this.selectionMode = selectionMode;
-            break;
-        default:
-            throw new IllegalArgumentException("invalid selectionMode");
+            case SINGLE_SELECTION:
+            case SINGLE_INTERVAL_SELECTION:
+            case MULTIPLE_INTERVAL_SELECTION:
+                this.selectionMode = selectionMode;
+                break;
+            default:
+                throw new IllegalArgumentException("invalid selectionMode");
+        }
+
+        /*
+        This code will only be executed when selection needs to be updated on
+        changing selection mode. It will happen only if selection mode is changed
+        from MULTIPLE_INTERVAL to SINGLE_INTERVAL or SINGLE or from
+        SINGLE_INTERVAL to SINGLE
+         */
+        if (oldMode > this.selectionMode) {
+            if (this.selectionMode == SINGLE_SELECTION) {
+                if (!isSelectionEmpty()) {
+                    setSelectionInterval(minIndex, minIndex);
+                }
+            } else if (this.selectionMode == SINGLE_INTERVAL_SELECTION) {
+                if(!isSelectionEmpty()) {
+                    int selectionEndindex = minIndex;
+                    while (value.get(selectionEndindex + 1)) {
+                        selectionEndindex++;
+                    }
+                    setSelectionInterval(minIndex, selectionEndindex);
+                }
+            }
         }
     }
 
--- a/src/java.desktop/share/classes/javax/swing/package-info.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/javax/swing/package-info.java	Wed Dec 13 10:25:38 2017 -0800
@@ -32,7 +32,7 @@
  * <em>The Java Tutorial</em>. For other resources, see
  * <a href="#related">Related Documentation</a>.
  *
- * <h2><a name="threading">Swing's Threading Policy</a></h2>
+ * <h2><a id="threading">Swing's Threading Policy</a></h2>
  * In general Swing is not thread safe. All Swing components and related
  * classes, unless otherwise documented, must be accessed on the event
  * dispatching thread.
@@ -94,6 +94,23 @@
  * If you modify the model on a separate thread you run the risk of exceptions
  * and possible display corruption.
  * <p>
+ * Although it is generally safe to make updates to the UI immediately,
+ * when executing on the event dispatch thread, there is an exception :
+ * if a model listener tries to further change the UI before the UI has been
+ * updated to reflect a pending change then the UI may render incorrectly.
+ *
+ * This can happen if an application installed listener needs to update the UI
+ * in response to an event which will cause a change in the model structure.
+ * It is important to first allow component installed listeners to process this
+ * change, since there is no guarantee of the order in which listeners may be
+ * called.
+ *
+ * The solution is for the application listener to make the change using
+ * {@link SwingUtilities.invokeLater} so that any changes to  UI rendering will
+ * be done post processing all the model listeners installed by the component.
+ * </p>
+ * <p>
+ *
  * As all events are delivered on the event dispatching thread, care must be
  * taken in event processing. In particular, a long running task, such as
  * network io or computational intensive processing, executed on the event
@@ -110,7 +127,7 @@
  * href="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html">
  * Concurrency in Swing</a>.
  *
- * <h2><a name="related">Related Documentation</a></h2>
+ * <h2><a id="related">Related Documentation</a></h2>
  * For overviews, tutorials, examples, guides, and other documentation,
  * please see:
  * <ul>
--- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboPopup.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboPopup.java	Wed Dec 13 10:25:38 2017 -0800
@@ -530,7 +530,6 @@
      */
     protected JList<Object> createList() {
         return new JList<Object>( comboBox.getModel() ) {
-            @SuppressWarnings("deprecation")
             public void processMouseEvent(MouseEvent e)  {
                 if (BasicGraphicsUtils.isMenuShortcutKeyDown(e))  {
                     // Fix for 4234053. Filter out the Control Key from the list.
@@ -538,7 +537,7 @@
                     Toolkit toolkit = Toolkit.getDefaultToolkit();
                     MouseEvent newEvent = new MouseEvent(
                                        (Component)e.getSource(), e.getID(), e.getWhen(),
-                                       e.getModifiers() ^ toolkit.getMenuShortcutKeyMask(),
+                                       e.getModifiersEx() ^ toolkit.getMenuShortcutKeyMaskEx(),
                                        e.getX(), e.getY(),
                                        e.getXOnScreen(), e.getYOnScreen(),
                                        e.getClickCount(),
--- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java	Wed Dec 13 10:25:38 2017 -0800
@@ -1134,6 +1134,7 @@
                 boolean isTrav = (selectedFile != null && chooser.isTraversable(selectedFile));
                 boolean isDirSelEnabled = chooser.isDirectorySelectionEnabled();
                 boolean isFileSelEnabled = chooser.isFileSelectionEnabled();
+                @SuppressWarnings("deprecation")
                 boolean isCtrl = (e != null && (e.getModifiers() &
                             Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()) != 0);
 
--- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicGraphicsUtils.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicGraphicsUtils.java	Wed Dec 13 10:25:38 2017 -0800
@@ -382,10 +382,9 @@
         return c.getComponentOrientation().isLeftToRight();
     }
 
-    @SuppressWarnings("deprecation")
     static boolean isMenuShortcutKeyDown(InputEvent event) {
-        return (event.getModifiers() &
-                Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()) != 0;
+        return (event.getModifiersEx() &
+                Toolkit.getDefaultToolkit().getMenuShortcutKeyMaskEx()) != 0;
     }
 
     /**
--- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicListUI.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicListUI.java	Wed Dec 13 10:25:38 2017 -0800
@@ -2134,8 +2134,11 @@
             Rectangle leadRect =
                 (lead==-1) ? new Rectangle() : list.getCellBounds(lead, lead);
 
+            if (leadRect == null) {
+                return index;
+            }
             if (list.getLayoutOrientation() == JList.VERTICAL_WRAP &&
-                list.getVisibleRowCount() <= 0) {
+                    list.getVisibleRowCount() <= 0) {
                 if (!list.getComponentOrientation().isLeftToRight()) {
                     direction = -direction;
                 }
@@ -2146,14 +2149,20 @@
                     visRect.x = leadRect.x + leadRect.width - visRect.width;
                     Point p = new Point(visRect.x - 1, leadRect.y);
                     index = list.locationToIndex(p);
+                    if (index == -1) {
+                        return index;
+                    }
                     Rectangle cellBounds = list.getCellBounds(index, index);
-                    if (visRect.intersects(cellBounds)) {
+                    if (cellBounds != null && visRect.intersects(cellBounds)) {
                         p.x = cellBounds.x - 1;
                         index = list.locationToIndex(p);
+                        if (index == -1) {
+                            return index;
+                        }
                         cellBounds = list.getCellBounds(index, index);
                     }
                     // this is necessary for right-to-left orientation only
-                    if (cellBounds.y != leadRect.y) {
+                    if (cellBounds != null && cellBounds.y != leadRect.y) {
                         p.x = cellBounds.x + cellBounds.width;
                         index = list.locationToIndex(p);
                     }
@@ -2163,13 +2172,19 @@
                     visRect.x = leadRect.x;
                     Point p = new Point(visRect.x + visRect.width, leadRect.y);
                     index = list.locationToIndex(p);
+                    if (index == -1) {
+                        return index;
+                    }
                     Rectangle cellBounds = list.getCellBounds(index, index);
-                    if (visRect.intersects(cellBounds)) {
+                    if (cellBounds != null && visRect.intersects(cellBounds)) {
                         p.x = cellBounds.x + cellBounds.width;
                         index = list.locationToIndex(p);
+                        if (index == -1) {
+                            return index;
+                        }
                         cellBounds = list.getCellBounds(index, index);
                     }
-                    if (cellBounds.y != leadRect.y) {
+                    if (cellBounds != null && cellBounds.y != leadRect.y) {
                         p.x = cellBounds.x - 1;
                         index = list.locationToIndex(p);
                     }
@@ -2187,17 +2202,23 @@
                         visRect.y = leadRect.y + leadRect.height - visRect.height;
                         p.y = visRect.y;
                         index = list.locationToIndex(p);
+                        if (index == -1) {
+                            return index;
+                        }
                         Rectangle cellBounds = list.getCellBounds(index, index);
                         // go one cell down if first visible cell doesn't fit
                         // into adjasted visible rectangle
-                        if (cellBounds.y < visRect.y) {
+                        if (cellBounds != null && cellBounds.y < visRect.y) {
                             p.y = cellBounds.y + cellBounds.height;
                             index = list.locationToIndex(p);
+                            if (index == -1) {
+                                return index;
+                            }
                             cellBounds = list.getCellBounds(index, index);
                         }
                         // if index isn't less then lead
                         // try to go to cell previous to lead
-                        if (cellBounds.y >= leadRect.y) {
+                        if (cellBounds != null && cellBounds.y >= leadRect.y) {
                             p.y = leadRect.y - 1;
                             index = list.locationToIndex(p);
                         }
@@ -2207,15 +2228,23 @@
                     // down
                     // go to the last completely visible cell
                     Point p = new Point(leadRect.x,
-                                        visRect.y + visRect.height - 1);
+                            visRect.y + visRect.height - 1);
                     index = list.locationToIndex(p);
+                    if (index == -1) {
+                        return index;
+                    }
                     Rectangle cellBounds = list.getCellBounds(index, index);
                     // go up one cell if last visible cell doesn't fit
                     // into visible rectangle
-                    if (cellBounds.y + cellBounds.height >
-                        visRect.y + visRect.height) {
+                    if (cellBounds != null &&
+                            cellBounds.y + cellBounds.height >
+                            visRect.y + visRect.height)
+                    {
                         p.y = cellBounds.y - 1;
                         index = list.locationToIndex(p);
+                        if (index == -1) {
+                            return index;
+                        }
                         cellBounds = list.getCellBounds(index, index);
                         index = Math.max(index, lead);
                     }
@@ -2226,24 +2255,33 @@
                         visRect.y = leadRect.y;
                         p.y = visRect.y + visRect.height - 1;
                         index = list.locationToIndex(p);
+                        if (index == -1) {
+                            return index;
+                        }
                         cellBounds = list.getCellBounds(index, index);
                         // go one cell up if last visible cell doesn't fit
                         // into adjasted visible rectangle
-                        if (cellBounds.y + cellBounds.height >
-                            visRect.y + visRect.height) {
+                        if (cellBounds != null &&
+                                cellBounds.y + cellBounds.height >
+                                visRect.y + visRect.height)
+                        {
                             p.y = cellBounds.y - 1;
                             index = list.locationToIndex(p);
+                            if (index == -1) {
+                                return index;
+                            }
                             cellBounds = list.getCellBounds(index, index);
                         }
                         // if index isn't greater then lead
                         // try to go to cell next after lead
-                        if (cellBounds.y <= leadRect.y) {
+                        if (cellBounds != null && cellBounds.y <= leadRect.y) {
                             p.y = leadRect.y + leadRect.height;
                             index = list.locationToIndex(p);
                         }
                     }
                 }
             }
+
             return index;
         }
 
@@ -2308,18 +2346,27 @@
                                 cellBounds.x + cellBounds.width - visRect.width);
                             int startIndex =
                                 list.locationToIndex(new Point(x, cellBounds.y));
+                            if (startIndex == -1) {
+                                return;
+                            }
                             Rectangle startRect = list.getCellBounds(startIndex,
                                                                      startIndex);
-                            if (startRect.x < x && startRect.x < cellBounds.x) {
+                            if (startRect != null &&
+                                startRect.x < x && startRect.x < cellBounds.x) {
                                 startRect.x += startRect.width;
                                 startIndex =
                                     list.locationToIndex(startRect.getLocation());
+                                if (startIndex == -1) {
+                                    return;
+                                }
                                 startRect = list.getCellBounds(startIndex,
                                                                startIndex);
                             }
                             cellBounds = startRect;
                         }
-                        cellBounds.width = visRect.width;
+                        if (cellBounds != null) {
+                            cellBounds.width = visRect.width;
+                        }
                     }
                     else {
                         if (direction > 0) {
@@ -2327,15 +2374,20 @@
                             int x = cellBounds.x + visRect.width;
                             int rightIndex =
                                 list.locationToIndex(new Point(x, cellBounds.y));
+                            if (rightIndex == -1) {
+                                return;
+                            }
                             Rectangle rightRect = list.getCellBounds(rightIndex,
                                                                      rightIndex);
-                            if (rightRect.x + rightRect.width > x &&
-                                rightRect.x > cellBounds.x) {
-                                rightRect.width = 0;
+                            if (rightRect != null) {
+                                if (rightRect.x + rightRect.width > x &&
+                                        rightRect.x > cellBounds.x) {
+                                    rightRect.width = 0;
+                                }
+                                cellBounds.x = Math.max(0,
+                                        rightRect.x + rightRect.width - visRect.width);
+                                cellBounds.width = visRect.width;
                             }
-                            cellBounds.x = Math.max(0,
-                                rightRect.x + rightRect.width - visRect.width);
-                            cellBounds.width = visRect.width;
                         }
                         else {
                             cellBounds.x += Math.max(0,
@@ -2357,24 +2409,35 @@
                             cellBounds.y + cellBounds.height - visRect.height);
                         int startIndex =
                             list.locationToIndex(new Point(cellBounds.x, y));
+                        if (startIndex == -1) {
+                            return;
+                        }
                         Rectangle startRect = list.getCellBounds(startIndex,
                                                                  startIndex);
-                        if (startRect.y < y && startRect.y < cellBounds.y) {
+                        if (startRect != null &&
+                                startRect.y < y && startRect.y < cellBounds.y) {
                             startRect.y += startRect.height;
                             startIndex =
                                 list.locationToIndex(startRect.getLocation());
+                            if (startIndex == -1) {
+                                return;
+                            }
                             startRect =
                                 list.getCellBounds(startIndex, startIndex);
                         }
                         cellBounds = startRect;
-                        cellBounds.height = visRect.height;
+                        if (cellBounds != null) {
+                            cellBounds.height = visRect.height;
+                        }
                     }
                     else {
                         // adjust height to fit into visible rectangle
                         cellBounds.height = Math.min(cellBounds.height, visRect.height);
                     }
                 }
-                list.scrollRectToVisible(cellBounds);
+                if (cellBounds != null) {
+                    list.scrollRectToVisible(cellBounds);
+                }
             }
         }
 
--- a/src/java.desktop/share/classes/javax/swing/plaf/multi/doc-files/multi_tsc.html	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/javax/swing/plaf/multi/doc-files/multi_tsc.html	Wed Dec 13 10:25:38 2017 -0800
@@ -1,16 +1,37 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
-<HTML>
-<HEAD>
-<TITLE>Using the Multiplexing Look and Feel</TITLE>
-</HEAD>
+<!doctype html>
+<html lang="en">
+<head>
+  <meta charset="utf-8"/>
+  <title>Using the Multiplexing Look and Feel</title>
+</head>
+<!--
+ Copyright (c) 1998, 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.  Oracle designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Oracle in the LICENSE file that accompanied this code.
 
-<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
+ 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).
 
-<b>
-<font size=+3>
-Using the Multiplexing Look and Feel
-</font>
-</b>
+ 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.
+-->
+
+<body>
+
+<h1>Using the Multiplexing Look and Feel</h1>
 
 <blockquote>
 <hr>
@@ -18,8 +39,8 @@
 <i>
 This document is based on an article
 originally published in
-<a href="http://www.oracle.com/technetwork/java/javase/tech/articles-jsp-139072.html" target="_top"><em>The Swing
-Connection</em></a>.
+<a href="http://www.oracle.com/technetwork/java/javase/tech/articles-jsp-139072.html"
+   target="_top"><em>The Swing Connection</em></a>.
 </i>
 </p>
 <hr>
@@ -31,10 +52,10 @@
 (called the <em>default</em> look and feel)
 with one or more <em>auxiliary</em> look and feels.
 For example, you could
-simultaneously provide text-to-speech and Braille outputs, 
-in addition to the ordinary visual output that a Swing-based 
+simultaneously provide text-to-speech and Braille outputs,
+in addition to the ordinary visual output that a Swing-based
 application generates,
-by adding 
+by adding
 two auxiliary look and feels (one for text-to-speech,
 the other for Braille)
 to the default look and feel.
@@ -62,169 +83,160 @@
 </ul>
 
 <p>
-Before reading further, you should be familiar 
+Before reading further, you should be familiar
 with the concept of pluggable look and feels.
 For basic information, see
-<a href="https://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html">How to Set the Look and Feel</a>,
-a section in 
-<em>The Java Tutorial</em>.
+<a href="https://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html">
+  How to Set the Look and Feel</a>, a section in <em>The Java Tutorial</em>.
 For architectural details, you can read
 <a
-href="http://www.oracle.com/technetwork/java/architecture-142923.html#pluggable">Pluggable look-and-feel architecture</a>, a section within
+href="http://www.oracle.com/technetwork/java/architecture-142923.html#pluggable">
+  Pluggable look-and-feel architecture</a>, a section within
 a <em>Swing Connection</em> article.
 </p>
 
-<p> 
-<a name="overview"></a>
-<hr width=100% align=LEFT size=2>
-<b>
-<font color="#000080" size="+2">Overview</font>
-</b>
-
+<p>
+<a id="overview"></a>
+<hr>
+  <h2>Overview</h2>
 
 <p>
 
-The classes in the 
+The classes in the
 <code>javax.swing.plaf.multi</code> package
-implement a 
+implement a
 <i>multiplexing look and feel</i>.
-A multiplexing look and feel transparently creates -- and 
+A multiplexing look and feel transparently creates -- and
 simultaneously supports -- UI objects from several different look and feels
 in response to a component requesting its UI object
 (with the <code>getUI</code> method).
 
 <p>
-Without a multiplexing look and feel, a 
-developer who wanted to enhance a particular look and feel would 
-need to extend the classes supporting that look and feel. For example, to 
-add text-to-speech support to the Java look and feel without using a multiplexing 
+Without a multiplexing look and feel, a
+developer who wanted to enhance a particular look and feel would
+need to extend the classes supporting that look and feel. For example, to
+add text-to-speech support to the Java look and feel without using a multiplexing
 look and feel, the developer would need to create a group of
 classes that extend those of
-the Java look and feel, and add text-to-speech support to the new classes. 
+the Java look and feel, and add text-to-speech support to the new classes.
 If the developer also wanted to add text-to-speech support to other look
-and feels, 
-such as Motif or Windows, the developers would need to create subclasses 
+and feels,
+such as Motif or Windows, the developers would need to create subclasses
 of those classes as well.
 </p>
 
 <p>
-This approach has at least two shortcomings: 
-<ul type="DISC">
-  <li>First, each subclass must use what is 
-      essentially a copy of the same code, potentially creating a difficult 
+This approach has at least two shortcomings:
+<ul>
+  <li>First, each subclass must use what is
+      essentially a copy of the same code, potentially creating a difficult
       support situation for the developer.<br></li>
-  <li>Second, and more significantly for the 
+  <li>Second, and more significantly for the
       end user, some application developers might force a
-      particular look and feel to be used. When this approach is used, 
+      particular look and feel to be used. When this approach is used,
       the end user can't even use the enhanced look and feel.</li>
 </ul>
 
 <p>
-A multiplexing look and feel 
-both these problems simultaneously because it allows multiple look 
+A multiplexing look and feel
+both these problems simultaneously because it allows multiple look
 and feels to be combined.
-The first problem (having to use what amounts to a second copy of the same 
-code) is solved because the developer can create a specialized look 
+The first problem (having to use what amounts to a second copy of the same
+code) is solved because the developer can create a specialized look
 and feel that can then be combined with other look and feels.
 </p>
 
 <p>
-The second problem (having to force the use of 
-a particular look and feel) is solved because a specialized look and feel 
-can be used with whatever default look and feel the 
+The second problem (having to force the use of
+a particular look and feel) is solved because a specialized look and feel
+can be used with whatever default look and feel the
 application may have locked in place.
 </p>
 
 <p>
-The default multiplexing look and feel implementation, 
+The default multiplexing look and feel implementation,
 represented by the <code>MultiLookAndFeel</code> class
 in the <code>javax.swing.plaf.multi</code> package,
-is called (unsurprisingly) 
+is called (unsurprisingly)
 the Multiplexing look and feel.
 
-<p> 
-<a name="howtouse"></a>
-<hr width=100% align=LEFT size=2>
-<b>
-<font color="#000080" size="+2">How to Use Auxiliary Look and Feels</font>
-</b>
-
+<p>
+<a id="howtouse"></a>
+<hr>
+  <h2>How to Use Auxiliary Look and Feels</h2>
 
 <p>
-It's easy to use auxiliary look and feels with Swing. To instruct 
-Swing to use the Multiplexing look and feel, all an application 
+It's easy to use auxiliary look and feels with Swing. To instruct
+Swing to use the Multiplexing look and feel, all an application
 has to do is modify the <code>$JDKHOME/conf/swing.properties</code>
 file to include a definition of the <code>swing.auxiliarylaf</code>
 property. Swing treats the <code>swing.auxiliarylaf</code>
 property as a comma-separated list of <code>LookAndFeel</code>
-subclasses that specify what auxiliary look and feels should be 
-used in addition to the default look and feel. If at least one valid 
+subclasses that specify what auxiliary look and feels should be
+used in addition to the default look and feel. If at least one valid
 <code>LookAndFeel</code>
 subclass is specified in the <code>swing.auxiliarylaf</code>
-property, Swing automatically uses the Multiplexing look and feel 
+property, Swing automatically uses the Multiplexing look and feel
 to load and support the default and auxiliary look and feels.
 </p>
 
 <p>
-For example, let's assume that an application 
-makes use of a look and feel that supports text-to-speech feedback, and also 
+For example, let's assume that an application
+makes use of a look and feel that supports text-to-speech feedback, and also
 uses an look and feel that adds support for a device
 that emits perfume.
 Let's assume that the text-to-speech
-look and feel is named <code>com.myco.TextTalkerLookAndFeel</code>, 
+look and feel is named <code>com.myco.TextTalkerLookAndFeel</code>,
 and the look and feel that adds support for perfume
 is named <code>com.smellco.OlfactoryLookAndFeel</code>.
 </p>
 
 <p>
-To tell Swing to use both these look and feels 
--- and to use a default look and feel at the same time -- your application 
+To tell Swing to use both these look and feels
+-- and to use a default look and feel at the same time -- your application
 could simply add the following line to the <code>$JDKHOME/conf/swing.properties</code> file:
 </p>
 
 <p>
-<code>&nbsp;&nbsp;&nbsp; 
+<code>&nbsp;&nbsp;&nbsp;
               swing.auxiliarylaf=com.myco.TextTalkerLookAndFeel,<br>
               &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; com.smellco.OlfactoryLookAndFeel</code>
 </p>
 
 <p>
-This statement tells Swing to obtain a component's UI from the Multiplexing 
-look and feel automatically, instead of obtaining it directly from 
-the default look and feel. The resulting multiplexing UI is a small 
-delegate that obtains and maintains UIs from the default and auxiliary 
-look and feels. As a result, when a method is invoked in a multiplexing 
-UI object, the multiplexing UI invokes the same method on each 
+This statement tells Swing to obtain a component's UI from the Multiplexing
+look and feel automatically, instead of obtaining it directly from
+the default look and feel. The resulting multiplexing UI is a small
+delegate that obtains and maintains UIs from the default and auxiliary
+look and feels. As a result, when a method is invoked in a multiplexing
+UI object, the multiplexing UI invokes the same method on each
 of the UIs obtained from the default and auxiliary look and feels.
 </p>
 
-<p> 
-<a name="howtowrite"></a>
-<hr width=100% align=LEFT size=2>
-<b>
-<font color="#000080" size="+2">Tips for Writing an Auxiliary Look and Feel</font>
-</b>
-
+<p>
+<a id="howtowrite"></a>
+<hr>
+  <h2>Tips for Writing an Auxiliary Look and Feel</h2>
 
 <p>
 An auxiliary look and feel is like any other look and feel,
-except that it doesn't have to provide the complete support 
-that a default look and feel must. For 
-example, an auxiliary look and feel that supports just text-to-speech feedback 
-doesn't need to provide any code for painting. 
+except that it doesn't have to provide the complete support
+that a default look and feel must. For
+example, an auxiliary look and feel that supports just text-to-speech feedback
+doesn't need to provide any code for painting.
 Also, it might not need to support all components --
 <code>JSeparator</code>s, for example, might be ignored.
 
 <p>
 Auxiliary look and feels tend to be simple,
-so developing one can be easier than developing a visual 
+so developing one can be easier than developing a visual
 look and feel.
-The developer can concentrate solely 
-on providing the specialized functionality. 
+The developer can concentrate solely
+on providing the specialized functionality.
 
 <p>
-Because the primary purpose of an auxiliary look and feel is to enhance the 
-default look and feel, auxiliary look and feels tend 
+Because the primary purpose of an auxiliary look and feel is to enhance the
+default look and feel, auxiliary look and feels tend
 be nonvisual. Since an auxiliary look and feel is a genuine
 look and feel, however, there is nothing to prevent it
 from rendering information on the display.
@@ -234,29 +246,26 @@
 Just like for any other look and feel, you
 implement an auxiliary look and feel
 by writing a subclass of <code>javax.swing.LookAndFeel</code>
-and creating subclasses of the 
+and creating subclasses of the
 <code><em>Foo</em>UI</code> classes defined in
 the <code>javax.swing.plaf</code> package.
 </p>
 
-<p> 
-<br>
-<a name="dosanddonts">
-<font color="#000080" size="+1"><b>Dos and Don'ts</b></font> 
+<a id="dosanddonts">
+  <h3>Dos and Don'ts</h3>
 </a>
-</p>
 
 <p>
-The following paragraphs provide some general recommendations for developing 
+The following paragraphs provide some general recommendations for developing
 auxiliary look and feels.
 </p>
 
 <p>
-<font color="#000080"><b>Use the <code>installUI</code> method
+<h4>Use the <code>installUI</code> method
 to perform all initialization,
 and the <code>uninstallUI</code> method
-to perform all cleanup.</b></font>
-</p>
+to perform all cleanup.</h4>
+
 <blockquote>
 The <code>installUI</code> and <code>uninstallUI</code>
 methods are invoked when a component's look and feel is set.
@@ -265,142 +274,134 @@
 Similarly, the <code>uninstallUI</code> method
 lets the previous UI object remove its listeners.
 </blockquote>
-            <p> <font color="#000080"><b>Don't extend 
-              visual look and feels.</b></font></p>
+            <h4><b>Don't extend visual look and feels.</b></h4>
 <blockquote>
-               We recommended that you <i>don't</i> implement 
-                UI classes of an auxiliary look and feel as subclasses of the 
-                UI classes of a visual look and feel. Why not? Because they might 
-                accidentally inherit code that installs listeners on a component 
-                object or renders the component on the display. As a result, 
-                your auxiliary look and feel would compete with the default look 
+               We recommended that you <i>don't</i> implement
+                UI classes of an auxiliary look and feel as subclasses of the
+                UI classes of a visual look and feel. Why not? Because they might
+                accidentally inherit code that installs listeners on a component
+                object or renders the component on the display. As a result,
+                your auxiliary look and feel would compete with the default look
                 and feel rather than cooperating with it.<br>
                 <br>
-                Instead, we recommend that the UI classes of an auxiliary look 
-                and feel directly extend the abstract UI classes in the <code>javax.swing.plaf</code> 
-                package. By using this strategy, the developer of an auxiliary 
+                Instead, we recommend that the UI classes of an auxiliary look
+                and feel directly extend the abstract UI classes in the <code>javax.swing.plaf</code>
+                package. By using this strategy, the developer of an auxiliary
                 look and feel can avoid competing with the default look and feel.
 </blockquote>
-            <p> <font color="#000080"><b>Override all UI-specific methods
-	    your UI classes inherit.</b></font>
-	    </p>
+            <h4><b>Override all UI-specific methods your UI classes inherit.</b></h4>
+
 <blockquote>
-               We recommend that each UI class of 
-                an auxiliary look and feel override the methods 
+               We recommend that each UI class of
+                an auxiliary look and feel override the methods
 		defined in the <code>javax.swing.plaf</code>
                 UI classes it descends from
-		The reasons for this recommendation are similar 
+		The reasons for this recommendation are similar
                 to those for not extending a visual look and feel.
                 For example, the <code>ComponentUI</code>
                 class, from which all UI classes descend,
 		provides a default implementation for the <code>update</code>
                 method. This default implementation paints on the display
-		if the 
-                component is opaque. If a UI class from a non-visual auxiliary 
-                look and feel does not override this method, all 
+		if the
+                component is opaque. If a UI class from a non-visual auxiliary
+                look and feel does not override this method, all
                 opaque components appear as blank areas on the screen!
 </blockquote>
-            <p> 
+
+<a id="uidefaults"></a>
+  <h3>Extending UIDefaults</h3>
 
-<br>
-<a name="uidefaults">
-<font color="#000080" size="+1"><b>Extending UIDefaults</b></font> 
-</a>
-
-            <p>In many cases, you 
-              might want an auxiliary look and feel to be &quot;incomplete.&quot; That 
-              is, you might not need to support the complete set 
+            <p>In many cases, you
+              might want an auxiliary look and feel to be &quot;incomplete.&quot; That
+              is, you might not need to support the complete set
               of components.
-            For example, an auxiliary look and feel might choose 
-	    to provide a <code>ButtonUI</code> subclass but no 
+            For example, an auxiliary look and feel might choose
+	    to provide a <code>ButtonUI</code> subclass but no
               <code>LabelUI</code> subclass.
-	     This 
-              option is allowed, and the multiplexing look and feel gracefully 
+	     This
+              option is allowed, and the multiplexing look and feel gracefully
               handles such situations.</p>
-            <p>By default, however, Swing issues an error message when it asks 
-              a look and feel for a UI object and the look and feel does not 
-              support that UI. This message can be annoying, especially to auxiliary 
-              look-and-feel developers who don't want to support a particular 
+            <p>By default, however, Swing issues an error message when it asks
+              a look and feel for a UI object and the look and feel does not
+              support that UI. This message can be annoying, especially to auxiliary
+              look-and-feel developers who don't want to support a particular
               component.</p>
-            <p>Fortunately, you can prevent this error 
-              message by creating a subclass of the <code>UIDefaults</code> 
-              class and returning an instance of it from the 
+            <p>Fortunately, you can prevent this error
+              message by creating a subclass of the <code>UIDefaults</code>
+              class and returning an instance of it from the
 	      <code>getDefaults</code> method
 	      of your <code>LookAndFeel</code> class.
 	      For example:
 	      </p>
-            <p><code>public class MyAuxLookAndFeel 
+            <p><code>public class MyAuxLookAndFeel
               extends LookAndFeel {<br>
-                  ...<br>
-                  public UIDefaults getDefaults() {<br>
-                      <b>UIDefaults table = <br>
-              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
+                  ...<br>
+                  public UIDefaults getDefaults() {<br>
+                      <b>UIDefaults table = <br>
+              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
               new MyAuxUIDefaults();<br>
-              </b>        Object[] uiDefaults = {<br>
-                        &quot;ButtonUI&quot;, &quot;MyAuxButtonUI&quot;,<br>
-                        ...<br>
-                      }<br>
-                      table.putDefaults(uiDefaults);<br>
-                      return table;<br>
-                  }<br>
+              </b>        Object[] uiDefaults = {<br>
+                        &quot;ButtonUI&quot;, &quot;MyAuxButtonUI&quot;,<br>
+                        ...<br>
+                      }<br>
+                      table.putDefaults(uiDefaults);<br>
+                      return table;<br>
+                  }<br>
               }<br>
               <br>
               <b>class MyAuxUIDefaults extends UIDefaults {<br>
-                  protected void getUIError(String msg) {<br>
-                      //System.err.println<br>
-              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp;&nbsp; (&quot;An 
+                  protected void getUIError(String msg) {<br>
+                      //System.err.println<br>
+              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp;&nbsp; (&quot;An
               annoying message!&quot;);<br>
-                  }<br>
+                  }<br>
               }</b></code></p>
 
 <p>
-In the preceding example, an auxiliary look and feel named <code>MyAux</code> 
-              creates a <code>UIDefaults</code> subclass 
-              that overrides the <code>getUIError</code> 
-              method. The <code>getUIError</code> 
-              method is the method that is invoked when Swing cannot find a UI 
-              object in a look and feel. By merely doing nothing in this method, 
+In the preceding example, an auxiliary look and feel named <code>MyAux</code>
+              creates a <code>UIDefaults</code> subclass
+              that overrides the <code>getUIError</code>
+              method. The <code>getUIError</code>
+              method is the method that is invoked when Swing cannot find a UI
+              object in a look and feel. By merely doing nothing in this method,
               you can avoid the error message.</p>
-            <p> 
+            <p>
 
-<br>
-<a name="defaultui">
-<b><font color="#000080" size="+1">Examining Other UI Objects</font></b> 
-</a>
+<a id="defaultui"></a>
+<h3>Examining Other UI Objects</h3>
 
-            <p>In 
-              rare instances, a UI object from an auxiliary look and feel 
-              may be interested in the default UI object used by the component. In 
-              these cases, the UI object from auxiliary look and feel can obtain 
+            <p>In
+              rare instances, a UI object from an auxiliary look and feel
+              may be interested in the default UI object used by the component. In
+              these cases, the UI object from auxiliary look and feel can obtain
               the UI from a component by calling its <code>getUI</code>
-              method. The returned UI is an instance of one of the multiplexing 
-              look and feel UI classes (for example, <code>MultiButtonUI</code>). 
-              The UI object from the auxiliary look and feel can call the <code>getUIs</code> 
-              method of the returned object to obtain an array containing a complete list 
-              of all UI objects handled by the multiplexing UI. The first element 
+              method. The returned UI is an instance of one of the multiplexing
+              look and feel UI classes (for example, <code>MultiButtonUI</code>).
+              The UI object from the auxiliary look and feel can call the <code>getUIs</code>
+              method of the returned object to obtain an array containing a complete list
+              of all UI objects handled by the multiplexing UI. The first element
               is guaranteed to be the UI created from the default look and feel.
 	      </p>
 
-<p> 
-<a name="implementation"></a>
-<hr width=100% align=LEFT size=2>
-<font color="#000080" size="+2"><b>How the Multiplexing Look and Feel
-Is Implemented</b></font> 
+<p>
+<a id="implementation"></a>
+<hr>
+<h2>How the Multiplexing Look and Feel Is Implemented</h2>
 
 <p>
 The Multiplexing look and feel
 (represented by
 <code>javax.swing.plaf.multi.MultiLookAndFeel</code>)
-is meant to be transparent to 
-all developers and users. It should &quot;just work&quot; -- and 
-              it is used only when the user tells Swing to use an auxiliary look 
+is meant to be transparent to
+all developers and users. It should &quot;just work&quot; -- and
+              it is used only when the user tells Swing to use an auxiliary look
               and feel.</p>
 
             <p>
-              When the Multiplexing look and 
-              feel is in use, the type of the UI object 
-	      associated with each component 
-	      depends on whether 
+              When the Multiplexing look and
+              feel is in use, the type of the UI object
+	      associated with each component
+	      depends on whether
 	      any of the auxiliary look and feels currently in use
 	      support the component.
 	      If so, the component's UI object is
@@ -408,81 +409,80 @@
 	      If only the default look and feel supports the component,
 	      then the component gets
               a UI object from the default look and feel,
-	      just as if no auxiliary look and feels were installed. 
+	      just as if no auxiliary look and feels were installed.
 
 	      <p>
 	      A multiplexing UI object
               obtains and maintains UI objects
 	      from the default and auxiliary look
 	      and feels,
-              referring to these UIs in the following manner: 
+              referring to these UIs in the following manner:
 
-<ul type="DISC">
-              <li> The UI object from the default look 
-                and feel is always the first to be created. After that, a UI object 
-                is created from each auxiliary look and feel in the order 
-                they are specified in the <code>swing.auxiliarylaf</code> 
+<ul>
+              <li> The UI object from the default look
+                and feel is always the first to be created. After that, a UI object
+                is created from each auxiliary look and feel in the order
+                they are specified in the <code>swing.auxiliarylaf</code>
                 property.<br><br></li>
 
-              <li> When a method that requests information 
-                from a UI object is invoked, the multiplexing UI object 
-		invokes the method on all the UI objects, but returns 
+              <li> When a method that requests information
+                from a UI object is invoked, the multiplexing UI object
+		invokes the method on all the UI objects, but returns
                 only the results from the UI for the default look and feel.
-                For example, when the <code>getPreferredSize</code> 
-                method is invoked on a multiplexing UI, the UI returns only the 
-                results of invoking <code>getPreferredSize</code> 
+                For example, when the <code>getPreferredSize</code>
+                method is invoked on a multiplexing UI, the UI returns only the
+                results of invoking <code>getPreferredSize</code>
                 on the UI obtained from the default look and feel.
 		The <code>getPreferredSize</code> method
 		is also invoked on the UI object for each auxiliary look and feel,
 		but the return values are ignored.
                 <br><br></li>
 
-              <li> When a method that does not request information 
-                from the UI object is invoked, the multiplexing UI object 
+              <li> When a method that does not request information
+                from the UI object is invoked, the multiplexing UI object
                 invokes that method on all UIs --
 		on the UI object obtained from the default look
 		and feel
                 and on all the UIs obtained from the auxiliary look and feels,
-		as well. 
-                For example, invoking the <code>installUI</code> 
-                method on a multiplexing UI causes the multiplexing UI to invoke 
-                <code>installUI</code> 
-                on the UI obtained from the default look and feel and the UIs obtained from 
+		as well.
+                For example, invoking the <code>installUI</code>
+                method on a multiplexing UI causes the multiplexing UI to invoke
+                <code>installUI</code>
+                on the UI obtained from the default look and feel and the UIs obtained from
                 the auxiliary factories.</li>
             </ul>
-            <p> In all cases, the UI object obtained from 
-              the default look and feel is acted upon first, and then the auxiliary 
-              look and feels are acted upon in the order they are specified in 
-              the <code>swing.auxiliarylaf</code> 
+            <p> In all cases, the UI object obtained from
+              the default look and feel is acted upon first, and then the auxiliary
+              look and feels are acted upon in the order they are specified in
+              the <code>swing.auxiliarylaf</code>
               property.
 </p>
 
-<p> 
+<p>
 
-<a name="custom"></a>
-<hr width=100% align=LEFT size=2>
-<font color="#000080" size="+2"><b>How to Provide a Custom Multiplexing Look
-and Feel</b></font> 
+<a id="custom"></a>
+<hr>
+<h2>How to Provide a Custom Multiplexing Look and Feel</h2>
 
-            <p>While 
-              we hope the behavior of the Multiplexing look and feel is 
-              flexible enough not to require an alternative multiplexing look 
-              and feel, Swing allows the user to specify another multiplexing look 
+            <p>While
+              we hope the behavior of the Multiplexing look and feel is
+              flexible enough not to require an alternative multiplexing look
+              and feel, Swing allows the user to specify another multiplexing look
               and feel to use.
 </p>
 
-            <p> To do that, all the user has to do is modify 
-              the <code>$JDKHOME/conf/swing.properties</code> 
-              file to include a definition of the <code>swing.plaf.multiplexinglaf</code> 
-              property. Swing then treats the <code>swing.plaf.multiplexinglaf</code> 
-              property as a <code>LookAndFeel</code> 
+            <p> To do that, all the user has to do is modify
+              the <code>$JDKHOME/conf/swing.properties</code>
+              file to include a definition of the <code>swing.plaf.multiplexinglaf</code>
+              property. Swing then treats the <code>swing.plaf.multiplexinglaf</code>
+              property as a <code>LookAndFeel</code>
               subclass that supports multiplexing.
 </p>
-            <p> For example, if a user has a multiplexing 
-              look and feel represented by <code>com.myco.SuperMultiLookAndFeel</code> 
-              that is a better match for their needs than the Multiplexing 
-              look and feel 
-	      (<code>javax.swing.plaf.multi.MultiLookAndFeel</code>), 
+            <p> For example, if a user has a multiplexing
+              look and feel represented by <code>com.myco.SuperMultiLookAndFeel</code>
+              that is a better match for their needs than the Multiplexing
+              look and feel
+	      (<code>javax.swing.plaf.multi.MultiLookAndFeel</code>),
               the user could include the following line in <code>$JDKHOME/conf/swing.properties</code>:
 </p>
 
@@ -491,12 +491,12 @@
 </p>
 
 <p>
-This statement instructs Swing to use <code>com.myco.SuperMultiLookAndFeel</code> 
-instead of <code>javax.swing.plaf.multi.MultiLookAndFeel</code>. But 
-if you use this kind of statement, be careful, because the suppliers 
-of auxiliary look and feels will most likely have developed and 
+This statement instructs Swing to use <code>com.myco.SuperMultiLookAndFeel</code>
+instead of <code>javax.swing.plaf.multi.MultiLookAndFeel</code>. But
+if you use this kind of statement, be careful, because the suppliers
+of auxiliary look and feels will most likely have developed and
 tested against our Multiplexing look and feel.
 </p>
 
-</BODY>
-</HTML>
+</body>
+</html>
--- a/src/java.desktop/share/classes/javax/swing/plaf/nimbus/doc-files/properties.html	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/javax/swing/plaf/nimbus/doc-files/properties.html	Wed Dec 13 10:25:38 2017 -0800
@@ -1,8 +1,34 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
+<!doctype html>
+<html lang="en">
 <head>
-<title></title>
+  <meta charset="utf-8"/>
+  <title>Nimbus colors</title>
 </head>
+<!--
+ Copyright (c) 2005, 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.  Oracle designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Oracle in the LICENSE file that accompanied this code.
+
+ This code is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ or visit www.oracle.com if you need additional information or have any
+ questions.
+-->
+
 <body>
 <h1 id="primaryColors">Primary Colors</h1>
 <table summary="Nimbus primary colors">
--- a/src/java.desktop/share/classes/javax/swing/plaf/synth/doc-files/componentProperties.html	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/javax/swing/plaf/synth/doc-files/componentProperties.html	Wed Dec 13 10:25:38 2017 -0800
@@ -1,8 +1,11 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
+<!doctype html>
+<html lang="en">
 <head>
+  <meta charset="utf-8"/>
+  <title>Component Specific Properties</title>
+</head>
 <!--
-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
@@ -24,16 +27,17 @@
 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.
+-->
 
--->
-</head>
 <body bgcolor="white">
 <h3>Component Specific Properties</h3>
 <p> The look, and to some degree the feel of Synth
-can be customized by way of component specific properties.
-These properties are accessed from <a
-				    href="../SynthStyle.html">SynthStyle#get</a>. Refer to <a href="synthFileFormat.html#e.property">synth file format</a> for examples of how to specify these properties in a synth configuration file.</p>
-    <p>
+  can be customized by way of component specific properties.
+  These properties are accessed from <a
+      href="../SynthStyle.html">SynthStyle#get</a>. Refer to <a
+      href="synthFileFormat.html#e.property">synth file format</a> for examples
+  of how to specify these properties in a synth configuration file.</p>
+<p>
       This file specifies the expected class type each of the values
       are to take. The behavior of supplying the wrong type is
       unspecified: typically a <code>ClassCastException</code> is
@@ -66,7 +70,7 @@
   </tbody>
 </table>
 <br>
-<h4><a name="JButton">JButton</a></h4>
+<h4><a id="JButton">JButton</a></h4>
 <p> JButton paints text using the TEXT_FOREGROUND ColorType. In addition
 to the <a href="#buttonProperties">Button 	properties</a>, JButton
 supports the following property: </p>
@@ -89,7 +93,7 @@
   </tbody>
 </table>
 <br>
-<h4><a name="JCheckBox">JCheckBox</a></h4>
+<h4><a id="JCheckBox">JCheckBox</a></h4>
 <p> JCheckBox paints text using the TEXT_FOREGROUND ColorType. In
 addition to the <a href="#buttonProperties">Button 	properties</a>,
 JCheckBox supports the following property: </p>
@@ -111,7 +115,7 @@
   </tbody>
 </table>
 <br>
-<h4><a name="JComboBox">JComboBox</a></h4>
+<h4><a id="JComboBox">JComboBox</a></h4>
 <p> JComboBox is a composite component that consists of the following
 child Components: </p>
 <table border="1" summary="JComboBox child components">
@@ -144,7 +148,7 @@
     <tr>
       <td>ComboBox.renderer</td>
       <td>Component 	 </td>
-      <td>The renderer used for the JComboBox. This is ONLY set if 	
+      <td>The renderer used for the JComboBox. This is ONLY set if
 the renderer is a UIResource. 	</td>
     </tr>
     <tr>
@@ -279,7 +283,7 @@
       <td style="vertical-align: top;">Icon used by the button that creates a new
           folder.
       </td>
-    </tr>          
+    </tr>
     <tr>
       <td style="vertical-align: top;">FileChooser.upFolderIcon<br>
       </td>
@@ -301,7 +305,7 @@
       <td style="vertical-align: top;">Icon used by the button that navigates to the
           current user's home directory.
       </td>
-    </tr>          
+    </tr>
     <tr>
       <td style="vertical-align: top;">FileChooser.detailsViewIcon<br>
       </td>
@@ -312,7 +316,7 @@
       <td style="vertical-align: top;">Icon used by the button that toggles the
           detailed files list view.
       </td>
-    </tr>             
+    </tr>
     <tr>
       <td style="vertical-align: top;">FileChooser.listViewIcon<br>
       </td>
@@ -324,7 +328,7 @@
           regular files list view, showing only an icon and the name of each
           file and directory.
       </td>
-    </tr>          
+    </tr>
     <tr>
       <td style="vertical-align: top;">FileChooser.viewMenuIcon<br>
       </td>
@@ -339,7 +343,7 @@
   </tbody>
 </table>
 <br>
-<h4><a name="JInternalFrame"></a>JInternalFrame</h4>
+<h4><a id="JInternalFrame"></a>JInternalFrame</h4>
 <h5>JInternalFrame Specific Properties</h5>
 <table cellpadding="2" cellspacing="2" border="1" summary="JInternalFrame specific properties"
  style="text-align: left; width: 100%;">
@@ -369,7 +373,7 @@
   </tbody>
 </table>
 <br>
-<h4><a name="JInternalFrameTitlePane"></a>JInternalFrameTitlePane</h4>
+<h4><a id="JInternalFrameTitlePane"></a>JInternalFrameTitlePane</h4>
 <p>JInternalFrameTitlePane is the control bar located at the top of the
 internal frame similar to that found in a frame.<br>
 </p>
@@ -469,7 +473,7 @@
   </tbody>
 </table>
 <br>
-<h4><a name="JList">JList</a></h4>
+<h4><a id="JList">JList</a></h4>
 <p> JList's sets the name of the renderer to List.renderer.       JList
 supports the following properties: </p>
 <h5>JList Specific Properties</h5>
@@ -486,7 +490,7 @@
       <td>Boolean</td>
       <td>true 	 </td>
       <td>If true the renderers state is not updated, and the 	    text
-colors come from JList's getSelectionBackground and 	
+colors come from JList's getSelectionBackground and
 getSelectionForeground methods. If false, the renderer's 	    state is
 updated and the colors will instead come from the 	    Style. 	</td>
     </tr>
@@ -508,7 +512,7 @@
   </tbody>
 </table>
 <br>
-<h4><a name="menuProperties">Menu Properties</a></h4>
+<h4><a id="menuProperties">Menu Properties</a></h4>
 <p> The Menu classes (JCheckBoxMenuItem, JMenu, JMenuItem, and
 JRadioButtonMenuItem) all support the same set of properties and behave
 similarly.       Each component consists of two Regions: the region
@@ -536,7 +540,7 @@
       <td>prefix.arrowIcon</td>
       <td>Icon</td>
       <td>null 	 </td>
-      <td>Icon drawn to the right of the text (or left when the 	
+      <td>Icon drawn to the right of the text (or left when the
 ComponentOrientation is right to left) of the text. This 	    is
 typically only defined for JMenu. 	</td>
     </tr>
@@ -544,7 +548,7 @@
       <td>prefix.checkIcon</td>
       <td>Icon</td>
       <td>null 	 </td>
-      <td>Icon drawn to the left of the text (or right when the 	
+      <td>Icon drawn to the left of the text (or right when the
 ComponentOrientation is right to left) of the text. This 	    is
 typically only defined for JCheckBoxMenuItem and 	 JRadioButtonMenuItem
 to provide the check or radio button. 	</td>
@@ -561,7 +565,7 @@
       <td>prefix.textIconGap</td>
       <td>Integer</td>
       <td>4 	 </td>
-      <td>Padding between the icon and text. Refer to the javadoc for 
+      <td>Padding between the icon and text. Refer to the javadoc for
 <code>javax.swing.AbstractButton#setIconTextGap(int)</code> for details of how
 this is used. </td>
     </tr>
@@ -593,7 +597,7 @@
   </tbody>
 </table>
 <br>
-<h4><a name="JOptionPane">JOptionPane</a></h4>
+<h4><a id="JOptionPane">JOptionPane</a></h4>
 <p> JOptionPane is a composite component and may consist of numerous child
 components, they are: OptionPane.button, OptionPane.label,
 OptionPane.comboBox, OptionPane.scrollPane, OptionPane.list,
@@ -623,7 +627,7 @@
       <td>OptionPane.buttonOrientation</td>
       <td>Integer 	 </td>
       <td>SwingConstants.CENTER 	 </td>
-      <td>How the buttons should be layed out, one of 	
+      <td>How the buttons should be layed out, one of
 SwingConstants.LEFT, SwingConstants.RIGHT or 	    SwingConstants.CENTER
 (this will be flipped when in a 	    right to left locale). 	</td>
     </tr>
@@ -709,7 +713,7 @@
   </tbody>
 </table>
 <br>
-<h4><a name="JProgressBar"></a>JProgressBar<br>
+<h4><a id="JProgressBar"></a>JProgressBar<br>
 </h4>
 <h5>JProgressBar Specific Properties<br>
 </h5>
@@ -749,7 +753,7 @@
     </tr>
   </tbody>
 </table>
-<h4><a name="JRadioButton">JRadioButton</a></h4>
+<h4><a id="JRadioButton">JRadioButton</a></h4>
 <p> JRadioButton paints text using the TEXT_FOREGROUND ColorType. In
 addition to the <a href="#buttonProperties">Button 	properties</a>,
 JRadioButton supports the following property: </p>
@@ -771,7 +775,7 @@
   </tbody>
 </table>
 <br>
-<h4><a name="JScrollBar">JScrollBar</a></h4>
+<h4><a id="JScrollBar">JScrollBar</a></h4>
 <p> JScrollBar is a composite component that consists of the following
 child Components: </p>
 <table border="1" summary="JScrollBar child components">
@@ -841,7 +845,7 @@
   </tbody>
 </table>
 <br>
-<h4><a name="Separator">Separators</a></h4>
+<h4><a id="Separator">Separators</a></h4>
 <p> All of the separator classes, JSeparator, JPopupMenu.Separator and
 JToolBar.Separator use the same property: </p>
 <table border="1" summary="Separator classes common properties">
@@ -856,7 +860,7 @@
       <td>Separator.thickness</td>
       <td>Integer</td>
       <td>2 	 </td>
-      <td>Preferred width, for vertically aligned separators, or 	
+      <td>Preferred width, for vertically aligned separators, or
 preferred height for horizontally aligned separators. The 	 resulting
 preferred size will include the Insets. </td>
     </tr>
@@ -875,20 +879,21 @@
       <td>ToolBar.separatorSize</td>
       <td>Dimension</td>
       <td>null 	 </td>
-      <td>The value of this is passed to the <code>javax.swing.JToolBar$Separator#setSeparatorSize(java.awt.Dimension)</code>
-method. If unspecified <code>setSeparatorSize</code> is 	    not
-invoked. </td>
-    </tr>
+    <td>The value of this is passed to the
+      <code>javax.swing.JToolBar$Separator#setSeparatorSize(java.awt.Dimension)</code>
+      method. If unspecified <code>setSeparatorSize</code> is not invoked.
+    </td>
+  </tr>
   </tbody>
 </table>
 <br>
-<h4><a name="JScrollPane">JScrollPane</a></h4>
-<p> 
+<h4><a id="JScrollPane">JScrollPane</a></h4>
+<p>
       JScrollPane is unique in that it provides a method for setting
       the Border around the JViewport with JViewport throwing an
       IllegalArgumentException from <code>setBorder</code>. To
       accommodate this a special border is installed on the
-      <code>JScrollPane</code> that uses the 
+      <code>JScrollPane</code> that uses the
       insets from the key
       <code>ScrollPane.viewportBorderInsets</code>. The
       <code>SynthPainter</code> method
@@ -913,7 +918,7 @@
   </tbody>
 </table>
 <br>
-<h4><a name="JSplitPane">JSplitPane</a></h4>
+<h4><a id="JSplitPane">JSplitPane</a></h4>
 <p> JSplitPane is a composite component that will contain a divider and
 potentially two buttons, if setOneTouchExpandable(true) has been
 invoked. The two buttons will be named:
@@ -950,7 +955,7 @@
       <td>SplitPane.oneTouchExpandable</td>
       <td>Boolean</td>
       <td>null 	 </td>
-      <td>If non null, the value of this is passed to 	
+      <td>If non null, the value of this is passed to
 setOneTouchExpandable. 	</td>
     </tr>
     <tr>
@@ -962,7 +967,7 @@
   </tbody>
 </table>
 <br>
-<h4><a name="JSlider"></a>JSlider</h4>
+<h4><a id="JSlider"></a>JSlider</h4>
 <h5>JSlider Specific Properties</h5>
 <table cellpadding="2" cellspacing="2" border="1" summary="JSlider specific properties"
  style="text-align: left; width: 100%;">
@@ -1022,7 +1027,7 @@
   </tbody>
 </table>
 <br>
-<h4><a name="JTabbedPane"></a>JTabbedPane</h4>
+<h4><a id="JTabbedPane"></a>JTabbedPane</h4>
 <h5>JTabbedPane Specific Properties</h5>
 <table cellpadding="2" cellspacing="2" border="1" summary="JTabbedPane specific properties"
  style="text-align: left; width: 100%;">
@@ -1084,8 +1089,8 @@
   </tbody>
 </table>
 <br>
-<h4><a name="JTable">JTable</a></h4>
-<p> JTable sets the name of the renderer to Table.cellRenderer.      
+<h4><a id="JTable">JTable</a></h4>
+<p> JTable sets the name of the renderer to Table.cellRenderer.
 JTable supports the following properties: </p>
 <h5>JTable Specific Properties</h5>
 <table border="1" summary="JTable specific properties">
@@ -1108,7 +1113,7 @@
       <td>Boolean</td>
       <td>true 	 </td>
       <td>If true the renderers state is not updated, and the 	    text
-colors come from JTable's getSelectionBackground and 	   
+colors come from JTable's getSelectionBackground and
 getSelectionForeground methods. If false, the renderer's 	    state is
 updated and the colors will instead come from the 	    Style. 	</td>
     </tr>
@@ -1116,7 +1121,7 @@
       <td>Table.rendererUseUIBorder</td>
       <td>Boolean</td>
       <td>true 	 </td>
-      <td>If true setBorder on the renderer will succeed 	   
+      <td>If true setBorder on the renderer will succeed
 regardless of the border passed in, otherwise setBorder on 	    the
 renderer will only succeed if it is a Synth Border. 	</td>
     </tr>
@@ -1129,7 +1134,7 @@
   </tbody>
 </table>
 <br>
-<h4><a name="JTree">JTree</a></h4>
+<h4><a id="JTree">JTree</a></h4>
 <p> JTree sets the name of the renderer to Tree.renderer, the name of
 the editor is Tree.cellEditor.</p>
 <h5>JTree Specific Properties</h5>
@@ -1151,7 +1156,7 @@
       <td>Tree.drawHorizontalLines</td>
       <td>Boolean</td>
       <td>true 	 </td>
-      <td>If true nodes have a horizontal connecting them to the 	
+      <td>If true nodes have a horizontal connecting them to the
 leading edge of their parent. 	</td>
     </tr>
     <tr>
@@ -1198,7 +1203,7 @@
       <td>Tree.scrollsOnExpand</td>
       <td>Boolean</td>
       <td>true 	 </td>
-      <td>Whether or not the JTree should scroll when a node is 	
+      <td>Whether or not the JTree should scroll when a node is
 expanded. </td>
     </tr>
     <tr>
@@ -1212,7 +1217,7 @@
     </tr>
   </tbody>
 </table>
-<h4><a name="JToggleButton">JToggleButton</a></h4>
+<h4><a id="JToggleButton">JToggleButton</a></h4>
 <p> JToggleButton paints text using the TEXT_FOREGROUND ColorType. In
 addition to the <a href="#buttonProperties">Button 	properties</a>,
 JToggleButton supports the following property: </p>
@@ -1234,7 +1239,7 @@
   </tbody>
 </table>
 <br>
-<h4><a name="buttonProperties">Button Properties</a></h4>
+<h4><a id="buttonProperties">Button Properties</a></h4>
 <p> Each of the Button classes (JButton, JCheckBox, JRadioButton,
 JToggleButton and SynthArrowButton) support a similar set of properties.
 These properties are: </p>
@@ -1250,23 +1255,29 @@
       <td>prefix.contentAreaFilled</td>
       <td>Integer</td>
       <td>true 	 </td>
-      <td>Refer to the javadoc of <code>javax.swing.AbstractButton#contentAreaFilled(boolean)</code> 	    for details
-of how this is used. It is up to the Painter 	    to properly honor this
-property. 	</td>
-    </tr>
+    <td>Refer to the javadoc of
+      <code>javax.swing.AbstractButton#contentAreaFilled(boolean)</code>
+      for details of how this is used. It is up to the Painter to properly honor
+      this property.
+    </td>
+  </tr>
     <tr>
       <td>prefix.iconTextGap</td>
       <td>Integer</td>
-      <td>If 	    unspecified, JButton.setIconTextGap is not invoked. 	</td>
-      <td>Padding between the icon and text. Refer to the javadoc of <code>javax.swing.AbstractButton#setIconTextGap(int)</code> 	    for details of how
-this is used. 	</td>
+      <td>If unspecified, JButton.setIconTextGap is not invoked.</td>
+      <td>Padding between the icon and text. Refer to the javadoc of
+        <code>javax.swing.AbstractButton#setIconTextGap(int)</code>
+        for details of how this is used.
+      </td>
     </tr>
     <tr>
       <td>prefix.margin</td>
       <td>Insets</td>
       <td>Empty Insets (0, 0, 0, 0) 	 </td>
-      <td>Margin for the JButton. Refer to the javadoc of <code>javax.swing.AbstractButton#setMargin(java.awt.Insets)</code> 	    for details
-of how the margin is used. 	</td>
+      <td>Margin for the JButton. Refer to the javadoc of
+        <code>javax.swing.AbstractButton#setMargin(java.awt.Insets)</code> for
+        details of how the margin is used.
+      </td>
     </tr>
     <tr>
       <td>prefix.textShiftOffset</td>
@@ -1281,7 +1292,7 @@
 <p> <code>Prefix</code> is one of: Button, CheckBox, RadioButton or
 JToggleButton.<br>
 </p>
-<h4><a name="textProperties"></a>Text Properties<br>
+<h4><a id="textProperties"></a>Text Properties<br>
 </h4>
 <table cellpadding="2" cellspacing="2" border="1" summary="Text properties"
  style="text-align: left; width: 100%;">
--- a/src/java.desktop/share/classes/javax/swing/plaf/synth/doc-files/synthFileFormat.html	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/javax/swing/plaf/synth/doc-files/synthFileFormat.html	Wed Dec 13 10:25:38 2017 -0800
@@ -1,7 +1,33 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-  <head>
-    <title>Synth File Format</title>
+<!doctype html>
+<html lang="en">
+<head>
+  <meta charset="utf-8"/>
+  <title>Synth File Format</title>
+<!--
+ Copyright (c) 1998, 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.  Oracle designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Oracle in the LICENSE file that accompanied this code.
+
+ This code is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ or visit www.oracle.com if you need additional information or have any
+ questions.
+-->
+
   <style type="text/css">
 div.dtd-fragment {
     width: 100%;
@@ -19,14 +45,17 @@
   </head>
 
   <body>
-    <h2><a name="file">File Format</a></h2>
+    <h2><a id="file">File Format</a></h2>
     <p>
       Synth's file format (<a href="synth.dtd">dtd</a>)
       allows for specifying all the pieces
       necessary to create your own look and feel. A synth file is
-      loaded by way of the <A HREF="../../../../../javax/swing/plaf/synth/SynthLookAndFeel.html#load(java.io.InputStream,%20java.lang.Class)">SynthLookAndFeel.load(InputStream, Class)</a> or
-      <a href="../../../../../javax/swing/plaf/synth/SynthLookAndFeel.html#load(java.net.URL)">SynthLookAndFeel.load(URL)</a> methods.
-      The following example uses the <code>load</code> method to configure 
+      loaded by way of the <A
+        HREF="../../../../../javax/swing/plaf/synth/SynthLookAndFeel.html#load(java.io.InputStream,%20java.lang.Class)">
+      SynthLookAndFeel.load(InputStream, Class)</a> or
+      <a href="../../../../../javax/swing/plaf/synth/SynthLookAndFeel.html#load(java.net.URL)">
+        SynthLookAndFeel.load(URL)</a> methods.
+      The following example uses the <code>load</code> method to configure
       a <code>SynthLookAndFeel</code> and sets it as the current look
       and feel:
     </p>
@@ -51,8 +80,10 @@
       </pre>
     </div>
     <p>
-      The method <a href="../../../../../javax/swing/plaf/synth/SynthLookAndFeel.html#load(java.net.URL)">SynthLookAndFeel.load(URL)</a> can be
-      used, for instance, to load a look and feel from any of the following:
+      The method <a
+        href="../../../../../javax/swing/plaf/synth/SynthLookAndFeel.html#load(java.net.URL)">
+      SynthLookAndFeel.load(URL)</a> can be used, for instance, to load a look
+      and feel from any of the following:
     </p>
     <ul>
       <li>File, e.g. <code>file:///C:/java/synth/laf/laf.xml</code></li>
@@ -70,7 +101,7 @@
     <h3>The synth element</h3>
 <div class="dtd-fragment">
 <pre class="dtd-fragment">
-&lt;!ELEMENT <a name="e.synth">synth</a> ((<a href="#ee.beansPersistance">%beansPersistance;</a>) | <a href="#e.style">style</a> | <a href="#e.bind">bind</a> | <a href="#e.font">font</a> | <a href="#e.color">color</a> |
+&lt;!ELEMENT <a id="e.synth">synth</a> ((<a href="#ee.beansPersistance">%beansPersistance;</a>) | <a href="#e.style">style</a> | <a href="#e.bind">bind</a> | <a href="#e.font">font</a> | <a href="#e.color">color</a> |
                  <a href="#e.imagePainter">imagePainter</a> | <a href="#e.imageIcon">imageIcon</a> | <a href="#e.defaultsProperty">defaultsProperty</a>)*>
 &lt;!ATTLIST synth
           <a href="#synth.version">version</a>              CDATA          #IMPLIED
@@ -78,7 +109,7 @@
 </pre>
 </div>
     <p><em>Attribute definitions</em></p>
-    <dl><dt><a name="synth.version"><samp>version</samp></a></dt>
+    <dl><dt><a id="synth.version"><samp>version</samp></a></dt>
 	<dd>File format version, should be 1</dd>
     </dl>
     <p>
@@ -86,11 +117,11 @@
       elements that make up a SynthLookAndFeel definition.
     </p>
 
-      
+
     <h3>The style element</h3>
 <div class="dtd-fragment">
 <pre class="dtd-fragment">
-&lt;!ELEMENT <a name="e.style">style</a> (<a href="#e.property">property</a> | <a href="#e.defaultsProperty">defaultsProperty</a> | <a href="#e.state">state</a> | <a href="#e.font">font</a> | <a href="#e.graphicsUtils">graphicsUtils</a> |
+&lt;!ELEMENT <a id="e.style">style</a> (<a href="#e.property">property</a> | <a href="#e.defaultsProperty">defaultsProperty</a> | <a href="#e.state">state</a> | <a href="#e.font">font</a> | <a href="#e.graphicsUtils">graphicsUtils</a> |
                  <a href="#e.insets">insets</a> | <a href="#e.painter">painter</a> | <a href="#e.imagePainter">imagePainter</a> | <a href="#e.opaque">opaque</a> | (<a href="#ee.beansPersistance">%beansPersistance;</a>) |
                  <a href="#e.imageIcon">imageIcon</a>)*>
 &lt;!ATTLIST style
@@ -101,9 +132,9 @@
 </div>
     <p><em>Attribute definitions</em></p>
     <dl>
-      <dt><a name="style.id"><samp>id</samp></a></dt>
+      <dt><a id="style.id"><samp>id</samp></a></dt>
       <dd>Unique identifier for the style.</dd>
-      <dt><a name="style.clone"><samp>clone</samp></a></dt>
+      <dt><a id="style.clone"><samp>clone</samp></a></dt>
       <dd>Identifier of a previously defined style that is copied
 	    and used for the new style. This provides a convenient
 	    mechanism for overriding only a portion of an existing
@@ -144,7 +175,7 @@
     <h3>The state element</h3>
 <div class="dtd-fragment">
 <pre class="dtd-fragment">
-&lt;!ELEMENT <a name="e.state">state</a> (<a href="#e.color">color</a> | <a href="#e.font">font</a> | <a href="#e.painter">painter</a> | <a href="#e.imagePainter">imagePainter</a> | (<a href="#ee.beansPersistance">%beansPersistance;</a>) |
+&lt;!ELEMENT <a id="e.state">state</a> (<a href="#e.color">color</a> | <a href="#e.font">font</a> | <a href="#e.painter">painter</a> | <a href="#e.imagePainter">imagePainter</a> | (<a href="#ee.beansPersistance">%beansPersistance;</a>) |
                  <a href="#e.property">property</a> |  <a href="#e.imageIcon">imageIcon</a>)*>
 &lt;!ATTLIST state
           <a href="#state.id">id</a>              ID             #IMPLIED
@@ -156,19 +187,19 @@
 </div>
     <p><em>Attribute definitions</em></p>
     <dl>
-      <dt><a name="state.id"><samp>id</samp></a></dt>
+      <dt><a id="state.id"><samp>id</samp></a></dt>
       <dd>Unique identifier for the state.</dd>
-      <dt><a name="state.clone"><samp>clone</samp></a></dt>
+      <dt><a id="state.clone"><samp>clone</samp></a></dt>
       <dd>Identifier of a previously defined state that is copied
 	and used for the new state.</dd>
-      <dt><a name="state.value"><samp>value</samp></a></dt>
+      <dt><a id="state.value"><samp>value</samp></a></dt>
       <dd>Identifies the state of the Component the properties are to apply
 	to. This is a list of: ENABLED,
 	MOUSE_OVER, PRESSED, DISABLED, FOCUSED, SELECTED or
 	DEFAULT. Multiple states should
 	be separated by 'and.' If you do not specify a value, the
 	contents apply to all states.
-      <dt><a name="state.idref"><samp>idref</samp></a></dt>
+      <dt><a id="state.idref"><samp>idref</samp></a></dt>
       <dd>Indicates this state should be the same as a previously
 	    defined state. This is useful for multiple styles that
 	    wish to share the same visual properties for a particular
@@ -212,7 +243,7 @@
     <p>
       State <code>one</code> is used when the Component is SELECTED
       and PRESSED, and state <code>two</code> when the Component is
-      SELECTED. If the state of the Component 
+      SELECTED. If the state of the Component
       contains at least SELECTED and PRESSED, state <code>one</code> will be
       chosen, otherwise if the state is SELECTED, but not does not
       contain PRESSED, state <code>two</code> will be used.
@@ -220,7 +251,7 @@
     <h3>The font element</h3>
 <div class="dtd-fragment">
 <pre class="dtd-fragment">
-&lt;!ELEMENT <a name="e.font">font</a> EMPTY>
+&lt;!ELEMENT <a id="e.font">font</a> EMPTY>
 &lt;!ATTLIST font
           <a href="#font.id">id</a>              ID             #IMPLIED
           <a href="#font.idref">clone</a>           IDREF          #IMPLIED
@@ -232,18 +263,18 @@
 </div>
     <p><em>Attribute definitions</em></p>
     <dl>
-      <dt><a name="font.id"><samp>id</samp></a></dt>
+      <dt><a id="font.id"><samp>id</samp></a></dt>
       <dd>Unique identifier for the Font.</dd>
-      <dt><a name="font.idref"><samp>idref</samp></a></dt>
+      <dt><a id="font.idref"><samp>idref</samp></a></dt>
       <dd>Identifier of a previously defined font.</dd>
-      <dt><a name="font.name"><samp>name</samp></a></dt>
+      <dt><a id="font.name"><samp>name</samp></a></dt>
       <dd>Name of the font.
-      <dt><a name="font.style"><samp>style</samp></a></dt>
+      <dt><a id="font.style"><samp>style</samp></a></dt>
       <dd>Style of the font. This is a list of the styles defined by
 	Font separated by spaces: PLAIN, BOLD or ITALIC. If
 	unspecified PLAIN is used.
       </dd>
-      <dt><a name="font.size"><samp>size</samp></a></dt>
+      <dt><a id="font.size"><samp>size</samp></a></dt>
       <dd>Size of the font, in pixels</dd>
     </dl>
     <p>
@@ -289,7 +320,7 @@
     <h3>The color element</h3>
 <div class="dtd-fragment">
 <pre class="dtd-fragment">
-&lt;!ELEMENT <a name="e.color">color</a> EMPTY>
+&lt;!ELEMENT <a id="e.color">color</a> EMPTY>
 &lt;!ATTLIST color
           <a href="#color.id">id</a>              ID             #IMPLIED
           <a href="#color.idref">idref</a>           IDREF          #IMPLIED
@@ -300,11 +331,11 @@
 </div>
     <p><em>Attribute definitions</em></p>
     <dl>
-      <dt><a name="color.id"><samp>id</samp></a></dt>
+      <dt><a id="color.id"><samp>id</samp></a></dt>
       <dd>Unique identifier for the color.</dd>
-      <dt><a name="color.idref"><samp>idref</samp></a></dt>
+      <dt><a id="color.idref"><samp>idref</samp></a></dt>
       <dd>Identifier of a previously defined color.</dd>
-      <dt><a name="color.type"><samp>type</samp></a></dt>
+      <dt><a id="color.type"><samp>type</samp></a></dt>
       <dd>Describes where this color should be used. This is
 	    typically one of the constants defined by ColorType:
 	    FOREGROUND, BACKGROUND, TEXT_FOREGROUND, TEXT_BACKGROUND
@@ -314,12 +345,12 @@
 	    is useful for subclasses of synth that define additional
 	    color types.
       </dd>
-      <dt><a name="color.value"><samp>value</samp></a></dt>
+      <dt><a id="color.value"><samp>value</samp></a></dt>
       <dd>
-        Value for the color. This accepts the following forms. 
+        Value for the color. This accepts the following forms.
         <ul>
           <li>The name of a constant in the <code>Color</code> class,
-            for example <code> RED</code>. 
+            for example <code> RED</code>.
           <li>A hex value of the form <code>#RRGGBB</code> where
             <code>RR</code> gives the red component, <code>GG</code>
             the green component and <code>BB</code> the blue
@@ -329,7 +360,7 @@
             <code>#AARRGGBB</code>. This is useful for alpha values
             other than <code>0xFF</code>. The form
             <code>#ARRGGBB</code> is equivalent to
-            <code>#0ARRGGBB</code>. 
+            <code>#0ARRGGBB</code>.
         </ul>
       </dd>
     </dl>
@@ -366,7 +397,7 @@
     <h3>The property element</h3>
 <div class="dtd-fragment">
 <pre class="dtd-fragment">
-&lt;!ELEMENT <a name="e.property">property</a> EMPTY>
+&lt;!ELEMENT <a id="e.property">property</a> EMPTY>
 &lt;!ATTLIST property
           <a href="#property.key">key</a>               CDATA                                             #REQUIRED
           <a href="#property.type">type</a>              (idref|boolean|dimension|insets|integer|string)          "idref"
@@ -376,11 +407,11 @@
 </div>
     <p><em>Attribute definitions</em></p>
     <dl>
-      <dt><a name="property.key"><samp>key</samp></a></dt>
+      <dt><a id="property.key"><samp>key</samp></a></dt>
       <dd>Name of the property.</dd>
-      <dt><a name="property.type"><samp>type</samp></a></dt>
+      <dt><a id="property.type"><samp>type</samp></a></dt>
       <dd>Indicates the type of the property.</dd>
-      <dt><a name="property.value"><samp>value</samp></a></dt>
+      <dt><a id="property.value"><samp>value</samp></a></dt>
       <dd>Value for the property. For boolean properties this will be
 	be true or false, for integer properties this will be a
 	valid integer, for dimensions this will be the width and
@@ -438,7 +469,7 @@
 </div>
 <div class="dtd-fragment">
 <pre class="dtd-fragment">
-&lt;!ELEMENT <a name="e.defaultsProperty">defaultsProperty</a> EMPTY>
+&lt;!ELEMENT <a id="e.defaultsProperty">defaultsProperty</a> EMPTY>
 &lt;!ATTLIST defaultsProperty
           <a href="#defaultsProperty.key">key</a>               CDATA                                             #REQUIRED
           <a href="#defaultsProperty.type">type</a>              (idref|boolean|dimension|insets|integer|string)   "idref"
@@ -448,11 +479,11 @@
 </div>
     <p><em>Attribute definitions</em></p>
     <dl>
-      <dt><a name="defaultsProperty.key"><samp>key</samp></a></dt>
+      <dt><a id="defaultsProperty.key"><samp>key</samp></a></dt>
       <dd>Name of the property.</dd>
-      <dt><a name="defaultsProperty.type"><samp>type</samp></a></dt>
+      <dt><a id="defaultsProperty.type"><samp>type</samp></a></dt>
       <dd>Indicates the type of the property.</dd>
-      <dt><a name="defaultsProperty.value"><samp>value</samp></a></dt>
+      <dt><a id="defaultsProperty.value"><samp>value</samp></a></dt>
       <dd>Value for the property. For boolean properties this will be
 	true or false, for integer properties this will be a
 	valid integer, for dimensions this will be the width and
@@ -488,7 +519,7 @@
     <h3>The graphicsUtils element</h3>
 <div class="dtd-fragment">
 <pre class="dtd-fragment">
-&lt;!ELEMENT <a name="e.graphicsUtils">graphicsUtils</a> EMPTY>
+&lt;!ELEMENT <a id="e.graphicsUtils">graphicsUtils</a> EMPTY>
 &lt;!ATTLIST graphicsUtils
           <a href="#graphicsUtils.idref">idref</a>           IDREF             #REQUIRED
 &gt;
@@ -496,7 +527,7 @@
 </div>
     <p><em>Attribute definitions</em></p>
     <dl>
-      <dt><a name="graphicsUtils.idref"><samp>idref</samp></a></dt>
+      <dt><a id="graphicsUtils.idref"><samp>idref</samp></a></dt>
       <dd>Identifer of a previously defined SynthGraphicsUtils object
 	that is to be used as the SynthGraphicsUtils for the current
 	<a href="#e.style">style</a>.</dd>
@@ -520,7 +551,7 @@
     <h3>The insets element</h3>
 <div class="dtd-fragment">
 <pre class="dtd-fragment">
-&lt;!ELEMENT <a name="e.insets">insets</a> EMPTY>
+&lt;!ELEMENT <a id="e.insets">insets</a> EMPTY>
 &lt;!ATTLIST insets
           <a href="#insets.id">id</a>           ID             #IMPLIED
           <a href="#insets.idref">idref</a>        IDREF          #IMPLIED
@@ -533,17 +564,17 @@
 </div>
     <p><em>Attribute definitions</em></p>
     <dl>
-      <dt><a name="insets.id"><samp>id</samp></a></dt>
+      <dt><a id="insets.id"><samp>id</samp></a></dt>
       <dd>Unique identifier for the Insets.</dd>
-      <dt><a name="insets.idref"><samp>idref</samp></a></dt>
+      <dt><a id="insets.idref"><samp>idref</samp></a></dt>
       <dd>Identifier of a previously defined Insets.</dd>
-      <dt><a name="insets.top"><samp>top</samp></a></dt>
+      <dt><a id="insets.top"><samp>top</samp></a></dt>
       <dd>Top component of the Insets.</dd>
-      <dt><a name="insets.bottom"><samp>bottom</samp></a></dt>
+      <dt><a id="insets.bottom"><samp>bottom</samp></a></dt>
       <dd>Bottom component of the Insets.</dd>
-      <dt><a name="insets.left"><samp>left</samp></a></dt>
+      <dt><a id="insets.left"><samp>left</samp></a></dt>
       <dd>Left component of the Insets.</dd>
-      <dt><a name="insets.right"><samp>right</samp></a></dt>
+      <dt><a id="insets.right"><samp>right</samp></a></dt>
       <dd>Right component of the Insets.</dd>
     </dl>
     <p>
@@ -564,7 +595,7 @@
     <h3>The bind element</h3>
 <div class="dtd-fragment">
 <pre class="dtd-fragment">
-&lt;!ELEMENT <a name="e.bind">bind</a> EMPTY>
+&lt;!ELEMENT <a id="e.bind">bind</a> EMPTY>
 &lt;!ATTLIST bind
           <a href="#bind.style">style</a>        IDREF             #REQUIRED
           <a href="#bind.type">type</a>         (name|region)     #REQUIRED
@@ -574,12 +605,12 @@
 </div>
     <p><em>Attribute definitions</em></p>
     <dl>
-      <dt><a name="bind.style"><samp>style</samp></a></dt>
+      <dt><a id="bind.style"><samp>style</samp></a></dt>
       <dd>Unique identifier of a previously defined style.</dd>
-      <dt><a name="bind.type"><samp>type</samp></a></dt>
+      <dt><a id="bind.type"><samp>type</samp></a></dt>
       <dd>One of name or region. For type name component.getName() is used,
 	otherwise the name of the Region is used.</dd>
-      <dt><a name="bind.key"><samp>key</samp></a></dt>
+      <dt><a id="bind.key"><samp>key</samp></a></dt>
       <dd>Regular expression applied to the name of the Component, or the
 	name of the Region, depending upon the value of
 	<a href="#bind.type">type</a>.</dd>
@@ -673,7 +704,7 @@
     <h3>The painter element</h3>
 <div class="dtd-fragment">
 <pre class="dtd-fragment">
-&lt;!ELEMENT <a name="e.painter">painter</a> EMPTY>
+&lt;!ELEMENT <a id="e.painter">painter</a> EMPTY>
 &lt;!ATTLIST painter
           <a href="#painter.idref">idref</a>                 IDREF          #IMPLIED
           <a href="#painter.method">method</a>                CDATA          #IMPLIED
@@ -683,9 +714,9 @@
 </div>
     <p><em>Attribute definitions</em></p>
     <dl>
-      <dt><a name="painter.idref"><samp>idref</samp></a></dt>
+      <dt><a id="painter.idref"><samp>idref</samp></a></dt>
       <dd>Identifier of a previously defined SynthPainter.</dd>
-      <dt><a name="painter.method"><samp>method</samp></a></dt>
+      <dt><a id="painter.method"><samp>method</samp></a></dt>
       <dd>Identifies the SynthPainter method this is to be used for. The name
 	corresponds to the method name of a paint method in SynthPainter
 	with the paint prefix dropped, the remainder is case
@@ -694,7 +725,7 @@
 	'buttonBackground' or 'buttonbackground'. If this is
 	not specified the painter is used for all methods that don't have a
 	a specific painter for them.</dd>
-      <dt><a name="painter.direction"><samp>direction</samp></a></dt>
+      <dt><a id="painter.direction"><samp>direction</samp></a></dt>
       <dd>Identifies the direction, or orientation, this painter is to be
 	used for. This is only useful for the SynthPainter methods that take
 	a direction or orientation. If this is not specified the painter is
@@ -787,7 +818,7 @@
     <h3>The imagePainter element</h3>
 <div class="dtd-fragment">
 <pre class="dtd-fragment">
-&lt;!ELEMENT <a name="e.imagePainter">imagePainter</a> EMPTY>
+&lt;!ELEMENT <a id="e.imagePainter">imagePainter</a> EMPTY>
 &lt;!ATTLIST imagePainter
           <a href="#imagePainter.id">id</a>                    ID             #IMPLIED
           <a href="#imagePainter.method">method</a>                CDATA          #IMPLIED
@@ -803,9 +834,9 @@
 </div>
     <p><em>Attribute definitions</em></p>
     <dl>
-      <dt><a name="imagePainter.id"><samp>id</samp></a></dt>
+      <dt><a id="imagePainter.id"><samp>id</samp></a></dt>
       <dd>Unique identifier for the imagePainter.</dd>
-      <dt><a name="imagePainter.method"><samp>method</samp></a></dt>
+      <dt><a id="imagePainter.method"><samp>method</samp></a></dt>
       <dd>Identifies the SynthPainter method this is to be used for. The name
 	corresponds to the method name of a paint method in SynthPainter
 	with the paint prefix dropped, the remainder is case
@@ -814,29 +845,29 @@
 	'buttonBackground' or 'buttonbackground'. If this is
 	not specified the painter is used for all methods that don't have a
 	a specific painter for them.</dd>
-      <dt><a name="imagePainter.direction"><samp>direction</samp></a></dt>
+      <dt><a id="imagePainter.direction"><samp>direction</samp></a></dt>
       <dd>Identifies the direction, or orientation, this image is to be
 	used for. This is only useful for the SynthPainter methods that take
 	a direction or orientation. If this is not specified the image is
 	used for all directions.</dd>
-      <dt><a name="imagePainter.path"><samp>path</samp></a></dt>
+      <dt><a id="imagePainter.path"><samp>path</samp></a></dt>
       <dd>Path to the image. Path to the image.  If SynthLookAndFeel.load is
     passed a Class this will use the Class method getResource (with with the
     Class suplied to the load method). If load is passed a URL this will use the
     URL constructor URL(context, path) to resolve the path.</dd>
-      <dt><a name="imagePainter.sourceInsets"><samp>sourceInsets</samp></a></dt>
+      <dt><a id="imagePainter.sourceInsets"><samp>sourceInsets</samp></a></dt>
       <dd>Insets on the source image. This is top, left, bottom, right with
 	each component separated by a space.</dd>
-      <dt><a name="imagePainter.destinationInsets"><samp>destinationInsets</samp></a></dt>
+      <dt><a id="imagePainter.destinationInsets"><samp>destinationInsets</samp></a></dt>
       <dd>Insets of the destination image. This is top, left, bottom, right with
 	each component separated by a space. If not specified the
 	<a href="#imagePainter.sourceInsets">sourceInsets</a> are used.</dd>
-      <dt><a name="imagePainter.painterCenter"><samp>paintCenter</samp></a></dt>
+      <dt><a id="imagePainter.painterCenter"><samp>paintCenter</samp></a></dt>
       <dd>Whether or not the center of the image should be drawn.</dd>
-      <dt><a name="imagePainter.stretch"><samp>stretch</samp></a></dt>
+      <dt><a id="imagePainter.stretch"><samp>stretch</samp></a></dt>
       <dd>Whether or not the north, south, east and west components of the
 	resulting image should be scaled or tiled.</dd>
-      <dt><a name="imagePainter.center"><samp>center</samp></a></dt>
+      <dt><a id="imagePainter.center"><samp>center</samp></a></dt>
       <dd>Whether or not the image is centered.</dd>
     </dl>
     <p>
@@ -844,7 +875,7 @@
       painter for the current style or state that will render using
       the specified image.  ImagePainter offers two distinct rendering
       modes.  The first mode is used to center an image in the space
-      provided.  This is 
+      provided.  This is
       commonly used in rendering decorations on top of a widget, for
       example, to specify an arrow for a scroll button use the center
       mode. The following example illustrates this:
@@ -878,12 +909,12 @@
       Refer to the description of the <a href="#e.painter">painter</a>
       element for details as to the precedence in choosing a painter and to
       understand how identical painters are handled.
-	
+
 
     <h3>The imageIcon element</h3>
 <div class="dtd-fragment">
 <pre class="dtd-fragment">
-&lt;!ELEMENT <a name="e.imageIcon">imageIcon</a> EMPTY>
+&lt;!ELEMENT <a id="e.imageIcon">imageIcon</a> EMPTY>
 &lt;!ATTLIST imageIcon
           <a href="#imageIcon.id">id</a>                    ID             #REQUIRED
           <a href="#imageIcon.path">path</a>                  CDATA          #REQUIRED
@@ -892,9 +923,9 @@
 </div>
     <p><em>Attribute definitions</em></p>
     <dl>
-      <dt><a name="imageIcon.id"><samp>id</samp></a></dt>
+      <dt><a id="imageIcon.id"><samp>id</samp></a></dt>
       <dd>Unique identifier for the imageIcon.</dd>
-      <dt><a name="imageIcon.path"><samp>path</samp></a></dt>
+      <dt><a id="imageIcon.path"><samp>path</samp></a></dt>
       <dd>Path to the image. This uses the Class method
 	getResource to resolve the path, with the Class supplied to
 	SynthLookAndFeel.load.</dd>
@@ -917,7 +948,7 @@
    <h3>The opaque element</h3>
 <div class="dtd-fragment">
 <pre class="dtd-fragment">
-&lt;!ELEMENT <a name="e.opaque">opaque</a> EMPTY>
+&lt;!ELEMENT <a id="e.opaque">opaque</a> EMPTY>
 &lt;!ATTLIST opaque
           <a href="#opaque.value">value</a>              (true|false)   "true"
 &gt;
@@ -925,7 +956,7 @@
 </div>
     <p><em>Attribute definitions</em></p>
     <dl>
-      <dt><a name="opaque.value"><samp>id</samp></a></dt>
+      <dt><a id="opaque.value"><samp>id</samp></a></dt>
       <dd>Whether or not the style should be opaque, if unspecified the style
 	is opaque.</dd>
     </dl>
@@ -945,12 +976,14 @@
     </pre>
 </div>
 
-    <h3><a name="ee.beansPersistance">The beansPersistance entity</a></h3>
+    <h3><a id="ee.beansPersistance">The beansPersistance entity</a></h3>
     <p>
       Beans persistance can be used to embed any Object. This is
       typically used for embedding your own Painters, but can be used
       for other arbritrary objects as well. Refer to <a
-							href="http://www.oracle.com/technetwork/java/persistence3-139471.html">http://www.oracle.com/technetwork/java/persistence3-139471.html</a> for details on beans persistance.
+        href="http://www.oracle.com/technetwork/java/persistence3-139471.html">
+      http://www.oracle.com/technetwork/java/persistence3-139471.html</a>
+      for details on beans persistance.
 
 
     <h3>Backing Style</h3>
--- a/src/java.desktop/share/classes/module-info.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/module-info.java	Wed Dec 13 10:25:38 2017 -0800
@@ -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
@@ -112,8 +112,6 @@
 
     opens javax.swing.plaf.basic to
         jdk.jconsole;
-    opens com.sun.java.swing.plaf.windows to
-        jdk.jconsole;
 
     uses java.awt.im.spi.InputMethodDescriptor;
     uses javax.accessibility.AccessibilityProvider;
--- a/src/java.desktop/share/classes/sun/awt/HToolkit.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/sun/awt/HToolkit.java	Wed Dec 13 10:25:38 2017 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -130,12 +130,19 @@
     }
 
     @Override
+    @Deprecated(since = "10")
     public int getMenuShortcutKeyMask()
         throws HeadlessException {
         throw new HeadlessException();
     }
 
     @Override
+    public int getMenuShortcutKeyMaskEx()
+        throws HeadlessException {
+        throw new HeadlessException();
+    }
+
+    @Override
     public boolean getLockingKeyState(int keyCode)
         throws UnsupportedOperationException {
         throw new HeadlessException();
--- a/src/java.desktop/share/classes/sun/awt/HeadlessToolkit.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/sun/awt/HeadlessToolkit.java	Wed Dec 13 10:25:38 2017 -0800
@@ -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
@@ -31,6 +31,7 @@
 import java.awt.dnd.DragGestureRecognizer;
 import java.awt.dnd.DragSource;
 import java.awt.event.AWTEventListener;
+import java.awt.event.InputEvent;
 import java.awt.font.TextAttribute;
 import java.awt.im.InputMethodHighlight;
 import java.awt.image.ColorModel;
@@ -128,12 +129,19 @@
     }
 
     @Override
+    @Deprecated(since = "10")
     public int getMenuShortcutKeyMask()
         throws HeadlessException {
         throw new HeadlessException();
     }
 
     @Override
+    public int getMenuShortcutKeyMaskEx()
+        throws HeadlessException {
+        throw new HeadlessException();
+    }
+
+    @Override
     public boolean getLockingKeyState(int keyCode)
         throws UnsupportedOperationException {
         throw new HeadlessException();
--- a/src/java.desktop/share/classes/sun/font/FontDesignMetrics.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/sun/font/FontDesignMetrics.java	Wed Dec 13 10:25:38 2017 -0800
@@ -33,6 +33,7 @@
 import java.awt.GraphicsEnvironment;
 import java.awt.geom.AffineTransform;
 import java.awt.geom.NoninvertibleTransformException;
+import java.awt.geom.Rectangle2D;
 import java.awt.font.FontRenderContext;
 import java.awt.font.TextLayout;
 
@@ -519,6 +520,28 @@
     }
 
     /**
+     * This method is called from java.awt.Font only after verifying
+     * the arguments and that the text is simple and there are no
+     * layout attributes, font transform etc.
+     */
+    public Rectangle2D getSimpleBounds(char data[], int off, int len) {
+
+        float width = 0;
+        int limit = off + len;
+        for (int i=off; i < limit; i++) {
+            char ch = data[i];
+            if (ch < 0x100) {
+                width += getLatinCharWidth(ch);
+            } else {
+                width += handleCharWidth(ch);
+            }
+        }
+
+        float height = ascent + descent + leading;
+        return new Rectangle2D.Float(0f, -ascent, width, height);
+     }
+
+    /**
      * Gets the advance widths of the first 256 characters in the
      * {@code Font}.  The advance is the
      * distance from the leftmost point to the rightmost point on the
--- a/src/java.desktop/share/classes/sun/java2d/marlin/Curve.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/sun/java2d/marlin/Curve.java	Wed Dec 13 10:25:38 2017 -0800
@@ -56,12 +56,16 @@
              float x3, float y3,
              float x4, float y4)
     {
-        ax = 3.0f * (x2 - x3) + x4 - x1;
-        ay = 3.0f * (y2 - y3) + y4 - y1;
-        bx = 3.0f * (x1 - 2.0f * x2 + x3);
-        by = 3.0f * (y1 - 2.0f * y2 + y3);
-        cx = 3.0f * (x2 - x1);
-        cy = 3.0f * (y2 - y1);
+        final float dx32 = 3.0f * (x3 - x2);
+        final float dy32 = 3.0f * (y3 - y2);
+        final float dx21 = 3.0f * (x2 - x1);
+        final float dy21 = 3.0f * (y2 - y1);
+        ax = (x4 - x1) - dx32;
+        ay = (y4 - y1) - dy32;
+        bx = (dx32 - dx21);
+        by = (dy32 - dy21);
+        cx = dx21;
+        cy = dy21;
         dx = x1;
         dy = y1;
         dax = 3.0f * ax; day = 3.0f * ay;
@@ -72,11 +76,13 @@
              float x2, float y2,
              float x3, float y3)
     {
+        final float dx21 = (x2 - x1);
+        final float dy21 = (y2 - y1);
         ax = 0.0f; ay = 0.0f;
-        bx = x1 - 2.0f * x2 + x3;
-        by = y1 - 2.0f * y2 + y3;
-        cx = 2.0f * (x2 - x1);
-        cy = 2.0f * (y2 - y1);
+        bx = (x3 - x2) - dx21;
+        by = (y3 - y2) - dy21;
+        cx = 2.0f * dx21;
+        cy = 2.0f * dy21;
         dx = x1;
         dy = y1;
         dax = 0.0f; day = 0.0f;
--- a/src/java.desktop/share/classes/sun/java2d/marlin/DCurve.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/sun/java2d/marlin/DCurve.java	Wed Dec 13 10:25:38 2017 -0800
@@ -56,12 +56,16 @@
              double x3, double y3,
              double x4, double y4)
     {
-        ax = 3.0d * (x2 - x3) + x4 - x1;
-        ay = 3.0d * (y2 - y3) + y4 - y1;
-        bx = 3.0d * (x1 - 2.0d * x2 + x3);
-        by = 3.0d * (y1 - 2.0d * y2 + y3);
-        cx = 3.0d * (x2 - x1);
-        cy = 3.0d * (y2 - y1);
+        final double dx32 = 3.0d * (x3 - x2);
+        final double dy32 = 3.0d * (y3 - y2);
+        final double dx21 = 3.0d * (x2 - x1);
+        final double dy21 = 3.0d * (y2 - y1);
+        ax = (x4 - x1) - dx32;
+        ay = (y4 - y1) - dy32;
+        bx = (dx32 - dx21);
+        by = (dy32 - dy21);
+        cx = dx21;
+        cy = dy21;
         dx = x1;
         dy = y1;
         dax = 3.0d * ax; day = 3.0d * ay;
@@ -72,11 +76,13 @@
              double x2, double y2,
              double x3, double y3)
     {
+        final double dx21 = (x2 - x1);
+        final double dy21 = (y2 - y1);
         ax = 0.0d; ay = 0.0d;
-        bx = x1 - 2.0d * x2 + x3;
-        by = y1 - 2.0d * y2 + y3;
-        cx = 2.0d * (x2 - x1);
-        cy = 2.0d * (y2 - y1);
+        bx = (x3 - x2) - dx21;
+        by = (y3 - y2) - dy21;
+        cx = 2.0d * dx21;
+        cy = 2.0d * dy21;
         dx = x1;
         dy = y1;
         dax = 0.0d; day = 0.0d;
--- a/src/java.desktop/share/classes/sun/java2d/marlin/DDasher.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/sun/java2d/marlin/DDasher.java	Wed Dec 13 10:25:38 2017 -0800
@@ -137,7 +137,7 @@
                     dashOn = !dashOn;
                 }
             }
-        } else if (phase > 0) {
+        } else if (phase > 0.0d) {
             if (cycles >= MAX_CYCLES) {
                 phase = 0.0d;
             } else {
@@ -157,12 +157,13 @@
 
         this.dash = dash;
         this.dashLen = dashLen;
-        this.startPhase = this.phase = phase;
+        this.phase = phase;
+        this.startPhase = phase;
         this.startDashOn = dashOn;
         this.startIdx = sidx;
         this.starting = true;
-        needsMoveTo = false;
-        firstSegidx = 0;
+        this.needsMoveTo = false;
+        this.firstSegidx = 0;
 
         this.recycleDashes = recycleDashes;
 
@@ -201,8 +202,8 @@
     }
 
     @Override
-    public void moveTo(double x0, double y0) {
-        if (firstSegidx > 0) {
+    public void moveTo(final double x0, final double y0) {
+        if (firstSegidx != 0) {
             out.moveTo(sx, sy);
             emitFirstSegments();
         }
@@ -210,8 +211,10 @@
         this.idx = startIdx;
         this.dashOn = this.startDashOn;
         this.phase = this.startPhase;
-        this.sx = this.x0 = x0;
-        this.sy = this.y0 = y0;
+        this.sx = x0;
+        this.sy = y0;
+        this.x0 = x0;
+        this.y0 = y0;
         this.starting = true;
     }
 
@@ -236,7 +239,7 @@
     private void emitFirstSegments() {
         final double[] fSegBuf = firstSegmentsBuffer;
 
-        for (int i = 0; i < firstSegidx; ) {
+        for (int i = 0, len = firstSegidx; i < len; ) {
             int type = (int)fSegBuf[i];
             emitSeg(fSegBuf, i + 1, type);
             i += (type - 1);
@@ -251,48 +254,59 @@
     private int firstSegidx;
 
     // precondition: pts must be in relative coordinates (relative to x0,y0)
-    private void goTo(double[] pts, int off, final int type) {
-        double x = pts[off + type - 4];
-        double y = pts[off + type - 3];
-        if (dashOn) {
+    private void goTo(final double[] pts, final int off, final int type,
+                      final boolean on)
+    {
+        final int index = off + type;
+        final double x = pts[index - 4];
+        final double y = pts[index - 3];
+
+        if (on) {
             if (starting) {
-                int len = type - 1; // - 2 + 1
-                int segIdx = firstSegidx;
-                double[] buf = firstSegmentsBuffer;
-                if (segIdx + len  > buf.length) {
-                    if (DO_STATS) {
-                        rdrCtx.stats.stat_array_dasher_firstSegmentsBuffer
-                            .add(segIdx + len);
-                    }
-                    firstSegmentsBuffer = buf
-                        = firstSegmentsBuffer_ref.widenArray(buf, segIdx,
-                                                             segIdx + len);
-                }
-                buf[segIdx++] = type;
-                len--;
-                // small arraycopy (2, 4 or 6) but with offset:
-                System.arraycopy(pts, off, buf, segIdx, len);
-                segIdx += len;
-                firstSegidx = segIdx;
+                goTo_starting(pts, off, type);
             } else {
                 if (needsMoveTo) {
+                    needsMoveTo = false;
                     out.moveTo(x0, y0);
-                    needsMoveTo = false;
                 }
                 emitSeg(pts, off, type);
             }
         } else {
-            starting = false;
+            if (starting) {
+                // low probability test (hotspot)
+                starting = false;
+            }
             needsMoveTo = true;
         }
         this.x0 = x;
         this.y0 = y;
     }
 
+    private void goTo_starting(final double[] pts, final int off, final int type) {
+        int len = type - 1; // - 2 + 1
+        int segIdx = firstSegidx;
+        double[] buf = firstSegmentsBuffer;
+
+        if (segIdx + len  > buf.length) {
+            if (DO_STATS) {
+                rdrCtx.stats.stat_array_dasher_firstSegmentsBuffer
+                    .add(segIdx + len);
+            }
+            firstSegmentsBuffer = buf
+                = firstSegmentsBuffer_ref.widenArray(buf, segIdx,
+                                                     segIdx + len);
+        }
+        buf[segIdx++] = type;
+        len--;
+        // small arraycopy (2, 4 or 6) but with offset:
+        System.arraycopy(pts, off, buf, segIdx, len);
+        firstSegidx = segIdx + len;
+    }
+
     @Override
-    public void lineTo(double x1, double y1) {
-        double dx = x1 - x0;
-        double dy = y1 - y0;
+    public void lineTo(final double x1, final double y1) {
+        final double dx = x1 - x0;
+        final double dy = y1 - y0;
 
         double len = dx*dx + dy*dy;
         if (len == 0.0d) {
@@ -307,48 +321,61 @@
 
         final double[] _curCurvepts = curCurvepts;
         final double[] _dash = dash;
+        final int _dashLen = this.dashLen;
+
+        int _idx = idx;
+        boolean _dashOn = dashOn;
+        double _phase = phase;
 
         double leftInThisDashSegment;
-        double dashdx, dashdy, p;
+        double d, dashdx, dashdy, p;
 
         while (true) {
-            leftInThisDashSegment = _dash[idx] - phase;
+            d = _dash[_idx];
+            leftInThisDashSegment = d - _phase;
 
             if (len <= leftInThisDashSegment) {
                 _curCurvepts[0] = x1;
                 _curCurvepts[1] = y1;
-                goTo(_curCurvepts, 0, 4);
+
+                goTo(_curCurvepts, 0, 4, _dashOn);
 
                 // Advance phase within current dash segment
-                phase += len;
+                _phase += len;
+
                 // TODO: compare double values using epsilon:
                 if (len == leftInThisDashSegment) {
-                    phase = 0.0d;
-                    idx = (idx + 1) % dashLen;
-                    dashOn = !dashOn;
+                    _phase = 0.0d;
+                    _idx = (_idx + 1) % _dashLen;
+                    _dashOn = !_dashOn;
                 }
+
+                // Save local state:
+                idx = _idx;
+                dashOn = _dashOn;
+                phase = _phase;
                 return;
             }
 
-            dashdx = _dash[idx] * cx;
-            dashdy = _dash[idx] * cy;
+            dashdx = d * cx;
+            dashdy = d * cy;
 
-            if (phase == 0.0d) {
+            if (_phase == 0.0d) {
                 _curCurvepts[0] = x0 + dashdx;
                 _curCurvepts[1] = y0 + dashdy;
             } else {
-                p = leftInThisDashSegment / _dash[idx];
+                p = leftInThisDashSegment / d;
                 _curCurvepts[0] = x0 + p * dashdx;
                 _curCurvepts[1] = y0 + p * dashdy;
             }
 
-            goTo(_curCurvepts, 0, 4);
+            goTo(_curCurvepts, 0, 4, _dashOn);
 
             len -= leftInThisDashSegment;
             // Advance to next dash segment
-            idx = (idx + 1) % dashLen;
-            dashOn = !dashOn;
-            phase = 0.0d;
+            _idx = (_idx + 1) % _dashLen;
+            _dashOn = !_dashOn;
+            _phase = 0.0d;
         }
     }
 
@@ -357,43 +384,59 @@
 
     // preconditions: curCurvepts must be an array of length at least 2 * type,
     // that contains the curve we want to dash in the first type elements
-    private void somethingTo(int type) {
+    private void somethingTo(final int type) {
         if (pointCurve(curCurvepts, type)) {
             return;
         }
-        li.initializeIterationOnCurve(curCurvepts, type);
+        final LengthIterator _li = li;
+        final double[] _curCurvepts = curCurvepts;
+        final double[] _dash = dash;
+        final int _dashLen = this.dashLen;
+
+        _li.initializeIterationOnCurve(_curCurvepts, type);
+
+        int _idx = idx;
+        boolean _dashOn = dashOn;
+        double _phase = phase;
 
         // initially the current curve is at curCurvepts[0...type]
         int curCurveoff = 0;
         double lastSplitT = 0.0d;
         double t;
-        double leftInThisDashSegment = dash[idx] - phase;
+        double leftInThisDashSegment = _dash[_idx] - _phase;
 
-        while ((t = li.next(leftInThisDashSegment)) < 1.0d) {
+        while ((t = _li.next(leftInThisDashSegment)) < 1.0d) {
             if (t != 0.0d) {
                 DHelpers.subdivideAt((t - lastSplitT) / (1.0d - lastSplitT),
-                                    curCurvepts, curCurveoff,
-                                    curCurvepts, 0,
-                                    curCurvepts, type, type);
+                                    _curCurvepts, curCurveoff,
+                                    _curCurvepts, 0,
+                                    _curCurvepts, type, type);
                 lastSplitT = t;
-                goTo(curCurvepts, 2, type);
+                goTo(_curCurvepts, 2, type, _dashOn);
                 curCurveoff = type;
             }
             // Advance to next dash segment
-            idx = (idx + 1) % dashLen;
-            dashOn = !dashOn;
-            phase = 0.0d;
-            leftInThisDashSegment = dash[idx];
+            _idx = (_idx + 1) % _dashLen;
+            _dashOn = !_dashOn;
+            _phase = 0.0d;
+            leftInThisDashSegment = _dash[_idx];
         }
-        goTo(curCurvepts, curCurveoff+2, type);
-        phase += li.lastSegLen();
-        if (phase >= dash[idx]) {
-            phase = 0.0d;
-            idx = (idx + 1) % dashLen;
-            dashOn = !dashOn;
+
+        goTo(_curCurvepts, curCurveoff + 2, type, _dashOn);
+
+        _phase += _li.lastSegLen();
+        if (_phase >= _dash[_idx]) {
+            _phase = 0.0d;
+            _idx = (_idx + 1) % _dashLen;
+            _dashOn = !_dashOn;
         }
+        // Save local state:
+        idx = _idx;
+        dashOn = _dashOn;
+        phase = _phase;
+
         // reset LengthIterator:
-        li.reset();
+        _li.reset();
     }
 
     private static boolean pointCurve(double[] curve, int type) {
@@ -419,7 +462,7 @@
     // tree; however, the trees we are interested in have the property that
     // every non leaf node has exactly 2 children
     static final class LengthIterator {
-        private enum Side {LEFT, RIGHT};
+        private enum Side {LEFT, RIGHT}
         // Holds the curves at various levels of the recursion. The root
         // (i.e. the original curve) is at recCurveStack[0] (but then it
         // gets subdivided, the left half is put at 1, so most of the time
@@ -669,22 +712,23 @@
         // this is a bit of a hack. It returns -1 if we're not on a leaf, and
         // the length of the leaf if we are on a leaf.
         private double onLeaf() {
-            double[] curve = recCurveStack[recLevel];
+            final double[] curve = recCurveStack[recLevel];
+            final int _curveType = curveType;
             double polyLen = 0.0d;
 
             double x0 = curve[0], y0 = curve[1];
-            for (int i = 2; i < curveType; i += 2) {
+            for (int i = 2; i < _curveType; i += 2) {
                 final double x1 = curve[i], y1 = curve[i+1];
                 final double len = DHelpers.linelen(x0, y0, x1, y1);
                 polyLen += len;
-                curLeafCtrlPolyLengths[i/2 - 1] = len;
+                curLeafCtrlPolyLengths[(i >> 1) - 1] = len;
                 x0 = x1;
                 y0 = y1;
             }
 
             final double lineLen = DHelpers.linelen(curve[0], curve[1],
-                                                  curve[curveType-2],
-                                                  curve[curveType-1]);
+                                                    curve[_curveType-2],
+                                                    curve[_curveType-1]);
             if ((polyLen - lineLen) < ERR || recLevel == REC_LIMIT) {
                 return (polyLen + lineLen) / 2.0d;
             }
@@ -693,9 +737,9 @@
     }
 
     @Override
-    public void curveTo(double x1, double y1,
-                        double x2, double y2,
-                        double x3, double y3)
+    public void curveTo(final double x1, final double y1,
+                        final double x2, final double y2,
+                        final double x3, final double y3)
     {
         final double[] _curCurvepts = curCurvepts;
         _curCurvepts[0] = x0;        _curCurvepts[1] = y0;
@@ -706,7 +750,9 @@
     }
 
     @Override
-    public void quadTo(double x1, double y1, double x2, double y2) {
+    public void quadTo(final double x1, final double y1,
+                       final double x2, final double y2)
+    {
         final double[] _curCurvepts = curCurvepts;
         _curCurvepts[0] = x0;        _curCurvepts[1] = y0;
         _curCurvepts[2] = x1;        _curCurvepts[3] = y1;
@@ -717,7 +763,7 @@
     @Override
     public void closePath() {
         lineTo(sx, sy);
-        if (firstSegidx > 0) {
+        if (firstSegidx != 0) {
             if (!dashOn || needsMoveTo) {
                 out.moveTo(sx, sy);
             }
@@ -728,7 +774,7 @@
 
     @Override
     public void pathDone() {
-        if (firstSegidx > 0) {
+        if (firstSegidx != 0) {
             out.moveTo(sx, sy);
             emitFirstSegments();
         }
--- a/src/java.desktop/share/classes/sun/java2d/marlin/DHelpers.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/sun/java2d/marlin/DHelpers.java	Wed Dec 13 10:25:38 2017 -0800
@@ -26,10 +26,9 @@
 package sun.java2d.marlin;
 
 import static java.lang.Math.PI;
-import static java.lang.Math.cos;
-import static java.lang.Math.sqrt;
-import static java.lang.Math.cbrt;
-import static java.lang.Math.acos;
+import java.util.Arrays;
+import sun.java2d.marlin.stats.Histogram;
+import sun.java2d.marlin.stats.StatLong;
 
 final class DHelpers implements MarlinConst {
 
@@ -115,17 +114,17 @@
         int num;
         if (D < 0.0d) {
             // see: http://en.wikipedia.org/wiki/Cubic_function#Trigonometric_.28and_hyperbolic.29_method
-            final double phi = (1.0d/3.0d) * acos(-q / sqrt(-cb_p));
-            final double t = 2.0d * sqrt(-p);
+            final double phi = (1.0d/3.0d) * Math.acos(-q / Math.sqrt(-cb_p));
+            final double t = 2.0d * Math.sqrt(-p);
 
-            pts[ off+0 ] = ( t * cos(phi));
-            pts[ off+1 ] = (-t * cos(phi + (PI / 3.0d)));
-            pts[ off+2 ] = (-t * cos(phi - (PI / 3.0d)));
+            pts[ off+0 ] = ( t * Math.cos(phi));
+            pts[ off+1 ] = (-t * Math.cos(phi + (PI / 3.0d)));
+            pts[ off+2 ] = (-t * Math.cos(phi - (PI / 3.0d)));
             num = 3;
         } else {
-            final double sqrt_D = sqrt(D);
-            final double u = cbrt(sqrt_D - q);
-            final double v = - cbrt(sqrt_D + q);
+            final double sqrt_D = Math.sqrt(D);
+            final double u =   Math.cbrt(sqrt_D - q);
+            final double v = - Math.cbrt(sqrt_D + q);
 
             pts[ off ] = (u + v);
             num = 1;
@@ -171,15 +170,6 @@
         return ret;
     }
 
-    static double polyLineLength(double[] poly, final int off, final int nCoords) {
-        assert nCoords % 2 == 0 && poly.length >= off + nCoords : "";
-        double acc = 0.0d;
-        for (int i = off + 2; i < off + nCoords; i += 2) {
-            acc += linelen(poly[i], poly[i+1], poly[i-2], poly[i-1]);
-        }
-        return acc;
-    }
-
     static double linelen(double x1, double y1, double x2, double y2) {
         final double dx = x2 - x1;
         final double dy = y2 - y1;
@@ -433,4 +423,388 @@
             return;
         }
     }
+
+    // From sun.java2d.loops.GeneralRenderer:
+
+    static int outcode(final double x, final double y,
+                       final double[] clipRect)
+    {
+        int code;
+        if (y < clipRect[0]) {
+            code = OUTCODE_TOP;
+        } else if (y >= clipRect[1]) {
+            code = OUTCODE_BOTTOM;
+        } else {
+            code = 0;
+        }
+        if (x < clipRect[2]) {
+            code |= OUTCODE_LEFT;
+        } else if (x >= clipRect[3]) {
+            code |= OUTCODE_RIGHT;
+        }
+        return code;
+    }
+
+    // a stack of polynomial curves where each curve shares endpoints with
+    // adjacent ones.
+    static final class PolyStack {
+        private static final byte TYPE_LINETO  = (byte) 0;
+        private static final byte TYPE_QUADTO  = (byte) 1;
+        private static final byte TYPE_CUBICTO = (byte) 2;
+
+        // curves capacity = edges count (8192) = edges x 2 (coords)
+        private static final int INITIAL_CURVES_COUNT = INITIAL_EDGES_COUNT << 1;
+
+        // types capacity = edges count (4096)
+        private static final int INITIAL_TYPES_COUNT = INITIAL_EDGES_COUNT;
+
+        double[] curves;
+        int end;
+        byte[] curveTypes;
+        int numCurves;
+
+        // curves ref (dirty)
+        final DoubleArrayCache.Reference curves_ref;
+        // curveTypes ref (dirty)
+        final ByteArrayCache.Reference curveTypes_ref;
+
+        // used marks (stats only)
+        int curveTypesUseMark;
+        int curvesUseMark;
+
+        private final StatLong stat_polystack_types;
+        private final StatLong stat_polystack_curves;
+        private final Histogram hist_polystack_curves;
+        private final StatLong stat_array_polystack_curves;
+        private final StatLong stat_array_polystack_curveTypes;
+
+        PolyStack(final DRendererContext rdrCtx) {
+            this(rdrCtx, null, null, null, null, null);
+        }
+
+        PolyStack(final DRendererContext rdrCtx,
+                  final StatLong stat_polystack_types,
+                  final StatLong stat_polystack_curves,
+                  final Histogram hist_polystack_curves,
+                  final StatLong stat_array_polystack_curves,
+                  final StatLong stat_array_polystack_curveTypes)
+        {
+            curves_ref = rdrCtx.newDirtyDoubleArrayRef(INITIAL_CURVES_COUNT); // 32K
+            curves     = curves_ref.initial;
+
+            curveTypes_ref = rdrCtx.newDirtyByteArrayRef(INITIAL_TYPES_COUNT); // 4K
+            curveTypes     = curveTypes_ref.initial;
+            numCurves = 0;
+            end = 0;
+
+            if (DO_STATS) {
+                curveTypesUseMark = 0;
+                curvesUseMark = 0;
+            }
+            this.stat_polystack_types = stat_polystack_types;
+            this.stat_polystack_curves = stat_polystack_curves;
+            this.hist_polystack_curves = hist_polystack_curves;
+            this.stat_array_polystack_curves = stat_array_polystack_curves;
+            this.stat_array_polystack_curveTypes = stat_array_polystack_curveTypes;
+        }
+
+        /**
+         * Disposes this PolyStack:
+         * clean up before reusing this instance
+         */
+        void dispose() {
+            end = 0;
+            numCurves = 0;
+
+            if (DO_STATS) {
+                stat_polystack_types.add(curveTypesUseMark);
+                stat_polystack_curves.add(curvesUseMark);
+                hist_polystack_curves.add(curvesUseMark);
+
+                // reset marks
+                curveTypesUseMark = 0;
+                curvesUseMark = 0;
+            }
+
+            // Return arrays:
+            // curves and curveTypes are kept dirty
+            curves     = curves_ref.putArray(curves);
+            curveTypes = curveTypes_ref.putArray(curveTypes);
+        }
+
+        private void ensureSpace(final int n) {
+            // use substraction to avoid integer overflow:
+            if (curves.length - end < n) {
+                if (DO_STATS) {
+                    stat_array_polystack_curves.add(end + n);
+                }
+                curves = curves_ref.widenArray(curves, end, end + n);
+            }
+            if (curveTypes.length <= numCurves) {
+                if (DO_STATS) {
+                    stat_array_polystack_curveTypes.add(numCurves + 1);
+                }
+                curveTypes = curveTypes_ref.widenArray(curveTypes,
+                                                       numCurves,
+                                                       numCurves + 1);
+            }
+        }
+
+        void pushCubic(double x0, double y0,
+                       double x1, double y1,
+                       double x2, double y2)
+        {
+            ensureSpace(6);
+            curveTypes[numCurves++] = TYPE_CUBICTO;
+            // we reverse the coordinate order to make popping easier
+            final double[] _curves = curves;
+            int e = end;
+            _curves[e++] = x2;    _curves[e++] = y2;
+            _curves[e++] = x1;    _curves[e++] = y1;
+            _curves[e++] = x0;    _curves[e++] = y0;
+            end = e;
+        }
+
+        void pushQuad(double x0, double y0,
+                      double x1, double y1)
+        {
+            ensureSpace(4);
+            curveTypes[numCurves++] = TYPE_QUADTO;
+            final double[] _curves = curves;
+            int e = end;
+            _curves[e++] = x1;    _curves[e++] = y1;
+            _curves[e++] = x0;    _curves[e++] = y0;
+            end = e;
+        }
+
+        void pushLine(double x, double y) {
+            ensureSpace(2);
+            curveTypes[numCurves++] = TYPE_LINETO;
+            curves[end++] = x;    curves[end++] = y;
+        }
+
+        void pullAll(final DPathConsumer2D io) {
+            final int nc = numCurves;
+            if (nc == 0) {
+                return;
+            }
+            if (DO_STATS) {
+                // update used marks:
+                if (numCurves > curveTypesUseMark) {
+                    curveTypesUseMark = numCurves;
+                }
+                if (end > curvesUseMark) {
+                    curvesUseMark = end;
+                }
+            }
+            final byte[]  _curveTypes = curveTypes;
+            final double[] _curves = curves;
+            int e = 0;
+
+            for (int i = 0; i < nc; i++) {
+                switch(_curveTypes[i]) {
+                case TYPE_LINETO:
+                    io.lineTo(_curves[e], _curves[e+1]);
+                    e += 2;
+                    continue;
+                case TYPE_QUADTO:
+                    io.quadTo(_curves[e+0], _curves[e+1],
+                              _curves[e+2], _curves[e+3]);
+                    e += 4;
+                    continue;
+                case TYPE_CUBICTO:
+                    io.curveTo(_curves[e+0], _curves[e+1],
+                               _curves[e+2], _curves[e+3],
+                               _curves[e+4], _curves[e+5]);
+                    e += 6;
+                    continue;
+                default:
+                }
+            }
+            numCurves = 0;
+            end = 0;
+        }
+
+        void popAll(final DPathConsumer2D io) {
+            int nc = numCurves;
+            if (nc == 0) {
+                return;
+            }
+            if (DO_STATS) {
+                // update used marks:
+                if (numCurves > curveTypesUseMark) {
+                    curveTypesUseMark = numCurves;
+                }
+                if (end > curvesUseMark) {
+                    curvesUseMark = end;
+                }
+            }
+            final byte[]  _curveTypes = curveTypes;
+            final double[] _curves = curves;
+            int e  = end;
+
+            while (nc != 0) {
+                switch(_curveTypes[--nc]) {
+                case TYPE_LINETO:
+                    e -= 2;
+                    io.lineTo(_curves[e], _curves[e+1]);
+                    continue;
+                case TYPE_QUADTO:
+                    e -= 4;
+                    io.quadTo(_curves[e+0], _curves[e+1],
+                              _curves[e+2], _curves[e+3]);
+                    continue;
+                case TYPE_CUBICTO:
+                    e -= 6;
+                    io.curveTo(_curves[e+0], _curves[e+1],
+                               _curves[e+2], _curves[e+3],
+                               _curves[e+4], _curves[e+5]);
+                    continue;
+                default:
+                }
+            }
+            numCurves = 0;
+            end = 0;
+        }
+
+        @Override
+        public String toString() {
+            String ret = "";
+            int nc = numCurves;
+            int last = end;
+            int len;
+            while (nc != 0) {
+                switch(curveTypes[--nc]) {
+                case TYPE_LINETO:
+                    len = 2;
+                    ret += "line: ";
+                    break;
+                case TYPE_QUADTO:
+                    len = 4;
+                    ret += "quad: ";
+                    break;
+                case TYPE_CUBICTO:
+                    len = 6;
+                    ret += "cubic: ";
+                    break;
+                default:
+                    len = 0;
+                }
+                last -= len;
+                ret += Arrays.toString(Arrays.copyOfRange(curves, last, last+len))
+                                       + "\n";
+            }
+            return ret;
+        }
+    }
+
+    // a stack of integer indices
+    static final class IndexStack {
+
+        // integer capacity = edges count / 4 ~ 1024
+        private static final int INITIAL_COUNT = INITIAL_EDGES_COUNT >> 2;
+
+        private int end;
+        private int[] indices;
+
+        // indices ref (dirty)
+        private final IntArrayCache.Reference indices_ref;
+
+        // used marks (stats only)
+        private int indicesUseMark;
+
+        private final StatLong stat_idxstack_indices;
+        private final Histogram hist_idxstack_indices;
+        private final StatLong stat_array_idxstack_indices;
+
+        IndexStack(final DRendererContext rdrCtx) {
+            this(rdrCtx, null, null, null);
+        }
+
+        IndexStack(final DRendererContext rdrCtx,
+                   final StatLong stat_idxstack_indices,
+                   final Histogram hist_idxstack_indices,
+                   final StatLong stat_array_idxstack_indices)
+        {
+            indices_ref = rdrCtx.newDirtyIntArrayRef(INITIAL_COUNT); // 4K
+            indices     = indices_ref.initial;
+            end = 0;
+
+            if (DO_STATS) {
+                indicesUseMark = 0;
+            }
+            this.stat_idxstack_indices = stat_idxstack_indices;
+            this.hist_idxstack_indices = hist_idxstack_indices;
+            this.stat_array_idxstack_indices = stat_array_idxstack_indices;
+        }
+
+        /**
+         * Disposes this PolyStack:
+         * clean up before reusing this instance
+         */
+        void dispose() {
+            end = 0;
+
+            if (DO_STATS) {
+                stat_idxstack_indices.add(indicesUseMark);
+                hist_idxstack_indices.add(indicesUseMark);
+
+                // reset marks
+                indicesUseMark = 0;
+            }
+
+            // Return arrays:
+            // values is kept dirty
+            indices = indices_ref.putArray(indices);
+        }
+
+        boolean isEmpty() {
+            return (end == 0);
+        }
+
+        void reset() {
+            end = 0;
+        }
+
+        void push(final int v) {
+            // remove redundant values (reverse order):
+            int[] _values = indices;
+            final int nc = end;
+            if (nc != 0) {
+                if (_values[nc - 1] == v) {
+                    // remove both duplicated values:
+                    end--;
+                    return;
+                }
+            }
+            if (_values.length <= nc) {
+                if (DO_STATS) {
+                    stat_array_idxstack_indices.add(nc + 1);
+                }
+                indices = _values = indices_ref.widenArray(_values, nc, nc + 1);
+            }
+            _values[end++] = v;
+
+            if (DO_STATS) {
+                // update used marks:
+                if (end > indicesUseMark) {
+                    indicesUseMark = end;
+                }
+            }
+        }
+
+        void pullAll(final double[] points, final DPathConsumer2D io) {
+            final int nc = end;
+            if (nc == 0) {
+                return;
+            }
+            final int[] _values = indices;
+
+            for (int i = 0, j; i < nc; i++) {
+                j = _values[i] << 1;
+                io.lineTo(points[j], points[j + 1]);
+            }
+            end = 0;
+        }
+    }
 }
--- a/src/java.desktop/share/classes/sun/java2d/marlin/DMarlinRenderingEngine.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/sun/java2d/marlin/DMarlinRenderingEngine.java	Wed Dec 13 10:25:38 2017 -0800
@@ -84,6 +84,13 @@
     static final double UPPER_BND = Float.MAX_VALUE / 2.0d;
     static final double LOWER_BND = -UPPER_BND;
 
+    static final boolean DO_CLIP = MarlinProperties.isDoClip();
+    static final boolean DO_CLIP_FILL = true;
+
+    static final boolean DO_TRACE_PATH = false;
+
+    static final boolean DO_CLIP_RUNTIME_ENABLE = MarlinProperties.isDoClipRuntimeFlag();
+
     /**
      * Public constructor
      */
@@ -133,7 +140,7 @@
                      miterlimit,
                      dashes,
                      dashphase,
-                     rdrCtx.transformerPC2D.wrapPath2d(p2d)
+                     rdrCtx.transformerPC2D.wrapPath2D(p2d)
                     );
 
             // Use Path2D copy constructor (trim)
@@ -195,14 +202,14 @@
         }
     }
 
-    final void strokeTo(final DRendererContext rdrCtx,
-                        Shape src,
-                        AffineTransform at,
-                        BasicStroke bs,
-                        boolean thin,
-                        NormMode normalize,
-                        boolean antialias,
-                        DPathConsumer2D pc2d)
+    void strokeTo(final DRendererContext rdrCtx,
+                  Shape src,
+                  AffineTransform at,
+                  BasicStroke bs,
+                  boolean thin,
+                  NormMode normalize,
+                  boolean antialias,
+                  DPathConsumer2D pc2d)
     {
         double lw;
         if (thin) {
@@ -295,17 +302,17 @@
         return (lw / widthScale);
     }
 
-    final void strokeTo(final DRendererContext rdrCtx,
-                        Shape src,
-                        AffineTransform at,
-                        double width,
-                        NormMode norm,
-                        int caps,
-                        int join,
-                        float miterlimit,
-                        float[] dashes,
-                        float dashphase,
-                        DPathConsumer2D pc2d)
+    void strokeTo(final DRendererContext rdrCtx,
+                  Shape src,
+                  AffineTransform at,
+                  double width,
+                  NormMode norm,
+                  int caps,
+                  int join,
+                  float miterlimit,
+                  float[] dashes,
+                  float dashphase,
+                  DPathConsumer2D pc2d)
     {
         // We use strokerat so that in Stroker and Dasher we can work only
         // with the pre-transformation coordinates. This will repeat a lot of
@@ -324,6 +331,7 @@
 
         int dashLen = -1;
         boolean recycleDashes = false;
+        double scale = 1.0d;
         double[] dashesD = null;
 
         // Ensure converting dashes to double precision:
@@ -364,7 +372,7 @@
             // a*b == -c*d && a*a+c*c == b*b+d*d. In the actual check below, we
             // leave a bit of room for error.
             if (nearZero(a*b + c*d) && nearZero(a*a + c*c - (b*b + d*d))) {
-                final double scale =  Math.sqrt(a*a + c*c);
+                scale =  Math.sqrt(a*a + c*c);
 
                 if (dashesD != null) {
                     for (int i = 0; i < dashLen; i++) {
@@ -399,23 +407,44 @@
             at = null;
         }
 
+        final DTransformingPathConsumer2D transformerPC2D = rdrCtx.transformerPC2D;
+
+        if (DO_TRACE_PATH) {
+            // trace Stroker:
+            pc2d = transformerPC2D.traceStroker(pc2d);
+        }
+
         if (USE_SIMPLIFIER) {
             // Use simplifier after stroker before Renderer
             // to remove collinear segments (notably due to cap square)
             pc2d = rdrCtx.simplifier.init(pc2d);
         }
 
-        final DTransformingPathConsumer2D transformerPC2D = rdrCtx.transformerPC2D;
+        // deltaTransformConsumer may adjust the clip rectangle:
         pc2d = transformerPC2D.deltaTransformConsumer(pc2d, strokerat);
 
-        pc2d = rdrCtx.stroker.init(pc2d, width, caps, join, miterlimit);
+        // stroker will adjust the clip rectangle (width / miter limit):
+        pc2d = rdrCtx.stroker.init(pc2d, width, caps, join, miterlimit, scale);
 
         if (dashesD != null) {
             pc2d = rdrCtx.dasher.init(pc2d, dashesD, dashLen, dashphase,
                                       recycleDashes);
+        } else if (rdrCtx.doClip && (caps != Stroker.CAP_BUTT)) {
+            if (DO_TRACE_PATH) {
+                pc2d = transformerPC2D.traceClosedPathDetector(pc2d);
+            }
+
+            // If no dash and clip is enabled:
+            // detect closedPaths (polygons) for caps
+            pc2d = transformerPC2D.detectClosedPath(pc2d);
         }
         pc2d = transformerPC2D.inverseDeltaTransformConsumer(pc2d, strokerat);
 
+        if (DO_TRACE_PATH) {
+            // trace Input:
+            pc2d = transformerPC2D.traceInput(pc2d);
+        }
+
         final PathIterator pi = norm.getNormalizingPathIterator(rdrCtx,
                                          src.getPathIterator(at));
 
@@ -596,14 +625,12 @@
     }
 
     private static void pathTo(final DRendererContext rdrCtx, final PathIterator pi,
-                               final DPathConsumer2D pc2d)
+                               DPathConsumer2D pc2d)
     {
         // mark context as DIRTY:
         rdrCtx.dirty = true;
 
-        final double[] coords = rdrCtx.double6;
-
-        pathToLoop(coords, pi, pc2d);
+        pathToLoop(rdrCtx.double6, pi, pc2d);
 
         // mark context as CLEAN:
         rdrCtx.dirty = false;
@@ -781,6 +808,19 @@
 
         final DRendererContext rdrCtx = getRendererContext();
         try {
+            if (DO_CLIP || (DO_CLIP_RUNTIME_ENABLE && MarlinProperties.isDoClipAtRuntime())) {
+                // Define the initial clip bounds:
+                final double[] clipRect = rdrCtx.clipRect;
+
+                clipRect[0] = clip.getLoY();
+                clipRect[1] = clip.getLoY() + clip.getHeight();
+                clipRect[2] = clip.getLoX();
+                clipRect[3] = clip.getLoX() + clip.getWidth();
+
+                // Enable clipping:
+                rdrCtx.doClip = true;
+            }
+
             // Test if at is identity:
             final AffineTransform _at = (at != null && !at.isIdentity()) ? at
                                         : null;
@@ -797,13 +837,29 @@
                                          clip.getWidth(), clip.getHeight(),
                                          pi.getWindingRule());
 
+                DPathConsumer2D pc2d = r;
+
+                if (DO_CLIP_FILL && rdrCtx.doClip) {
+                    if (DO_TRACE_PATH) {
+                        // trace Filler:
+                        pc2d = rdrCtx.transformerPC2D.traceFiller(pc2d);
+                    }
+                    pc2d = rdrCtx.transformerPC2D.pathClipper(pc2d);
+                }
+
+                if (DO_TRACE_PATH) {
+                    // trace Input:
+                    pc2d = rdrCtx.transformerPC2D.traceInput(pc2d);
+                }
+
                 // TODO: subdivide quad/cubic curves into monotonic curves ?
-                pathTo(rdrCtx, pi, r);
+                pathTo(rdrCtx, pi, pc2d);
+
             } else {
                 // draw shape with given stroke:
                 r = rdrCtx.renderer.init(clip.getLoX(), clip.getLoY(),
                                          clip.getWidth(), clip.getHeight(),
-                                         PathIterator.WIND_NON_ZERO);
+                                         WIND_NON_ZERO);
 
                 strokeTo(rdrCtx, s, _at, bs, thin, norm, true, r);
             }
@@ -826,12 +882,12 @@
     }
 
     @Override
-    public final AATileGenerator getAATileGenerator(double x, double y,
-                                                    double dx1, double dy1,
-                                                    double dx2, double dy2,
-                                                    double lw1, double lw2,
-                                                    Region clip,
-                                                    int[] bbox)
+    public AATileGenerator getAATileGenerator(double x, double y,
+                                              double dx1, double dy1,
+                                              double dx2, double dy2,
+                                              double lw1, double lw2,
+                                              Region clip,
+                                              int[] bbox)
     {
         // REMIND: Deal with large coordinates!
         double ldx1, ldy1, ldx2, ldy2;
@@ -862,8 +918,8 @@
         final DRendererContext rdrCtx = getRendererContext();
         try {
             r = rdrCtx.renderer.init(clip.getLoX(), clip.getLoY(),
-                                         clip.getWidth(), clip.getHeight(),
-                                         DRenderer.WIND_EVEN_ODD);
+                                     clip.getWidth(), clip.getHeight(),
+                                     WIND_EVEN_ODD);
 
             r.moveTo( x,  y);
             r.lineTo( (x+dx1),  (y+dy1));
@@ -915,14 +971,14 @@
     }
 
     static {
-        if (PathIterator.WIND_NON_ZERO != DRenderer.WIND_NON_ZERO ||
-            PathIterator.WIND_EVEN_ODD != DRenderer.WIND_EVEN_ODD ||
-            BasicStroke.JOIN_MITER != DStroker.JOIN_MITER ||
-            BasicStroke.JOIN_ROUND != DStroker.JOIN_ROUND ||
-            BasicStroke.JOIN_BEVEL != DStroker.JOIN_BEVEL ||
-            BasicStroke.CAP_BUTT != DStroker.CAP_BUTT ||
-            BasicStroke.CAP_ROUND != DStroker.CAP_ROUND ||
-            BasicStroke.CAP_SQUARE != DStroker.CAP_SQUARE)
+        if (PathIterator.WIND_NON_ZERO != WIND_NON_ZERO ||
+            PathIterator.WIND_EVEN_ODD != WIND_EVEN_ODD ||
+            BasicStroke.JOIN_MITER != JOIN_MITER ||
+            BasicStroke.JOIN_ROUND != JOIN_ROUND ||
+            BasicStroke.JOIN_BEVEL != JOIN_BEVEL ||
+            BasicStroke.CAP_BUTT != CAP_BUTT ||
+            BasicStroke.CAP_ROUND != CAP_ROUND ||
+            BasicStroke.CAP_SQUARE != CAP_SQUARE)
         {
             throw new InternalError("mismatched renderer constants");
         }
@@ -1045,6 +1101,11 @@
         logInfo("sun.java2d.renderer.useSimplifier    = "
                 + MarlinConst.USE_SIMPLIFIER);
 
+        logInfo("sun.java2d.renderer.clip             = "
+                + MarlinProperties.isDoClip());
+        logInfo("sun.java2d.renderer.clip.runtime.enable = "
+                + MarlinProperties.isDoClipRuntimeFlag());
+
         // debugging parameters
         logInfo("sun.java2d.renderer.doStats          = "
                 + MarlinConst.DO_STATS);
--- a/src/java.desktop/share/classes/sun/java2d/marlin/DRenderer.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/sun/java2d/marlin/DRenderer.java	Wed Dec 13 10:25:38 2017 -0800
@@ -46,6 +46,9 @@
     static final int SUBPIXEL_MASK_X = SUBPIXEL_POSITIONS_X - 1;
     static final int SUBPIXEL_MASK_Y = SUBPIXEL_POSITIONS_Y - 1;
 
+    static final double RDR_OFFSET_X = 0.5d / SUBPIXEL_SCALE_X;
+    static final double RDR_OFFSET_Y = 0.5d / SUBPIXEL_SCALE_Y;
+
     // number of subpixels corresponding to a tile line
     private static final int SUBPIXEL_TILE
         = TILE_H << SUBPIXEL_LG_POSITIONS_Y;
@@ -57,9 +60,6 @@
     // crossing capacity = edges count / 4 ~ 1024
     static final int INITIAL_CROSSING_COUNT = INITIAL_EDGES_COUNT >> 2;
 
-    public static final int WIND_EVEN_ODD = 0;
-    public static final int WIND_NON_ZERO = 1;
-
     // common to all types of input path segments.
     // OFFSET as bytes
     // only integer values:
@@ -522,11 +522,11 @@
 
     DRenderer(final DRendererContext rdrCtx) {
         this.rdrCtx = rdrCtx;
+        this.curve = rdrCtx.curve;
+        this.cache = rdrCtx.cache;
 
         this.edges = rdrCtx.newOffHeapArray(INITIAL_EDGES_CAPACITY); // 96K
 
-        this.curve = rdrCtx.curve;
-
         edgeBuckets_ref      = rdrCtx.newCleanIntArrayRef(INITIAL_BUCKET_ARRAY); // 64K
         edgeBucketCounts_ref = rdrCtx.newCleanIntArrayRef(INITIAL_BUCKET_ARRAY); // 64K
 
@@ -537,8 +537,6 @@
         alphaLine_ref = rdrCtx.newCleanIntArrayRef(INITIAL_AA_ARRAY); // 8K
         alphaLine     = alphaLine_ref.initial;
 
-        this.cache = rdrCtx.cache;
-
         crossings_ref     = rdrCtx.newDirtyIntArrayRef(INITIAL_CROSSING_COUNT); // 2K
         aux_crossings_ref = rdrCtx.newDirtyIntArrayRef(INITIAL_CROSSING_COUNT); // 2K
         edgePtrs_ref      = rdrCtx.newDirtyIntArrayRef(INITIAL_CROSSING_COUNT); // 2K
@@ -668,7 +666,7 @@
     }
 
     @Override
-    public void moveTo(double pix_x0, double pix_y0) {
+    public void moveTo(final double pix_x0, final double pix_y0) {
         closePath();
         final double sx = tosubpixx(pix_x0);
         final double sy = tosubpixy(pix_y0);
@@ -679,7 +677,7 @@
     }
 
     @Override
-    public void lineTo(double pix_x1, double pix_y1) {
+    public void lineTo(final double pix_x1, final double pix_y1) {
         final double x1 = tosubpixx(pix_x1);
         final double y1 = tosubpixy(pix_y1);
         addLine(x0, y0, x1, y1);
@@ -688,24 +686,26 @@
     }
 
     @Override
-    public void curveTo(double x1, double y1,
-                        double x2, double y2,
-                        double x3, double y3)
+    public void curveTo(final double pix_x1, final double pix_y1,
+                        final double pix_x2, final double pix_y2,
+                        final double pix_x3, final double pix_y3)
     {
-        final double xe = tosubpixx(x3);
-        final double ye = tosubpixy(y3);
-        curve.set(x0, y0, tosubpixx(x1), tosubpixy(y1),
-                          tosubpixx(x2), tosubpixy(y2), xe, ye);
+        final double xe = tosubpixx(pix_x3);
+        final double ye = tosubpixy(pix_y3);
+        curve.set(x0, y0, tosubpixx(pix_x1), tosubpixy(pix_y1),
+                  tosubpixx(pix_x2), tosubpixy(pix_y2), xe, ye);
         curveBreakIntoLinesAndAdd(x0, y0, curve, xe, ye);
         x0 = xe;
         y0 = ye;
     }
 
     @Override
-    public void quadTo(double x1, double y1, double x2, double y2) {
-        final double xe = tosubpixx(x2);
-        final double ye = tosubpixy(y2);
-        curve.set(x0, y0, tosubpixx(x1), tosubpixy(y1), xe, ye);
+    public void quadTo(final double pix_x1, final double pix_y1,
+                       final double pix_x2, final double pix_y2)
+    {
+        final double xe = tosubpixx(pix_x2);
+        final double ye = tosubpixy(pix_y2);
+        curve.set(x0, y0, tosubpixx(pix_x1), tosubpixy(pix_y1), xe, ye);
         quadBreakIntoLinesAndAdd(x0, y0, curve, xe, ye);
         x0 = xe;
         y0 = ye;
@@ -713,9 +713,11 @@
 
     @Override
     public void closePath() {
-        addLine(x0, y0, sx0, sy0);
-        x0 = sx0;
-        y0 = sy0;
+        if (x0 != sx0 || y0 != sy0) {
+            addLine(x0, y0, sx0, sy0);
+            x0 = sx0;
+            y0 = sy0;
+        }
     }
 
     @Override
--- a/src/java.desktop/share/classes/sun/java2d/marlin/DRendererContext.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/sun/java2d/marlin/DRendererContext.java	Wed Dec 13 10:25:38 2017 -0800
@@ -75,16 +75,22 @@
     final MarlinCache cache;
     // flag indicating the shape is stroked (1) or filled (0)
     int stroking = 0;
+    // flag indicating to clip the shape
+    boolean doClip = false;
+    // flag indicating if the path is closed or not (in advance) to handle properly caps
+    boolean closedPath = false;
+    // clip rectangle (ymin, ymax, xmin, xmax):
+    final double[] clipRect = new double[4];
 
     // Array caches:
     /* clean int[] cache (zero-filled) = 5 refs */
     private final IntArrayCache cleanIntCache = new IntArrayCache(true, 5);
-    /* dirty int[] cache = 4 refs */
-    private final IntArrayCache dirtyIntCache = new IntArrayCache(false, 4);
-    /* dirty double[] cache = 3 refs */
-    private final DoubleArrayCache dirtyDoubleCache = new DoubleArrayCache(false, 3);
-    /* dirty byte[] cache = 1 ref */
-    private final ByteArrayCache dirtyByteCache = new ByteArrayCache(false, 1);
+    /* dirty int[] cache = 5 refs */
+    private final IntArrayCache dirtyIntCache = new IntArrayCache(false, 5);
+    /* dirty double[] cache = 4 refs (2 polystack) */
+    private final DoubleArrayCache dirtyDoubleCache = new DoubleArrayCache(false, 4);
+    /* dirty byte[] cache = 2 ref (2 polystack) */
+    private final ByteArrayCache dirtyByteCache = new ByteArrayCache(false, 2);
 
     // RendererContext statistics
     final RendererStats stats;
@@ -119,7 +125,7 @@
         nPQPathIterator  = new NormalizingPathIterator.NearestPixelQuarter(double6);
 
         // MarlinRenderingEngine.TransformingPathConsumer2D
-        transformerPC2D = new DTransformingPathConsumer2D();
+        transformerPC2D = new DTransformingPathConsumer2D(this);
 
         // Renderer:
         cache = new MarlinCache(this);
@@ -141,7 +147,10 @@
             }
             stats.totalOffHeap = 0L;
         }
-        stroking = 0;
+        stroking   = 0;
+        doClip     = false;
+        closedPath = false;
+
         // if context is maked as DIRTY:
         if (dirty) {
             // may happen if an exception if thrown in the pipeline processing:
@@ -162,12 +171,11 @@
 
     Path2D.Double getPath2D() {
         // resolve reference:
-        Path2D.Double p2d
-            = (refPath2D != null) ? refPath2D.get() : null;
+        Path2D.Double p2d = (refPath2D != null) ? refPath2D.get() : null;
 
         // create a new Path2D ?
         if (p2d == null) {
-            p2d = new Path2D.Double(Path2D.WIND_NON_ZERO, INITIAL_EDGES_COUNT); // 32K
+            p2d = new Path2D.Double(WIND_NON_ZERO, INITIAL_EDGES_COUNT); // 32K
 
             // update weak reference:
             refPath2D = new WeakReference<Path2D.Double>(p2d);
--- a/src/java.desktop/share/classes/sun/java2d/marlin/DStroker.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/sun/java2d/marlin/DStroker.java	Wed Dec 13 10:25:38 2017 -0800
@@ -26,6 +26,7 @@
 package sun.java2d.marlin;
 
 import java.util.Arrays;
+import sun.java2d.marlin.DHelpers.PolyStack;
 
 // TODO: some of the arithmetic here is too verbose and prone to hard to
 // debug typos. We should consider making a small Point/Vector class that
@@ -36,42 +37,16 @@
     private static final int DRAWING_OP_TO = 1; // ie. curve, line, or quad
     private static final int CLOSE = 2;
 
-    /**
-     * Constant value for join style.
-     */
-    public static final int JOIN_MITER = 0;
-
-    /**
-     * Constant value for join style.
-     */
-    public static final int JOIN_ROUND = 1;
-
-    /**
-     * Constant value for join style.
-     */
-    public static final int JOIN_BEVEL = 2;
-
-    /**
-     * Constant value for end cap style.
-     */
-    public static final int CAP_BUTT = 0;
-
-    /**
-     * Constant value for end cap style.
-     */
-    public static final int CAP_ROUND = 1;
-
-    /**
-     * Constant value for end cap style.
-     */
-    public static final int CAP_SQUARE = 2;
-
     // pisces used to use fixed point arithmetic with 16 decimal digits. I
     // didn't want to change the values of the constant below when I converted
     // it to floating point, so that's why the divisions by 2^16 are there.
     private static final double ROUND_JOIN_THRESHOLD = 1000.0d/65536.0d;
 
-    private static final double C = 0.5522847498307933d;
+    // kappa = (4/3) * (SQRT(2) - 1)
+    private static final double C = (4.0d * (Math.sqrt(2.0d) - 1.0d) / 3.0d);
+
+    // SQRT(2)
+    private static final double SQRT_2 = Math.sqrt(2.0d);
 
     private static final int MAX_N_CURVES = 11;
 
@@ -118,6 +93,20 @@
     // dirty curve
     final DCurve curve;
 
+    // Bounds of the drawing region, at pixel precision.
+    private double[] clipRect;
+
+    // the outcode of the current point
+    private int cOutCode = 0;
+
+    // the outcode of the starting point
+    private int sOutCode = 0;
+
+    // flag indicating if the path is opened (clipped)
+    private boolean opened = false;
+    // flag indicating if the starting point's cap is done
+    private boolean capStart = false;
+
     /**
      * Constructs a <code>DStroker</code>.
      * @param rdrCtx per-thread renderer context
@@ -125,7 +114,15 @@
     DStroker(final DRendererContext rdrCtx) {
         this.rdrCtx = rdrCtx;
 
-        this.reverse = new PolyStack(rdrCtx);
+        this.reverse = (rdrCtx.stats != null) ?
+            new PolyStack(rdrCtx,
+                    rdrCtx.stats.stat_str_polystack_types,
+                    rdrCtx.stats.stat_str_polystack_curves,
+                    rdrCtx.stats.hist_str_polystack_curves,
+                    rdrCtx.stats.stat_array_str_polystack_curves,
+                    rdrCtx.stats.stat_array_str_polystack_types)
+            : new PolyStack(rdrCtx);
+
         this.curve = rdrCtx.curve;
     }
 
@@ -141,13 +138,15 @@
      * <code>JOIN_MITER</code>, <code>JOIN_ROUND</code> or
      * <code>JOIN_BEVEL</code>.
      * @param miterLimit the desired miter limit
+     * @param scale scaling factor applied to clip boundaries
      * @return this instance
      */
-    DStroker init(DPathConsumer2D pc2d,
-              double lineWidth,
-              int capStyle,
-              int joinStyle,
-              double miterLimit)
+    DStroker init(final DPathConsumer2D pc2d,
+                  final double lineWidth,
+                  final int capStyle,
+                  final int joinStyle,
+                  final double miterLimit,
+                  final double scale)
     {
         this.out = pc2d;
 
@@ -156,13 +155,45 @@
         this.capStyle = capStyle;
         this.joinStyle = joinStyle;
 
-        double limit = miterLimit * lineWidth2;
+        final double limit = miterLimit * lineWidth2;
         this.miterLimitSq = limit * limit;
 
         this.prev = CLOSE;
 
         rdrCtx.stroking = 1;
 
+        if (rdrCtx.doClip) {
+            // Adjust the clipping rectangle with the stroker margin (miter limit, width)
+            double rdrOffX = 0.0d, rdrOffY = 0.0d;
+            double margin = lineWidth2;
+
+            if (capStyle == CAP_SQUARE) {
+                margin *= SQRT_2;
+            }
+            if ((joinStyle == JOIN_MITER) && (margin < limit)) {
+                margin = limit;
+            }
+            if (scale != 1.0d) {
+                margin *= scale;
+                rdrOffX = scale * DRenderer.RDR_OFFSET_X;
+                rdrOffY = scale * DRenderer.RDR_OFFSET_Y;
+            }
+            // add a small rounding error:
+            margin += 1e-3d;
+
+            // bounds as half-open intervals: minX <= x < maxX and minY <= y < maxY
+            // adjust clip rectangle (ymin, ymax, xmin, xmax):
+            final double[] _clipRect = rdrCtx.clipRect;
+            _clipRect[0] -= margin - rdrOffY;
+            _clipRect[1] += margin + rdrOffY;
+            _clipRect[2] -= margin - rdrOffX;
+            _clipRect[3] += margin + rdrOffX;
+            this.clipRect = _clipRect;
+        } else {
+            this.clipRect = null;
+            this.cOutCode = 0;
+            this.sOutCode = 0;
+        }
         return this; // fluent API
     }
 
@@ -173,6 +204,9 @@
     void dispose() {
         reverse.dispose();
 
+        opened   = false;
+        capStart = false;
+
         if (DO_CLEAN_DIRTY) {
             // Force zero-fill dirty arrays:
             Arrays.fill(offset0, 0.0d);
@@ -443,19 +477,62 @@
     }
 
     @Override
-    public void moveTo(double x0, double y0) {
-        if (prev == DRAWING_OP_TO) {
-            finish();
+    public void moveTo(final double x0, final double y0) {
+        moveTo(x0, y0, cOutCode);
+        // update starting point:
+        this.sx0 = x0;
+        this.sy0 = y0;
+        this.sdx = 1.0d;
+        this.sdy = 0.0d;
+        this.opened   = false;
+        this.capStart = false;
+
+        if (clipRect != null) {
+            final int outcode = DHelpers.outcode(x0, y0, clipRect);
+            this.cOutCode = outcode;
+            this.sOutCode = outcode;
         }
-        this.sx0 = this.cx0 = x0;
-        this.sy0 = this.cy0 = y0;
-        this.cdx = this.sdx = 1.0d;
-        this.cdy = this.sdy = 0.0d;
-        this.prev = MOVE_TO;
+    }
+
+    private void moveTo(final double x0, final double y0,
+                        final int outcode)
+    {
+        if (prev == MOVE_TO) {
+            this.cx0 = x0;
+            this.cy0 = y0;
+        } else {
+            if (prev == DRAWING_OP_TO) {
+                finish(outcode);
+            }
+            this.prev = MOVE_TO;
+            this.cx0 = x0;
+            this.cy0 = y0;
+            this.cdx = 1.0d;
+            this.cdy = 0.0d;
+        }
     }
 
     @Override
-    public void lineTo(double x1, double y1) {
+    public void lineTo(final double x1, final double y1) {
+        lineTo(x1, y1, false);
+    }
+
+    private void lineTo(final double x1, final double y1,
+                        final boolean force)
+    {
+        final int outcode0 = this.cOutCode;
+        if (!force && clipRect != null) {
+            final int outcode1 = DHelpers.outcode(x1, y1, clipRect);
+            this.cOutCode = outcode1;
+
+            // basic rejection criteria
+            if ((outcode0 & outcode1) != 0) {
+                moveTo(x1, y1, outcode0);
+                opened = true;
+                return;
+            }
+        }
+
         double dx = x1 - cx0;
         double dy = y1 - cy0;
         if (dx == 0.0d && dy == 0.0d) {
@@ -465,7 +542,7 @@
         final double mx = offset0[0];
         final double my = offset0[1];
 
-        drawJoin(cdx, cdy, cx0, cy0, dx, dy, cmx, cmy, mx, my);
+        drawJoin(cdx, cdy, cx0, cy0, dx, dy, cmx, cmy, mx, my, outcode0);
 
         emitLineTo(cx0 + mx, cy0 + my);
         emitLineTo( x1 + mx,  y1 + my);
@@ -473,43 +550,65 @@
         emitLineToRev(cx0 - mx, cy0 - my);
         emitLineToRev( x1 - mx,  y1 - my);
 
-        this.cmx = mx;
-        this.cmy = my;
+        this.prev = DRAWING_OP_TO;
+        this.cx0 = x1;
+        this.cy0 = y1;
         this.cdx = dx;
         this.cdy = dy;
-        this.cx0 = x1;
-        this.cy0 = y1;
-        this.prev = DRAWING_OP_TO;
+        this.cmx = mx;
+        this.cmy = my;
     }
 
     @Override
     public void closePath() {
-        if (prev != DRAWING_OP_TO) {
+        // distinguish empty path at all vs opened path ?
+        if (prev != DRAWING_OP_TO && !opened) {
             if (prev == CLOSE) {
                 return;
             }
             emitMoveTo(cx0, cy0 - lineWidth2);
-            this.cmx = this.smx = 0.0d;
-            this.cmy = this.smy = -lineWidth2;
-            this.cdx = this.sdx = 1.0d;
-            this.cdy = this.sdy = 0.0d;
-            finish();
+
+            this.sdx = 1.0d;
+            this.sdy = 0.0d;
+            this.cdx = 1.0d;
+            this.cdy = 0.0d;
+
+            this.smx = 0.0d;
+            this.smy = -lineWidth2;
+            this.cmx = 0.0d;
+            this.cmy = -lineWidth2;
+
+            finish(cOutCode);
             return;
         }
 
-        if (cx0 != sx0 || cy0 != sy0) {
-            lineTo(sx0, sy0);
-        }
+        // basic acceptance criteria
+        if ((sOutCode & cOutCode) == 0) {
+            if (cx0 != sx0 || cy0 != sy0) {
+                lineTo(sx0, sy0, true);
+            }
+
+            drawJoin(cdx, cdy, cx0, cy0, sdx, sdy, cmx, cmy, smx, smy, sOutCode);
 
-        drawJoin(cdx, cdy, cx0, cy0, sdx, sdy, cmx, cmy, smx, smy);
+            emitLineTo(sx0 + smx, sy0 + smy);
 
-        emitLineTo(sx0 + smx, sy0 + smy);
-
-        emitMoveTo(sx0 - smx, sy0 - smy);
+            if (opened) {
+                emitLineTo(sx0 - smx, sy0 - smy);
+            } else {
+                emitMoveTo(sx0 - smx, sy0 - smy);
+            }
+        }
+        // Ignore caps like finish(false)
         emitReverse();
 
         this.prev = CLOSE;
-        emitClose();
+
+        if (opened) {
+            // do not emit close
+            opened = false;
+        } else {
+            emitClose();
+        }
     }
 
     private void emitReverse() {
@@ -519,7 +618,7 @@
     @Override
     public void pathDone() {
         if (prev == DRAWING_OP_TO) {
-            finish();
+            finish(cOutCode);
         }
 
         out.pathDone();
@@ -532,23 +631,39 @@
         dispose();
     }
 
-    private void finish() {
-        if (capStyle == CAP_ROUND) {
-            drawRoundCap(cx0, cy0, cmx, cmy);
-        } else if (capStyle == CAP_SQUARE) {
-            emitLineTo(cx0 - cmy + cmx, cy0 + cmx + cmy);
-            emitLineTo(cx0 - cmy - cmx, cy0 + cmx - cmy);
-        }
+    private void finish(final int outcode) {
+        // Problem: impossible to guess if the path will be closed in advance
+        //          i.e. if caps must be drawn or not ?
+        // Solution: use the ClosedPathDetector before Stroker to determine
+        // if the path is a closed path or not
+        if (!rdrCtx.closedPath) {
+            if (outcode == 0) {
+                // current point = end's cap:
+                if (capStyle == CAP_ROUND) {
+                    drawRoundCap(cx0, cy0, cmx, cmy);
+                } else if (capStyle == CAP_SQUARE) {
+                    emitLineTo(cx0 - cmy + cmx, cy0 + cmx + cmy);
+                    emitLineTo(cx0 - cmy - cmx, cy0 + cmx - cmy);
+                }
+            }
+            emitReverse();
 
-        emitReverse();
+            if (!capStart) {
+                capStart = true;
 
-        if (capStyle == CAP_ROUND) {
-            drawRoundCap(sx0, sy0, -smx, -smy);
-        } else if (capStyle == CAP_SQUARE) {
-            emitLineTo(sx0 + smy - smx, sy0 - smx - smy);
-            emitLineTo(sx0 + smy + smx, sy0 - smx + smy);
+                if (sOutCode == 0) {
+                    // starting point = initial cap:
+                    if (capStyle == CAP_ROUND) {
+                        drawRoundCap(sx0, sy0, -smx, -smy);
+                    } else if (capStyle == CAP_SQUARE) {
+                        emitLineTo(sx0 + smy - smx, sy0 - smx - smy);
+                        emitLineTo(sx0 + smy + smx, sy0 - smx + smy);
+                    }
+                }
+            }
+        } else {
+            emitReverse();
         }
-
         emitClose();
     }
 
@@ -620,23 +735,28 @@
                           double x0, double y0,
                           double dx, double dy,
                           double omx, double omy,
-                          double mx, double my)
+                          double mx, double my,
+                          final int outcode)
     {
         if (prev != DRAWING_OP_TO) {
             emitMoveTo(x0 + mx, y0 + my);
-            this.sdx = dx;
-            this.sdy = dy;
-            this.smx = mx;
-            this.smy = my;
+            if (!opened) {
+                this.sdx = dx;
+                this.sdy = dy;
+                this.smx = mx;
+                this.smy = my;
+            }
         } else {
-            boolean cw = isCW(pdx, pdy, dx, dy);
-            if (joinStyle == JOIN_MITER) {
-                drawMiter(pdx, pdy, x0, y0, dx, dy, omx, omy, mx, my, cw);
-            } else if (joinStyle == JOIN_ROUND) {
-                drawRoundJoin(x0, y0,
-                              omx, omy,
-                              mx, my, cw,
-                              ROUND_JOIN_THRESHOLD);
+            final boolean cw = isCW(pdx, pdy, dx, dy);
+            if (outcode == 0) {
+                if (joinStyle == JOIN_MITER) {
+                    drawMiter(pdx, pdy, x0, y0, dx, dy, omx, omy, mx, my, cw);
+                } else if (joinStyle == JOIN_ROUND) {
+                    drawRoundJoin(x0, y0,
+                                  omx, omy,
+                                  mx, my, cw,
+                                  ROUND_JOIN_THRESHOLD);
+                }
             }
             emitLineTo(x0, y0, !cw);
         }
@@ -941,10 +1061,29 @@
         return ret;
     }
 
-    @Override public void curveTo(double x1, double y1,
-                                  double x2, double y2,
-                                  double x3, double y3)
+    @Override
+    public void curveTo(final double x1, final double y1,
+                        final double x2, final double y2,
+                        final double x3, final double y3)
     {
+        final int outcode0 = this.cOutCode;
+        if (clipRect != null) {
+            final int outcode3 = DHelpers.outcode(x3, y3, clipRect);
+            this.cOutCode = outcode3;
+
+            if ((outcode0 & outcode3) != 0) {
+                final int outcode1 = DHelpers.outcode(x1, y1, clipRect);
+                final int outcode2 = DHelpers.outcode(x2, y2, clipRect);
+
+                // basic rejection criteria
+                if ((outcode0 & outcode1 & outcode2 & outcode3) != 0) {
+                    moveTo(x3, y3, outcode0);
+                    opened = true;
+                    return;
+                }
+            }
+        }
+
         final double[] mid = middle;
 
         mid[0] = cx0; mid[1] = cy0;
@@ -953,7 +1092,7 @@
         mid[6] = x3;  mid[7] = y3;
 
         // need these so we can update the state at the end of this method
-        final double xf = mid[6], yf = mid[7];
+        final double xf = x3, yf = y3;
         double dxs = mid[2] - mid[0];
         double dys = mid[3] - mid[1];
         double dxf = mid[6] - mid[4];
@@ -979,6 +1118,10 @@
         }
         if (dxs == 0.0d && dys == 0.0d) {
             // this happens if the "curve" is just a point
+            // fix outcode0 for lineTo() call:
+            if (clipRect != null) {
+                this.cOutCode = outcode0;
+            }
             lineTo(mid[0], mid[1]);
             return;
         }
@@ -997,7 +1140,7 @@
         }
 
         computeOffset(dxs, dys, lineWidth2, offset0);
-        drawJoin(cdx, cdy, cx0, cy0, dxs, dys, cmx, cmy, offset0[0], offset0[1]);
+        drawJoin(cdx, cdy, cx0, cy0, dxs, dys, cmx, cmy, offset0[0], offset0[1], outcode0);
 
         final int nSplits = findSubdivPoints(curve, mid, subdivTs, 8, lineWidth2);
 
@@ -1032,16 +1175,36 @@
             emitLineToRev(r[kind - 2], r[kind - 1]);
         }
 
-        this.cmx = (l[kind - 2] - r[kind - 2]) / 2.0d;
-        this.cmy = (l[kind - 1] - r[kind - 1]) / 2.0d;
+        this.prev = DRAWING_OP_TO;
+        this.cx0 = xf;
+        this.cy0 = yf;
         this.cdx = dxf;
         this.cdy = dyf;
-        this.cx0 = xf;
-        this.cy0 = yf;
-        this.prev = DRAWING_OP_TO;
+        this.cmx = (l[kind - 2] - r[kind - 2]) / 2.0d;
+        this.cmy = (l[kind - 1] - r[kind - 1]) / 2.0d;
     }
 
-    @Override public void quadTo(double x1, double y1, double x2, double y2) {
+    @Override
+    public void quadTo(final double x1, final double y1,
+                       final double x2, final double y2)
+    {
+        final int outcode0 = this.cOutCode;
+        if (clipRect != null) {
+            final int outcode2 = DHelpers.outcode(x2, y2, clipRect);
+            this.cOutCode = outcode2;
+
+            if ((outcode0 & outcode2) != 0) {
+                final int outcode1 = DHelpers.outcode(x1, y1, clipRect);
+
+                // basic rejection criteria
+                if ((outcode0 & outcode1 & outcode2) != 0) {
+                    moveTo(x2, y2, outcode0);
+                    opened = true;
+                    return;
+                }
+            }
+        }
+
         final double[] mid = middle;
 
         mid[0] = cx0; mid[1] = cy0;
@@ -1049,7 +1212,7 @@
         mid[4] = x2;  mid[5] = y2;
 
         // need these so we can update the state at the end of this method
-        final double xf = mid[4], yf = mid[5];
+        final double xf = x2, yf = y2;
         double dxs = mid[2] - mid[0];
         double dys = mid[3] - mid[1];
         double dxf = mid[4] - mid[2];
@@ -1060,6 +1223,10 @@
         }
         if (dxs == 0.0d && dys == 0.0d) {
             // this happens if the "curve" is just a point
+            // fix outcode0 for lineTo() call:
+            if (clipRect != null) {
+                this.cOutCode = outcode0;
+            }
             lineTo(mid[0], mid[1]);
             return;
         }
@@ -1077,7 +1244,7 @@
         }
 
         computeOffset(dxs, dys, lineWidth2, offset0);
-        drawJoin(cdx, cdy, cx0, cy0, dxs, dys, cmx, cmy, offset0[0], offset0[1]);
+        drawJoin(cdx, cdy, cx0, cy0, dxs, dys, cmx, cmy, offset0[0], offset0[1], outcode0);
 
         int nSplits = findSubdivPoints(curve, mid, subdivTs, 6, lineWidth2);
 
@@ -1112,214 +1279,16 @@
             emitLineToRev(r[kind - 2], r[kind - 1]);
         }
 
-        this.cmx = (l[kind - 2] - r[kind - 2]) / 2.0d;
-        this.cmy = (l[kind - 1] - r[kind - 1]) / 2.0d;
+        this.prev = DRAWING_OP_TO;
+        this.cx0 = xf;
+        this.cy0 = yf;
         this.cdx = dxf;
         this.cdy = dyf;
-        this.cx0 = xf;
-        this.cy0 = yf;
-        this.prev = DRAWING_OP_TO;
+        this.cmx = (l[kind - 2] - r[kind - 2]) / 2.0d;
+        this.cmy = (l[kind - 1] - r[kind - 1]) / 2.0d;
     }
 
     @Override public long getNativeConsumer() {
         throw new InternalError("Stroker doesn't use a native consumer");
     }
-
-    // a stack of polynomial curves where each curve shares endpoints with
-    // adjacent ones.
-    static final class PolyStack {
-        private static final byte TYPE_LINETO  = (byte) 0;
-        private static final byte TYPE_QUADTO  = (byte) 1;
-        private static final byte TYPE_CUBICTO = (byte) 2;
-
-        // curves capacity = edges count (8192) = edges x 2 (coords)
-        private static final int INITIAL_CURVES_COUNT = INITIAL_EDGES_COUNT << 1;
-
-        // types capacity = edges count (4096)
-        private static final int INITIAL_TYPES_COUNT = INITIAL_EDGES_COUNT;
-
-        double[] curves;
-        int end;
-        byte[] curveTypes;
-        int numCurves;
-
-        // per-thread renderer context
-        final DRendererContext rdrCtx;
-
-        // curves ref (dirty)
-        final DoubleArrayCache.Reference curves_ref;
-        // curveTypes ref (dirty)
-        final ByteArrayCache.Reference curveTypes_ref;
-
-        // used marks (stats only)
-        int curveTypesUseMark;
-        int curvesUseMark;
-
-        /**
-         * Constructor
-         * @param rdrCtx per-thread renderer context
-         */
-        PolyStack(final DRendererContext rdrCtx) {
-            this.rdrCtx = rdrCtx;
-
-            curves_ref = rdrCtx.newDirtyDoubleArrayRef(INITIAL_CURVES_COUNT); // 32K
-            curves     = curves_ref.initial;
-
-            curveTypes_ref = rdrCtx.newDirtyByteArrayRef(INITIAL_TYPES_COUNT); // 4K
-            curveTypes     = curveTypes_ref.initial;
-            numCurves = 0;
-            end = 0;
-
-            if (DO_STATS) {
-                curveTypesUseMark = 0;
-                curvesUseMark = 0;
-            }
-        }
-
-        /**
-         * Disposes this PolyStack:
-         * clean up before reusing this instance
-         */
-        void dispose() {
-            end = 0;
-            numCurves = 0;
-
-            if (DO_STATS) {
-                rdrCtx.stats.stat_rdr_poly_stack_types.add(curveTypesUseMark);
-                rdrCtx.stats.stat_rdr_poly_stack_curves.add(curvesUseMark);
-                rdrCtx.stats.hist_rdr_poly_stack_curves.add(curvesUseMark);
-
-                // reset marks
-                curveTypesUseMark = 0;
-                curvesUseMark = 0;
-            }
-
-            // Return arrays:
-            // curves and curveTypes are kept dirty
-            curves     = curves_ref.putArray(curves);
-            curveTypes = curveTypes_ref.putArray(curveTypes);
-        }
-
-        private void ensureSpace(final int n) {
-            // use substraction to avoid integer overflow:
-            if (curves.length - end < n) {
-                if (DO_STATS) {
-                    rdrCtx.stats.stat_array_stroker_polystack_curves
-                        .add(end + n);
-                }
-                curves = curves_ref.widenArray(curves, end, end + n);
-            }
-            if (curveTypes.length <= numCurves) {
-                if (DO_STATS) {
-                    rdrCtx.stats.stat_array_stroker_polystack_curveTypes
-                        .add(numCurves + 1);
-                }
-                curveTypes = curveTypes_ref.widenArray(curveTypes,
-                                                       numCurves,
-                                                       numCurves + 1);
-            }
-        }
-
-        void pushCubic(double x0, double y0,
-                       double x1, double y1,
-                       double x2, double y2)
-        {
-            ensureSpace(6);
-            curveTypes[numCurves++] = TYPE_CUBICTO;
-            // we reverse the coordinate order to make popping easier
-            final double[] _curves = curves;
-            int e = end;
-            _curves[e++] = x2;    _curves[e++] = y2;
-            _curves[e++] = x1;    _curves[e++] = y1;
-            _curves[e++] = x0;    _curves[e++] = y0;
-            end = e;
-        }
-
-        void pushQuad(double x0, double y0,
-                      double x1, double y1)
-        {
-            ensureSpace(4);
-            curveTypes[numCurves++] = TYPE_QUADTO;
-            final double[] _curves = curves;
-            int e = end;
-            _curves[e++] = x1;    _curves[e++] = y1;
-            _curves[e++] = x0;    _curves[e++] = y0;
-            end = e;
-        }
-
-        void pushLine(double x, double y) {
-            ensureSpace(2);
-            curveTypes[numCurves++] = TYPE_LINETO;
-            curves[end++] = x;    curves[end++] = y;
-        }
-
-        void popAll(DPathConsumer2D io) {
-            if (DO_STATS) {
-                // update used marks:
-                if (numCurves > curveTypesUseMark) {
-                    curveTypesUseMark = numCurves;
-                }
-                if (end > curvesUseMark) {
-                    curvesUseMark = end;
-                }
-            }
-            final byte[]  _curveTypes = curveTypes;
-            final double[] _curves = curves;
-            int nc = numCurves;
-            int e  = end;
-
-            while (nc != 0) {
-                switch(_curveTypes[--nc]) {
-                case TYPE_LINETO:
-                    e -= 2;
-                    io.lineTo(_curves[e], _curves[e+1]);
-                    continue;
-                case TYPE_QUADTO:
-                    e -= 4;
-                    io.quadTo(_curves[e+0], _curves[e+1],
-                              _curves[e+2], _curves[e+3]);
-                    continue;
-                case TYPE_CUBICTO:
-                    e -= 6;
-                    io.curveTo(_curves[e+0], _curves[e+1],
-                               _curves[e+2], _curves[e+3],
-                               _curves[e+4], _curves[e+5]);
-                    continue;
-                default:
-                }
-            }
-            numCurves = 0;
-            end = 0;
-        }
-
-        @Override
-        public String toString() {
-            String ret = "";
-            int nc = numCurves;
-            int last = end;
-            int len;
-            while (nc != 0) {
-                switch(curveTypes[--nc]) {
-                case TYPE_LINETO:
-                    len = 2;
-                    ret += "line: ";
-                    break;
-                case TYPE_QUADTO:
-                    len = 4;
-                    ret += "quad: ";
-                    break;
-                case TYPE_CUBICTO:
-                    len = 6;
-                    ret += "cubic: ";
-                    break;
-                default:
-                    len = 0;
-                }
-                last -= len;
-                ret += Arrays.toString(Arrays.copyOfRange(curves, last, last+len))
-                                       + "\n";
-            }
-            return ret;
-        }
-    }
 }
--- a/src/java.desktop/share/classes/sun/java2d/marlin/DTransformingPathConsumer2D.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/sun/java2d/marlin/DTransformingPathConsumer2D.java	Wed Dec 13 10:25:38 2017 -0800
@@ -27,50 +27,169 @@
 
 import java.awt.geom.AffineTransform;
 import java.awt.geom.Path2D;
+import sun.java2d.marlin.DHelpers.IndexStack;
+import sun.java2d.marlin.DHelpers.PolyStack;
 
 final class DTransformingPathConsumer2D {
 
-    DTransformingPathConsumer2D() {
-        // used by DRendererContext
-    }
+    private final DRendererContext rdrCtx;
+
+    // recycled ClosedPathDetector instance from detectClosedPath()
+    private final ClosedPathDetector   cpDetector;
 
-    // recycled DPathConsumer2D instance from wrapPath2d()
+    // recycled PathClipFilter instance from pathClipper()
+    private final PathClipFilter       pathClipper;
+
+    // recycled DPathConsumer2D instance from wrapPath2D()
     private final Path2DWrapper        wp_Path2DWrapper        = new Path2DWrapper();
 
-    DPathConsumer2D wrapPath2d(Path2D.Double p2d)
-    {
-        return wp_Path2DWrapper.init(p2d);
-    }
-
     // recycled DPathConsumer2D instances from deltaTransformConsumer()
     private final DeltaScaleFilter     dt_DeltaScaleFilter     = new DeltaScaleFilter();
     private final DeltaTransformFilter dt_DeltaTransformFilter = new DeltaTransformFilter();
 
+    // recycled DPathConsumer2D instances from inverseDeltaTransformConsumer()
+    private final DeltaScaleFilter     iv_DeltaScaleFilter     = new DeltaScaleFilter();
+    private final DeltaTransformFilter iv_DeltaTransformFilter = new DeltaTransformFilter();
+
+    // recycled PathTracer instances from tracer...() methods
+    private final PathTracer tracerInput      = new PathTracer("[Input]");
+    private final PathTracer tracerCPDetector = new PathTracer("ClosedPathDetector");
+    private final PathTracer tracerFiller     = new PathTracer("Filler");
+    private final PathTracer tracerStroker    = new PathTracer("Stroker");
+
+    DTransformingPathConsumer2D(final DRendererContext rdrCtx) {
+        // used by RendererContext
+        this.rdrCtx = rdrCtx;
+        this.cpDetector = new ClosedPathDetector(rdrCtx);
+        this.pathClipper = new PathClipFilter(rdrCtx);
+    }
+
+    DPathConsumer2D wrapPath2D(Path2D.Double p2d) {
+        return wp_Path2DWrapper.init(p2d);
+    }
+
+    DPathConsumer2D traceInput(DPathConsumer2D out) {
+        return tracerInput.init(out);
+    }
+
+    DPathConsumer2D traceClosedPathDetector(DPathConsumer2D out) {
+        return tracerCPDetector.init(out);
+    }
+
+    DPathConsumer2D traceFiller(DPathConsumer2D out) {
+        return tracerFiller.init(out);
+    }
+
+    DPathConsumer2D traceStroker(DPathConsumer2D out) {
+        return tracerStroker.init(out);
+    }
+
+    DPathConsumer2D detectClosedPath(DPathConsumer2D out) {
+        return cpDetector.init(out);
+    }
+
+    DPathConsumer2D pathClipper(DPathConsumer2D out) {
+        return pathClipper.init(out);
+    }
+
     DPathConsumer2D deltaTransformConsumer(DPathConsumer2D out,
                                           AffineTransform at)
     {
         if (at == null) {
             return out;
         }
-        double mxx = at.getScaleX();
-        double mxy = at.getShearX();
-        double myx = at.getShearY();
-        double myy = at.getScaleY();
+        final double mxx = at.getScaleX();
+        final double mxy = at.getShearX();
+        final double myx = at.getShearY();
+        final double myy = at.getScaleY();
 
         if (mxy == 0.0d && myx == 0.0d) {
             if (mxx == 1.0d && myy == 1.0d) {
                 return out;
             } else {
+                // Scale only
+                if (rdrCtx.doClip) {
+                    // adjust clip rectangle (ymin, ymax, xmin, xmax):
+                    adjustClipScale(rdrCtx.clipRect, mxx, myy);
+                }
                 return dt_DeltaScaleFilter.init(out, mxx, myy);
             }
         } else {
+            if (rdrCtx.doClip) {
+                // adjust clip rectangle (ymin, ymax, xmin, xmax):
+                adjustClipInverseDelta(rdrCtx.clipRect, mxx, mxy, myx, myy);
+            }
             return dt_DeltaTransformFilter.init(out, mxx, mxy, myx, myy);
         }
     }
 
-    // recycled DPathConsumer2D instances from inverseDeltaTransformConsumer()
-    private final DeltaScaleFilter     iv_DeltaScaleFilter     = new DeltaScaleFilter();
-    private final DeltaTransformFilter iv_DeltaTransformFilter = new DeltaTransformFilter();
+    private static void adjustClipOffset(final double[] clipRect) {
+        clipRect[0] += Renderer.RDR_OFFSET_Y;
+        clipRect[1] += Renderer.RDR_OFFSET_Y;
+        clipRect[2] += Renderer.RDR_OFFSET_X;
+        clipRect[3] += Renderer.RDR_OFFSET_X;
+    }
+
+    private static void adjustClipScale(final double[] clipRect,
+                                        final double mxx, final double myy)
+    {
+        adjustClipOffset(clipRect);
+
+        // Adjust the clipping rectangle (iv_DeltaScaleFilter):
+        clipRect[0] /= myy;
+        clipRect[1] /= myy;
+        clipRect[2] /= mxx;
+        clipRect[3] /= mxx;
+    }
+
+    private static void adjustClipInverseDelta(final double[] clipRect,
+                                               final double mxx, final double mxy,
+                                               final double myx, final double myy)
+    {
+        adjustClipOffset(clipRect);
+
+        // Adjust the clipping rectangle (iv_DeltaTransformFilter):
+        final double det = mxx * myy - mxy * myx;
+        final double imxx =  myy / det;
+        final double imxy = -mxy / det;
+        final double imyx = -myx / det;
+        final double imyy =  mxx / det;
+
+        double xmin, xmax, ymin, ymax;
+        double x, y;
+        // xmin, ymin:
+        x = clipRect[2] * imxx + clipRect[0] * imxy;
+        y = clipRect[2] * imyx + clipRect[0] * imyy;
+
+        xmin = xmax = x;
+        ymin = ymax = y;
+
+        // xmax, ymin:
+        x = clipRect[3] * imxx + clipRect[0] * imxy;
+        y = clipRect[3] * imyx + clipRect[0] * imyy;
+
+        if (x < xmin) { xmin = x; } else if (x > xmax) { xmax = x; }
+        if (y < ymin) { ymin = y; } else if (y > ymax) { ymax = y; }
+
+        // xmin, ymax:
+        x = clipRect[2] * imxx + clipRect[1] * imxy;
+        y = clipRect[2] * imyx + clipRect[1] * imyy;
+
+        if (x < xmin) { xmin = x; } else if (x > xmax) { xmax = x; }
+        if (y < ymin) { ymin = y; } else if (y > ymax) { ymax = y; }
+
+        // xmax, ymax:
+        x = clipRect[3] * imxx + clipRect[1] * imxy;
+        y = clipRect[3] * imyx + clipRect[1] * imyy;
+
+        if (x < xmin) { xmin = x; } else if (x > xmax) { xmax = x; }
+        if (y < ymin) { ymin = y; } else if (y > ymax) { ymax = y; }
+
+        clipRect[0] = ymin;
+        clipRect[1] = ymax;
+        clipRect[2] = xmin;
+        clipRect[3] = xmax;
+    }
 
     DPathConsumer2D inverseDeltaTransformConsumer(DPathConsumer2D out,
                                                  AffineTransform at)
@@ -90,7 +209,7 @@
                 return iv_DeltaScaleFilter.init(out, 1.0d/mxx, 1.0d/myy);
             }
         } else {
-            double det = mxx * myy - mxy * myx;
+            final double det = mxx * myy - mxy * myx;
             return iv_DeltaTransformFilter.init(out,
                                                 myy / det,
                                                -mxy / det,
@@ -99,7 +218,6 @@
         }
     }
 
-
     static final class DeltaScaleFilter implements DPathConsumer2D {
         private DPathConsumer2D out;
         private double sx, sy;
@@ -274,4 +392,427 @@
             throw new InternalError("Not using a native peer");
         }
     }
+
+    static final class ClosedPathDetector implements DPathConsumer2D {
+
+        private final DRendererContext rdrCtx;
+        private final PolyStack stack;
+
+        private DPathConsumer2D out;
+
+        ClosedPathDetector(final DRendererContext rdrCtx) {
+            this.rdrCtx = rdrCtx;
+            this.stack = (rdrCtx.stats != null) ?
+                new PolyStack(rdrCtx,
+                        rdrCtx.stats.stat_cpd_polystack_types,
+                        rdrCtx.stats.stat_cpd_polystack_curves,
+                        rdrCtx.stats.hist_cpd_polystack_curves,
+                        rdrCtx.stats.stat_array_cpd_polystack_curves,
+                        rdrCtx.stats.stat_array_cpd_polystack_types)
+                : new PolyStack(rdrCtx);
+        }
+
+        ClosedPathDetector init(DPathConsumer2D out) {
+            this.out = out;
+            return this; // fluent API
+        }
+
+        /**
+         * Disposes this instance:
+         * clean up before reusing this instance
+         */
+        void dispose() {
+            stack.dispose();
+        }
+
+        @Override
+        public void pathDone() {
+            // previous path is not closed:
+            finish(false);
+            out.pathDone();
+
+            // TODO: fix possible leak if exception happened
+            // Dispose this instance:
+            dispose();
+        }
+
+        @Override
+        public void closePath() {
+            // path is closed
+            finish(true);
+            out.closePath();
+        }
+
+        @Override
+        public void moveTo(double x0, double y0) {
+            // previous path is not closed:
+            finish(false);
+            out.moveTo(x0, y0);
+        }
+
+        private void finish(final boolean closed) {
+            rdrCtx.closedPath = closed;
+            stack.pullAll(out);
+        }
+
+        @Override
+        public void lineTo(double x1, double y1) {
+            stack.pushLine(x1, y1);
+        }
+
+        @Override
+        public void curveTo(double x3, double y3,
+                            double x2, double y2,
+                            double x1, double y1)
+        {
+            stack.pushCubic(x1, y1, x2, y2, x3, y3);
+        }
+
+        @Override
+        public void quadTo(double x2, double y2, double x1, double y1) {
+            stack.pushQuad(x1, y1, x2, y2);
+        }
+
+        @Override
+        public long getNativeConsumer() {
+            throw new InternalError("Not using a native peer");
+        }
+    }
+
+    static final class PathClipFilter implements DPathConsumer2D {
+
+        private DPathConsumer2D out;
+
+        // Bounds of the drawing region, at pixel precision.
+        private final double[] clipRect;
+
+        private final double[] corners = new double[8];
+        private boolean init_corners = false;
+
+        private final IndexStack stack;
+
+        // the current outcode of the current sub path
+        private int cOutCode = 0;
+
+        // the cumulated (and) outcode of the complete path
+        private int gOutCode = MarlinConst.OUTCODE_MASK_T_B_L_R;
+
+        private boolean outside = false;
+
+        // The current point OUTSIDE
+        private double cx0, cy0;
+
+        PathClipFilter(final DRendererContext rdrCtx) {
+            this.clipRect = rdrCtx.clipRect;
+            this.stack = (rdrCtx.stats != null) ?
+                new IndexStack(rdrCtx,
+                        rdrCtx.stats.stat_pcf_idxstack_indices,
+                        rdrCtx.stats.hist_pcf_idxstack_indices,
+                        rdrCtx.stats.stat_array_pcf_idxstack_indices)
+                : new IndexStack(rdrCtx);
+        }
+
+        PathClipFilter init(final DPathConsumer2D out) {
+            this.out = out;
+
+            // Adjust the clipping rectangle with the renderer offsets
+            final double rdrOffX = DRenderer.RDR_OFFSET_X;
+            final double rdrOffY = DRenderer.RDR_OFFSET_Y;
+
+            // add a small rounding error:
+            final double margin = 1e-3d;
+
+            final double[] _clipRect = this.clipRect;
+            _clipRect[0] -= margin - rdrOffY;
+            _clipRect[1] += margin + rdrOffY;
+            _clipRect[2] -= margin - rdrOffX;
+            _clipRect[3] += margin + rdrOffX;
+
+            this.init_corners = true;
+            this.gOutCode = MarlinConst.OUTCODE_MASK_T_B_L_R;
+
+            return this; // fluent API
+        }
+
+        /**
+         * Disposes this instance:
+         * clean up before reusing this instance
+         */
+        void dispose() {
+            stack.dispose();
+        }
+
+        private void finishPath() {
+            if (outside) {
+                // criteria: inside or totally outside ?
+                if (gOutCode == 0) {
+                    finish();
+                } else {
+                    this.outside = false;
+                    stack.reset();
+                }
+            }
+        }
+
+        private void finish() {
+            this.outside = false;
+
+            if (!stack.isEmpty()) {
+                if (init_corners) {
+                    init_corners = false;
+
+                    final double[] _corners = corners;
+                    final double[] _clipRect = clipRect;
+                    // Top Left (0):
+                    _corners[0] = _clipRect[2];
+                    _corners[1] = _clipRect[0];
+                    // Bottom Left (1):
+                    _corners[2] = _clipRect[2];
+                    _corners[3] = _clipRect[1];
+                    // Top right (2):
+                    _corners[4] = _clipRect[3];
+                    _corners[5] = _clipRect[0];
+                    // Bottom Right (3):
+                    _corners[6] = _clipRect[3];
+                    _corners[7] = _clipRect[1];
+                }
+                stack.pullAll(corners, out);
+            }
+            out.lineTo(cx0, cy0);
+        }
+
+        @Override
+        public void pathDone() {
+            finishPath();
+
+            out.pathDone();
+
+            // TODO: fix possible leak if exception happened
+            // Dispose this instance:
+            dispose();
+        }
+
+        @Override
+        public void closePath() {
+            finishPath();
+
+            out.closePath();
+        }
+
+        @Override
+        public void moveTo(final double x0, final double y0) {
+            finishPath();
+
+            final int outcode = DHelpers.outcode(x0, y0, clipRect);
+            this.cOutCode = outcode;
+            this.outside = false;
+            out.moveTo(x0, y0);
+        }
+
+        @Override
+        public void lineTo(final double xe, final double ye) {
+            final int outcode0 = this.cOutCode;
+            final int outcode1 = DHelpers.outcode(xe, ye, clipRect);
+            this.cOutCode = outcode1;
+
+            final int sideCode = (outcode0 & outcode1);
+
+            // basic rejection criteria:
+            if (sideCode == 0) {
+                this.gOutCode = 0;
+            } else {
+                this.gOutCode &= sideCode;
+                // keep last point coordinate before entering the clip again:
+                this.outside = true;
+                this.cx0 = xe;
+                this.cy0 = ye;
+
+                clip(sideCode, outcode0, outcode1);
+                return;
+            }
+            if (outside) {
+                finish();
+            }
+            // clipping disabled:
+            out.lineTo(xe, ye);
+        }
+
+        private void clip(final int sideCode,
+                          final int outcode0,
+                          final int outcode1)
+        {
+            // corner or cross-boundary on left or right side:
+            if ((outcode0 != outcode1)
+                    && ((sideCode & MarlinConst.OUTCODE_MASK_L_R) != 0))
+            {
+                // combine outcodes:
+                final int mergeCode = (outcode0 | outcode1);
+                final int tbCode = mergeCode & MarlinConst.OUTCODE_MASK_T_B;
+                final int lrCode = mergeCode & MarlinConst.OUTCODE_MASK_L_R;
+                final int off = (lrCode == MarlinConst.OUTCODE_LEFT) ? 0 : 2;
+
+                // add corners to outside stack:
+                switch (tbCode) {
+                    case MarlinConst.OUTCODE_TOP:
+// System.out.println("TOP "+ ((off == 0) ? "LEFT" : "RIGHT"));
+                        stack.push(off); // top
+                        return;
+                    case MarlinConst.OUTCODE_BOTTOM:
+// System.out.println("BOTTOM "+ ((off == 0) ? "LEFT" : "RIGHT"));
+                        stack.push(off + 1); // bottom
+                        return;
+                    default:
+                        // both TOP / BOTTOM:
+                        if ((outcode0 & MarlinConst.OUTCODE_TOP) != 0) {
+// System.out.println("TOP + BOTTOM "+ ((off == 0) ? "LEFT" : "RIGHT"));
+                            // top to bottom
+                            stack.push(off); // top
+                            stack.push(off + 1); // bottom
+                        } else {
+// System.out.println("BOTTOM + TOP "+ ((off == 0) ? "LEFT" : "RIGHT"));
+                            // bottom to top
+                            stack.push(off + 1); // bottom
+                            stack.push(off); // top
+                        }
+                }
+            }
+        }
+
+        @Override
+        public void curveTo(final double x1, final double y1,
+                            final double x2, final double y2,
+                            final double xe, final double ye)
+        {
+            final int outcode0 = this.cOutCode;
+            final int outcode3 = DHelpers.outcode(xe, ye, clipRect);
+            this.cOutCode = outcode3;
+
+            int sideCode = outcode0 & outcode3;
+
+            if (sideCode == 0) {
+                this.gOutCode = 0;
+            } else {
+                sideCode &= DHelpers.outcode(x1, y1, clipRect);
+                sideCode &= DHelpers.outcode(x2, y2, clipRect);
+                this.gOutCode &= sideCode;
+
+                // basic rejection criteria:
+                if (sideCode != 0) {
+                    // keep last point coordinate before entering the clip again:
+                    this.outside = true;
+                    this.cx0 = xe;
+                    this.cy0 = ye;
+
+                    clip(sideCode, outcode0, outcode3);
+                    return;
+                }
+            }
+            if (outside) {
+                finish();
+            }
+            // clipping disabled:
+            out.curveTo(x1, y1, x2, y2, xe, ye);
+        }
+
+        @Override
+        public void quadTo(final double x1, final double y1,
+                           final double xe, final double ye)
+        {
+            final int outcode0 = this.cOutCode;
+            final int outcode2 = DHelpers.outcode(xe, ye, clipRect);
+            this.cOutCode = outcode2;
+
+            int sideCode = outcode0 & outcode2;
+
+            if (sideCode == 0) {
+                this.gOutCode = 0;
+            } else {
+                sideCode &= DHelpers.outcode(x1, y1, clipRect);
+                this.gOutCode &= sideCode;
+
+                // basic rejection criteria:
+                if (sideCode != 0) {
+                    // keep last point coordinate before entering the clip again:
+                    this.outside = true;
+                    this.cx0 = xe;
+                    this.cy0 = ye;
+
+                    clip(sideCode, outcode0, outcode2);
+                    return;
+                }
+            }
+            if (outside) {
+                finish();
+            }
+            // clipping disabled:
+            out.quadTo(x1, y1, xe, ye);
+        }
+
+        @Override
+        public long getNativeConsumer() {
+            throw new InternalError("Not using a native peer");
+        }
+    }
+
+    static final class PathTracer implements DPathConsumer2D {
+        private final String prefix;
+        private DPathConsumer2D out;
+
+        PathTracer(String name) {
+            this.prefix = name + ": ";
+        }
+
+        PathTracer init(DPathConsumer2D out) {
+            this.out = out;
+            return this; // fluent API
+        }
+
+        @Override
+        public void moveTo(double x0, double y0) {
+            log("moveTo (" + x0 + ", " + y0 + ')');
+            out.moveTo(x0, y0);
+        }
+
+        @Override
+        public void lineTo(double x1, double y1) {
+            log("lineTo (" + x1 + ", " + y1 + ')');
+            out.lineTo(x1, y1);
+        }
+
+        @Override
+        public void curveTo(double x1, double y1,
+                            double x2, double y2,
+                            double x3, double y3)
+        {
+            log("curveTo P1(" + x1 + ", " + y1 + ") P2(" + x2 + ", " + y2  + ") P3(" + x3 + ", " + y3 + ')');
+            out.curveTo(x1, y1, x2, y2, x3, y3);
+        }
+
+        @Override
+        public void quadTo(double x1, double y1, double x2, double y2) {
+            log("quadTo P1(" + x1 + ", " + y1 + ") P2(" + x2 + ", " + y2  + ')');
+            out.quadTo(x1, y1, x2, y2);
+        }
+
+        @Override
+        public void closePath() {
+            log("closePath");
+            out.closePath();
+        }
+
+        @Override
+        public void pathDone() {
+            log("pathDone");
+            out.pathDone();
+        }
+
+        private void log(final String message) {
+            System.out.println(prefix + message);
+        }
+
+        @Override
+        public long getNativeConsumer() {
+            throw new InternalError("Not using a native peer");
+        }
+    }
 }
--- a/src/java.desktop/share/classes/sun/java2d/marlin/Dasher.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/sun/java2d/marlin/Dasher.java	Wed Dec 13 10:25:38 2017 -0800
@@ -138,7 +138,7 @@
                     dashOn = !dashOn;
                 }
             }
-        } else if (phase > 0) {
+        } else if (phase > 0.0f) {
             if (cycles >= MAX_CYCLES) {
                 phase = 0.0f;
             } else {
@@ -158,12 +158,13 @@
 
         this.dash = dash;
         this.dashLen = dashLen;
-        this.startPhase = this.phase = phase;
+        this.phase = phase;
+        this.startPhase = phase;
         this.startDashOn = dashOn;
         this.startIdx = sidx;
         this.starting = true;
-        needsMoveTo = false;
-        firstSegidx = 0;
+        this.needsMoveTo = false;
+        this.firstSegidx = 0;
 
         this.recycleDashes = recycleDashes;
 
@@ -202,8 +203,8 @@
     }
 
     @Override
-    public void moveTo(float x0, float y0) {
-        if (firstSegidx > 0) {
+    public void moveTo(final float x0, final float y0) {
+        if (firstSegidx != 0) {
             out.moveTo(sx, sy);
             emitFirstSegments();
         }
@@ -211,8 +212,10 @@
         this.idx = startIdx;
         this.dashOn = this.startDashOn;
         this.phase = this.startPhase;
-        this.sx = this.x0 = x0;
-        this.sy = this.y0 = y0;
+        this.sx = x0;
+        this.sy = y0;
+        this.x0 = x0;
+        this.y0 = y0;
         this.starting = true;
     }
 
@@ -237,7 +240,7 @@
     private void emitFirstSegments() {
         final float[] fSegBuf = firstSegmentsBuffer;
 
-        for (int i = 0; i < firstSegidx; ) {
+        for (int i = 0, len = firstSegidx; i < len; ) {
             int type = (int)fSegBuf[i];
             emitSeg(fSegBuf, i + 1, type);
             i += (type - 1);
@@ -252,48 +255,59 @@
     private int firstSegidx;
 
     // precondition: pts must be in relative coordinates (relative to x0,y0)
-    private void goTo(float[] pts, int off, final int type) {
-        float x = pts[off + type - 4];
-        float y = pts[off + type - 3];
-        if (dashOn) {
+    private void goTo(final float[] pts, final int off, final int type,
+                      final boolean on)
+    {
+        final int index = off + type;
+        final float x = pts[index - 4];
+        final float y = pts[index - 3];
+
+        if (on) {
             if (starting) {
-                int len = type - 1; // - 2 + 1
-                int segIdx = firstSegidx;
-                float[] buf = firstSegmentsBuffer;
-                if (segIdx + len  > buf.length) {
-                    if (DO_STATS) {
-                        rdrCtx.stats.stat_array_dasher_firstSegmentsBuffer
-                            .add(segIdx + len);
-                    }
-                    firstSegmentsBuffer = buf
-                        = firstSegmentsBuffer_ref.widenArray(buf, segIdx,
-                                                             segIdx + len);
-                }
-                buf[segIdx++] = type;
-                len--;
-                // small arraycopy (2, 4 or 6) but with offset:
-                System.arraycopy(pts, off, buf, segIdx, len);
-                segIdx += len;
-                firstSegidx = segIdx;
+                goTo_starting(pts, off, type);
             } else {
                 if (needsMoveTo) {
+                    needsMoveTo = false;
                     out.moveTo(x0, y0);
-                    needsMoveTo = false;
                 }
                 emitSeg(pts, off, type);
             }
         } else {
-            starting = false;
+            if (starting) {
+                // low probability test (hotspot)
+                starting = false;
+            }
             needsMoveTo = true;
         }
         this.x0 = x;
         this.y0 = y;
     }
 
+    private void goTo_starting(final float[] pts, final int off, final int type) {
+        int len = type - 1; // - 2 + 1
+        int segIdx = firstSegidx;
+        float[] buf = firstSegmentsBuffer;
+
+        if (segIdx + len  > buf.length) {
+            if (DO_STATS) {
+                rdrCtx.stats.stat_array_dasher_firstSegmentsBuffer
+                    .add(segIdx + len);
+            }
+            firstSegmentsBuffer = buf
+                = firstSegmentsBuffer_ref.widenArray(buf, segIdx,
+                                                     segIdx + len);
+        }
+        buf[segIdx++] = type;
+        len--;
+        // small arraycopy (2, 4 or 6) but with offset:
+        System.arraycopy(pts, off, buf, segIdx, len);
+        firstSegidx = segIdx + len;
+    }
+
     @Override
-    public void lineTo(float x1, float y1) {
-        float dx = x1 - x0;
-        float dy = y1 - y0;
+    public void lineTo(final float x1, final float y1) {
+        final float dx = x1 - x0;
+        final float dy = y1 - y0;
 
         float len = dx*dx + dy*dy;
         if (len == 0.0f) {
@@ -308,48 +322,61 @@
 
         final float[] _curCurvepts = curCurvepts;
         final float[] _dash = dash;
+        final int _dashLen = this.dashLen;
+
+        int _idx = idx;
+        boolean _dashOn = dashOn;
+        float _phase = phase;
 
         float leftInThisDashSegment;
-        float dashdx, dashdy, p;
+        float d, dashdx, dashdy, p;
 
         while (true) {
-            leftInThisDashSegment = _dash[idx] - phase;
+            d = _dash[_idx];
+            leftInThisDashSegment = d - _phase;
 
             if (len <= leftInThisDashSegment) {
                 _curCurvepts[0] = x1;
                 _curCurvepts[1] = y1;
-                goTo(_curCurvepts, 0, 4);
+
+                goTo(_curCurvepts, 0, 4, _dashOn);
 
                 // Advance phase within current dash segment
-                phase += len;
+                _phase += len;
+
                 // TODO: compare float values using epsilon:
                 if (len == leftInThisDashSegment) {
-                    phase = 0.0f;
-                    idx = (idx + 1) % dashLen;
-                    dashOn = !dashOn;
+                    _phase = 0.0f;
+                    _idx = (_idx + 1) % _dashLen;
+                    _dashOn = !_dashOn;
                 }
+
+                // Save local state:
+                idx = _idx;
+                dashOn = _dashOn;
+                phase = _phase;
                 return;
             }
 
-            dashdx = _dash[idx] * cx;
-            dashdy = _dash[idx] * cy;
+            dashdx = d * cx;
+            dashdy = d * cy;
 
-            if (phase == 0.0f) {
+            if (_phase == 0.0f) {
                 _curCurvepts[0] = x0 + dashdx;
                 _curCurvepts[1] = y0 + dashdy;
             } else {
-                p = leftInThisDashSegment / _dash[idx];
+                p = leftInThisDashSegment / d;
                 _curCurvepts[0] = x0 + p * dashdx;
                 _curCurvepts[1] = y0 + p * dashdy;
             }
 
-            goTo(_curCurvepts, 0, 4);
+            goTo(_curCurvepts, 0, 4, _dashOn);
 
             len -= leftInThisDashSegment;
             // Advance to next dash segment
-            idx = (idx + 1) % dashLen;
-            dashOn = !dashOn;
-            phase = 0.0f;
+            _idx = (_idx + 1) % _dashLen;
+            _dashOn = !_dashOn;
+            _phase = 0.0f;
         }
     }
 
@@ -358,43 +385,59 @@
 
     // preconditions: curCurvepts must be an array of length at least 2 * type,
     // that contains the curve we want to dash in the first type elements
-    private void somethingTo(int type) {
+    private void somethingTo(final int type) {
         if (pointCurve(curCurvepts, type)) {
             return;
         }
-        li.initializeIterationOnCurve(curCurvepts, type);
+        final LengthIterator _li = li;
+        final float[] _curCurvepts = curCurvepts;
+        final float[] _dash = dash;
+        final int _dashLen = this.dashLen;
+
+        _li.initializeIterationOnCurve(_curCurvepts, type);
+
+        int _idx = idx;
+        boolean _dashOn = dashOn;
+        float _phase = phase;
 
         // initially the current curve is at curCurvepts[0...type]
         int curCurveoff = 0;
         float lastSplitT = 0.0f;
         float t;
-        float leftInThisDashSegment = dash[idx] - phase;
+        float leftInThisDashSegment = _dash[_idx] - _phase;
 
-        while ((t = li.next(leftInThisDashSegment)) < 1.0f) {
+        while ((t = _li.next(leftInThisDashSegment)) < 1.0f) {
             if (t != 0.0f) {
                 Helpers.subdivideAt((t - lastSplitT) / (1.0f - lastSplitT),
-                                    curCurvepts, curCurveoff,
-                                    curCurvepts, 0,
-                                    curCurvepts, type, type);
+                                    _curCurvepts, curCurveoff,
+                                    _curCurvepts, 0,
+                                    _curCurvepts, type, type);
                 lastSplitT = t;
-                goTo(curCurvepts, 2, type);
+                goTo(_curCurvepts, 2, type, _dashOn);
                 curCurveoff = type;
             }
             // Advance to next dash segment
-            idx = (idx + 1) % dashLen;
-            dashOn = !dashOn;
-            phase = 0.0f;
-            leftInThisDashSegment = dash[idx];
+            _idx = (_idx + 1) % _dashLen;
+            _dashOn = !_dashOn;
+            _phase = 0.0f;
+            leftInThisDashSegment = _dash[_idx];
         }
-        goTo(curCurvepts, curCurveoff+2, type);
-        phase += li.lastSegLen();
-        if (phase >= dash[idx]) {
-            phase = 0.0f;
-            idx = (idx + 1) % dashLen;
-            dashOn = !dashOn;
+
+        goTo(_curCurvepts, curCurveoff + 2, type, _dashOn);
+
+        _phase += _li.lastSegLen();
+        if (_phase >= _dash[_idx]) {
+            _phase = 0.0f;
+            _idx = (_idx + 1) % _dashLen;
+            _dashOn = !_dashOn;
         }
+        // Save local state:
+        idx = _idx;
+        dashOn = _dashOn;
+        phase = _phase;
+
         // reset LengthIterator:
-        li.reset();
+        _li.reset();
     }
 
     private static boolean pointCurve(float[] curve, int type) {
@@ -420,7 +463,7 @@
     // tree; however, the trees we are interested in have the property that
     // every non leaf node has exactly 2 children
     static final class LengthIterator {
-        private enum Side {LEFT, RIGHT};
+        private enum Side {LEFT, RIGHT}
         // Holds the curves at various levels of the recursion. The root
         // (i.e. the original curve) is at recCurveStack[0] (but then it
         // gets subdivided, the left half is put at 1, so most of the time
@@ -670,22 +713,23 @@
         // this is a bit of a hack. It returns -1 if we're not on a leaf, and
         // the length of the leaf if we are on a leaf.
         private float onLeaf() {
-            float[] curve = recCurveStack[recLevel];
+            final float[] curve = recCurveStack[recLevel];
+            final int _curveType = curveType;
             float polyLen = 0.0f;
 
             float x0 = curve[0], y0 = curve[1];
-            for (int i = 2; i < curveType; i += 2) {
+            for (int i = 2; i < _curveType; i += 2) {
                 final float x1 = curve[i], y1 = curve[i+1];
                 final float len = Helpers.linelen(x0, y0, x1, y1);
                 polyLen += len;
-                curLeafCtrlPolyLengths[i/2 - 1] = len;
+                curLeafCtrlPolyLengths[(i >> 1) - 1] = len;
                 x0 = x1;
                 y0 = y1;
             }
 
             final float lineLen = Helpers.linelen(curve[0], curve[1],
-                                                  curve[curveType-2],
-                                                  curve[curveType-1]);
+                                                  curve[_curveType-2],
+                                                  curve[_curveType-1]);
             if ((polyLen - lineLen) < ERR || recLevel == REC_LIMIT) {
                 return (polyLen + lineLen) / 2.0f;
             }
@@ -694,9 +738,9 @@
     }
 
     @Override
-    public void curveTo(float x1, float y1,
-                        float x2, float y2,
-                        float x3, float y3)
+    public void curveTo(final float x1, final float y1,
+                        final float x2, final float y2,
+                        final float x3, final float y3)
     {
         final float[] _curCurvepts = curCurvepts;
         _curCurvepts[0] = x0;        _curCurvepts[1] = y0;
@@ -707,7 +751,9 @@
     }
 
     @Override
-    public void quadTo(float x1, float y1, float x2, float y2) {
+    public void quadTo(final float x1, final float y1,
+                       final float x2, final float y2)
+    {
         final float[] _curCurvepts = curCurvepts;
         _curCurvepts[0] = x0;        _curCurvepts[1] = y0;
         _curCurvepts[2] = x1;        _curCurvepts[3] = y1;
@@ -718,7 +764,7 @@
     @Override
     public void closePath() {
         lineTo(sx, sy);
-        if (firstSegidx > 0) {
+        if (firstSegidx != 0) {
             if (!dashOn || needsMoveTo) {
                 out.moveTo(sx, sy);
             }
@@ -729,7 +775,7 @@
 
     @Override
     public void pathDone() {
-        if (firstSegidx > 0) {
+        if (firstSegidx != 0) {
             out.moveTo(sx, sy);
             emitFirstSegments();
         }
--- a/src/java.desktop/share/classes/sun/java2d/marlin/Helpers.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/sun/java2d/marlin/Helpers.java	Wed Dec 13 10:25:38 2017 -0800
@@ -26,10 +26,10 @@
 package sun.java2d.marlin;
 
 import static java.lang.Math.PI;
-import static java.lang.Math.cos;
-import static java.lang.Math.sqrt;
-import static java.lang.Math.cbrt;
-import static java.lang.Math.acos;
+import java.util.Arrays;
+import sun.awt.geom.PathConsumer2D;
+import sun.java2d.marlin.stats.Histogram;
+import sun.java2d.marlin.stats.StatLong;
 
 final class Helpers implements MarlinConst {
 
@@ -120,17 +120,17 @@
         int num;
         if (D < 0.0d) {
             // see: http://en.wikipedia.org/wiki/Cubic_function#Trigonometric_.28and_hyperbolic.29_method
-            final double phi = (1.0d/3.0d) * acos(-q / sqrt(-cb_p));
-            final double t = 2.0d * sqrt(-p);
+            final double phi = (1.0d/3.0d) * Math.acos(-q / Math.sqrt(-cb_p));
+            final double t = 2.0d * Math.sqrt(-p);
 
-            pts[ off+0 ] = (float) ( t * cos(phi));
-            pts[ off+1 ] = (float) (-t * cos(phi + (PI / 3.0d)));
-            pts[ off+2 ] = (float) (-t * cos(phi - (PI / 3.0d)));
+            pts[ off+0 ] = (float) ( t * Math.cos(phi));
+            pts[ off+1 ] = (float) (-t * Math.cos(phi + (PI / 3.0d)));
+            pts[ off+2 ] = (float) (-t * Math.cos(phi - (PI / 3.0d)));
             num = 3;
         } else {
-            final double sqrt_D = sqrt(D);
-            final double u = cbrt(sqrt_D - q);
-            final double v = - cbrt(sqrt_D + q);
+            final double sqrt_D = Math.sqrt(D);
+            final double u =   Math.cbrt(sqrt_D - q);
+            final double v = - Math.cbrt(sqrt_D + q);
 
             pts[ off ] = (float) (u + v);
             num = 1;
@@ -176,15 +176,6 @@
         return ret;
     }
 
-    static float polyLineLength(float[] poly, final int off, final int nCoords) {
-        assert nCoords % 2 == 0 && poly.length >= off + nCoords : "";
-        float acc = 0.0f;
-        for (int i = off + 2; i < off + nCoords; i += 2) {
-            acc += linelen(poly[i], poly[i+1], poly[i-2], poly[i-1]);
-        }
-        return acc;
-    }
-
     static float linelen(float x1, float y1, float x2, float y2) {
         final float dx = x2 - x1;
         final float dy = y2 - y1;
@@ -438,4 +429,388 @@
             return;
         }
     }
+
+    // From sun.java2d.loops.GeneralRenderer:
+
+    static int outcode(final float x, final float y,
+                       final float[] clipRect)
+    {
+        int code;
+        if (y < clipRect[0]) {
+            code = OUTCODE_TOP;
+        } else if (y >= clipRect[1]) {
+            code = OUTCODE_BOTTOM;
+        } else {
+            code = 0;
+        }
+        if (x < clipRect[2]) {
+            code |= OUTCODE_LEFT;
+        } else if (x >= clipRect[3]) {
+            code |= OUTCODE_RIGHT;
+        }
+        return code;
+    }
+
+    // a stack of polynomial curves where each curve shares endpoints with
+    // adjacent ones.
+    static final class PolyStack {
+        private static final byte TYPE_LINETO  = (byte) 0;
+        private static final byte TYPE_QUADTO  = (byte) 1;
+        private static final byte TYPE_CUBICTO = (byte) 2;
+
+        // curves capacity = edges count (8192) = edges x 2 (coords)
+        private static final int INITIAL_CURVES_COUNT = INITIAL_EDGES_COUNT << 1;
+
+        // types capacity = edges count (4096)
+        private static final int INITIAL_TYPES_COUNT = INITIAL_EDGES_COUNT;
+
+        float[] curves;
+        int end;
+        byte[] curveTypes;
+        int numCurves;
+
+        // curves ref (dirty)
+        final FloatArrayCache.Reference curves_ref;
+        // curveTypes ref (dirty)
+        final ByteArrayCache.Reference curveTypes_ref;
+
+        // used marks (stats only)
+        int curveTypesUseMark;
+        int curvesUseMark;
+
+        private final StatLong stat_polystack_types;
+        private final StatLong stat_polystack_curves;
+        private final Histogram hist_polystack_curves;
+        private final StatLong stat_array_polystack_curves;
+        private final StatLong stat_array_polystack_curveTypes;
+
+        PolyStack(final RendererContext rdrCtx) {
+            this(rdrCtx, null, null, null, null, null);
+        }
+
+        PolyStack(final RendererContext rdrCtx,
+                  final StatLong stat_polystack_types,
+                  final StatLong stat_polystack_curves,
+                  final Histogram hist_polystack_curves,
+                  final StatLong stat_array_polystack_curves,
+                  final StatLong stat_array_polystack_curveTypes)
+        {
+            curves_ref = rdrCtx.newDirtyFloatArrayRef(INITIAL_CURVES_COUNT); // 32K
+            curves     = curves_ref.initial;
+
+            curveTypes_ref = rdrCtx.newDirtyByteArrayRef(INITIAL_TYPES_COUNT); // 4K
+            curveTypes     = curveTypes_ref.initial;
+            numCurves = 0;
+            end = 0;
+
+            if (DO_STATS) {
+                curveTypesUseMark = 0;
+                curvesUseMark = 0;
+            }
+            this.stat_polystack_types = stat_polystack_types;
+            this.stat_polystack_curves = stat_polystack_curves;
+            this.hist_polystack_curves = hist_polystack_curves;
+            this.stat_array_polystack_curves = stat_array_polystack_curves;
+            this.stat_array_polystack_curveTypes = stat_array_polystack_curveTypes;
+        }
+
+        /**
+         * Disposes this PolyStack:
+         * clean up before reusing this instance
+         */
+        void dispose() {
+            end = 0;
+            numCurves = 0;
+
+            if (DO_STATS) {
+                stat_polystack_types.add(curveTypesUseMark);
+                stat_polystack_curves.add(curvesUseMark);
+                hist_polystack_curves.add(curvesUseMark);
+
+                // reset marks
+                curveTypesUseMark = 0;
+                curvesUseMark = 0;
+            }
+
+            // Return arrays:
+            // curves and curveTypes are kept dirty
+            curves     = curves_ref.putArray(curves);
+            curveTypes = curveTypes_ref.putArray(curveTypes);
+        }
+
+        private void ensureSpace(final int n) {
+            // use substraction to avoid integer overflow:
+            if (curves.length - end < n) {
+                if (DO_STATS) {
+                    stat_array_polystack_curves.add(end + n);
+                }
+                curves = curves_ref.widenArray(curves, end, end + n);
+            }
+            if (curveTypes.length <= numCurves) {
+                if (DO_STATS) {
+                    stat_array_polystack_curveTypes.add(numCurves + 1);
+                }
+                curveTypes = curveTypes_ref.widenArray(curveTypes,
+                                                       numCurves,
+                                                       numCurves + 1);
+            }
+        }
+
+        void pushCubic(float x0, float y0,
+                       float x1, float y1,
+                       float x2, float y2)
+        {
+            ensureSpace(6);
+            curveTypes[numCurves++] = TYPE_CUBICTO;
+            // we reverse the coordinate order to make popping easier
+            final float[] _curves = curves;
+            int e = end;
+            _curves[e++] = x2;    _curves[e++] = y2;
+            _curves[e++] = x1;    _curves[e++] = y1;
+            _curves[e++] = x0;    _curves[e++] = y0;
+            end = e;
+        }
+
+        void pushQuad(float x0, float y0,
+                      float x1, float y1)
+        {
+            ensureSpace(4);
+            curveTypes[numCurves++] = TYPE_QUADTO;
+            final float[] _curves = curves;
+            int e = end;
+            _curves[e++] = x1;    _curves[e++] = y1;
+            _curves[e++] = x0;    _curves[e++] = y0;
+            end = e;
+        }
+
+        void pushLine(float x, float y) {
+            ensureSpace(2);
+            curveTypes[numCurves++] = TYPE_LINETO;
+            curves[end++] = x;    curves[end++] = y;
+        }
+
+        void pullAll(final PathConsumer2D io) {
+            final int nc = numCurves;
+            if (nc == 0) {
+                return;
+            }
+            if (DO_STATS) {
+                // update used marks:
+                if (numCurves > curveTypesUseMark) {
+                    curveTypesUseMark = numCurves;
+                }
+                if (end > curvesUseMark) {
+                    curvesUseMark = end;
+                }
+            }
+            final byte[]  _curveTypes = curveTypes;
+            final float[] _curves = curves;
+            int e = 0;
+
+            for (int i = 0; i < nc; i++) {
+                switch(_curveTypes[i]) {
+                case TYPE_LINETO:
+                    io.lineTo(_curves[e], _curves[e+1]);
+                    e += 2;
+                    continue;
+                case TYPE_QUADTO:
+                    io.quadTo(_curves[e+0], _curves[e+1],
+                              _curves[e+2], _curves[e+3]);
+                    e += 4;
+                    continue;
+                case TYPE_CUBICTO:
+                    io.curveTo(_curves[e+0], _curves[e+1],
+                               _curves[e+2], _curves[e+3],
+                               _curves[e+4], _curves[e+5]);
+                    e += 6;
+                    continue;
+                default:
+                }
+            }
+            numCurves = 0;
+            end = 0;
+        }
+
+        void popAll(final PathConsumer2D io) {
+            int nc = numCurves;
+            if (nc == 0) {
+                return;
+            }
+            if (DO_STATS) {
+                // update used marks:
+                if (numCurves > curveTypesUseMark) {
+                    curveTypesUseMark = numCurves;
+                }
+                if (end > curvesUseMark) {
+                    curvesUseMark = end;
+                }
+            }
+            final byte[]  _curveTypes = curveTypes;
+            final float[] _curves = curves;
+            int e  = end;
+
+            while (nc != 0) {
+                switch(_curveTypes[--nc]) {
+                case TYPE_LINETO:
+                    e -= 2;
+                    io.lineTo(_curves[e], _curves[e+1]);
+                    continue;
+                case TYPE_QUADTO:
+                    e -= 4;
+                    io.quadTo(_curves[e+0], _curves[e+1],
+                              _curves[e+2], _curves[e+3]);
+                    continue;
+                case TYPE_CUBICTO:
+                    e -= 6;
+                    io.curveTo(_curves[e+0], _curves[e+1],
+                               _curves[e+2], _curves[e+3],
+                               _curves[e+4], _curves[e+5]);
+                    continue;
+                default:
+                }
+            }
+            numCurves = 0;
+            end = 0;
+        }
+
+        @Override
+        public String toString() {
+            String ret = "";
+            int nc = numCurves;
+            int last = end;
+            int len;
+            while (nc != 0) {
+                switch(curveTypes[--nc]) {
+                case TYPE_LINETO:
+                    len = 2;
+                    ret += "line: ";
+                    break;
+                case TYPE_QUADTO:
+                    len = 4;
+                    ret += "quad: ";
+                    break;
+                case TYPE_CUBICTO:
+                    len = 6;
+                    ret += "cubic: ";
+                    break;
+                default:
+                    len = 0;
+                }
+                last -= len;
+                ret += Arrays.toString(Arrays.copyOfRange(curves, last, last+len))
+                                       + "\n";
+            }
+            return ret;
+        }
+    }
+
+    // a stack of integer indices
+    static final class IndexStack {
+
+        // integer capacity = edges count / 4 ~ 1024
+        private static final int INITIAL_COUNT = INITIAL_EDGES_COUNT >> 2;
+
+        private int end;
+        private int[] indices;
+
+        // indices ref (dirty)
+        private final IntArrayCache.Reference indices_ref;
+
+        // used marks (stats only)
+        private int indicesUseMark;
+
+        private final StatLong stat_idxstack_indices;
+        private final Histogram hist_idxstack_indices;
+        private final StatLong stat_array_idxstack_indices;
+
+        IndexStack(final RendererContext rdrCtx) {
+            this(rdrCtx, null, null, null);
+        }
+
+        IndexStack(final RendererContext rdrCtx,
+                   final StatLong stat_idxstack_indices,
+                   final Histogram hist_idxstack_indices,
+                   final StatLong stat_array_idxstack_indices)
+        {
+            indices_ref = rdrCtx.newDirtyIntArrayRef(INITIAL_COUNT); // 4K
+            indices     = indices_ref.initial;
+            end = 0;
+
+            if (DO_STATS) {
+                indicesUseMark = 0;
+            }
+            this.stat_idxstack_indices = stat_idxstack_indices;
+            this.hist_idxstack_indices = hist_idxstack_indices;
+            this.stat_array_idxstack_indices = stat_array_idxstack_indices;
+        }
+
+        /**
+         * Disposes this PolyStack:
+         * clean up before reusing this instance
+         */
+        void dispose() {
+            end = 0;
+
+            if (DO_STATS) {
+                stat_idxstack_indices.add(indicesUseMark);
+                hist_idxstack_indices.add(indicesUseMark);
+
+                // reset marks
+                indicesUseMark = 0;
+            }
+
+            // Return arrays:
+            // values is kept dirty
+            indices = indices_ref.putArray(indices);
+        }
+
+        boolean isEmpty() {
+            return (end == 0);
+        }
+
+        void reset() {
+            end = 0;
+        }
+
+        void push(final int v) {
+            // remove redundant values (reverse order):
+            int[] _values = indices;
+            final int nc = end;
+            if (nc != 0) {
+                if (_values[nc - 1] == v) {
+                    // remove both duplicated values:
+                    end--;
+                    return;
+                }
+            }
+            if (_values.length <= nc) {
+                if (DO_STATS) {
+                    stat_array_idxstack_indices.add(nc + 1);
+                }
+                indices = _values = indices_ref.widenArray(_values, nc, nc + 1);
+            }
+            _values[end++] = v;
+
+            if (DO_STATS) {
+                // update used marks:
+                if (end > indicesUseMark) {
+                    indicesUseMark = end;
+                }
+            }
+        }
+
+        void pullAll(final float[] points, final PathConsumer2D io) {
+            final int nc = end;
+            if (nc == 0) {
+                return;
+            }
+            final int[] _values = indices;
+
+            for (int i = 0, j; i < nc; i++) {
+                j = _values[i] << 1;
+                io.lineTo(points[j], points[j + 1]);
+            }
+            end = 0;
+        }
+    }
 }
--- a/src/java.desktop/share/classes/sun/java2d/marlin/MarlinCache.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/sun/java2d/marlin/MarlinCache.java	Wed Dec 13 10:25:38 2017 -0800
@@ -139,11 +139,7 @@
             // ie number of primitives:
 
             // fast check min and max width (maxx < 23bits):
-            if (width <= RLE_MIN_WIDTH || width >= RLE_MAX_WIDTH) {
-                useRLE = false;
-            } else {
-                useRLE = true;
-            }
+            useRLE = (width > RLE_MIN_WIDTH && width < RLE_MAX_WIDTH);
         }
 
         // the ceiling of (maxy - miny + 1) / TILE_SIZE;
--- a/src/java.desktop/share/classes/sun/java2d/marlin/MarlinConst.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/sun/java2d/marlin/MarlinConst.java	Wed Dec 13 10:25:38 2017 -0800
@@ -128,4 +128,47 @@
 
     public static final int BLOCK_SIZE_LG = MarlinProperties.getBlockSize_Log2();
     public static final int BLOCK_SIZE    = 1 << BLOCK_SIZE_LG;
+
+    // Constants
+    public static final int WIND_EVEN_ODD = 0;
+    public static final int WIND_NON_ZERO = 1;
+
+    /**
+     * Constant value for join style.
+     */
+    public static final int JOIN_MITER = 0;
+
+    /**
+     * Constant value for join style.
+     */
+    public static final int JOIN_ROUND = 1;
+
+    /**
+     * Constant value for join style.
+     */
+    public static final int JOIN_BEVEL = 2;
+
+    /**
+     * Constant value for end cap style.
+     */
+    public static final int CAP_BUTT = 0;
+
+    /**
+     * Constant value for end cap style.
+     */
+    public static final int CAP_ROUND = 1;
+
+    /**
+     * Constant value for end cap style.
+     */
+    public static final int CAP_SQUARE = 2;
+
+    // Out codes
+    static final int OUTCODE_TOP      = 1;
+    static final int OUTCODE_BOTTOM   = 2;
+    static final int OUTCODE_LEFT     = 4;
+    static final int OUTCODE_RIGHT    = 8;
+    static final int OUTCODE_MASK_T_B = OUTCODE_TOP  | OUTCODE_BOTTOM;
+    static final int OUTCODE_MASK_L_R = OUTCODE_LEFT | OUTCODE_RIGHT;
+    static final int OUTCODE_MASK_T_B_L_R = OUTCODE_MASK_T_B | OUTCODE_MASK_L_R;
 }
--- a/src/java.desktop/share/classes/sun/java2d/marlin/MarlinProperties.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/sun/java2d/marlin/MarlinProperties.java	Wed Dec 13 10:25:38 2017 -0800
@@ -145,6 +145,18 @@
         return getBoolean("sun.java2d.renderer.useSimplifier", "false");
     }
 
+    public static boolean isDoClip() {
+        return getBoolean("sun.java2d.renderer.clip", "true");
+    }
+
+    public static boolean isDoClipRuntimeFlag() {
+        return getBoolean("sun.java2d.renderer.clip.runtime.enable", "false");
+    }
+
+    public static boolean isDoClipAtRuntime() {
+        return getBoolean("sun.java2d.renderer.clip.runtime", "true");
+    }
+
     // debugging parameters
 
     public static boolean isDoStats() {
--- a/src/java.desktop/share/classes/sun/java2d/marlin/MarlinRenderingEngine.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/sun/java2d/marlin/MarlinRenderingEngine.java	Wed Dec 13 10:25:38 2017 -0800
@@ -85,6 +85,13 @@
     static final float UPPER_BND = Float.MAX_VALUE / 2.0f;
     static final float LOWER_BND = -UPPER_BND;
 
+    static final boolean DO_CLIP = MarlinProperties.isDoClip();
+    static final boolean DO_CLIP_FILL = true;
+
+    static final boolean DO_TRACE_PATH = false;
+
+    static final boolean DO_CLIP_RUNTIME_ENABLE = MarlinProperties.isDoClipRuntimeFlag();
+
     /**
      * Public constructor
      */
@@ -134,7 +141,7 @@
                      miterlimit,
                      dashes,
                      dashphase,
-                     rdrCtx.transformerPC2D.wrapPath2d(p2d)
+                     rdrCtx.transformerPC2D.wrapPath2D(p2d)
                     );
 
             // Use Path2D copy constructor (trim)
@@ -195,14 +202,14 @@
         }
     }
 
-    final void strokeTo(final RendererContext rdrCtx,
-                        Shape src,
-                        AffineTransform at,
-                        BasicStroke bs,
-                        boolean thin,
-                        NormMode normalize,
-                        boolean antialias,
-                        PathConsumer2D pc2d)
+    void strokeTo(final RendererContext rdrCtx,
+                  Shape src,
+                  AffineTransform at,
+                  BasicStroke bs,
+                  boolean thin,
+                  NormMode normalize,
+                  boolean antialias,
+                  PathConsumer2D pc2d)
     {
         float lw;
         if (thin) {
@@ -295,17 +302,17 @@
         return (lw / widthScale);
     }
 
-    final void strokeTo(final RendererContext rdrCtx,
-                        Shape src,
-                        AffineTransform at,
-                        float width,
-                        NormMode norm,
-                        int caps,
-                        int join,
-                        float miterlimit,
-                        float[] dashes,
-                        float dashphase,
-                        PathConsumer2D pc2d)
+    void strokeTo(final RendererContext rdrCtx,
+                  Shape src,
+                  AffineTransform at,
+                  float width,
+                  NormMode norm,
+                  int caps,
+                  int join,
+                  float miterlimit,
+                  float[] dashes,
+                  float dashphase,
+                  PathConsumer2D pc2d)
     {
         // We use strokerat so that in Stroker and Dasher we can work only
         // with the pre-transformation coordinates. This will repeat a lot of
@@ -324,6 +331,7 @@
 
         int dashLen = -1;
         boolean recycleDashes = false;
+        float scale = 1.0f;
 
         if (at != null && !at.isIdentity()) {
             final double a = at.getScaleX();
@@ -356,7 +364,7 @@
             // a*b == -c*d && a*a+c*c == b*b+d*d. In the actual check below, we
             // leave a bit of room for error.
             if (nearZero(a*b + c*d) && nearZero(a*a + c*c - (b*b + d*d))) {
-                final float scale = (float) Math.sqrt(a*a + c*c);
+                scale = (float) Math.sqrt(a*a + c*c);
 
                 if (dashes != null) {
                     recycleDashes = true;
@@ -394,16 +402,24 @@
             at = null;
         }
 
+        final TransformingPathConsumer2D transformerPC2D = rdrCtx.transformerPC2D;
+
+        if (DO_TRACE_PATH) {
+            // trace Stroker:
+            pc2d = transformerPC2D.traceStroker(pc2d);
+        }
+
         if (USE_SIMPLIFIER) {
             // Use simplifier after stroker before Renderer
             // to remove collinear segments (notably due to cap square)
             pc2d = rdrCtx.simplifier.init(pc2d);
         }
 
-        final TransformingPathConsumer2D transformerPC2D = rdrCtx.transformerPC2D;
+        // deltaTransformConsumer may adjust the clip rectangle:
         pc2d = transformerPC2D.deltaTransformConsumer(pc2d, strokerat);
 
-        pc2d = rdrCtx.stroker.init(pc2d, width, caps, join, miterlimit);
+        // stroker will adjust the clip rectangle (width / miter limit):
+        pc2d = rdrCtx.stroker.init(pc2d, width, caps, join, miterlimit, scale);
 
         if (dashes != null) {
             if (!recycleDashes) {
@@ -411,9 +427,22 @@
             }
             pc2d = rdrCtx.dasher.init(pc2d, dashes, dashLen, dashphase,
                                       recycleDashes);
+        } else if (rdrCtx.doClip && (caps != Stroker.CAP_BUTT)) {
+            if (DO_TRACE_PATH) {
+                pc2d = transformerPC2D.traceClosedPathDetector(pc2d);
+            }
+
+            // If no dash and clip is enabled:
+            // detect closedPaths (polygons) for caps
+            pc2d = transformerPC2D.detectClosedPath(pc2d);
         }
         pc2d = transformerPC2D.inverseDeltaTransformConsumer(pc2d, strokerat);
 
+        if (DO_TRACE_PATH) {
+            // trace Input:
+            pc2d = transformerPC2D.traceInput(pc2d);
+        }
+
         final PathIterator pi = norm.getNormalizingPathIterator(rdrCtx,
                                          src.getPathIterator(at));
 
@@ -594,14 +623,12 @@
     }
 
     private static void pathTo(final RendererContext rdrCtx, final PathIterator pi,
-                               final PathConsumer2D pc2d)
+                               PathConsumer2D pc2d)
     {
         // mark context as DIRTY:
         rdrCtx.dirty = true;
 
-        final float[] coords = rdrCtx.float6;
-
-        pathToLoop(coords, pi, pc2d);
+        pathToLoop(rdrCtx.float6, pi, pc2d);
 
         // mark context as CLEAN:
         rdrCtx.dirty = false;
@@ -779,6 +806,19 @@
 
         final RendererContext rdrCtx = getRendererContext();
         try {
+            if (DO_CLIP || (DO_CLIP_RUNTIME_ENABLE && MarlinProperties.isDoClipAtRuntime())) {
+                // Define the initial clip bounds:
+                final float[] clipRect = rdrCtx.clipRect;
+
+                clipRect[0] = clip.getLoY();
+                clipRect[1] = clip.getLoY() + clip.getHeight();
+                clipRect[2] = clip.getLoX();
+                clipRect[3] = clip.getLoX() + clip.getWidth();
+
+                // Enable clipping:
+                rdrCtx.doClip = true;
+            }
+
             // Test if at is identity:
             final AffineTransform _at = (at != null && !at.isIdentity()) ? at
                                         : null;
@@ -795,13 +835,29 @@
                                          clip.getWidth(), clip.getHeight(),
                                          pi.getWindingRule());
 
+                PathConsumer2D pc2d = r;
+
+                if (DO_CLIP_FILL && rdrCtx.doClip) {
+                    if (DO_TRACE_PATH) {
+                        // trace Filler:
+                        pc2d = rdrCtx.transformerPC2D.traceFiller(pc2d);
+                    }
+                    pc2d = rdrCtx.transformerPC2D.pathClipper(pc2d);
+                }
+
+                if (DO_TRACE_PATH) {
+                    // trace Input:
+                    pc2d = rdrCtx.transformerPC2D.traceInput(pc2d);
+                }
+
                 // TODO: subdivide quad/cubic curves into monotonic curves ?
-                pathTo(rdrCtx, pi, r);
+                pathTo(rdrCtx, pi, pc2d);
+
             } else {
                 // draw shape with given stroke:
                 r = rdrCtx.renderer.init(clip.getLoX(), clip.getLoY(),
                                          clip.getWidth(), clip.getHeight(),
-                                         PathIterator.WIND_NON_ZERO);
+                                         WIND_NON_ZERO);
 
                 strokeTo(rdrCtx, s, _at, bs, thin, norm, true, r);
             }
@@ -824,12 +880,12 @@
     }
 
     @Override
-    public final AATileGenerator getAATileGenerator(double x, double y,
-                                                    double dx1, double dy1,
-                                                    double dx2, double dy2,
-                                                    double lw1, double lw2,
-                                                    Region clip,
-                                                    int[] bbox)
+    public AATileGenerator getAATileGenerator(double x, double y,
+                                              double dx1, double dy1,
+                                              double dx2, double dy2,
+                                              double lw1, double lw2,
+                                              Region clip,
+                                              int[] bbox)
     {
         // REMIND: Deal with large coordinates!
         double ldx1, ldy1, ldx2, ldy2;
@@ -860,8 +916,8 @@
         final RendererContext rdrCtx = getRendererContext();
         try {
             r = rdrCtx.renderer.init(clip.getLoX(), clip.getLoY(),
-                                         clip.getWidth(), clip.getHeight(),
-                                         Renderer.WIND_EVEN_ODD);
+                                     clip.getWidth(), clip.getHeight(),
+                                     WIND_EVEN_ODD);
 
             r.moveTo((float) x, (float) y);
             r.lineTo((float) (x+dx1), (float) (y+dy1));
@@ -913,14 +969,14 @@
     }
 
     static {
-        if (PathIterator.WIND_NON_ZERO != Renderer.WIND_NON_ZERO ||
-            PathIterator.WIND_EVEN_ODD != Renderer.WIND_EVEN_ODD ||
-            BasicStroke.JOIN_MITER != Stroker.JOIN_MITER ||
-            BasicStroke.JOIN_ROUND != Stroker.JOIN_ROUND ||
-            BasicStroke.JOIN_BEVEL != Stroker.JOIN_BEVEL ||
-            BasicStroke.CAP_BUTT != Stroker.CAP_BUTT ||
-            BasicStroke.CAP_ROUND != Stroker.CAP_ROUND ||
-            BasicStroke.CAP_SQUARE != Stroker.CAP_SQUARE)
+        if (PathIterator.WIND_NON_ZERO != WIND_NON_ZERO ||
+            PathIterator.WIND_EVEN_ODD != WIND_EVEN_ODD ||
+            BasicStroke.JOIN_MITER != JOIN_MITER ||
+            BasicStroke.JOIN_ROUND != JOIN_ROUND ||
+            BasicStroke.JOIN_BEVEL != JOIN_BEVEL ||
+            BasicStroke.CAP_BUTT != CAP_BUTT ||
+            BasicStroke.CAP_ROUND != CAP_ROUND ||
+            BasicStroke.CAP_SQUARE != CAP_SQUARE)
         {
             throw new InternalError("mismatched renderer constants");
         }
@@ -1046,6 +1102,11 @@
         logInfo("sun.java2d.renderer.useSimplifier    = "
                 + MarlinConst.USE_SIMPLIFIER);
 
+        logInfo("sun.java2d.renderer.clip             = "
+                + MarlinProperties.isDoClip());
+        logInfo("sun.java2d.renderer.clip.runtime.enable = "
+                + MarlinProperties.isDoClipRuntimeFlag());
+
         // debugging parameters
         logInfo("sun.java2d.renderer.doStats          = "
                 + MarlinConst.DO_STATS);
--- a/src/java.desktop/share/classes/sun/java2d/marlin/Renderer.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/sun/java2d/marlin/Renderer.java	Wed Dec 13 10:25:38 2017 -0800
@@ -47,6 +47,9 @@
     static final int SUBPIXEL_MASK_X = SUBPIXEL_POSITIONS_X - 1;
     static final int SUBPIXEL_MASK_Y = SUBPIXEL_POSITIONS_Y - 1;
 
+    static final float RDR_OFFSET_X = 0.5f / SUBPIXEL_SCALE_X;
+    static final float RDR_OFFSET_Y = 0.5f / SUBPIXEL_SCALE_Y;
+
     // number of subpixels corresponding to a tile line
     private static final int SUBPIXEL_TILE
         = TILE_H << SUBPIXEL_LG_POSITIONS_Y;
@@ -58,9 +61,6 @@
     // crossing capacity = edges count / 4 ~ 1024
     static final int INITIAL_CROSSING_COUNT = INITIAL_EDGES_COUNT >> 2;
 
-    public static final int WIND_EVEN_ODD = 0;
-    public static final int WIND_NON_ZERO = 1;
-
     // common to all types of input path segments.
     // OFFSET as bytes
     // only integer values:
@@ -526,11 +526,11 @@
 
     Renderer(final RendererContext rdrCtx) {
         this.rdrCtx = rdrCtx;
+        this.curve = rdrCtx.curve;
+        this.cache = rdrCtx.cache;
 
         this.edges = rdrCtx.newOffHeapArray(INITIAL_EDGES_CAPACITY); // 96K
 
-        this.curve = rdrCtx.curve;
-
         edgeBuckets_ref      = rdrCtx.newCleanIntArrayRef(INITIAL_BUCKET_ARRAY); // 64K
         edgeBucketCounts_ref = rdrCtx.newCleanIntArrayRef(INITIAL_BUCKET_ARRAY); // 64K
 
@@ -541,8 +541,6 @@
         alphaLine_ref = rdrCtx.newCleanIntArrayRef(INITIAL_AA_ARRAY); // 8K
         alphaLine     = alphaLine_ref.initial;
 
-        this.cache = rdrCtx.cache;
-
         crossings_ref     = rdrCtx.newDirtyIntArrayRef(INITIAL_CROSSING_COUNT); // 2K
         aux_crossings_ref = rdrCtx.newDirtyIntArrayRef(INITIAL_CROSSING_COUNT); // 2K
         edgePtrs_ref      = rdrCtx.newDirtyIntArrayRef(INITIAL_CROSSING_COUNT); // 2K
@@ -672,7 +670,7 @@
     }
 
     @Override
-    public void moveTo(float pix_x0, float pix_y0) {
+    public void moveTo(final float pix_x0, final float pix_y0) {
         closePath();
         final float sx = tosubpixx(pix_x0);
         final float sy = tosubpixy(pix_y0);
@@ -683,7 +681,7 @@
     }
 
     @Override
-    public void lineTo(float pix_x1, float pix_y1) {
+    public void lineTo(final float pix_x1, final float pix_y1) {
         final float x1 = tosubpixx(pix_x1);
         final float y1 = tosubpixy(pix_y1);
         addLine(x0, y0, x1, y1);
@@ -692,24 +690,26 @@
     }
 
     @Override
-    public void curveTo(float x1, float y1,
-                        float x2, float y2,
-                        float x3, float y3)
+    public void curveTo(final float pix_x1, final float pix_y1,
+                        final float pix_x2, final float pix_y2,
+                        final float pix_x3, final float pix_y3)
     {
-        final float xe = tosubpixx(x3);
-        final float ye = tosubpixy(y3);
-        curve.set(x0, y0, tosubpixx(x1), tosubpixy(y1),
-                          tosubpixx(x2), tosubpixy(y2), xe, ye);
+        final float xe = tosubpixx(pix_x3);
+        final float ye = tosubpixy(pix_y3);
+        curve.set(x0, y0, tosubpixx(pix_x1), tosubpixy(pix_y1),
+                  tosubpixx(pix_x2), tosubpixy(pix_y2), xe, ye);
         curveBreakIntoLinesAndAdd(x0, y0, curve, xe, ye);
         x0 = xe;
         y0 = ye;
     }
 
     @Override
-    public void quadTo(float x1, float y1, float x2, float y2) {
-        final float xe = tosubpixx(x2);
-        final float ye = tosubpixy(y2);
-        curve.set(x0, y0, tosubpixx(x1), tosubpixy(y1), xe, ye);
+    public void quadTo(final float pix_x1, final float pix_y1,
+                       final float pix_x2, final float pix_y2)
+    {
+        final float xe = tosubpixx(pix_x2);
+        final float ye = tosubpixy(pix_y2);
+        curve.set(x0, y0, tosubpixx(pix_x1), tosubpixy(pix_y1), xe, ye);
         quadBreakIntoLinesAndAdd(x0, y0, curve, xe, ye);
         x0 = xe;
         y0 = ye;
@@ -717,9 +717,11 @@
 
     @Override
     public void closePath() {
-        addLine(x0, y0, sx0, sy0);
-        x0 = sx0;
-        y0 = sy0;
+        if (x0 != sx0 || y0 != sy0) {
+            addLine(x0, y0, sx0, sy0);
+            x0 = sx0;
+            y0 = sy0;
+        }
     }
 
     @Override
--- a/src/java.desktop/share/classes/sun/java2d/marlin/RendererContext.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/sun/java2d/marlin/RendererContext.java	Wed Dec 13 10:25:38 2017 -0800
@@ -75,16 +75,22 @@
     final MarlinCache cache;
     // flag indicating the shape is stroked (1) or filled (0)
     int stroking = 0;
+    // flag indicating to clip the shape
+    boolean doClip = false;
+    // flag indicating if the path is closed or not (in advance) to handle properly caps
+    boolean closedPath = false;
+    // clip rectangle (ymin, ymax, xmin, xmax):
+    final float[] clipRect = new float[4];
 
     // Array caches:
     /* clean int[] cache (zero-filled) = 5 refs */
     private final IntArrayCache cleanIntCache = new IntArrayCache(true, 5);
-    /* dirty int[] cache = 4 refs */
-    private final IntArrayCache dirtyIntCache = new IntArrayCache(false, 4);
-    /* dirty float[] cache = 3 refs */
-    private final FloatArrayCache dirtyFloatCache = new FloatArrayCache(false, 3);
-    /* dirty byte[] cache = 1 ref */
-    private final ByteArrayCache dirtyByteCache = new ByteArrayCache(false, 1);
+    /* dirty int[] cache = 5 refs */
+    private final IntArrayCache dirtyIntCache = new IntArrayCache(false, 5);
+    /* dirty float[] cache = 4 refs (2 polystack) */
+    private final FloatArrayCache dirtyFloatCache = new FloatArrayCache(false, 4);
+    /* dirty byte[] cache = 2 ref (2 polystack) */
+    private final ByteArrayCache dirtyByteCache = new ByteArrayCache(false, 2);
 
     // RendererContext statistics
     final RendererStats stats;
@@ -116,7 +122,7 @@
         nPQPathIterator  = new NormalizingPathIterator.NearestPixelQuarter(float6);
 
         // MarlinRenderingEngine.TransformingPathConsumer2D
-        transformerPC2D = new TransformingPathConsumer2D();
+        transformerPC2D = new TransformingPathConsumer2D(this);
 
         // Renderer:
         cache = new MarlinCache(this);
@@ -138,7 +144,10 @@
             }
             stats.totalOffHeap = 0L;
         }
-        stroking = 0;
+        stroking   = 0;
+        doClip     = false;
+        closedPath = false;
+
         // if context is maked as DIRTY:
         if (dirty) {
             // may happen if an exception if thrown in the pipeline processing:
@@ -159,12 +168,11 @@
 
     Path2D.Float getPath2D() {
         // resolve reference:
-        Path2D.Float p2d
-            = (refPath2D != null) ? refPath2D.get() : null;
+        Path2D.Float p2d = (refPath2D != null) ? refPath2D.get() : null;
 
         // create a new Path2D ?
         if (p2d == null) {
-            p2d = new Path2D.Float(Path2D.WIND_NON_ZERO, INITIAL_EDGES_COUNT); // 32K
+            p2d = new Path2D.Float(WIND_NON_ZERO, INITIAL_EDGES_COUNT); // 32K
 
             // update weak reference:
             refPath2D = new WeakReference<Path2D.Float>(p2d);
--- a/src/java.desktop/share/classes/sun/java2d/marlin/RendererStats.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/sun/java2d/marlin/RendererStats.java	Wed Dec 13 10:25:38 2017 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, 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
@@ -66,10 +66,6 @@
         = new StatLong("cache.rowAAChunk");
     final StatLong stat_cache_tiles
         = new StatLong("cache.tiles");
-    final StatLong stat_rdr_poly_stack_curves
-        = new StatLong("renderer.poly.stack.curves");
-    final StatLong stat_rdr_poly_stack_types
-        = new StatLong("renderer.poly.stack.types");
     final StatLong stat_rdr_addLine
         = new StatLong("renderer.addLine");
     final StatLong stat_rdr_addLine_skip
@@ -106,15 +102,21 @@
         = new StatLong("renderer.crossings.bsearch");
     final StatLong stat_rdr_crossings_msorts
         = new StatLong("renderer.crossings.msorts");
+    final StatLong stat_str_polystack_curves
+        = new StatLong("stroker.polystack.curves");
+    final StatLong stat_str_polystack_types
+        = new StatLong("stroker.polystack.types");
+    final StatLong stat_cpd_polystack_curves
+        = new StatLong("closedPathDetector.polystack.curves");
+    final StatLong stat_cpd_polystack_types
+        = new StatLong("closedPathDetector.polystack.types");
+    final StatLong stat_pcf_idxstack_indices
+        = new StatLong("pathClipFilter.stack.indices");
     // growable arrays
     final StatLong stat_array_dasher_dasher
         = new StatLong("array.dasher.dasher.d_float");
     final StatLong stat_array_dasher_firstSegmentsBuffer
         = new StatLong("array.dasher.firstSegmentsBuffer.d_float");
-    final StatLong stat_array_stroker_polystack_curves
-        = new StatLong("array.stroker.polystack.curves.d_float");
-    final StatLong stat_array_stroker_polystack_curveTypes
-        = new StatLong("array.stroker.polystack.curveTypes.d_byte");
     final StatLong stat_array_marlincache_rowAAChunk
         = new StatLong("array.marlincache.rowAAChunk.resize");
     final StatLong stat_array_marlincache_touchedTile
@@ -133,11 +135,19 @@
         = new StatLong("array.renderer.edgePtrs.int");
     final StatLong stat_array_renderer_aux_edgePtrs
         = new StatLong("array.renderer.aux_edgePtrs.int");
+    final StatLong stat_array_str_polystack_curves
+        = new StatLong("array.stroker.polystack.curves.d_float");
+    final StatLong stat_array_str_polystack_types
+        = new StatLong("array.stroker.polystack.curveTypes.d_byte");
+    final StatLong stat_array_cpd_polystack_curves
+        = new StatLong("array.closedPathDetector.polystack.curves.d_float");
+    final StatLong stat_array_cpd_polystack_types
+        = new StatLong("array.closedPathDetector.polystack.curveTypes.d_byte");
+    final StatLong stat_array_pcf_idxstack_indices
+        = new StatLong("array.pathClipFilter.stack.indices.d_int");
     // histograms
     final Histogram hist_rdr_edges_count
         = new Histogram("renderer.edges.count");
-    final Histogram hist_rdr_poly_stack_curves
-        = new Histogram("renderer.polystack.curves");
     final Histogram hist_rdr_crossings
         = new Histogram("renderer.crossings");
     final Histogram hist_rdr_crossings_ratio
@@ -148,6 +158,8 @@
         = new Histogram("renderer.crossings.msorts");
     final Histogram hist_rdr_crossings_msorts_adds
         = new Histogram("renderer.crossings.msorts.adds");
+    final Histogram hist_str_polystack_curves
+        = new Histogram("stroker.polystack.curves");
     final Histogram hist_tile_generator_alpha
         = new Histogram("tile_generator.alpha");
     final Histogram hist_tile_generator_encoding
@@ -158,13 +170,15 @@
         = new Histogram("tile_generator.encoding.ratio");
     final Histogram hist_tile_generator_encoding_runLen
         = new Histogram("tile_generator.encoding.runLen");
+    final Histogram hist_cpd_polystack_curves
+        = new Histogram("closedPathDetector.polystack.curves");
+    final Histogram hist_pcf_idxstack_indices
+        = new Histogram("pathClipFilter.stack.indices");
     // all stats
     final StatLong[] statistics = new StatLong[]{
         stat_cache_rowAA,
         stat_cache_rowAAChunk,
         stat_cache_tiles,
-        stat_rdr_poly_stack_types,
-        stat_rdr_poly_stack_curves,
         stat_rdr_addLine,
         stat_rdr_addLine_skip,
         stat_rdr_curveBreak,
@@ -183,8 +197,12 @@
         stat_rdr_crossings_sorts,
         stat_rdr_crossings_bsearch,
         stat_rdr_crossings_msorts,
+        stat_str_polystack_types,
+        stat_str_polystack_curves,
+        stat_cpd_polystack_curves,
+        stat_cpd_polystack_types,
+        stat_pcf_idxstack_indices,
         hist_rdr_edges_count,
-        hist_rdr_poly_stack_curves,
         hist_rdr_crossings,
         hist_rdr_crossings_ratio,
         hist_rdr_crossings_adds,
@@ -195,10 +213,11 @@
         hist_tile_generator_encoding_dist,
         hist_tile_generator_encoding_ratio,
         hist_tile_generator_encoding_runLen,
+        hist_str_polystack_curves,
+        hist_cpd_polystack_curves,
+        hist_pcf_idxstack_indices,
         stat_array_dasher_dasher,
         stat_array_dasher_firstSegmentsBuffer,
-        stat_array_stroker_polystack_curves,
-        stat_array_stroker_polystack_curveTypes,
         stat_array_marlincache_rowAAChunk,
         stat_array_marlincache_touchedTile,
         stat_array_renderer_alphaline,
@@ -207,7 +226,12 @@
         stat_array_renderer_edgeBuckets,
         stat_array_renderer_edgeBucketCounts,
         stat_array_renderer_edgePtrs,
-        stat_array_renderer_aux_edgePtrs
+        stat_array_renderer_aux_edgePtrs,
+        stat_array_str_polystack_curves,
+        stat_array_str_polystack_types,
+        stat_array_cpd_polystack_curves,
+        stat_array_cpd_polystack_types,
+        stat_array_pcf_idxstack_indices
     };
     // monitors
     final Monitor mon_pre_getAATileGenerator
--- a/src/java.desktop/share/classes/sun/java2d/marlin/Stroker.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/sun/java2d/marlin/Stroker.java	Wed Dec 13 10:25:38 2017 -0800
@@ -28,6 +28,7 @@
 import java.util.Arrays;
 
 import sun.awt.geom.PathConsumer2D;
+import sun.java2d.marlin.Helpers.PolyStack;
 
 // TODO: some of the arithmetic here is too verbose and prone to hard to
 // debug typos. We should consider making a small Point/Vector class that
@@ -38,42 +39,16 @@
     private static final int DRAWING_OP_TO = 1; // ie. curve, line, or quad
     private static final int CLOSE = 2;
 
-    /**
-     * Constant value for join style.
-     */
-    public static final int JOIN_MITER = 0;
-
-    /**
-     * Constant value for join style.
-     */
-    public static final int JOIN_ROUND = 1;
-
-    /**
-     * Constant value for join style.
-     */
-    public static final int JOIN_BEVEL = 2;
-
-    /**
-     * Constant value for end cap style.
-     */
-    public static final int CAP_BUTT = 0;
-
-    /**
-     * Constant value for end cap style.
-     */
-    public static final int CAP_ROUND = 1;
-
-    /**
-     * Constant value for end cap style.
-     */
-    public static final int CAP_SQUARE = 2;
-
     // pisces used to use fixed point arithmetic with 16 decimal digits. I
     // didn't want to change the values of the constant below when I converted
     // it to floating point, so that's why the divisions by 2^16 are there.
     private static final float ROUND_JOIN_THRESHOLD = 1000.0f/65536.0f;
 
-    private static final float C = 0.5522847498307933f;
+    // kappa = (4/3) * (SQRT(2) - 1)
+    private static final float C = (float)(4.0d * (Math.sqrt(2.0d) - 1.0d) / 3.0d);
+
+    // SQRT(2)
+    private static final float SQRT_2 = (float)Math.sqrt(2.0d);
 
     private static final int MAX_N_CURVES = 11;
 
@@ -120,6 +95,20 @@
     // dirty curve
     final Curve curve;
 
+    // Bounds of the drawing region, at pixel precision.
+    private float[] clipRect;
+
+    // the outcode of the current point
+    private int cOutCode = 0;
+
+    // the outcode of the starting point
+    private int sOutCode = 0;
+
+    // flag indicating if the path is opened (clipped)
+    private boolean opened = false;
+    // flag indicating if the starting point's cap is done
+    private boolean capStart = false;
+
     /**
      * Constructs a <code>Stroker</code>.
      * @param rdrCtx per-thread renderer context
@@ -127,7 +116,15 @@
     Stroker(final RendererContext rdrCtx) {
         this.rdrCtx = rdrCtx;
 
-        this.reverse = new PolyStack(rdrCtx);
+        this.reverse = (rdrCtx.stats != null) ?
+            new PolyStack(rdrCtx,
+                    rdrCtx.stats.stat_str_polystack_types,
+                    rdrCtx.stats.stat_str_polystack_curves,
+                    rdrCtx.stats.hist_str_polystack_curves,
+                    rdrCtx.stats.stat_array_str_polystack_curves,
+                    rdrCtx.stats.stat_array_str_polystack_types)
+            : new PolyStack(rdrCtx);
+
         this.curve = rdrCtx.curve;
     }
 
@@ -143,13 +140,15 @@
      * <code>JOIN_MITER</code>, <code>JOIN_ROUND</code> or
      * <code>JOIN_BEVEL</code>.
      * @param miterLimit the desired miter limit
+     * @param scale scaling factor applied to clip boundaries
      * @return this instance
      */
-    Stroker init(PathConsumer2D pc2d,
-              float lineWidth,
-              int capStyle,
-              int joinStyle,
-              float miterLimit)
+    Stroker init(final PathConsumer2D pc2d,
+                 final float lineWidth,
+                 final int capStyle,
+                 final int joinStyle,
+                 final float miterLimit,
+                 final float scale)
     {
         this.out = pc2d;
 
@@ -158,13 +157,45 @@
         this.capStyle = capStyle;
         this.joinStyle = joinStyle;
 
-        float limit = miterLimit * lineWidth2;
+        final float limit = miterLimit * lineWidth2;
         this.miterLimitSq = limit * limit;
 
         this.prev = CLOSE;
 
         rdrCtx.stroking = 1;
 
+        if (rdrCtx.doClip) {
+            // Adjust the clipping rectangle with the stroker margin (miter limit, width)
+            float rdrOffX = 0.0f, rdrOffY = 0.0f;
+            float margin = lineWidth2;
+
+            if (capStyle == CAP_SQUARE) {
+                margin *= SQRT_2;
+            }
+            if ((joinStyle == JOIN_MITER) && (margin < limit)) {
+                margin = limit;
+            }
+            if (scale != 1.0f) {
+                margin *= scale;
+                rdrOffX = scale * Renderer.RDR_OFFSET_X;
+                rdrOffY = scale * Renderer.RDR_OFFSET_Y;
+            }
+            // add a small rounding error:
+            margin += 1e-3f;
+
+            // bounds as half-open intervals: minX <= x < maxX and minY <= y < maxY
+            // adjust clip rectangle (ymin, ymax, xmin, xmax):
+            final float[] _clipRect = rdrCtx.clipRect;
+            _clipRect[0] -= margin - rdrOffY;
+            _clipRect[1] += margin + rdrOffY;
+            _clipRect[2] -= margin - rdrOffX;
+            _clipRect[3] += margin + rdrOffX;
+            this.clipRect = _clipRect;
+        } else {
+            this.clipRect = null;
+            this.cOutCode = 0;
+            this.sOutCode = 0;
+        }
         return this; // fluent API
     }
 
@@ -175,6 +206,9 @@
     void dispose() {
         reverse.dispose();
 
+        opened   = false;
+        capStart = false;
+
         if (DO_CLEAN_DIRTY) {
             // Force zero-fill dirty arrays:
             Arrays.fill(offset0, 0.0f);
@@ -445,19 +479,62 @@
     }
 
     @Override
-    public void moveTo(float x0, float y0) {
-        if (prev == DRAWING_OP_TO) {
-            finish();
+    public void moveTo(final float x0, final float y0) {
+        moveTo(x0, y0, cOutCode);
+        // update starting point:
+        this.sx0 = x0;
+        this.sy0 = y0;
+        this.sdx = 1.0f;
+        this.sdy = 0.0f;
+        this.opened   = false;
+        this.capStart = false;
+
+        if (clipRect != null) {
+            final int outcode = Helpers.outcode(x0, y0, clipRect);
+            this.cOutCode = outcode;
+            this.sOutCode = outcode;
         }
-        this.sx0 = this.cx0 = x0;
-        this.sy0 = this.cy0 = y0;
-        this.cdx = this.sdx = 1.0f;
-        this.cdy = this.sdy = 0.0f;
-        this.prev = MOVE_TO;
+    }
+
+    private void moveTo(final float x0, final float y0,
+                        final int outcode)
+    {
+        if (prev == MOVE_TO) {
+            this.cx0 = x0;
+            this.cy0 = y0;
+        } else {
+            if (prev == DRAWING_OP_TO) {
+                finish(outcode);
+            }
+            this.prev = MOVE_TO;
+            this.cx0 = x0;
+            this.cy0 = y0;
+            this.cdx = 1.0f;
+            this.cdy = 0.0f;
+        }
     }
 
     @Override
-    public void lineTo(float x1, float y1) {
+    public void lineTo(final float x1, final float y1) {
+        lineTo(x1, y1, false);
+    }
+
+    private void lineTo(final float x1, final float y1,
+                        final boolean force)
+    {
+        final int outcode0 = this.cOutCode;
+        if (!force && clipRect != null) {
+            final int outcode1 = Helpers.outcode(x1, y1, clipRect);
+            this.cOutCode = outcode1;
+
+            // basic rejection criteria
+            if ((outcode0 & outcode1) != 0) {
+                moveTo(x1, y1, outcode0);
+                opened = true;
+                return;
+            }
+        }
+
         float dx = x1 - cx0;
         float dy = y1 - cy0;
         if (dx == 0.0f && dy == 0.0f) {
@@ -467,7 +544,7 @@
         final float mx = offset0[0];
         final float my = offset0[1];
 
-        drawJoin(cdx, cdy, cx0, cy0, dx, dy, cmx, cmy, mx, my);
+        drawJoin(cdx, cdy, cx0, cy0, dx, dy, cmx, cmy, mx, my, outcode0);
 
         emitLineTo(cx0 + mx, cy0 + my);
         emitLineTo( x1 + mx,  y1 + my);
@@ -475,43 +552,65 @@
         emitLineToRev(cx0 - mx, cy0 - my);
         emitLineToRev( x1 - mx,  y1 - my);
 
-        this.cmx = mx;
-        this.cmy = my;
+        this.prev = DRAWING_OP_TO;
+        this.cx0 = x1;
+        this.cy0 = y1;
         this.cdx = dx;
         this.cdy = dy;
-        this.cx0 = x1;
-        this.cy0 = y1;
-        this.prev = DRAWING_OP_TO;
+        this.cmx = mx;
+        this.cmy = my;
     }
 
     @Override
     public void closePath() {
-        if (prev != DRAWING_OP_TO) {
+        // distinguish empty path at all vs opened path ?
+        if (prev != DRAWING_OP_TO && !opened) {
             if (prev == CLOSE) {
                 return;
             }
             emitMoveTo(cx0, cy0 - lineWidth2);
-            this.cmx = this.smx = 0.0f;
-            this.cmy = this.smy = -lineWidth2;
-            this.cdx = this.sdx = 1.0f;
-            this.cdy = this.sdy = 0.0f;
-            finish();
+
+            this.sdx = 1.0f;
+            this.sdy = 0.0f;
+            this.cdx = 1.0f;
+            this.cdy = 0.0f;
+
+            this.smx = 0.0f;
+            this.smy = -lineWidth2;
+            this.cmx = 0.0f;
+            this.cmy = -lineWidth2;
+
+            finish(cOutCode);
             return;
         }
 
-        if (cx0 != sx0 || cy0 != sy0) {
-            lineTo(sx0, sy0);
-        }
+        // basic acceptance criteria
+        if ((sOutCode & cOutCode) == 0) {
+            if (cx0 != sx0 || cy0 != sy0) {
+                lineTo(sx0, sy0, true);
+            }
+
+            drawJoin(cdx, cdy, cx0, cy0, sdx, sdy, cmx, cmy, smx, smy, sOutCode);
 
-        drawJoin(cdx, cdy, cx0, cy0, sdx, sdy, cmx, cmy, smx, smy);
+            emitLineTo(sx0 + smx, sy0 + smy);
 
-        emitLineTo(sx0 + smx, sy0 + smy);
-
-        emitMoveTo(sx0 - smx, sy0 - smy);
+            if (opened) {
+                emitLineTo(sx0 - smx, sy0 - smy);
+            } else {
+                emitMoveTo(sx0 - smx, sy0 - smy);
+            }
+        }
+        // Ignore caps like finish(false)
         emitReverse();
 
         this.prev = CLOSE;
-        emitClose();
+
+        if (opened) {
+            // do not emit close
+            opened = false;
+        } else {
+            emitClose();
+        }
     }
 
     private void emitReverse() {
@@ -521,7 +620,7 @@
     @Override
     public void pathDone() {
         if (prev == DRAWING_OP_TO) {
-            finish();
+            finish(cOutCode);
         }
 
         out.pathDone();
@@ -534,23 +633,39 @@
         dispose();
     }
 
-    private void finish() {
-        if (capStyle == CAP_ROUND) {
-            drawRoundCap(cx0, cy0, cmx, cmy);
-        } else if (capStyle == CAP_SQUARE) {
-            emitLineTo(cx0 - cmy + cmx, cy0 + cmx + cmy);
-            emitLineTo(cx0 - cmy - cmx, cy0 + cmx - cmy);
-        }
+    private void finish(final int outcode) {
+        // Problem: impossible to guess if the path will be closed in advance
+        //          i.e. if caps must be drawn or not ?
+        // Solution: use the ClosedPathDetector before Stroker to determine
+        // if the path is a closed path or not
+        if (!rdrCtx.closedPath) {
+            if (outcode == 0) {
+                // current point = end's cap:
+                if (capStyle == CAP_ROUND) {
+                    drawRoundCap(cx0, cy0, cmx, cmy);
+                } else if (capStyle == CAP_SQUARE) {
+                    emitLineTo(cx0 - cmy + cmx, cy0 + cmx + cmy);
+                    emitLineTo(cx0 - cmy - cmx, cy0 + cmx - cmy);
+                }
+            }
+            emitReverse();
 
-        emitReverse();
+            if (!capStart) {
+                capStart = true;
 
-        if (capStyle == CAP_ROUND) {
-            drawRoundCap(sx0, sy0, -smx, -smy);
-        } else if (capStyle == CAP_SQUARE) {
-            emitLineTo(sx0 + smy - smx, sy0 - smx - smy);
-            emitLineTo(sx0 + smy + smx, sy0 - smx + smy);
+                if (sOutCode == 0) {
+                    // starting point = initial cap:
+                    if (capStyle == CAP_ROUND) {
+                        drawRoundCap(sx0, sy0, -smx, -smy);
+                    } else if (capStyle == CAP_SQUARE) {
+                        emitLineTo(sx0 + smy - smx, sy0 - smx - smy);
+                        emitLineTo(sx0 + smy + smx, sy0 - smx + smy);
+                    }
+                }
+            }
+        } else {
+            emitReverse();
         }
-
         emitClose();
     }
 
@@ -622,23 +737,28 @@
                           float x0, float y0,
                           float dx, float dy,
                           float omx, float omy,
-                          float mx, float my)
+                          float mx, float my,
+                          final int outcode)
     {
         if (prev != DRAWING_OP_TO) {
             emitMoveTo(x0 + mx, y0 + my);
-            this.sdx = dx;
-            this.sdy = dy;
-            this.smx = mx;
-            this.smy = my;
+            if (!opened) {
+                this.sdx = dx;
+                this.sdy = dy;
+                this.smx = mx;
+                this.smy = my;
+            }
         } else {
-            boolean cw = isCW(pdx, pdy, dx, dy);
-            if (joinStyle == JOIN_MITER) {
-                drawMiter(pdx, pdy, x0, y0, dx, dy, omx, omy, mx, my, cw);
-            } else if (joinStyle == JOIN_ROUND) {
-                drawRoundJoin(x0, y0,
-                              omx, omy,
-                              mx, my, cw,
-                              ROUND_JOIN_THRESHOLD);
+            final boolean cw = isCW(pdx, pdy, dx, dy);
+            if (outcode == 0) {
+                if (joinStyle == JOIN_MITER) {
+                    drawMiter(pdx, pdy, x0, y0, dx, dy, omx, omy, mx, my, cw);
+                } else if (joinStyle == JOIN_ROUND) {
+                    drawRoundJoin(x0, y0,
+                                  omx, omy,
+                                  mx, my, cw,
+                                  ROUND_JOIN_THRESHOLD);
+                }
             }
             emitLineTo(x0, y0, !cw);
         }
@@ -943,10 +1063,29 @@
         return ret;
     }
 
-    @Override public void curveTo(float x1, float y1,
-                                  float x2, float y2,
-                                  float x3, float y3)
+    @Override
+    public void curveTo(final float x1, final float y1,
+                        final float x2, final float y2,
+                        final float x3, final float y3)
     {
+        final int outcode0 = this.cOutCode;
+        if (clipRect != null) {
+            final int outcode3 = Helpers.outcode(x3, y3, clipRect);
+            this.cOutCode = outcode3;
+
+            if ((outcode0 & outcode3) != 0) {
+                final int outcode1 = Helpers.outcode(x1, y1, clipRect);
+                final int outcode2 = Helpers.outcode(x2, y2, clipRect);
+
+                // basic rejection criteria
+                if ((outcode0 & outcode1 & outcode2 & outcode3) != 0) {
+                    moveTo(x3, y3, outcode0);
+                    opened = true;
+                    return;
+                }
+            }
+        }
+
         final float[] mid = middle;
 
         mid[0] = cx0; mid[1] = cy0;
@@ -955,7 +1094,7 @@
         mid[6] = x3;  mid[7] = y3;
 
         // need these so we can update the state at the end of this method
-        final float xf = mid[6], yf = mid[7];
+        final float xf = x3, yf = y3;
         float dxs = mid[2] - mid[0];
         float dys = mid[3] - mid[1];
         float dxf = mid[6] - mid[4];
@@ -981,6 +1120,10 @@
         }
         if (dxs == 0.0f && dys == 0.0f) {
             // this happens if the "curve" is just a point
+            // fix outcode0 for lineTo() call:
+            if (clipRect != null) {
+                this.cOutCode = outcode0;
+            }
             lineTo(mid[0], mid[1]);
             return;
         }
@@ -999,7 +1142,7 @@
         }
 
         computeOffset(dxs, dys, lineWidth2, offset0);
-        drawJoin(cdx, cdy, cx0, cy0, dxs, dys, cmx, cmy, offset0[0], offset0[1]);
+        drawJoin(cdx, cdy, cx0, cy0, dxs, dys, cmx, cmy, offset0[0], offset0[1], outcode0);
 
         final int nSplits = findSubdivPoints(curve, mid, subdivTs, 8, lineWidth2);
 
@@ -1034,16 +1177,36 @@
             emitLineToRev(r[kind - 2], r[kind - 1]);
         }
 
-        this.cmx = (l[kind - 2] - r[kind - 2]) / 2.0f;
-        this.cmy = (l[kind - 1] - r[kind - 1]) / 2.0f;
+        this.prev = DRAWING_OP_TO;
+        this.cx0 = xf;
+        this.cy0 = yf;
         this.cdx = dxf;
         this.cdy = dyf;
-        this.cx0 = xf;
-        this.cy0 = yf;
-        this.prev = DRAWING_OP_TO;
+        this.cmx = (l[kind - 2] - r[kind - 2]) / 2.0f;
+        this.cmy = (l[kind - 1] - r[kind - 1]) / 2.0f;
     }
 
-    @Override public void quadTo(float x1, float y1, float x2, float y2) {
+    @Override
+    public void quadTo(final float x1, final float y1,
+                       final float x2, final float y2)
+    {
+        final int outcode0 = this.cOutCode;
+        if (clipRect != null) {
+            final int outcode2 = Helpers.outcode(x2, y2, clipRect);
+            this.cOutCode = outcode2;
+
+            if ((outcode0 & outcode2) != 0) {
+                final int outcode1 = Helpers.outcode(x1, y1, clipRect);
+
+                // basic rejection criteria
+                if ((outcode0 & outcode1 & outcode2) != 0) {
+                    moveTo(x2, y2, outcode0);
+                    opened = true;
+                    return;
+                }
+            }
+        }
+
         final float[] mid = middle;
 
         mid[0] = cx0; mid[1] = cy0;
@@ -1051,7 +1214,7 @@
         mid[4] = x2;  mid[5] = y2;
 
         // need these so we can update the state at the end of this method
-        final float xf = mid[4], yf = mid[5];
+        final float xf = x2, yf = y2;
         float dxs = mid[2] - mid[0];
         float dys = mid[3] - mid[1];
         float dxf = mid[4] - mid[2];
@@ -1062,6 +1225,10 @@
         }
         if (dxs == 0.0f && dys == 0.0f) {
             // this happens if the "curve" is just a point
+            // fix outcode0 for lineTo() call:
+            if (clipRect != null) {
+                this.cOutCode = outcode0;
+            }
             lineTo(mid[0], mid[1]);
             return;
         }
@@ -1079,7 +1246,7 @@
         }
 
         computeOffset(dxs, dys, lineWidth2, offset0);
-        drawJoin(cdx, cdy, cx0, cy0, dxs, dys, cmx, cmy, offset0[0], offset0[1]);
+        drawJoin(cdx, cdy, cx0, cy0, dxs, dys, cmx, cmy, offset0[0], offset0[1], outcode0);
 
         int nSplits = findSubdivPoints(curve, mid, subdivTs, 6, lineWidth2);
 
@@ -1114,214 +1281,16 @@
             emitLineToRev(r[kind - 2], r[kind - 1]);
         }
 
-        this.cmx = (l[kind - 2] - r[kind - 2]) / 2.0f;
-        this.cmy = (l[kind - 1] - r[kind - 1]) / 2.0f;
+        this.prev = DRAWING_OP_TO;
+        this.cx0 = xf;
+        this.cy0 = yf;
         this.cdx = dxf;
         this.cdy = dyf;
-        this.cx0 = xf;
-        this.cy0 = yf;
-        this.prev = DRAWING_OP_TO;
+        this.cmx = (l[kind - 2] - r[kind - 2]) / 2.0f;
+        this.cmy = (l[kind - 1] - r[kind - 1]) / 2.0f;
     }
 
     @Override public long getNativeConsumer() {
         throw new InternalError("Stroker doesn't use a native consumer");
     }
-
-    // a stack of polynomial curves where each curve shares endpoints with
-    // adjacent ones.
-    static final class PolyStack {
-        private static final byte TYPE_LINETO  = (byte) 0;
-        private static final byte TYPE_QUADTO  = (byte) 1;
-        private static final byte TYPE_CUBICTO = (byte) 2;
-
-        // curves capacity = edges count (8192) = edges x 2 (coords)
-        private static final int INITIAL_CURVES_COUNT = INITIAL_EDGES_COUNT << 1;
-
-        // types capacity = edges count (4096)
-        private static final int INITIAL_TYPES_COUNT = INITIAL_EDGES_COUNT;
-
-        float[] curves;
-        int end;
-        byte[] curveTypes;
-        int numCurves;
-
-        // per-thread renderer context
-        final RendererContext rdrCtx;
-
-        // curves ref (dirty)
-        final FloatArrayCache.Reference curves_ref;
-        // curveTypes ref (dirty)
-        final ByteArrayCache.Reference curveTypes_ref;
-
-        // used marks (stats only)
-        int curveTypesUseMark;
-        int curvesUseMark;
-
-        /**
-         * Constructor
-         * @param rdrCtx per-thread renderer context
-         */
-        PolyStack(final RendererContext rdrCtx) {
-            this.rdrCtx = rdrCtx;
-
-            curves_ref = rdrCtx.newDirtyFloatArrayRef(INITIAL_CURVES_COUNT); // 32K
-            curves     = curves_ref.initial;
-
-            curveTypes_ref = rdrCtx.newDirtyByteArrayRef(INITIAL_TYPES_COUNT); // 4K
-            curveTypes     = curveTypes_ref.initial;
-            numCurves = 0;
-            end = 0;
-
-            if (DO_STATS) {
-                curveTypesUseMark = 0;
-                curvesUseMark = 0;
-            }
-        }
-
-        /**
-         * Disposes this PolyStack:
-         * clean up before reusing this instance
-         */
-        void dispose() {
-            end = 0;
-            numCurves = 0;
-
-            if (DO_STATS) {
-                rdrCtx.stats.stat_rdr_poly_stack_types.add(curveTypesUseMark);
-                rdrCtx.stats.stat_rdr_poly_stack_curves.add(curvesUseMark);
-                rdrCtx.stats.hist_rdr_poly_stack_curves.add(curvesUseMark);
-
-                // reset marks
-                curveTypesUseMark = 0;
-                curvesUseMark = 0;
-            }
-
-            // Return arrays:
-            // curves and curveTypes are kept dirty
-            curves     = curves_ref.putArray(curves);
-            curveTypes = curveTypes_ref.putArray(curveTypes);
-        }
-
-        private void ensureSpace(final int n) {
-            // use substraction to avoid integer overflow:
-            if (curves.length - end < n) {
-                if (DO_STATS) {
-                    rdrCtx.stats.stat_array_stroker_polystack_curves
-                        .add(end + n);
-                }
-                curves = curves_ref.widenArray(curves, end, end + n);
-            }
-            if (curveTypes.length <= numCurves) {
-                if (DO_STATS) {
-                    rdrCtx.stats.stat_array_stroker_polystack_curveTypes
-                        .add(numCurves + 1);
-                }
-                curveTypes = curveTypes_ref.widenArray(curveTypes,
-                                                       numCurves,
-                                                       numCurves + 1);
-            }
-        }
-
-        void pushCubic(float x0, float y0,
-                       float x1, float y1,
-                       float x2, float y2)
-        {
-            ensureSpace(6);
-            curveTypes[numCurves++] = TYPE_CUBICTO;
-            // we reverse the coordinate order to make popping easier
-            final float[] _curves = curves;
-            int e = end;
-            _curves[e++] = x2;    _curves[e++] = y2;
-            _curves[e++] = x1;    _curves[e++] = y1;
-            _curves[e++] = x0;    _curves[e++] = y0;
-            end = e;
-        }
-
-        void pushQuad(float x0, float y0,
-                      float x1, float y1)
-        {
-            ensureSpace(4);
-            curveTypes[numCurves++] = TYPE_QUADTO;
-            final float[] _curves = curves;
-            int e = end;
-            _curves[e++] = x1;    _curves[e++] = y1;
-            _curves[e++] = x0;    _curves[e++] = y0;
-            end = e;
-        }
-
-        void pushLine(float x, float y) {
-            ensureSpace(2);
-            curveTypes[numCurves++] = TYPE_LINETO;
-            curves[end++] = x;    curves[end++] = y;
-        }
-
-        void popAll(PathConsumer2D io) {
-            if (DO_STATS) {
-                // update used marks:
-                if (numCurves > curveTypesUseMark) {
-                    curveTypesUseMark = numCurves;
-                }
-                if (end > curvesUseMark) {
-                    curvesUseMark = end;
-                }
-            }
-            final byte[]  _curveTypes = curveTypes;
-            final float[] _curves = curves;
-            int nc = numCurves;
-            int e  = end;
-
-            while (nc != 0) {
-                switch(_curveTypes[--nc]) {
-                case TYPE_LINETO:
-                    e -= 2;
-                    io.lineTo(_curves[e], _curves[e+1]);
-                    continue;
-                case TYPE_QUADTO:
-                    e -= 4;
-                    io.quadTo(_curves[e+0], _curves[e+1],
-                              _curves[e+2], _curves[e+3]);
-                    continue;
-                case TYPE_CUBICTO:
-                    e -= 6;
-                    io.curveTo(_curves[e+0], _curves[e+1],
-                               _curves[e+2], _curves[e+3],
-                               _curves[e+4], _curves[e+5]);
-                    continue;
-                default:
-                }
-            }
-            numCurves = 0;
-            end = 0;
-        }
-
-        @Override
-        public String toString() {
-            String ret = "";
-            int nc = numCurves;
-            int last = end;
-            int len;
-            while (nc != 0) {
-                switch(curveTypes[--nc]) {
-                case TYPE_LINETO:
-                    len = 2;
-                    ret += "line: ";
-                    break;
-                case TYPE_QUADTO:
-                    len = 4;
-                    ret += "quad: ";
-                    break;
-                case TYPE_CUBICTO:
-                    len = 6;
-                    ret += "cubic: ";
-                    break;
-                default:
-                    len = 0;
-                }
-                last -= len;
-                ret += Arrays.toString(Arrays.copyOfRange(curves, last, last+len))
-                                       + "\n";
-            }
-            return ret;
-        }
-    }
 }
--- a/src/java.desktop/share/classes/sun/java2d/marlin/TransformingPathConsumer2D.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/sun/java2d/marlin/TransformingPathConsumer2D.java	Wed Dec 13 10:25:38 2017 -0800
@@ -28,50 +28,169 @@
 import sun.awt.geom.PathConsumer2D;
 import java.awt.geom.AffineTransform;
 import java.awt.geom.Path2D;
+import sun.java2d.marlin.Helpers.IndexStack;
+import sun.java2d.marlin.Helpers.PolyStack;
 
 final class TransformingPathConsumer2D {
 
-    TransformingPathConsumer2D() {
-        // used by RendererContext
-    }
+    private final RendererContext rdrCtx;
+
+    // recycled ClosedPathDetector instance from detectClosedPath()
+    private final ClosedPathDetector   cpDetector;
 
-    // recycled PathConsumer2D instance from wrapPath2d()
+    // recycled PathClipFilter instance from pathClipper()
+    private final PathClipFilter       pathClipper;
+
+    // recycled PathConsumer2D instance from wrapPath2D()
     private final Path2DWrapper        wp_Path2DWrapper        = new Path2DWrapper();
 
-    PathConsumer2D wrapPath2d(Path2D.Float p2d)
-    {
-        return wp_Path2DWrapper.init(p2d);
-    }
-
     // recycled PathConsumer2D instances from deltaTransformConsumer()
     private final DeltaScaleFilter     dt_DeltaScaleFilter     = new DeltaScaleFilter();
     private final DeltaTransformFilter dt_DeltaTransformFilter = new DeltaTransformFilter();
 
+    // recycled PathConsumer2D instances from inverseDeltaTransformConsumer()
+    private final DeltaScaleFilter     iv_DeltaScaleFilter     = new DeltaScaleFilter();
+    private final DeltaTransformFilter iv_DeltaTransformFilter = new DeltaTransformFilter();
+
+    // recycled PathTracer instances from tracer...() methods
+    private final PathTracer tracerInput      = new PathTracer("[Input]");
+    private final PathTracer tracerCPDetector = new PathTracer("ClosedPathDetector");
+    private final PathTracer tracerFiller     = new PathTracer("Filler");
+    private final PathTracer tracerStroker    = new PathTracer("Stroker");
+
+    TransformingPathConsumer2D(final RendererContext rdrCtx) {
+        // used by RendererContext
+        this.rdrCtx = rdrCtx;
+        this.cpDetector = new ClosedPathDetector(rdrCtx);
+        this.pathClipper = new PathClipFilter(rdrCtx);
+    }
+
+    PathConsumer2D wrapPath2D(Path2D.Float p2d) {
+        return wp_Path2DWrapper.init(p2d);
+    }
+
+    PathConsumer2D traceInput(PathConsumer2D out) {
+        return tracerInput.init(out);
+    }
+
+    PathConsumer2D traceClosedPathDetector(PathConsumer2D out) {
+        return tracerCPDetector.init(out);
+    }
+
+    PathConsumer2D traceFiller(PathConsumer2D out) {
+        return tracerFiller.init(out);
+    }
+
+    PathConsumer2D traceStroker(PathConsumer2D out) {
+        return tracerStroker.init(out);
+    }
+
+    PathConsumer2D detectClosedPath(PathConsumer2D out) {
+        return cpDetector.init(out);
+    }
+
+    PathConsumer2D pathClipper(PathConsumer2D out) {
+        return pathClipper.init(out);
+    }
+
     PathConsumer2D deltaTransformConsumer(PathConsumer2D out,
                                           AffineTransform at)
     {
         if (at == null) {
             return out;
         }
-        float mxx = (float) at.getScaleX();
-        float mxy = (float) at.getShearX();
-        float myx = (float) at.getShearY();
-        float myy = (float) at.getScaleY();
+        final float mxx = (float) at.getScaleX();
+        final float mxy = (float) at.getShearX();
+        final float myx = (float) at.getShearY();
+        final float myy = (float) at.getScaleY();
 
         if (mxy == 0.0f && myx == 0.0f) {
             if (mxx == 1.0f && myy == 1.0f) {
                 return out;
             } else {
+                // Scale only
+                if (rdrCtx.doClip) {
+                    // adjust clip rectangle (ymin, ymax, xmin, xmax):
+                    adjustClipScale(rdrCtx.clipRect, mxx, myy);
+                }
                 return dt_DeltaScaleFilter.init(out, mxx, myy);
             }
         } else {
+            if (rdrCtx.doClip) {
+                // adjust clip rectangle (ymin, ymax, xmin, xmax):
+                adjustClipInverseDelta(rdrCtx.clipRect, mxx, mxy, myx, myy);
+            }
             return dt_DeltaTransformFilter.init(out, mxx, mxy, myx, myy);
         }
     }
 
-    // recycled PathConsumer2D instances from inverseDeltaTransformConsumer()
-    private final DeltaScaleFilter     iv_DeltaScaleFilter     = new DeltaScaleFilter();
-    private final DeltaTransformFilter iv_DeltaTransformFilter = new DeltaTransformFilter();
+    private static void adjustClipOffset(final float[] clipRect) {
+        clipRect[0] += Renderer.RDR_OFFSET_Y;
+        clipRect[1] += Renderer.RDR_OFFSET_Y;
+        clipRect[2] += Renderer.RDR_OFFSET_X;
+        clipRect[3] += Renderer.RDR_OFFSET_X;
+    }
+
+    private static void adjustClipScale(final float[] clipRect,
+                                        final float mxx, final float myy)
+    {
+        adjustClipOffset(clipRect);
+
+        // Adjust the clipping rectangle (iv_DeltaScaleFilter):
+        clipRect[0] /= myy;
+        clipRect[1] /= myy;
+        clipRect[2] /= mxx;
+        clipRect[3] /= mxx;
+    }
+
+    private static void adjustClipInverseDelta(final float[] clipRect,
+                                               final float mxx, final float mxy,
+                                               final float myx, final float myy)
+    {
+        adjustClipOffset(clipRect);
+
+        // Adjust the clipping rectangle (iv_DeltaTransformFilter):
+        final float det = mxx * myy - mxy * myx;
+        final float imxx =  myy / det;
+        final float imxy = -mxy / det;
+        final float imyx = -myx / det;
+        final float imyy =  mxx / det;
+
+        float xmin, xmax, ymin, ymax;
+        float x, y;
+        // xmin, ymin:
+        x = clipRect[2] * imxx + clipRect[0] * imxy;
+        y = clipRect[2] * imyx + clipRect[0] * imyy;
+
+        xmin = xmax = x;
+        ymin = ymax = y;
+
+        // xmax, ymin:
+        x = clipRect[3] * imxx + clipRect[0] * imxy;
+        y = clipRect[3] * imyx + clipRect[0] * imyy;
+
+        if (x < xmin) { xmin = x; } else if (x > xmax) { xmax = x; }
+        if (y < ymin) { ymin = y; } else if (y > ymax) { ymax = y; }
+
+        // xmin, ymax:
+        x = clipRect[2] * imxx + clipRect[1] * imxy;
+        y = clipRect[2] * imyx + clipRect[1] * imyy;
+
+        if (x < xmin) { xmin = x; } else if (x > xmax) { xmax = x; }
+        if (y < ymin) { ymin = y; } else if (y > ymax) { ymax = y; }
+
+        // xmax, ymax:
+        x = clipRect[3] * imxx + clipRect[1] * imxy;
+        y = clipRect[3] * imyx + clipRect[1] * imyy;
+
+        if (x < xmin) { xmin = x; } else if (x > xmax) { xmax = x; }
+        if (y < ymin) { ymin = y; } else if (y > ymax) { ymax = y; }
+
+        clipRect[0] = ymin;
+        clipRect[1] = ymax;
+        clipRect[2] = xmin;
+        clipRect[3] = xmax;
+    }
 
     PathConsumer2D inverseDeltaTransformConsumer(PathConsumer2D out,
                                                  AffineTransform at)
@@ -91,7 +210,7 @@
                 return iv_DeltaScaleFilter.init(out, 1.0f/mxx, 1.0f/myy);
             }
         } else {
-            float det = mxx * myy - mxy * myx;
+            final float det = mxx * myy - mxy * myx;
             return iv_DeltaTransformFilter.init(out,
                                                 myy / det,
                                                -mxy / det,
@@ -100,7 +219,6 @@
         }
     }
 
-
     static final class DeltaScaleFilter implements PathConsumer2D {
         private PathConsumer2D out;
         private float sx, sy;
@@ -275,4 +393,427 @@
             throw new InternalError("Not using a native peer");
         }
     }
+
+    static final class ClosedPathDetector implements PathConsumer2D {
+
+        private final RendererContext rdrCtx;
+        private final PolyStack stack;
+
+        private PathConsumer2D out;
+
+        ClosedPathDetector(final RendererContext rdrCtx) {
+            this.rdrCtx = rdrCtx;
+            this.stack = (rdrCtx.stats != null) ?
+                new PolyStack(rdrCtx,
+                        rdrCtx.stats.stat_cpd_polystack_types,
+                        rdrCtx.stats.stat_cpd_polystack_curves,
+                        rdrCtx.stats.hist_cpd_polystack_curves,
+                        rdrCtx.stats.stat_array_cpd_polystack_curves,
+                        rdrCtx.stats.stat_array_cpd_polystack_types)
+                : new PolyStack(rdrCtx);
+        }
+
+        ClosedPathDetector init(PathConsumer2D out) {
+            this.out = out;
+            return this; // fluent API
+        }
+
+        /**
+         * Disposes this instance:
+         * clean up before reusing this instance
+         */
+        void dispose() {
+            stack.dispose();
+        }
+
+        @Override
+        public void pathDone() {
+            // previous path is not closed:
+            finish(false);
+            out.pathDone();
+
+            // TODO: fix possible leak if exception happened
+            // Dispose this instance:
+            dispose();
+        }
+
+        @Override
+        public void closePath() {
+            // path is closed
+            finish(true);
+            out.closePath();
+        }
+
+        @Override
+        public void moveTo(float x0, float y0) {
+            // previous path is not closed:
+            finish(false);
+            out.moveTo(x0, y0);
+        }
+
+        private void finish(final boolean closed) {
+            rdrCtx.closedPath = closed;
+            stack.pullAll(out);
+        }
+
+        @Override
+        public void lineTo(float x1, float y1) {
+            stack.pushLine(x1, y1);
+        }
+
+        @Override
+        public void curveTo(float x3, float y3,
+                            float x2, float y2,
+                            float x1, float y1)
+        {
+            stack.pushCubic(x1, y1, x2, y2, x3, y3);
+        }
+
+        @Override
+        public void quadTo(float x2, float y2, float x1, float y1) {
+            stack.pushQuad(x1, y1, x2, y2);
+        }
+
+        @Override
+        public long getNativeConsumer() {
+            throw new InternalError("Not using a native peer");
+        }
+    }
+
+    static final class PathClipFilter implements PathConsumer2D {
+
+        private PathConsumer2D out;
+
+        // Bounds of the drawing region, at pixel precision.
+        private final float[] clipRect;
+
+        private final float[] corners = new float[8];
+        private boolean init_corners = false;
+
+        private final IndexStack stack;
+
+        // the current outcode of the current sub path
+        private int cOutCode = 0;
+
+        // the cumulated (and) outcode of the complete path
+        private int gOutCode = MarlinConst.OUTCODE_MASK_T_B_L_R;
+
+        private boolean outside = false;
+
+        // The current point OUTSIDE
+        private float cx0, cy0;
+
+        PathClipFilter(final RendererContext rdrCtx) {
+            this.clipRect = rdrCtx.clipRect;
+            this.stack = (rdrCtx.stats != null) ?
+                new IndexStack(rdrCtx,
+                        rdrCtx.stats.stat_pcf_idxstack_indices,
+                        rdrCtx.stats.hist_pcf_idxstack_indices,
+                        rdrCtx.stats.stat_array_pcf_idxstack_indices)
+                : new IndexStack(rdrCtx);
+        }
+
+        PathClipFilter init(final PathConsumer2D out) {
+            this.out = out;
+
+            // Adjust the clipping rectangle with the renderer offsets
+            final float rdrOffX = Renderer.RDR_OFFSET_X;
+            final float rdrOffY = Renderer.RDR_OFFSET_Y;
+
+            // add a small rounding error:
+            final float margin = 1e-3f;
+
+            final float[] _clipRect = this.clipRect;
+            _clipRect[0] -= margin - rdrOffY;
+            _clipRect[1] += margin + rdrOffY;
+            _clipRect[2] -= margin - rdrOffX;
+            _clipRect[3] += margin + rdrOffX;
+
+            this.init_corners = true;
+            this.gOutCode = MarlinConst.OUTCODE_MASK_T_B_L_R;
+
+            return this; // fluent API
+        }
+
+        /**
+         * Disposes this instance:
+         * clean up before reusing this instance
+         */
+        void dispose() {
+            stack.dispose();
+        }
+
+        private void finishPath() {
+            if (outside) {
+                // criteria: inside or totally outside ?
+                if (gOutCode == 0) {
+                    finish();
+                } else {
+                    this.outside = false;
+                    stack.reset();
+                }
+            }
+        }
+
+        private void finish() {
+            this.outside = false;
+
+            if (!stack.isEmpty()) {
+                if (init_corners) {
+                    init_corners = false;
+
+                    final float[] _corners = corners;
+                    final float[] _clipRect = clipRect;
+                    // Top Left (0):
+                    _corners[0] = _clipRect[2];
+                    _corners[1] = _clipRect[0];
+                    // Bottom Left (1):
+                    _corners[2] = _clipRect[2];
+                    _corners[3] = _clipRect[1];
+                    // Top right (2):
+                    _corners[4] = _clipRect[3];
+                    _corners[5] = _clipRect[0];
+                    // Bottom Right (3):
+                    _corners[6] = _clipRect[3];
+                    _corners[7] = _clipRect[1];
+                }
+                stack.pullAll(corners, out);
+            }
+            out.lineTo(cx0, cy0);
+        }
+
+        @Override
+        public void pathDone() {
+            finishPath();
+
+            out.pathDone();
+
+            // TODO: fix possible leak if exception happened
+            // Dispose this instance:
+            dispose();
+        }
+
+        @Override
+        public void closePath() {
+            finishPath();
+
+            out.closePath();
+        }
+
+        @Override
+        public void moveTo(final float x0, final float y0) {
+            finishPath();
+
+            final int outcode = Helpers.outcode(x0, y0, clipRect);
+            this.cOutCode = outcode;
+            this.outside = false;
+            out.moveTo(x0, y0);
+        }
+
+        @Override
+        public void lineTo(final float xe, final float ye) {
+            final int outcode0 = this.cOutCode;
+            final int outcode1 = Helpers.outcode(xe, ye, clipRect);
+            this.cOutCode = outcode1;
+
+            final int sideCode = (outcode0 & outcode1);
+
+            // basic rejection criteria:
+            if (sideCode == 0) {
+                this.gOutCode = 0;
+            } else {
+                this.gOutCode &= sideCode;
+                // keep last point coordinate before entering the clip again:
+                this.outside = true;
+                this.cx0 = xe;
+                this.cy0 = ye;
+
+                clip(sideCode, outcode0, outcode1);
+                return;
+            }
+            if (outside) {
+                finish();
+            }
+            // clipping disabled:
+            out.lineTo(xe, ye);
+        }
+
+        private void clip(final int sideCode,
+                          final int outcode0,
+                          final int outcode1)
+        {
+            // corner or cross-boundary on left or right side:
+            if ((outcode0 != outcode1)
+                    && ((sideCode & MarlinConst.OUTCODE_MASK_L_R) != 0))
+            {
+                // combine outcodes:
+                final int mergeCode = (outcode0 | outcode1);
+                final int tbCode = mergeCode & MarlinConst.OUTCODE_MASK_T_B;
+                final int lrCode = mergeCode & MarlinConst.OUTCODE_MASK_L_R;
+                final int off = (lrCode == MarlinConst.OUTCODE_LEFT) ? 0 : 2;
+
+                // add corners to outside stack:
+                switch (tbCode) {
+                    case MarlinConst.OUTCODE_TOP:
+// System.out.println("TOP "+ ((off == 0) ? "LEFT" : "RIGHT"));
+                        stack.push(off); // top
+                        return;
+                    case MarlinConst.OUTCODE_BOTTOM:
+// System.out.println("BOTTOM "+ ((off == 0) ? "LEFT" : "RIGHT"));
+                        stack.push(off + 1); // bottom
+                        return;
+                    default:
+                        // both TOP / BOTTOM:
+                        if ((outcode0 & MarlinConst.OUTCODE_TOP) != 0) {
+// System.out.println("TOP + BOTTOM "+ ((off == 0) ? "LEFT" : "RIGHT"));
+                            // top to bottom
+                            stack.push(off); // top
+                            stack.push(off + 1); // bottom
+                        } else {
+// System.out.println("BOTTOM + TOP "+ ((off == 0) ? "LEFT" : "RIGHT"));
+                            // bottom to top
+                            stack.push(off + 1); // bottom
+                            stack.push(off); // top
+                        }
+                }
+            }
+        }
+
+        @Override
+        public void curveTo(final float x1, final float y1,
+                            final float x2, final float y2,
+                            final float xe, final float ye)
+        {
+            final int outcode0 = this.cOutCode;
+            final int outcode3 = Helpers.outcode(xe, ye, clipRect);
+            this.cOutCode = outcode3;
+
+            int sideCode = outcode0 & outcode3;
+
+            if (sideCode == 0) {
+                this.gOutCode = 0;
+            } else {
+                sideCode &= Helpers.outcode(x1, y1, clipRect);
+                sideCode &= Helpers.outcode(x2, y2, clipRect);
+                this.gOutCode &= sideCode;
+
+                // basic rejection criteria:
+                if (sideCode != 0) {
+                    // keep last point coordinate before entering the clip again:
+                    this.outside = true;
+                    this.cx0 = xe;
+                    this.cy0 = ye;
+
+                    clip(sideCode, outcode0, outcode3);
+                    return;
+                }
+            }
+            if (outside) {
+                finish();
+            }
+            // clipping disabled:
+            out.curveTo(x1, y1, x2, y2, xe, ye);
+        }
+
+        @Override
+        public void quadTo(final float x1, final float y1,
+                           final float xe, final float ye)
+        {
+            final int outcode0 = this.cOutCode;
+            final int outcode2 = Helpers.outcode(xe, ye, clipRect);
+            this.cOutCode = outcode2;
+
+            int sideCode = outcode0 & outcode2;
+
+            if (sideCode == 0) {
+                this.gOutCode = 0;
+            } else {
+                sideCode &= Helpers.outcode(x1, y1, clipRect);
+                this.gOutCode &= sideCode;
+
+                // basic rejection criteria:
+                if (sideCode != 0) {
+                    // keep last point coordinate before entering the clip again:
+                    this.outside = true;
+                    this.cx0 = xe;
+                    this.cy0 = ye;
+
+                    clip(sideCode, outcode0, outcode2);
+                    return;
+                }
+            }
+            if (outside) {
+                finish();
+            }
+            // clipping disabled:
+            out.quadTo(x1, y1, xe, ye);
+        }
+
+        @Override
+        public long getNativeConsumer() {
+            throw new InternalError("Not using a native peer");
+        }
+    }
+
+    static final class PathTracer implements PathConsumer2D {
+        private final String prefix;
+        private PathConsumer2D out;
+
+        PathTracer(String name) {
+            this.prefix = name + ": ";
+        }
+
+        PathTracer init(PathConsumer2D out) {
+            this.out = out;
+            return this; // fluent API
+        }
+
+        @Override
+        public void moveTo(float x0, float y0) {
+            log("moveTo (" + x0 + ", " + y0 + ')');
+            out.moveTo(x0, y0);
+        }
+
+        @Override
+        public void lineTo(float x1, float y1) {
+            log("lineTo (" + x1 + ", " + y1 + ')');
+            out.lineTo(x1, y1);
+        }
+
+        @Override
+        public void curveTo(float x1, float y1,
+                            float x2, float y2,
+                            float x3, float y3)
+        {
+            log("curveTo P1(" + x1 + ", " + y1 + ") P2(" + x2 + ", " + y2  + ") P3(" + x3 + ", " + y3 + ')');
+            out.curveTo(x1, y1, x2, y2, x3, y3);
+        }
+
+        @Override
+        public void quadTo(float x1, float y1, float x2, float y2) {
+            log("quadTo P1(" + x1 + ", " + y1 + ") P2(" + x2 + ", " + y2  + ')');
+            out.quadTo(x1, y1, x2, y2);
+        }
+
+        @Override
+        public void closePath() {
+            log("closePath");
+            out.closePath();
+        }
+
+        @Override
+        public void pathDone() {
+            log("pathDone");
+            out.pathDone();
+        }
+
+        private void log(final String message) {
+            System.out.println(prefix + message);
+        }
+
+        @Override
+        public long getNativeConsumer() {
+            throw new InternalError("Not using a native peer");
+        }
+    }
 }
--- a/src/java.desktop/share/classes/sun/java2d/marlin/Version.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/sun/java2d/marlin/Version.java	Wed Dec 13 10:25:38 2017 -0800
@@ -27,7 +27,7 @@
 
 public final class Version {
 
-    private static final String VERSION = "marlin-0.7.5-Unsafe-OpenJDK";
+    private static final String VERSION = "marlin-0.8.2-Unsafe-OpenJDK";
 
     public static String getVersion() {
         return VERSION;
--- a/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java	Wed Dec 13 10:25:38 2017 -0800
@@ -886,12 +886,45 @@
         }
    }
 
-   protected PageFormat getPageFormatFromAttributes() {
-       if (attributes == null || attributes.isEmpty()) {
+    protected PageFormat getPageFormatFromAttributes() {
+        if (attributes == null || attributes.isEmpty()) {
             return null;
         }
-        return attributeToPageFormat(getPrintService(), this.attributes);
-   }
+
+        PageFormat newPf = attributeToPageFormat(
+            getPrintService(), attributes);
+        PageFormat oldPf = null;
+        Pageable pageable = getPageable();
+        if ((pageable != null) &&
+            (pageable instanceof OpenBook) &&
+            ((oldPf = pageable.getPageFormat(0)) != null)) {
+            // If orientation, media, imageable area attributes are not in
+            // "attributes" set, then use respective values of the existing
+            // page format "oldPf".
+            if (attributes.get(OrientationRequested.class) == null) {
+                newPf.setOrientation(oldPf.getOrientation());
+            }
+
+            Paper newPaper = newPf.getPaper();
+            Paper oldPaper = oldPf.getPaper();
+            boolean oldPaperValWasSet = false;
+            if (attributes.get(MediaSizeName.class) == null) {
+                newPaper.setSize(oldPaper.getWidth(), oldPaper.getHeight());
+                oldPaperValWasSet = true;
+            }
+            if (attributes.get(MediaPrintableArea.class) == null) {
+                newPaper.setImageableArea(
+                    oldPaper.getImageableX(), oldPaper.getImageableY(),
+                    oldPaper.getImageableWidth(),
+                    oldPaper.getImageableHeight());
+                oldPaperValWasSet = true;
+            }
+            if (oldPaperValWasSet) {
+                newPf.setPaper(newPaper);
+            }
+        }
+        return newPf;
+    }
 
 
    /**
--- a/src/java.desktop/share/classes/sun/swing/SwingUtilities2.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/classes/sun/swing/SwingUtilities2.java	Wed Dec 13 10:25:38 2017 -0800
@@ -890,8 +890,17 @@
                                           FontMetrics fm,
                                           boolean useFPAPI)
     {
-        return len == 0 ? 0 : getFontStringWidth(new String(data, offset, len),
-                                                 fm, useFPAPI);
+        if (len == 0) {
+           return 0;
+        }
+        if (useFPAPI) {
+            Rectangle2D bounds = fm.getFont().
+                                     getStringBounds(data, offset, offset + len,
+                                                     fm.getFontRenderContext());
+            return (float) bounds.getWidth();
+        } else {
+            return fm.charsWidth(data, offset, len);
+        }
     }
 
     public static float getFontStringWidth(String data, FontMetrics fm,
--- a/src/java.desktop/share/classes/sun/swing/plaf/windows/ClassicSortArrowIcon.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +0,0 @@
-/*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.swing.plaf.windows;
-
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Graphics;
-import java.io.Serializable;
-import javax.swing.Icon;
-import javax.swing.UIManager;
-import javax.swing.plaf.UIResource;
-
-/**
- * Classic sort icons.
- *
- */
-@SuppressWarnings("serial") // JDK-implementation class
-public class ClassicSortArrowIcon implements Icon, UIResource, Serializable{
-    private static final int X_OFFSET = 9;
-    private boolean ascending;
-
-    public ClassicSortArrowIcon(boolean ascending) {
-        this.ascending = ascending;
-    }
-
-    public void paintIcon(Component c, Graphics g, int x, int y) {
-        x += X_OFFSET;
-        if (ascending) {
-            g.setColor(UIManager.getColor("Table.sortIconHighlight"));
-            drawSide(g, x + 3, y, -1);
-
-            g.setColor(UIManager.getColor("Table.sortIconLight"));
-            drawSide(g, x + 4, y, 1);
-
-            g.fillRect(x + 1, y + 6, 6, 1);
-        }
-        else {
-            g.setColor(UIManager.getColor("Table.sortIconHighlight"));
-            drawSide(g, x + 3, y + 6, -1);
-            g.fillRect(x + 1, y, 6, 1);
-
-            g.setColor(UIManager.getColor("Table.sortIconLight"));
-            drawSide(g, x + 4, y + 6, 1);
-        }
-    }
-
-    private void drawSide(Graphics g, int x, int y, int xIncrement) {
-        int yIncrement = 2;
-        if (ascending) {
-            g.fillRect(x, y, 1, 2);
-            y++;
-        }
-        else {
-            g.fillRect(x, --y, 1, 2);
-            yIncrement = -2;
-            y -= 2;
-        }
-        x += xIncrement;
-        for (int i = 0; i < 2; i++) {
-            g.fillRect(x, y, 1, 3);
-            x += xIncrement;
-            y += yIncrement;
-        }
-        if (!ascending) {
-            y++;
-        }
-        g.fillRect(x, y, 1, 2);
-    }
-
-    public int getIconWidth() {
-        return X_OFFSET + 8;
-    }
-    public int getIconHeight() {
-        return 9;
-    }
-}
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-atomic-private.hh	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-atomic-private.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -89,9 +89,9 @@
 #define hb_atomic_ptr_impl_cmpexch(P,O,N)       OSAtomicCompareAndSwapPtrBarrier ((void *) (O), (void *) (N), (void **) (P))
 #else
 #if __ppc64__ || __x86_64__ || __aarch64__
-#define hb_atomic_ptr_impl_cmpexch(P,O,N)       OSAtomicCompareAndSwap64Barrier ((int64_t) (O), (int64_t) (N), (int64_t*) (P))
+#define hb_atomic_ptr_impl_cmpexch(P,O,N)       OSAtomicCompareAndSwap64Barrier ((int64_t) (void *) (O), (int64_t) (void *) (N), (int64_t*) (P))
 #else
-#define hb_atomic_ptr_impl_cmpexch(P,O,N)       OSAtomicCompareAndSwap32Barrier ((int32_t) (O), (int32_t) (N), (int32_t*) (P))
+#define hb_atomic_ptr_impl_cmpexch(P,O,N)       OSAtomicCompareAndSwap32Barrier ((int32_t) (void *) (O), (int32_t) (void *) (N), (int32_t*) (P))
 #endif
 #endif
 
@@ -124,13 +124,13 @@
 #include <builtins.h>
 
 
-static inline int hb_fetch_and_add(volatile int* AI, unsigned int V) {
+static inline int _hb_fetch_and_add(volatile int* AI, unsigned int V) {
   __lwsync();
   int result = __fetch_and_add(AI, V);
   __isync();
   return result;
 }
-static inline int hb_compare_and_swaplp(volatile long* P, long O, long N) {
+static inline int _hb_compare_and_swaplp(volatile long* P, long O, long N) {
   __sync();
   int result = __compare_and_swaplp (P, &O, N);
   __sync();
@@ -139,10 +139,10 @@
 
 typedef int hb_atomic_int_impl_t;
 #define HB_ATOMIC_INT_IMPL_INIT(V) (V)
-#define hb_atomic_int_impl_add(AI, V)           hb_fetch_and_add (&(AI), (V))
+#define hb_atomic_int_impl_add(AI, V)           _hb_fetch_and_add (&(AI), (V))
 
 #define hb_atomic_ptr_impl_get(P)               (__sync(), (void *) *(P))
-#define hb_atomic_ptr_impl_cmpexch(P,O,N)       hb_compare_and_swaplp ((long*)(P), (long)(O), (long)(N))
+#define hb_atomic_ptr_impl_cmpexch(P,O,N)       _hb_compare_and_swaplp ((long*)(P), (long)(O), (long)(N))
 
 #elif !defined(HB_NO_MT)
 
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-blob.cc	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-blob.cc	Wed Dec 13 10:25:38 2017 -0800
@@ -30,6 +30,7 @@
 #endif
 
 #include "hb-private.hh"
+#include "hb-debug.hh"
 
 #include "hb-object-private.hh"
 
@@ -44,12 +45,6 @@
 #include <errno.h>
 
 
-
-#ifndef HB_DEBUG_BLOB
-#define HB_DEBUG_BLOB (HB_DEBUG+0)
-#endif
-
-
 struct hb_blob_t {
   hb_object_header_t header;
   ASSERT_POD ();
@@ -72,8 +67,8 @@
 {
   if (blob->destroy) {
     blob->destroy (blob->user_data);
-    blob->user_data = NULL;
-    blob->destroy = NULL;
+    blob->user_data = nullptr;
+    blob->destroy = nullptr;
   }
 }
 
@@ -128,6 +123,12 @@
   return blob;
 }
 
+static void
+_hb_blob_destroy (void *data)
+{
+  hb_blob_destroy ((hb_blob_t *) data);
+}
+
 /**
  * hb_blob_create_sub_blob:
  * @parent: Parent blob.
@@ -164,7 +165,7 @@
                          MIN (length, parent->length - offset),
                          HB_MEMORY_MODE_READONLY,
                          hb_blob_reference (parent),
-                         (hb_destroy_func_t) hb_blob_destroy);
+                         _hb_blob_destroy);
 
   return blob;
 }
@@ -188,12 +189,12 @@
 
     true, /* immutable */
 
-    NULL, /* data */
+    nullptr, /* data */
     0, /* length */
     HB_MEMORY_MODE_READONLY, /* mode */
 
-    NULL, /* user_data */
-    NULL  /* destroy */
+    nullptr, /* user_data */
+    nullptr  /* destroy */
   };
 
   return const_cast<hb_blob_t *> (&_hb_blob_nil);
@@ -247,7 +248,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 +267,9 @@
  * @blob: a blob.
  * @key: key for data to get.
  *
- * 
+ *
  *
- * Return value: (transfer none): 
+ * Return value: (transfer none):
  *
  * Since: 0.9.2
  **/
@@ -284,7 +285,7 @@
  * hb_blob_make_immutable:
  * @blob: a blob.
  *
- * 
+ *
  *
  * Since: 0.9.2
  **/
@@ -301,7 +302,7 @@
  * hb_blob_is_immutable:
  * @blob: a blob.
  *
- * 
+ *
  *
  * Return value: TODO
  *
@@ -318,7 +319,7 @@
  * hb_blob_get_length:
  * @blob: a blob.
  *
- * 
+ *
  *
  * Return value: the length of blob data in bytes.
  *
@@ -335,9 +336,9 @@
  * @blob: a blob.
  * @length: (out):
  *
- * 
+ *
  *
- * Returns: (transfer none) (array length=length): 
+ * Returns: (transfer none) (array length=length):
  *
  * Since: 0.9.2
  **/
@@ -373,7 +374,7 @@
     if (length)
       *length = 0;
 
-    return NULL;
+    return nullptr;
   }
 
   if (length)
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-buffer-deserialize-json.hh	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-buffer-deserialize-json.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -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
 };
 
@@ -448,7 +448,7 @@
   const char *p = buf, *pe = buf + buf_len;
 
   /* Ensure we have positions. */
-  (void) hb_buffer_get_glyph_positions (buffer, NULL);
+  (void) hb_buffer_get_glyph_positions (buffer, nullptr);
 
   while (p < pe && ISSPACE (*p))
     p++;
@@ -457,11 +457,11 @@
     *end_ptr = ++p;
   }
 
-  const char *tok = NULL;
+  const char *tok = nullptr;
   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/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-buffer-deserialize-text.hh	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-buffer-deserialize-text.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -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
 };
 
@@ -325,7 +325,7 @@
   const char *p = buf, *pe = buf + buf_len;
 
   /* Ensure we have positions. */
-  (void) hb_buffer_get_glyph_positions (buffer, NULL);
+  (void) hb_buffer_get_glyph_positions (buffer, nullptr);
 
   while (p < pe && ISSPACE (*p))
     p++;
@@ -334,11 +334,11 @@
     *end_ptr = ++p;
   }
 
-  const char *eof = pe, *tok = NULL;
+  const char *eof = pe, *tok = nullptr;
   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/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-buffer-private.hh	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-buffer-private.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -45,11 +45,12 @@
 #define HB_BUFFER_MAX_LEN_DEFAULT 0x3FFFFFFF /* Shaping more than a billion chars? Let us know! */
 #endif
 
-ASSERT_STATIC (sizeof (hb_glyph_info_t) == 20);
-ASSERT_STATIC (sizeof (hb_glyph_info_t) == sizeof (hb_glyph_position_t));
+static_assert ((sizeof (hb_glyph_info_t) == 20), "");
+static_assert ((sizeof (hb_glyph_info_t) == sizeof (hb_glyph_position_t)), "");
 
 HB_MARK_AS_FLAG_T (hb_buffer_flags_t);
 HB_MARK_AS_FLAG_T (hb_buffer_serialize_flags_t);
+HB_MARK_AS_FLAG_T (hb_buffer_diff_flags_t);
 
 enum hb_buffer_scratch_flags_t {
   HB_BUFFER_SCRATCH_FLAG_DEFAULT                        = 0x00000000u,
@@ -57,6 +58,8 @@
   HB_BUFFER_SCRATCH_FLAG_HAS_DEFAULT_IGNORABLES         = 0x00000002u,
   HB_BUFFER_SCRATCH_FLAG_HAS_SPACE_FALLBACK             = 0x00000004u,
   HB_BUFFER_SCRATCH_FLAG_HAS_GPOS_ATTACHMENT            = 0x00000008u,
+  HB_BUFFER_SCRATCH_FLAG_HAS_UNSAFE_TO_BREAK            = 0x00000010u,
+
   /* Reserved for complex shapers' internal use. */
   HB_BUFFER_SCRATCH_FLAG_COMPLEX0                       = 0x01000000u,
   HB_BUFFER_SCRATCH_FLAG_COMPLEX1                       = 0x02000000u,
@@ -232,25 +235,31 @@
     for (unsigned int j = 0; j < len; j++)
       info[j].mask |= mask;
   }
-  HB_INTERNAL void set_masks (hb_mask_t value,
-                              hb_mask_t mask,
-                              unsigned int cluster_start,
-                              unsigned int cluster_end);
+  HB_INTERNAL void set_masks (hb_mask_t value, hb_mask_t mask,
+                              unsigned int cluster_start, unsigned int cluster_end);
 
-  HB_INTERNAL void merge_clusters (unsigned int start,
-                                   unsigned int end)
+  inline void merge_clusters (unsigned int start, unsigned int end)
   {
     if (end - start < 2)
       return;
     merge_clusters_impl (start, end);
   }
-  HB_INTERNAL void merge_clusters_impl (unsigned int start,
-                                        unsigned int end);
-  HB_INTERNAL void merge_out_clusters (unsigned int start,
-                                       unsigned int end);
+  HB_INTERNAL void merge_clusters_impl (unsigned int start, unsigned int end);
+  HB_INTERNAL void merge_out_clusters (unsigned int start, unsigned int end);
   /* Merge clusters for deleting current glyph, and skip it. */
   HB_INTERNAL void delete_glyph (void);
 
+  inline void unsafe_to_break (unsigned int start,
+                               unsigned int end)
+  {
+    if (end - start < 2)
+      return;
+    unsafe_to_break_impl (start, end);
+  }
+  HB_INTERNAL void unsafe_to_break_impl (unsigned int start, unsigned int end);
+  HB_INTERNAL void unsafe_to_break_from_outbuffer (unsigned int start, unsigned int end);
+
+
   /* Internal methods */
   HB_INTERNAL bool enlarge (unsigned int size);
 
@@ -282,9 +291,79 @@
     return ret;
   }
   HB_INTERNAL bool message_impl (hb_font_t *font, const char *fmt, va_list ap) HB_PRINTF_FUNC(3, 0);
+
+  static inline void
+  set_cluster (hb_glyph_info_t &info, unsigned int cluster, unsigned int mask = 0)
+  {
+    if (info.cluster != cluster)
+    {
+      if (mask & HB_GLYPH_FLAG_UNSAFE_TO_BREAK)
+        info.mask |= HB_GLYPH_FLAG_UNSAFE_TO_BREAK;
+      else
+        info.mask &= ~HB_GLYPH_FLAG_UNSAFE_TO_BREAK;
+    }
+    info.cluster = cluster;
+  }
+
+  inline int
+  _unsafe_to_break_find_min_cluster (const hb_glyph_info_t *info,
+                                     unsigned int start, unsigned int end,
+                                     unsigned int cluster) const
+  {
+    for (unsigned int i = start; i < end; i++)
+      cluster = MIN<unsigned int> (cluster, info[i].cluster);
+    return cluster;
+  }
+  inline void
+  _unsafe_to_break_set_mask (hb_glyph_info_t *info,
+                             unsigned int start, unsigned int end,
+                             unsigned int cluster)
+  {
+    for (unsigned int i = start; i < end; i++)
+      if (cluster != info[i].cluster)
+      {
+        scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_UNSAFE_TO_BREAK;
+        info[i].mask |= HB_GLYPH_FLAG_UNSAFE_TO_BREAK;
+      }
+  }
+
+  inline void
+  unsafe_to_break_all (void)
+  {
+    for (unsigned int i = 0; i < len; i++)
+      info[i].mask |= HB_GLYPH_FLAG_UNSAFE_TO_BREAK;
+  }
+  inline void
+  safe_to_break_all (void)
+  {
+    for (unsigned int i = 0; i < len; i++)
+      info[i].mask &= ~HB_GLYPH_FLAG_UNSAFE_TO_BREAK;
+  }
 };
 
 
+/* Loop over clusters. Duplicated in foreach_syllable(). */
+#define foreach_cluster(buffer, start, end) \
+  for (unsigned int \
+       _count = buffer->len, \
+       start = 0, end = _count ? _next_cluster (buffer, 0) : 0; \
+       start < _count; \
+       start = end, end = _next_cluster (buffer, start))
+
+static inline unsigned int
+_next_cluster (hb_buffer_t *buffer, unsigned int start)
+{
+  hb_glyph_info_t *info = buffer->info;
+  unsigned int count = buffer->len;
+
+  unsigned int cluster = info[start].cluster;
+  while (++start < count && cluster == info[start].cluster)
+    ;
+
+  return start;
+}
+
+
 #define HB_BUFFER_XALLOCATE_VAR(b, func, var) \
   b->func (offsetof (hb_glyph_info_t, var) - offsetof(hb_glyph_info_t, var1), \
            sizeof (b->info[0].var))
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-buffer-serialize.cc	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-buffer-serialize.cc	Wed Dec 13 10:25:38 2017 -0800
@@ -30,7 +30,7 @@
 static const char *serialize_formats[] = {
   "text",
   "json",
-  NULL
+  nullptr
 };
 
 /**
@@ -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
@@ -90,7 +90,7 @@
     case HB_BUFFER_SERIALIZE_FORMAT_TEXT:       return serialize_formats[0];
     case HB_BUFFER_SERIALIZE_FORMAT_JSON:       return serialize_formats[1];
     default:
-    case HB_BUFFER_SERIALIZE_FORMAT_INVALID:    return NULL;
+    case HB_BUFFER_SERIALIZE_FORMAT_INVALID:    return nullptr;
   }
 }
 
@@ -104,9 +104,9 @@
                                   hb_font_t *font,
                                   hb_buffer_serialize_flags_t flags)
 {
-  hb_glyph_info_t *info = hb_buffer_get_glyph_infos (buffer, NULL);
+  hb_glyph_info_t *info = hb_buffer_get_glyph_infos (buffer, nullptr);
   hb_glyph_position_t *pos = (flags & HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS) ?
-                             NULL : hb_buffer_get_glyph_positions (buffer, NULL);
+                             nullptr : hb_buffer_get_glyph_positions (buffer, nullptr);
 
   *buf_consumed = 0;
   for (unsigned int i = start; i < end; i++)
@@ -145,10 +145,16 @@
 
     if (!(flags & HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS))
     {
-      p += snprintf (p, ARRAY_LENGTH (b) - (p - b), ",\"dx\":%d,\"dy\":%d",
-                     pos[i].x_offset, pos[i].y_offset);
-      p += snprintf (p, ARRAY_LENGTH (b) - (p - b), ",\"ax\":%d,\"ay\":%d",
-                     pos[i].x_advance, pos[i].y_advance);
+      p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), ",\"dx\":%d,\"dy\":%d",
+                             pos[i].x_offset, pos[i].y_offset));
+      p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), ",\"ax\":%d,\"ay\":%d",
+                             pos[i].x_advance, pos[i].y_advance));
+    }
+
+    if (flags & HB_BUFFER_SERIALIZE_FLAG_GLYPH_FLAGS)
+    {
+      if (info[i].mask & HB_GLYPH_FLAG_DEFINED)
+        p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), ",\"fl\":%u", info[i].mask & HB_GLYPH_FLAG_DEFINED));
     }
 
     if (flags & HB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTS)
@@ -156,9 +162,9 @@
       hb_glyph_extents_t extents;
       hb_font_get_glyph_extents(font, info[i].codepoint, &extents);
       p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), ",\"xb\":%d,\"yb\":%d",
-        extents.x_bearing, extents.y_bearing));
+                extents.x_bearing, extents.y_bearing));
       p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), ",\"w\":%d,\"h\":%d",
-        extents.width, extents.height));
+                extents.width, extents.height));
     }
 
     *p++ = '}';
@@ -188,9 +194,9 @@
                                   hb_font_t *font,
                                   hb_buffer_serialize_flags_t flags)
 {
-  hb_glyph_info_t *info = hb_buffer_get_glyph_infos (buffer, NULL);
+  hb_glyph_info_t *info = hb_buffer_get_glyph_infos (buffer, nullptr);
   hb_glyph_position_t *pos = (flags & HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS) ?
-                             NULL : hb_buffer_get_glyph_positions (buffer, NULL);
+                             nullptr : hb_buffer_get_glyph_positions (buffer, nullptr);
 
   *buf_consumed = 0;
   for (unsigned int i = start; i < end; i++)
@@ -226,6 +232,12 @@
         p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), ",%d", pos[i].y_advance));
     }
 
+    if (flags & HB_BUFFER_SERIALIZE_FLAG_GLYPH_FLAGS)
+    {
+      if (info[i].mask &HB_GLYPH_FLAG_DEFINED)
+        p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), "#%X", info[i].mask &HB_GLYPH_FLAG_DEFINED));
+    }
+
     if (flags & HB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTS)
     {
       hb_glyph_extents_t extents;
@@ -289,7 +301,7 @@
  * ## json
  * TODO.
  *
- * Return value: 
+ * Return value:
  * The number of serialized items.
  *
  * Since: 0.9.7
@@ -311,6 +323,8 @@
   if (!buf_consumed)
     buf_consumed = &sconsumed;
   *buf_consumed = 0;
+  if (buf_size)
+    *buf = '\0';
 
   assert ((!buffer->len && buffer->content_type == HB_BUFFER_CONTENT_TYPE_INVALID) ||
           buffer->content_type == HB_BUFFER_CONTENT_TYPE_GLYPHS);
@@ -393,14 +407,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
  **/
@@ -408,8 +422,8 @@
 hb_buffer_deserialize_glyphs (hb_buffer_t *buffer,
                               const char *buf,
                               int buf_len, /* -1 means nul-terminated */
-                              const char **end_ptr, /* May be NULL */
-                              hb_font_t *font, /* May be NULL */
+                              const char **end_ptr, /* May be nullptr */
+                              hb_font_t *font, /* May be nullptr */
                               hb_buffer_serialize_format_t format)
 {
   const char *end;
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-buffer.cc	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-buffer.cc	Wed Dec 13 10:25:38 2017 -0800
@@ -31,10 +31,6 @@
 #include "hb-utf-private.hh"
 
 
-#ifndef HB_DEBUG_BUFFER
-#define HB_DEBUG_BUFFER (HB_DEBUG+0)
-#endif
-
 /**
  * SECTION: hb-buffer
  * @title: Buffers
@@ -124,8 +120,8 @@
   }
 
   unsigned int new_allocated = allocated;
-  hb_glyph_position_t *new_pos = NULL;
-  hb_glyph_info_t *new_info = NULL;
+  hb_glyph_position_t *new_pos = nullptr;
+  hb_glyph_info_t *new_info = nullptr;
   bool separate_out = out_info != info;
 
   if (unlikely (_hb_unsigned_int_mul_overflows (size, sizeof (info[0]))))
@@ -134,7 +130,7 @@
   while (size >= new_allocated)
     new_allocated += (new_allocated >> 1) + 32;
 
-  ASSERT_STATIC (sizeof (info[0]) == sizeof (pos[0]));
+  static_assert ((sizeof (info[0]) == sizeof (pos[0])), "");
   if (unlikely (_hb_unsigned_int_mul_overflows (new_allocated, sizeof (info[0]))))
     goto done;
 
@@ -267,7 +263,7 @@
 
   memset (glyph, 0, sizeof (*glyph));
   glyph->codepoint = codepoint;
-  glyph->mask = 1;
+  glyph->mask = 0;
   glyph->cluster = cluster;
 
   len++;
@@ -550,12 +546,15 @@
                                   unsigned int end)
 {
   if (cluster_level == HB_BUFFER_CLUSTER_LEVEL_CHARACTERS)
+  {
+    unsafe_to_break (start, end);
     return;
+  }
 
   unsigned int cluster = info[start].cluster;
 
   for (unsigned int i = start + 1; i < end; i++)
-    cluster = MIN (cluster, info[i].cluster);
+    cluster = MIN<unsigned int> (cluster, info[i].cluster);
 
   /* Extend end */
   while (end < len && info[end - 1].cluster == info[end].cluster)
@@ -568,10 +567,10 @@
   /* If we hit the start of buffer, continue in out-buffer. */
   if (idx == start)
     for (unsigned int i = out_len; i && out_info[i - 1].cluster == info[start].cluster; i--)
-      out_info[i - 1].cluster = cluster;
+      set_cluster (out_info[i - 1], cluster);
 
   for (unsigned int i = start; i < end; i++)
-    info[i].cluster = cluster;
+    set_cluster (info[i], cluster);
 }
 void
 hb_buffer_t::merge_out_clusters (unsigned int start,
@@ -586,7 +585,7 @@
   unsigned int cluster = out_info[start].cluster;
 
   for (unsigned int i = start + 1; i < end; i++)
-    cluster = MIN (cluster, out_info[i].cluster);
+    cluster = MIN<unsigned int> (cluster, out_info[i].cluster);
 
   /* Extend start */
   while (start && out_info[start - 1].cluster == out_info[start].cluster)
@@ -599,14 +598,16 @@
   /* If we hit the end of out-buffer, continue in buffer. */
   if (end == out_len)
     for (unsigned int i = idx; i < len && info[i].cluster == out_info[end - 1].cluster; i++)
-      info[i].cluster = cluster;
+      set_cluster (info[i], cluster);
 
   for (unsigned int i = start; i < end; i++)
-    out_info[i].cluster = cluster;
+    set_cluster (out_info[i], cluster);
 }
 void
 hb_buffer_t::delete_glyph ()
 {
+  /* The logic here is duplicated in hb_ot_hide_default_ignorables(). */
+
   unsigned int cluster = info[idx].cluster;
   if (idx + 1 < len && cluster == info[idx + 1].cluster)
   {
@@ -619,9 +620,10 @@
     /* Merge cluster backward. */
     if (cluster < out_info[out_len - 1].cluster)
     {
+      unsigned int mask = info[idx].mask;
       unsigned int old_cluster = out_info[out_len - 1].cluster;
       for (unsigned i = out_len; i && out_info[i - 1].cluster == old_cluster; i--)
-        out_info[i - 1].cluster = cluster;
+        set_cluster (out_info[i - 1], cluster, mask);
     }
     goto done;
   }
@@ -638,6 +640,32 @@
 }
 
 void
+hb_buffer_t::unsafe_to_break_impl (unsigned int start, unsigned int end)
+{
+  unsigned int cluster = (unsigned int) -1;
+  cluster = _unsafe_to_break_find_min_cluster (info, start, end, cluster);
+  _unsafe_to_break_set_mask (info, start, end, cluster);
+}
+void
+hb_buffer_t::unsafe_to_break_from_outbuffer (unsigned int start, unsigned int end)
+{
+  if (!have_output)
+  {
+    unsafe_to_break_impl (start, end);
+    return;
+  }
+
+  assert (start <= out_len);
+  assert (idx <= end);
+
+  unsigned int cluster = (unsigned int) -1;
+  cluster = _unsafe_to_break_find_min_cluster (out_info, start, out_len, cluster);
+  cluster = _unsafe_to_break_find_min_cluster (info, idx, end, cluster);
+  _unsafe_to_break_set_mask (out_info, start, out_len, cluster);
+  _unsafe_to_break_set_mask (info, idx, end, cluster);
+}
+
+void
 hb_buffer_t::guess_segment_properties (void)
 {
   assert (content_type == HB_BUFFER_CONTENT_TYPE_UNICODE ||
@@ -703,7 +731,7 @@
 /**
  * hb_buffer_get_empty:
  *
- * 
+ *
  *
  * Return value: (transfer full):
  *
@@ -780,14 +808,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 +832,11 @@
 /**
  * hb_buffer_get_user_data: (skip)
  * @buffer: an #hb_buffer_t.
- * @key: 
+ * @key:
+ *
  *
- * 
  *
- * Return value: 
+ * Return value:
  *
  * Since: 0.9.2
  **/
@@ -858,9 +886,9 @@
 /**
  * hb_buffer_set_unicode_funcs:
  * @buffer: an #hb_buffer_t.
- * @unicode_funcs: 
+ * @unicode_funcs:
  *
- * 
+ *
  *
  * Since: 0.9.2
  **/
@@ -884,9 +912,9 @@
  * hb_buffer_get_unicode_funcs:
  * @buffer: an #hb_buffer_t.
  *
- * 
+ *
  *
- * Return value: 
+ * Return value:
  *
  * Since: 0.9.2
  **/
@@ -1090,7 +1118,7 @@
  *
  * See hb_buffer_set_flags().
  *
- * Return value: 
+ * Return value:
  * The @buffer flags.
  *
  * Since: 0.9.7
@@ -1104,9 +1132,9 @@
 /**
  * hb_buffer_set_cluster_level:
  * @buffer: an #hb_buffer_t.
- * @cluster_level: 
+ * @cluster_level:
  *
- * 
+ *
  *
  * Since: 0.9.42
  **/
@@ -1124,9 +1152,9 @@
  * hb_buffer_get_cluster_level:
  * @buffer: an #hb_buffer_t.
  *
- * 
+ *
  *
- * Return value: 
+ * Return value:
  *
  * Since: 0.9.42
  **/
@@ -1165,7 +1193,7 @@
  *
  * See hb_buffer_set_replacement_codepoint().
  *
- * Return value: 
+ * Return value:
  * The @buffer replacement #hb_codepoint_t.
  *
  * Since: 0.9.31
@@ -1276,7 +1304,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
@@ -1380,6 +1408,23 @@
 }
 
 /**
+ * hb_glyph_info_get_glyph_flags:
+ * @info: a #hb_glyph_info_t.
+ *
+ * Returns glyph flags encoded within a #hb_glyph_info_t.
+ *
+ * Return value:
+ * The #hb_glyph_flags_t encoded within @info.
+ *
+ * Since: 1.5.0
+ **/
+hb_glyph_flags_t
+(hb_glyph_info_get_glyph_flags) (const hb_glyph_info_t *info)
+{
+  return hb_glyph_info_get_glyph_flags (info);
+}
+
+/**
  * hb_buffer_reverse:
  * @buffer: an #hb_buffer_t.
  *
@@ -1666,6 +1711,58 @@
 }
 
 
+/**
+ * hb_buffer_append:
+ * @buffer: an #hb_buffer_t.
+ * @source: source #hb_buffer_t.
+ * @start: start index into source buffer to copy.  Use 0 to copy from start of buffer.
+ * @end: end index into source buffer to copy.  Use (unsigned int) -1 to copy to end of buffer.
+ *
+ * Append (part of) contents of another buffer to this buffer.
+ *
+ * Since: 1.5.0
+ **/
+HB_EXTERN void
+hb_buffer_append (hb_buffer_t *buffer,
+                  hb_buffer_t *source,
+                  unsigned int start,
+                  unsigned int end)
+{
+  assert (!buffer->have_output && !source->have_output);
+  assert (buffer->have_positions == source->have_positions ||
+          !buffer->len || !source->len);
+  assert (buffer->content_type == source->content_type ||
+          !buffer->len || !source->len);
+
+  if (end > source->len)
+    end = source->len;
+  if (start > end)
+    start = end;
+  if (start == end)
+    return;
+
+  if (!buffer->len)
+    buffer->content_type = source->content_type;
+  if (!buffer->have_positions && source->have_positions)
+    buffer->clear_positions ();
+
+  if (buffer->len + (end - start) < buffer->len) /* Overflows. */
+  {
+    buffer->in_error = true;
+    return;
+  }
+
+  unsigned int orig_len = buffer->len;
+  hb_buffer_set_length (buffer, buffer->len + (end - start));
+  if (buffer->in_error)
+    return;
+
+  memcpy (buffer->info + orig_len, source->info + start, (end - start) * sizeof (buffer->info[0]));
+  if (buffer->have_positions)
+    memcpy (buffer->pos + orig_len, source->pos + start, (end - start) * sizeof (buffer->pos[0]));
+}
+
+
 static int
 compare_info_codepoint (const hb_glyph_info_t *pa,
                         const hb_glyph_info_t *pb)
@@ -1736,7 +1833,8 @@
 hb_buffer_normalize_glyphs (hb_buffer_t *buffer)
 {
   assert (buffer->have_positions);
-  assert (buffer->content_type == HB_BUFFER_CONTENT_TYPE_GLYPHS);
+  assert (buffer->content_type == HB_BUFFER_CONTENT_TYPE_GLYPHS ||
+          (!buffer->len && buffer->content_type == HB_BUFFER_CONTENT_TYPE_INVALID));
 
   bool backward = HB_DIRECTION_IS_BACKWARD (buffer->props.direction);
 
@@ -1775,6 +1873,98 @@
   }
 }
 
+
+/*
+ * Comparing buffers.
+ */
+
+/**
+ * hb_buffer_diff:
+ *
+ * If dottedcircle_glyph is (hb_codepoint_t) -1 then %HB_BUFFER_DIFF_FLAG_DOTTED_CIRCLE_PRESENT
+ * and %HB_BUFFER_DIFF_FLAG_NOTDEF_PRESENT are never returned.  This should be used by most
+ * callers if just comparing two buffers is needed.
+ *
+ * Since: 1.5.0
+ **/
+hb_buffer_diff_flags_t
+hb_buffer_diff (hb_buffer_t *buffer,
+                hb_buffer_t *reference,
+                hb_codepoint_t dottedcircle_glyph,
+                unsigned int position_fuzz)
+{
+  if (buffer->content_type != reference->content_type && buffer->len && reference->len)
+    return HB_BUFFER_DIFF_FLAG_CONTENT_TYPE_MISMATCH;
+
+  hb_buffer_diff_flags_t result = HB_BUFFER_DIFF_FLAG_EQUAL;
+  bool contains = dottedcircle_glyph != (hb_codepoint_t) -1;
+
+  unsigned int count = reference->len;
+
+  if (buffer->len != count)
+  {
+    /*
+     * we can't compare glyph-by-glyph, but we do want to know if there
+     * are .notdef or dottedcircle glyphs present in the reference buffer
+     */
+    const hb_glyph_info_t *info = reference->info;
+    unsigned int i;
+    for (i = 0; i < count; i++)
+    {
+      if (contains && info[i].codepoint == dottedcircle_glyph)
+        result |= HB_BUFFER_DIFF_FLAG_DOTTED_CIRCLE_PRESENT;
+      if (contains && info[i].codepoint == 0)
+        result |= HB_BUFFER_DIFF_FLAG_NOTDEF_PRESENT;
+    }
+    result |= HB_BUFFER_DIFF_FLAG_LENGTH_MISMATCH;
+    return hb_buffer_diff_flags_t (result);
+  }
+
+  if (!count)
+    return hb_buffer_diff_flags_t (result);
+
+  const hb_glyph_info_t *buf_info = buffer->info;
+  const hb_glyph_info_t *ref_info = reference->info;
+  for (unsigned int i = 0; i < count; i++)
+  {
+    if (buf_info->codepoint != ref_info->codepoint)
+      result |= HB_BUFFER_DIFF_FLAG_CODEPOINT_MISMATCH;
+    if (buf_info->cluster != ref_info->cluster)
+      result |= HB_BUFFER_DIFF_FLAG_CLUSTER_MISMATCH;
+    if ((buf_info->mask & HB_GLYPH_FLAG_DEFINED) != (ref_info->mask & HB_GLYPH_FLAG_DEFINED))
+      result |= HB_BUFFER_DIFF_FLAG_GLYPH_FLAGS_MISMATCH;
+    if (contains && ref_info->codepoint == dottedcircle_glyph)
+      result |= HB_BUFFER_DIFF_FLAG_DOTTED_CIRCLE_PRESENT;
+    if (contains && ref_info->codepoint == 0)
+      result |= HB_BUFFER_DIFF_FLAG_NOTDEF_PRESENT;
+    buf_info++;
+    ref_info++;
+  }
+
+  if (buffer->content_type == HB_BUFFER_CONTENT_TYPE_GLYPHS)
+  {
+    assert (buffer->have_positions);
+    const hb_glyph_position_t *buf_pos = buffer->pos;
+    const hb_glyph_position_t *ref_pos = reference->pos;
+    for (unsigned int i = 0; i < count; i++)
+    {
+      if ((unsigned int) abs (buf_pos->x_advance - ref_pos->x_advance) > position_fuzz ||
+          (unsigned int) abs (buf_pos->y_advance - ref_pos->y_advance) > position_fuzz ||
+          (unsigned int) abs (buf_pos->x_offset - ref_pos->x_offset) > position_fuzz ||
+          (unsigned int) abs (buf_pos->y_offset - ref_pos->y_offset) > position_fuzz)
+      {
+        result |= HB_BUFFER_DIFF_FLAG_POSITION_MISMATCH;
+        break;
+      }
+      buf_pos++;
+      ref_pos++;
+    }
+  }
+
+  return result;
+}
+
+
 /*
  * Debugging.
  */
@@ -1786,7 +1976,7 @@
  * @user_data:
  * @destroy:
  *
- * 
+ *
  *
  * Since: 1.1.3
  **/
@@ -1803,9 +1993,9 @@
     buffer->message_data = user_data;
     buffer->message_destroy = destroy;
   } else {
-    buffer->message_func = NULL;
-    buffer->message_data = NULL;
-    buffer->message_destroy = NULL;
+    buffer->message_func = nullptr;
+    buffer->message_data = nullptr;
+    buffer->message_destroy = nullptr;
   }
 }
 
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-buffer.h	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-buffer.h	Wed Dec 13 10:25:38 2017 -0800
@@ -63,7 +63,7 @@
  */
 typedef struct hb_glyph_info_t {
   hb_codepoint_t codepoint;
-  hb_mask_t      mask;
+  hb_mask_t      mask; /* Holds hb_glyph_flags_t after hb_shape(), plus other things. */
   uint32_t       cluster;
 
   /*< private >*/
@@ -71,6 +71,19 @@
   hb_var_int_t   var2;
 } hb_glyph_info_t;
 
+typedef enum { /*< flags >*/
+  HB_GLYPH_FLAG_UNSAFE_TO_BREAK         = 0x00000001,
+
+  HB_GLYPH_FLAG_DEFINED                 = 0x00000001 /* OR of all defined flags */
+} hb_glyph_flags_t;
+
+HB_EXTERN hb_glyph_flags_t
+hb_glyph_info_get_glyph_flags (const hb_glyph_info_t *info);
+
+#define hb_glyph_info_get_glyph_flags(info) \
+        ((hb_glyph_flags_t) ((unsigned int) (info)->mask & HB_GLYPH_FLAG_DEFINED))
+
+
 /**
  * hb_glyph_position_t:
  * @x_advance: how much the line advances after drawing this glyph when setting
@@ -119,8 +132,8 @@
 #define HB_SEGMENT_PROPERTIES_DEFAULT {HB_DIRECTION_INVALID, \
                                        HB_SCRIPT_INVALID, \
                                        HB_LANGUAGE_INVALID, \
-                                       NULL, \
-                                       NULL}
+                                       (void *) 0, \
+                                       (void *) 0}
 
 HB_EXTERN hb_bool_t
 hb_segment_properties_equal (const hb_segment_properties_t *a,
@@ -163,6 +176,7 @@
 hb_buffer_get_user_data (hb_buffer_t        *buffer,
                          hb_user_data_key_t *key);
 
+
 /**
  * hb_buffer_content_type_t:
  * @HB_BUFFER_CONTENT_TYPE_INVALID: Initial value for new buffer.
@@ -359,6 +373,11 @@
                           unsigned int          item_offset,
                           int                   item_length);
 
+HB_EXTERN void
+hb_buffer_append (hb_buffer_t *buffer,
+                  hb_buffer_t *source,
+                  unsigned int start,
+                  unsigned int end);
 
 HB_EXTERN hb_bool_t
 hb_buffer_set_length (hb_buffer_t  *buffer,
@@ -403,7 +422,8 @@
   HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS          = 0x00000001u,
   HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS         = 0x00000002u,
   HB_BUFFER_SERIALIZE_FLAG_NO_GLYPH_NAMES       = 0x00000004u,
-  HB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTS        = 0x00000008u
+  HB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTS        = 0x00000008u,
+  HB_BUFFER_SERIALIZE_FLAG_GLYPH_FLAGS          = 0x00000010u
 } hb_buffer_serialize_flags_t;
 
 /**
@@ -453,6 +473,45 @@
 
 
 /*
+ * Compare buffers
+ */
+
+typedef enum { /*< flags >*/
+  HB_BUFFER_DIFF_FLAG_EQUAL                     = 0x0000,
+
+  /* Buffers with different content_type cannot be meaningfully compared
+   * in any further detail. */
+  HB_BUFFER_DIFF_FLAG_CONTENT_TYPE_MISMATCH     = 0x0001,
+
+  /* For buffers with differing length, the per-glyph comparison is not
+   * attempted, though we do still scan reference for dottedcircle / .notdef
+   * glyphs. */
+  HB_BUFFER_DIFF_FLAG_LENGTH_MISMATCH           = 0x0002,
+
+  /* We want to know if dottedcircle / .notdef glyphs are present in the
+   * reference, as we may not care so much about other differences in this
+   * case. */
+  HB_BUFFER_DIFF_FLAG_NOTDEF_PRESENT            = 0x0004,
+  HB_BUFFER_DIFF_FLAG_DOTTED_CIRCLE_PRESENT     = 0x0008,
+
+  /* If the buffers have the same length, we compare them glyph-by-glyph
+   * and report which aspect(s) of the glyph info/position are different. */
+  HB_BUFFER_DIFF_FLAG_CODEPOINT_MISMATCH        = 0x0010,
+  HB_BUFFER_DIFF_FLAG_CLUSTER_MISMATCH          = 0x0020,
+  HB_BUFFER_DIFF_FLAG_GLYPH_FLAGS_MISMATCH      = 0x0040,
+  HB_BUFFER_DIFF_FLAG_POSITION_MISMATCH         = 0x0080
+
+} hb_buffer_diff_flags_t;
+
+/* Compare the contents of two buffers, report types of differences. */
+HB_EXTERN hb_buffer_diff_flags_t
+hb_buffer_diff (hb_buffer_t *buffer,
+                hb_buffer_t *reference,
+                hb_codepoint_t dottedcircle_glyph,
+                unsigned int position_fuzz);
+
+
+/*
  * Debugging.
  */
 
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-cache-private.hh	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-/*
- * Copyright © 2012  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): Behdad Esfahbod
- */
-
-#ifndef HB_CACHE_PRIVATE_HH
-#define HB_CACHE_PRIVATE_HH
-
-#include "hb-private.hh"
-
-
-/* Implements a lock-free cache for int->int functions. */
-
-template <unsigned int key_bits, unsigned int value_bits, unsigned int cache_bits>
-struct hb_cache_t
-{
-  ASSERT_STATIC (key_bits >= cache_bits);
-  ASSERT_STATIC (key_bits + value_bits - cache_bits < 8 * sizeof (unsigned int));
-
-  inline void clear (void)
-  {
-    memset (values, 255, sizeof (values));
-  }
-
-  inline bool get (unsigned int key, unsigned int *value)
-  {
-    unsigned int k = key & ((1u<<cache_bits)-1);
-    unsigned int v = values[k];
-    if ((v >> value_bits) != (key >> cache_bits))
-      return false;
-    *value = v & ((1u<<value_bits)-1);
-    return true;
-  }
-
-  inline bool set (unsigned int key, unsigned int value)
-  {
-    if (unlikely ((key >> key_bits) || (value >> value_bits)))
-      return false; /* Overflows */
-    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[1u<<cache_bits];
-};
-
-typedef hb_cache_t<21, 16, 8> hb_cmap_cache_t;
-typedef hb_cache_t<16, 24, 8> hb_advance_cache_t;
-
-
-#endif /* HB_CACHE_PRIVATE_HH */
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-common.cc	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-common.cc	Wed Dec 13 10:25:38 2017 -0800
@@ -32,6 +32,9 @@
 #include "hb-object-private.hh"
 
 #include <locale.h>
+#ifdef HAVE_XLOCALE_H
+#include <xlocale.h>
+#endif
 
 
 /* hb_options_t */
@@ -57,12 +60,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
  **/
@@ -82,15 +85,15 @@
   for (; i < 4; i++)
     tag[i] = ' ';
 
-  return HB_TAG_CHAR4 (tag);
+  return HB_TAG (tag[0], tag[1], tag[2], tag[3]);
 }
 
 /**
  * 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 +118,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 +146,11 @@
 
 /**
  * hb_direction_to_string:
- * @direction: 
+ * @direction:
+ *
  *
- * 
  *
- * Return value: (transfer none): 
+ * Return value: (transfer none):
  *
  * Since: 0.9.2
  **/
@@ -186,8 +189,10 @@
   const unsigned char *p1 = (const unsigned char *) v1;
   const unsigned char *p2 = (const unsigned char *) v2;
 
-  while (*p1 && *p1 == canon_map[*p2])
-    p1++, p2++;
+  while (*p1 && *p1 == canon_map[*p2]) {
+    p1++;
+    p2++;
+  }
 
   return *p1 == canon_map[*p2];
 }
@@ -219,9 +224,18 @@
   }
 
   inline hb_language_item_t & operator = (const char *s) {
-    lang = (hb_language_t) strdup (s);
-    for (unsigned char *p = (unsigned char *) lang; *p; p++)
-      *p = canon_map[*p];
+    /* If a custom allocated is used calling strdup() pairs
+    badly with a call to the custom free() in finish() below.
+    Therefore don't call strdup(), implement its behavior.
+    */
+    size_t len = strlen(s) + 1;
+    lang = (hb_language_t) malloc(len);
+    if (likely (lang))
+    {
+      memcpy((unsigned char *) lang, s, len);
+      for (unsigned char *p = (unsigned char *) lang; *p; p++)
+        *p = canon_map[*p];
+    }
 
     return *this;
   }
@@ -235,8 +249,8 @@
 static hb_language_item_t *langs;
 
 #ifdef HB_USE_ATEXIT
-static
-void free_langs (void)
+static void
+free_langs (void)
 {
   while (langs) {
     hb_language_item_t *next = langs->next;
@@ -260,9 +274,14 @@
   /* Not found; allocate one. */
   hb_language_item_t *lang = (hb_language_item_t *) calloc (1, sizeof (hb_language_item_t));
   if (unlikely (!lang))
-    return NULL;
+    return nullptr;
   lang->next = first_lang;
   *lang = key;
+  if (unlikely (!lang->lang))
+  {
+    free (lang);
+    return nullptr;
+  }
 
   if (!hb_atomic_ptr_cmpexch (&langs, first_lang, lang)) {
     lang->finish ();
@@ -299,7 +318,7 @@
   if (!str || !len || !*str)
     return HB_LANGUAGE_INVALID;
 
-  hb_language_item_t *item = NULL;
+  hb_language_item_t *item = nullptr;
   if (len >= 0)
   {
     /* NUL-terminate it. */
@@ -330,14 +349,14 @@
 const char *
 hb_language_to_string (hb_language_t language)
 {
-  /* This is actually NULL-safe! */
+  /* This is actually nullptr-safe! */
   return language->s;
 }
 
 /**
  * hb_language_get_default:
  *
- * 
+ *
  *
  * Return value: (transfer none):
  *
@@ -350,7 +369,7 @@
 
   hb_language_t language = (hb_language_t) hb_atomic_ptr_get (&default_language);
   if (unlikely (language == HB_LANGUAGE_INVALID)) {
-    language = hb_language_from_string (setlocale (LC_CTYPE, NULL), -1);
+    language = hb_language_from_string (setlocale (LC_CTYPE, nullptr), -1);
     (void) hb_atomic_ptr_cmpexch (&default_language, HB_LANGUAGE_INVALID, language);
   }
 
@@ -366,7 +385,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 +434,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 +464,11 @@
 
 /**
  * hb_script_get_horizontal_direction:
- * @script: 
+ * @script:
+ *
  *
- * 
  *
- * Return value: 
+ * Return value:
  *
  * Since: 0.9.2
  **/
@@ -543,9 +562,9 @@
 void *
 hb_user_data_array_t::get (hb_user_data_key_t *key)
 {
-  hb_user_data_item_t item = {NULL, NULL, NULL};
+  hb_user_data_item_t item = {nullptr, nullptr, nullptr};
 
-  return items.find (key, &item, lock) ? item.data : NULL;
+  return items.find (key, &item, lock) ? item.data : nullptr;
 }
 
 
@@ -588,13 +607,13 @@
 
 /**
  * hb_version_atleast:
- * @major: 
- * @minor: 
- * @micro: 
+ * @major:
+ * @minor:
+ * @micro:
  *
- * 
+ *
  *
- * Return value: 
+ * Return value:
  *
  * Since: 0.9.30
  **/
@@ -605,3 +624,426 @@
 {
   return HB_VERSION_ATLEAST (major, minor, micro);
 }
+
+
+
+/* hb_feature_t and hb_variation_t */
+
+static bool
+parse_space (const char **pp, const char *end)
+{
+  while (*pp < end && ISSPACE (**pp))
+    (*pp)++;
+  return true;
+}
+
+static bool
+parse_char (const char **pp, const char *end, char c)
+{
+  parse_space (pp, end);
+
+  if (*pp == end || **pp != c)
+    return false;
+
+  (*pp)++;
+  return true;
+}
+
+static bool
+parse_uint (const char **pp, const char *end, unsigned int *pv)
+{
+  char buf[32];
+  unsigned int len = MIN (ARRAY_LENGTH (buf) - 1, (unsigned int) (end - *pp));
+  strncpy (buf, *pp, len);
+  buf[len] = '\0';
+
+  char *p = buf;
+  char *pend = p;
+  unsigned int v;
+
+  /* Intentionally use strtol instead of strtoul, such that
+   * -1 turns into "big number"... */
+  errno = 0;
+  v = strtol (p, &pend, 0);
+  if (errno || p == pend)
+    return false;
+
+  *pv = v;
+  *pp += pend - p;
+  return true;
+}
+
+static bool
+parse_uint32 (const char **pp, const char *end, uint32_t *pv)
+{
+  char buf[32];
+  unsigned int len = MIN (ARRAY_LENGTH (buf) - 1, (unsigned int) (end - *pp));
+  strncpy (buf, *pp, len);
+  buf[len] = '\0';
+
+  char *p = buf;
+  char *pend = p;
+  unsigned int v;
+
+  /* Intentionally use strtol instead of strtoul, such that
+   * -1 turns into "big number"... */
+  errno = 0;
+  v = strtol (p, &pend, 0);
+  if (errno || p == pend)
+    return false;
+
+  *pv = v;
+  *pp += pend - p;
+  return true;
+}
+
+#if defined (HAVE_NEWLOCALE) && defined (HAVE_STRTOD_L)
+#define USE_XLOCALE 1
+#define HB_LOCALE_T locale_t
+#define HB_CREATE_LOCALE(locName) newlocale (LC_ALL_MASK, locName, nullptr)
+#define HB_FREE_LOCALE(loc) freelocale (loc)
+#elif defined(_MSC_VER)
+#define USE_XLOCALE 1
+#define HB_LOCALE_T _locale_t
+#define HB_CREATE_LOCALE(locName) _create_locale (LC_ALL, locName)
+#define HB_FREE_LOCALE(loc) _free_locale (loc)
+#define strtod_l(a, b, c) _strtod_l ((a), (b), (c))
+#endif
+
+#ifdef USE_XLOCALE
+
+static HB_LOCALE_T C_locale;
+
+#ifdef HB_USE_ATEXIT
+static void
+free_C_locale (void)
+{
+  if (C_locale)
+    HB_FREE_LOCALE (C_locale);
+}
+#endif
+
+static HB_LOCALE_T
+get_C_locale (void)
+{
+retry:
+  HB_LOCALE_T C = (HB_LOCALE_T) hb_atomic_ptr_get (&C_locale);
+
+  if (unlikely (!C))
+  {
+    C = HB_CREATE_LOCALE ("C");
+
+    if (!hb_atomic_ptr_cmpexch (&C_locale, nullptr, C))
+    {
+      HB_FREE_LOCALE (C_locale);
+      goto retry;
+    }
+
+#ifdef HB_USE_ATEXIT
+    atexit (free_C_locale); /* First person registers atexit() callback. */
+#endif
+  }
+
+  return C;
+}
+#endif
+
+static bool
+parse_float (const char **pp, const char *end, float *pv)
+{
+  char buf[32];
+  unsigned int len = MIN (ARRAY_LENGTH (buf) - 1, (unsigned int) (end - *pp));
+  strncpy (buf, *pp, len);
+  buf[len] = '\0';
+
+  char *p = buf;
+  char *pend = p;
+  float v;
+
+  errno = 0;
+#ifdef USE_XLOCALE
+  v = strtod_l (p, &pend, get_C_locale ());
+#else
+  v = strtod (p, &pend);
+#endif
+  if (errno || p == pend)
+    return false;
+
+  *pv = v;
+  *pp += pend - p;
+  return true;
+}
+
+static bool
+parse_bool (const char **pp, const char *end, uint32_t *pv)
+{
+  parse_space (pp, end);
+
+  const char *p = *pp;
+  while (*pp < end && ISALPHA(**pp))
+    (*pp)++;
+
+  /* CSS allows on/off as aliases 1/0. */
+  if (*pp - p == 2 || 0 == strncmp (p, "on", 2))
+    *pv = 1;
+  else if (*pp - p == 3 || 0 == strncmp (p, "off", 2))
+    *pv = 0;
+  else
+    return false;
+
+  return true;
+}
+
+/* hb_feature_t */
+
+static bool
+parse_feature_value_prefix (const char **pp, const char *end, hb_feature_t *feature)
+{
+  if (parse_char (pp, end, '-'))
+    feature->value = 0;
+  else {
+    parse_char (pp, end, '+');
+    feature->value = 1;
+  }
+
+  return true;
+}
+
+static bool
+parse_tag (const char **pp, const char *end, hb_tag_t *tag)
+{
+  parse_space (pp, end);
+
+  char quote = 0;
+
+  if (*pp < end && (**pp == '\'' || **pp == '"'))
+  {
+    quote = **pp;
+    (*pp)++;
+  }
+
+  const char *p = *pp;
+  while (*pp < end && ISALNUM(**pp))
+    (*pp)++;
+
+  if (p == *pp || *pp - p > 4)
+    return false;
+
+  *tag = hb_tag_from_string (p, *pp - p);
+
+  if (quote)
+  {
+    /* CSS expects exactly four bytes.  And we only allow quotations for
+     * CSS compatibility.  So, enforce the length. */
+     if (*pp - p != 4)
+       return false;
+    if (*pp == end || **pp != quote)
+      return false;
+    (*pp)++;
+  }
+
+  return true;
+}
+
+static bool
+parse_feature_indices (const char **pp, const char *end, hb_feature_t *feature)
+{
+  parse_space (pp, end);
+
+  bool has_start;
+
+  feature->start = 0;
+  feature->end = (unsigned int) -1;
+
+  if (!parse_char (pp, end, '['))
+    return true;
+
+  has_start = parse_uint (pp, end, &feature->start);
+
+  if (parse_char (pp, end, ':')) {
+    parse_uint (pp, end, &feature->end);
+  } else {
+    if (has_start)
+      feature->end = feature->start + 1;
+  }
+
+  return parse_char (pp, end, ']');
+}
+
+static bool
+parse_feature_value_postfix (const char **pp, const char *end, hb_feature_t *feature)
+{
+  bool had_equal = parse_char (pp, end, '=');
+  bool had_value = parse_uint32 (pp, end, &feature->value) ||
+                   parse_bool (pp, end, &feature->value);
+  /* CSS doesn't use equal-sign between tag and value.
+   * If there was an equal-sign, then there *must* be a value.
+   * A value without an eqaul-sign is ok, but not required. */
+  return !had_equal || had_value;
+}
+
+static bool
+parse_one_feature (const char **pp, const char *end, hb_feature_t *feature)
+{
+  return parse_feature_value_prefix (pp, end, feature) &&
+         parse_tag (pp, end, &feature->tag) &&
+         parse_feature_indices (pp, end, feature) &&
+         parse_feature_value_postfix (pp, end, feature) &&
+         parse_space (pp, end) &&
+         *pp == end;
+}
+
+/**
+ * hb_feature_from_string:
+ * @str: (array length=len) (element-type uint8_t): a string to parse
+ * @len: length of @str, or -1 if string is %NULL terminated
+ * @feature: (out): the #hb_feature_t to initialize with the parsed values
+ *
+ * Parses a string into a #hb_feature_t.
+ *
+ * TODO: document the syntax here.
+ *
+ * Return value:
+ * %true if @str is successfully parsed, %false otherwise.
+ *
+ * Since: 0.9.5
+ **/
+hb_bool_t
+hb_feature_from_string (const char *str, int len,
+                        hb_feature_t *feature)
+{
+  hb_feature_t feat;
+
+  if (len < 0)
+    len = strlen (str);
+
+  if (likely (parse_one_feature (&str, str + len, &feat)))
+  {
+    if (feature)
+      *feature = feat;
+    return true;
+  }
+
+  if (feature)
+    memset (feature, 0, sizeof (*feature));
+  return false;
+}
+
+/**
+ * hb_feature_to_string:
+ * @feature: an #hb_feature_t to convert
+ * @buf: (array length=size) (out): output string
+ * @size: the allocated size of @buf
+ *
+ * Converts a #hb_feature_t into a %NULL-terminated string in the format
+ * understood by hb_feature_from_string(). The client in responsible for
+ * allocating big enough size for @buf, 128 bytes is more than enough.
+ *
+ * Since: 0.9.5
+ **/
+void
+hb_feature_to_string (hb_feature_t *feature,
+                      char *buf, unsigned int size)
+{
+  if (unlikely (!size)) return;
+
+  char s[128];
+  unsigned int len = 0;
+  if (feature->value == 0)
+    s[len++] = '-';
+  hb_tag_to_string (feature->tag, s + len);
+  len += 4;
+  while (len && s[len - 1] == ' ')
+    len--;
+  if (feature->start != 0 || feature->end != (unsigned int) -1)
+  {
+    s[len++] = '[';
+    if (feature->start)
+      len += MAX (0, snprintf (s + len, ARRAY_LENGTH (s) - len, "%u", feature->start));
+    if (feature->end != feature->start + 1) {
+      s[len++] = ':';
+      if (feature->end != (unsigned int) -1)
+        len += MAX (0, snprintf (s + len, ARRAY_LENGTH (s) - len, "%u", feature->end));
+    }
+    s[len++] = ']';
+  }
+  if (feature->value > 1)
+  {
+    s[len++] = '=';
+    len += MAX (0, snprintf (s + len, ARRAY_LENGTH (s) - len, "%u", feature->value));
+  }
+  assert (len < ARRAY_LENGTH (s));
+  len = MIN (len, size - 1);
+  memcpy (buf, s, len);
+  buf[len] = '\0';
+}
+
+/* hb_variation_t */
+
+static bool
+parse_variation_value (const char **pp, const char *end, hb_variation_t *variation)
+{
+  parse_char (pp, end, '='); /* Optional. */
+  return parse_float (pp, end, &variation->value);
+}
+
+static bool
+parse_one_variation (const char **pp, const char *end, hb_variation_t *variation)
+{
+  return parse_tag (pp, end, &variation->tag) &&
+         parse_variation_value (pp, end, variation) &&
+         parse_space (pp, end) &&
+         *pp == end;
+}
+
+/**
+ * hb_variation_from_string:
+ *
+ * Since: 1.4.2
+ */
+hb_bool_t
+hb_variation_from_string (const char *str, int len,
+                          hb_variation_t *variation)
+{
+  hb_variation_t var;
+
+  if (len < 0)
+    len = strlen (str);
+
+  if (likely (parse_one_variation (&str, str + len, &var)))
+  {
+    if (variation)
+      *variation = var;
+    return true;
+  }
+
+  if (variation)
+    memset (variation, 0, sizeof (*variation));
+  return false;
+}
+
+/**
+ * hb_variation_to_string:
+ *
+ * Since: 1.4.2
+ */
+void
+hb_variation_to_string (hb_variation_t *variation,
+                        char *buf, unsigned int size)
+{
+  if (unlikely (!size)) return;
+
+  char s[128];
+  unsigned int len = 0;
+  hb_tag_to_string (variation->tag, s + len);
+  len += 4;
+  while (len && s[len - 1] == ' ')
+    len--;
+  s[len++] = '=';
+  len += MAX (0, snprintf (s + len, ARRAY_LENGTH (s) - len, "%g", variation->value));
+
+  assert (len < ARRAY_LENGTH (s));
+  len = MIN (len, size - 1);
+  memcpy (buf, s, len);
+  buf[len] = '\0';
+}
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-common.h	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-common.h	Wed Dec 13 10:25:38 2017 -0800
@@ -43,30 +43,16 @@
 # endif /* !__cplusplus */
 #endif
 
-#if !defined (HB_DONT_DEFINE_STDINT)
-
 #if defined (_SVR4) || defined (SVR4) || defined (__OpenBSD__) || \
     defined (_sgi) || defined (__sun) || defined (sun) || \
     defined (__digital__) || defined (__HP_cc)
 #  include <inttypes.h>
 #elif defined (_AIX)
 #  include <sys/inttypes.h>
-/* VS 2010 (_MSC_VER 1600) has stdint.h */
-#elif defined (_MSC_VER) && _MSC_VER < 1600
-typedef __int8 int8_t;
-typedef unsigned __int8 uint8_t;
-typedef __int16 int16_t;
-typedef unsigned __int16 uint16_t;
-typedef __int32 int32_t;
-typedef unsigned __int32 uint32_t;
-typedef __int64 int64_t;
-typedef unsigned __int64 uint64_t;
 #else
 #  include <stdint.h>
 #endif
 
-#endif
-
 HB_BEGIN_DECLS
 
 
@@ -148,7 +134,7 @@
 HB_EXTERN const char *
 hb_language_to_string (hb_language_t language);
 
-#define HB_LANGUAGE_INVALID ((hb_language_t) NULL)
+#define HB_LANGUAGE_INVALID ((hb_language_t) 0)
 
 HB_EXTERN hb_language_t
 hb_language_get_default (void);
@@ -321,6 +307,14 @@
   /*9.0*/ HB_SCRIPT_TANGUT                      = HB_TAG ('T','a','n','g'),
   /*9.0*/ HB_SCRIPT_NEWA                        = HB_TAG ('N','e','w','a'),
 
+  /*
+   * Since 1.6.0
+   */
+  /*10.0*/HB_SCRIPT_MASARAM_GONDI               = HB_TAG ('G','o','n','m'),
+  /*10.0*/HB_SCRIPT_NUSHU                       = HB_TAG ('N','s','h','u'),
+  /*10.0*/HB_SCRIPT_SOYOMBO                     = HB_TAG ('S','o','y','o'),
+  /*10.0*/HB_SCRIPT_ZANABAZAR_SQUARE            = HB_TAG ('Z','a','n','b'),
+
   /* No script set. */
   HB_SCRIPT_INVALID                             = HB_TAG_NONE,
 
@@ -362,6 +356,42 @@
 typedef void (*hb_destroy_func_t) (void *user_data);
 
 
+/* Font features and variations. */
+
+typedef struct hb_feature_t {
+  hb_tag_t      tag;
+  uint32_t      value;
+  unsigned int  start;
+  unsigned int  end;
+} hb_feature_t;
+
+HB_EXTERN hb_bool_t
+hb_feature_from_string (const char *str, int len,
+                        hb_feature_t *feature);
+
+HB_EXTERN void
+hb_feature_to_string (hb_feature_t *feature,
+                      char *buf, unsigned int size);
+
+/**
+ * hb_variation_t:
+ *
+ * Since: 1.4.2
+ */
+typedef struct hb_variation_t {
+  hb_tag_t tag;
+  float    value;
+} hb_variation_t;
+
+HB_EXTERN hb_bool_t
+hb_variation_from_string (const char *str, int len,
+                          hb_variation_t *variation);
+
+HB_EXTERN void
+hb_variation_to_string (hb_variation_t *variation,
+                        char *buf, unsigned int size);
+
+
 HB_END_DECLS
 
 #endif /* HB_COMMON_H */
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-coretext.cc	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-coretext.cc	Wed Dec 13 10:25:38 2017 -0800
@@ -27,15 +27,28 @@
  */
 
 #define HB_SHAPER coretext
+
+#include "hb-private.hh"
+#include "hb-debug.hh"
 #include "hb-shaper-impl-private.hh"
 
 #include "hb-coretext.h"
+#include <math.h>
 
+/* https://developer.apple.com/documentation/coretext/1508745-ctfontcreatewithgraphicsfont */
+#define HB_CORETEXT_DEFAULT_FONT_SIZE 12.f
 
-#ifndef HB_DEBUG_CORETEXT
-#define HB_DEBUG_CORETEXT (HB_DEBUG+0)
-#endif
-
+static CGFloat
+coretext_font_size (float ptem)
+{
+  /* CoreText points are CSS pixels (96 per inch),
+   * NOT typographic points (72 per inch).
+   *
+   * https://developer.apple.com/library/content/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Explained/Explained.html
+   */
+  ptem *= 96.f / 72.f;
+  return ptem <= 0.f ? HB_CORETEXT_DEFAULT_FONT_SIZE : ptem;
+}
 
 static void
 release_table_data (void *user_data)
@@ -50,28 +63,34 @@
   CGFontRef cg_font = reinterpret_cast<CGFontRef> (user_data);
   CFDataRef cf_data = CGFontCopyTableForTag (cg_font, tag);
   if (unlikely (!cf_data))
-    return NULL;
+    return nullptr;
 
   const char *data = reinterpret_cast<const char*> (CFDataGetBytePtr (cf_data));
   const size_t length = CFDataGetLength (cf_data);
   if (!data || !length)
-    return NULL;
+    return nullptr;
 
   return hb_blob_create (data, length, HB_MEMORY_MODE_READONLY,
                          reinterpret_cast<void *> (const_cast<__CFData *> (cf_data)),
                          release_table_data);
 }
 
+static void
+_hb_cg_font_release (void *data)
+{
+  CGFontRelease ((CGFontRef) data);
+}
+
 hb_face_t *
 hb_coretext_face_create (CGFontRef cg_font)
 {
-  return hb_face_create_for_tables (reference_table, CGFontRetain (cg_font), (hb_destroy_func_t) CGFontRelease);
+  return hb_face_create_for_tables (reference_table, CGFontRetain (cg_font), _hb_cg_font_release);
 }
 
-
-HB_SHAPER_DATA_ENSURE_DECLARE(coretext, face)
-HB_SHAPER_DATA_ENSURE_DECLARE(coretext, font)
-
+HB_SHAPER_DATA_ENSURE_DEFINE(coretext, face)
+HB_SHAPER_DATA_ENSURE_DEFINE_WITH_CONDITION(coretext, font,
+        fabs (CTFontGetSize((CTFontRef) data) - coretext_font_size (font->ptem)) <= .5
+)
 
 /*
  * shaper face data
@@ -104,7 +123,7 @@
 release_data (void *info, const void *data, size_t size)
 {
   assert (hb_blob_get_length ((hb_blob_t *) info) == size &&
-          hb_blob_get_data ((hb_blob_t *) info, NULL) == data);
+          hb_blob_get_data ((hb_blob_t *) info, nullptr) == data);
 
   hb_blob_destroy ((hb_blob_t *) info);
 }
@@ -112,8 +131,8 @@
 static CGFontRef
 create_cg_font (hb_face_t *face)
 {
-  CGFontRef cg_font = NULL;
-  if (face->destroy == (hb_destroy_func_t) CGFontRelease)
+  CGFontRef cg_font = nullptr;
+  if (face->destroy == _hb_cg_font_release)
   {
     cg_font = CGFontRetain ((CGFontRef) face->user_data);
   }
@@ -140,10 +159,36 @@
 static CTFontRef
 create_ct_font (CGFontRef cg_font, CGFloat font_size)
 {
-  CTFontRef ct_font = CTFontCreateWithGraphicsFont (cg_font, font_size, NULL, NULL);
+  CTFontRef ct_font = nullptr;
+
+  /* CoreText does not enable trak table usage / tracking when creating a CTFont
+   * using CTFontCreateWithGraphicsFont. The only way of enabling tracking seems
+   * to be through the CTFontCreateUIFontForLanguage call. */
+  CFStringRef cg_postscript_name = CGFontCopyPostScriptName (cg_font);
+  if (CFStringHasPrefix (cg_postscript_name, CFSTR (".SFNSText")) ||
+      CFStringHasPrefix (cg_postscript_name, CFSTR (".SFNSDisplay")))
+  {
+    CTFontUIFontType font_type = kCTFontUIFontSystem;
+    if (CFStringHasSuffix (cg_postscript_name, CFSTR ("-Bold")))
+      font_type = kCTFontUIFontEmphasizedSystem;
+
+    ct_font = CTFontCreateUIFontForLanguage (font_type, font_size, nullptr);
+    CFStringRef ct_result_name = CTFontCopyPostScriptName(ct_font);
+    if (CFStringCompare (ct_result_name, cg_postscript_name, 0) != kCFCompareEqualTo)
+    {
+      CFRelease(ct_font);
+      ct_font = nullptr;
+    }
+    CFRelease (ct_result_name);
+  }
+  CFRelease (cg_postscript_name);
+
+  if (!ct_font)
+    ct_font = CTFontCreateWithGraphicsFont (cg_font, font_size, nullptr, nullptr);
+
   if (unlikely (!ct_font)) {
     DEBUG_MSG (CORETEXT, cg_font, "Font CTFontCreateWithGraphicsFont() failed");
-    return NULL;
+    return nullptr;
   }
 
   /* crbug.com/576941 and crbug.com/625902 and the investigation in the latter
@@ -153,7 +198,7 @@
    * 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) {
+  if (&CTGetCoreTextVersion != nullptr && CTGetCoreTextVersion() < 0x00070000) {
     CFStringRef fontName = CTFontCopyPostScriptName (ct_font);
     bool isEmojiFont = CFStringCompare (fontName, CFSTR("AppleColorEmoji"), 0) == kCFCompareEqualTo;
     CFRelease (fontName);
@@ -167,7 +212,7 @@
    * font fallback which we don't need anyway. */
   {
     CTFontDescriptorRef last_resort_font_desc = get_last_resort_font_desc ();
-    CTFontRef new_ct_font = CTFontCreateCopyWithAttributes (ct_font, 0.0, NULL, last_resort_font_desc);
+    CTFontRef new_ct_font = CTFontCreateCopyWithAttributes (ct_font, 0.0, nullptr, last_resort_font_desc);
     CFRelease (last_resort_font_desc);
     if (new_ct_font)
     {
@@ -202,51 +247,24 @@
   return ct_font;
 }
 
-struct hb_coretext_shaper_face_data_t {
-  CGFontRef cg_font;
-  CTFontRef ct_font;
-};
-
 hb_coretext_shaper_face_data_t *
 _hb_coretext_shaper_face_data_create (hb_face_t *face)
 {
-  hb_coretext_shaper_face_data_t *data = (hb_coretext_shaper_face_data_t *) calloc (1, sizeof (hb_coretext_shaper_face_data_t));
-  if (unlikely (!data))
-    return NULL;
+  CGFontRef cg_font = create_cg_font (face);
 
-  data->cg_font = create_cg_font (face);
-  if (unlikely (!data->cg_font))
+  if (unlikely (!cg_font))
   {
     DEBUG_MSG (CORETEXT, face, "CGFont creation failed..");
-    free (data);
-    return NULL;
+    return nullptr;
   }
 
-  /* We use 36pt size instead of UPEM, because CoreText implements the 'trak' table,
-   * which can make the font too tight at large sizes.  36pt should be a good semi-neutral
-   * size.
-   *
-   * Since we always create CTFont at a fixed size, our CTFont lives in face_data
-   * instead of font_data.  Which is good, because when people change scale on
-   * hb_font_t, we won't need to update our CTFont. */
-  data->ct_font = create_ct_font (data->cg_font, 36.);
-  if (unlikely (!data->ct_font))
-  {
-    DEBUG_MSG (CORETEXT, face, "CTFont creation failed.");
-    CFRelease (data->cg_font);
-    free (data);
-    return NULL;
-  }
-
-  return data;
+  return (hb_coretext_shaper_face_data_t *) cg_font;
 }
 
 void
 _hb_coretext_shaper_face_data_destroy (hb_coretext_shaper_face_data_t *data)
 {
-  CFRelease (data->ct_font);
-  CFRelease (data->cg_font);
-  free (data);
+  CFRelease ((CGFontRef) data);
 }
 
 /*
@@ -255,9 +273,8 @@
 CGFontRef
 hb_coretext_face_get_cg_font (hb_face_t *face)
 {
-  if (unlikely (!hb_coretext_shaper_face_data_ensure (face))) return NULL;
-  hb_coretext_shaper_face_data_t *face_data = HB_SHAPER_DATA_GET (face);
-  return face_data->cg_font;
+  if (unlikely (!hb_coretext_shaper_face_data_ensure (face))) return nullptr;
+  return (CGFontRef) HB_SHAPER_DATA_GET (face);
 }
 
 
@@ -265,17 +282,28 @@
  * shaper font data
  */
 
-struct hb_coretext_shaper_font_data_t {};
+hb_coretext_shaper_font_data_t *
+_hb_coretext_shaper_font_data_create (hb_font_t *font)
+{
+  hb_face_t *face = font->face;
+  if (unlikely (!hb_coretext_shaper_face_data_ensure (face))) return nullptr;
+  CGFontRef cg_font = (CGFontRef) HB_SHAPER_DATA_GET (face);
 
-hb_coretext_shaper_font_data_t *
-_hb_coretext_shaper_font_data_create (hb_font_t *font HB_UNUSED)
-{
-  return (hb_coretext_shaper_font_data_t *) HB_SHAPER_DATA_SUCCEEDED;
+  CTFontRef ct_font = create_ct_font (cg_font, coretext_font_size (font->ptem));
+
+  if (unlikely (!ct_font))
+  {
+    DEBUG_MSG (CORETEXT, font, "CGFont creation failed..");
+    return nullptr;
+  }
+
+  return (hb_coretext_shaper_font_data_t *) ct_font;
 }
 
 void
 _hb_coretext_shaper_font_data_destroy (hb_coretext_shaper_font_data_t *data)
 {
+  CFRelease ((CTFontRef) data);
 }
 
 
@@ -303,10 +331,8 @@
 CTFontRef
 hb_coretext_font_get_ct_font (hb_font_t *font)
 {
-  hb_face_t *face = font->face;
-  if (unlikely (!hb_coretext_shaper_face_data_ensure (face))) return NULL;
-  hb_coretext_shaper_face_data_t *face_data = HB_SHAPER_DATA_GET (face);
-  return face_data->ct_font;
+  if (unlikely (!hb_coretext_shaper_font_data_ensure (font))) return nullptr;
+  return (CTFontRef)HB_SHAPER_DATA_GET (font);
 }
 
 
@@ -323,7 +349,9 @@
   feature_record_t rec;
   unsigned int order;
 
-  static int cmp (const active_feature_t *a, const active_feature_t *b) {
+  static int cmp (const void *pa, const void *pb) {
+    const active_feature_t *a = (const active_feature_t *) pa;
+    const active_feature_t *b = (const active_feature_t *) pb;
     return a->rec.feature < b->rec.feature ? -1 : a->rec.feature > b->rec.feature ? 1 :
            a->order < b->order ? -1 : a->order > b->order ? 1 :
            a->rec.setting < b->rec.setting ? -1 : a->rec.setting > b->rec.setting ? 1 :
@@ -339,7 +367,9 @@
   bool start;
   active_feature_t feature;
 
-  static int cmp (const feature_event_t *a, const feature_event_t *b) {
+  static int cmp (const void *pa, const void *pb) {
+    const feature_event_t *a = (const feature_event_t *) pa;
+    const feature_event_t *b = (const feature_event_t *) pb;
     return a->index < b->index ? -1 : a->index > b->index ? 1 :
            a->start < b->start ? -1 : a->start > b->start ? 1 :
            active_feature_t::cmp (&a->feature, &b->feature);
@@ -538,9 +568,10 @@
                     unsigned int        num_features)
 {
   hb_face_t *face = font->face;
-  hb_coretext_shaper_face_data_t *face_data = HB_SHAPER_DATA_GET (face);
+  CGFontRef cg_font = (CGFontRef) HB_SHAPER_DATA_GET (face);
+  CTFontRef ct_font = (CTFontRef) HB_SHAPER_DATA_GET (font);
 
-  CGFloat ct_font_size = CTFontGetSize (face_data->ct_font);
+  CGFloat ct_font_size = CTFontGetSize (ct_font);
   CGFloat x_mult = (CGFloat) font->x_scale / ct_font_size;
   CGFloat y_mult = (CGFloat) font->y_scale / ct_font_size;
 
@@ -641,22 +672,23 @@
           /* active_features.qsort (); */
           for (unsigned int j = 0; j < active_features.len; j++)
           {
-            CFStringRef keys[2] = {
+            CFStringRef keys[] = {
               kCTFontFeatureTypeIdentifierKey,
               kCTFontFeatureSelectorIdentifierKey
             };
-            CFNumberRef values[2] = {
+            CFNumberRef values[] = {
               CFNumberCreate (kCFAllocatorDefault, kCFNumberIntType, &active_features[j].rec.feature),
               CFNumberCreate (kCFAllocatorDefault, kCFNumberIntType, &active_features[j].rec.setting)
             };
+            static_assert ((ARRAY_LENGTH_CONST (keys) == ARRAY_LENGTH_CONST (values)), "");
             CFDictionaryRef dict = CFDictionaryCreate (kCFAllocatorDefault,
                                                        (const void **) keys,
                                                        (const void **) values,
-                                                       2,
+                                                       ARRAY_LENGTH (keys),
                                                        &kCFTypeDictionaryKeyCallBacks,
                                                        &kCFTypeDictionaryValueCallBacks);
-            CFRelease (values[0]);
-            CFRelease (values[1]);
+            for (unsigned int i = 0; i < ARRAY_LENGTH (values); i++)
+              CFRelease (values[i]);
 
             CFArrayAppendValue (features_array, dict);
             CFRelease (dict);
@@ -674,12 +706,12 @@
           CTFontDescriptorRef font_desc = CTFontDescriptorCreateWithAttributes (attributes);
           CFRelease (attributes);
 
-          range->font = CTFontCreateCopyWithAttributes (face_data->ct_font, 0.0, NULL, font_desc);
+          range->font = CTFontCreateCopyWithAttributes (ct_font, 0.0, nullptr, font_desc);
           CFRelease (font_desc);
         }
         else
         {
-          range->font = NULL;
+          range->font = nullptr;
         }
 
         range->index_first = last_index;
@@ -699,9 +731,6 @@
           active_features.remove (feature - active_features.array);
       }
     }
-
-    if (!range_records.len) /* No active feature found. */
-      goto fail_features;
   }
   else
   {
@@ -752,14 +781,14 @@
 
 #define FAIL(...) \
   HB_STMT_START { \
-    DEBUG_MSG (CORETEXT, NULL, __VA_ARGS__); \
+    DEBUG_MSG (CORETEXT, nullptr, __VA_ARGS__); \
     ret = false; \
     goto fail; \
   } HB_STMT_END;
 
   bool ret = true;
-  CFStringRef string_ref = NULL;
-  CTLineRef line = NULL;
+  CFStringRef string_ref = nullptr;
+  CTLineRef line = nullptr;
 
   if (0)
   {
@@ -771,8 +800,8 @@
     assert (line);
     CFRelease (string_ref);
     CFRelease (line);
-    string_ref = NULL;
-    line = NULL;
+    string_ref = nullptr;
+    line = nullptr;
 
     /* Get previous start-of-scratch-area, that we use later for readjusting
      * our existing scratch arrays. */
@@ -793,7 +822,7 @@
     scratch_size -= old_scratch_used;
   }
   {
-    string_ref = CFStringCreateWithCharactersNoCopy (NULL,
+    string_ref = CFStringCreateWithCharactersNoCopy (nullptr,
                                                      pchars, chars_len,
                                                      kCFAllocatorNull);
     if (unlikely (!string_ref))
@@ -831,9 +860,9 @@
         CFRelease (lang);
       }
       CFAttributedStringSetAttribute (attr_string, CFRangeMake (0, chars_len),
-                                      kCTFontAttributeName, face_data->ct_font);
+                                      kCTFontAttributeName, ct_font);
 
-      if (num_features)
+      if (num_features && range_records.len)
       {
         unsigned int start = 0;
         range_record_t *last_range = &range_records[0];
@@ -859,6 +888,30 @@
           CFAttributedStringSetAttribute (attr_string, CFRangeMake (start, chars_len - start),
                                           kCTFontAttributeName, last_range->font);
       }
+      /* Enable/disable kern if requested.
+       *
+       * Note: once kern is disabled, reenabling it doesn't currently seem to work in CoreText.
+       */
+      if (num_features)
+      {
+        unsigned int zeroint = 0;
+        CFNumberRef zero = CFNumberCreate (kCFAllocatorDefault, kCFNumberIntType, &zeroint);
+        for (unsigned int i = 0; i < num_features; i++)
+        {
+          const hb_feature_t &feature = features[i];
+          if (feature.tag == HB_TAG('k','e','r','n') &&
+              feature.start < chars_len && feature.start < feature.end)
+          {
+            CFRange feature_range = CFRangeMake (feature.start,
+                                                 MIN (feature.end, chars_len) - feature.start);
+            if (feature.value)
+              CFAttributedStringRemoveAttribute (attr_string, feature_range, kCTKernAttributeName);
+            else
+              CFAttributedStringSetAttribute (attr_string, feature_range, kCTKernAttributeName, zero);
+          }
+        }
+        CFRelease (zero);
+      }
 
       int level = HB_DIRECTION_IS_FORWARD (buffer->props.direction) ? 0 : 1;
       CFNumberRef level_number = CFNumberCreate (kCFAllocatorDefault, kCFNumberIntType, &level);
@@ -868,6 +921,7 @@
                                                     1,
                                                     &kCFTypeDictionaryKeyCallBacks,
                                                     &kCFTypeDictionaryValueCallBacks);
+      CFRelease (level_number);
       if (unlikely (!options))
         FAIL ("CFDictionaryCreate failed");
 
@@ -885,7 +939,7 @@
 
     CFArrayRef glyph_runs = CTLineGetGlyphRuns (line);
     unsigned int num_runs = CFArrayGetCount (glyph_runs);
-    DEBUG_MSG (CORETEXT, NULL, "Num runs: %d", num_runs);
+    DEBUG_MSG (CORETEXT, nullptr, "Num runs: %d", num_runs);
 
     buffer->len = 0;
     uint32_t status_and = ~0, status_or = 0;
@@ -911,7 +965,7 @@
       status_or  |= run_status;
       status_and &= run_status;
       DEBUG_MSG (CORETEXT, run, "CTRunStatus: %x", run_status);
-      double run_advance = CTRunGetTypographicBounds (run, range_all, NULL, NULL, NULL);
+      double run_advance = CTRunGetTypographicBounds (run, range_all, nullptr, nullptr, nullptr);
       if (HB_DIRECTION_IS_VERTICAL (buffer->props.direction))
           run_advance = -run_advance;
       DEBUG_MSG (CORETEXT, run, "Run advance: %g", run_advance);
@@ -924,7 +978,7 @@
        */
       CFDictionaryRef attributes = CTRunGetAttributes (run);
       CTFontRef run_ct_font = static_cast<CTFontRef>(CFDictionaryGetValue (attributes, kCTFontAttributeName));
-      if (!CFEqual (run_ct_font, face_data->ct_font))
+      if (!CFEqual (run_ct_font, ct_font))
       {
         /* The run doesn't use our main font instance.  We have to figure out
          * whether font fallback happened, or this is just CoreText giving us
@@ -962,13 +1016,13 @@
           CGFontRef run_cg_font = CTFontCopyGraphicsFont (run_ct_font, 0);
           if (run_cg_font)
           {
-            matched = CFEqual (run_cg_font, face_data->cg_font);
+            matched = CFEqual (run_cg_font, cg_font);
             CFRelease (run_cg_font);
           }
         }
         if (!matched)
         {
-          CFStringRef font_ps_name = CTFontCopyName (face_data->ct_font, kCTFontPostScriptNameKey);
+          CFStringRef font_ps_name = CTFontCopyName (ct_font, kCTFontPostScriptNameKey);
           CFStringRef run_ps_name = CTFontCopyName (run_ct_font, kCTFontPostScriptNameKey);
           CFComparisonResult result = CFStringCompare (run_ps_name, font_ps_name, 0);
           CFRelease (run_ps_name);
@@ -1037,7 +1091,7 @@
 
       /* Testing used to indicate that CTRunGetGlyphsPtr, etc (almost?) always
        * succeed, and so copying data to our own buffer will be rare.  Reports
-       * have it that this changed in OS X 10.10 Yosemite, and NULL is returned
+       * have it that this changed in OS X 10.10 Yosemite, and nullptr is returned
        * frequently.  At any rate, we can test that codepath by setting USE_PTR
        * to false. */
 
@@ -1053,13 +1107,13 @@
 
       { /* Setup glyphs */
         SCRATCH_SAVE();
-        const CGGlyph* glyphs = USE_PTR ? CTRunGetGlyphsPtr (run) : NULL;
+        const CGGlyph* glyphs = USE_PTR ? CTRunGetGlyphsPtr (run) : nullptr;
         if (!glyphs) {
           ALLOCATE_ARRAY (CGGlyph, glyph_buf, num_glyphs, goto resize_and_retry);
           CTRunGetGlyphs (run, range_all, glyph_buf);
           glyphs = glyph_buf;
         }
-        const CFIndex* string_indices = USE_PTR ? CTRunGetStringIndicesPtr (run) : NULL;
+        const CFIndex* string_indices = USE_PTR ? CTRunGetStringIndicesPtr (run) : nullptr;
         if (!string_indices) {
           ALLOCATE_ARRAY (CFIndex, index_buf, num_glyphs, goto resize_and_retry);
           CTRunGetStringIndices (run, range_all, index_buf);
@@ -1081,7 +1135,7 @@
          * advance (in the advance direction only), and for last glyph we set
          * whatever is needed to make the whole run's advance add up. */
         SCRATCH_SAVE();
-        const CGPoint* positions = USE_PTR ? CTRunGetPositionsPtr (run) : NULL;
+        const CGPoint* positions = USE_PTR ? CTRunGetPositionsPtr (run) : nullptr;
         if (!positions) {
           ALLOCATE_ARRAY (CGPoint, position_buf, num_glyphs, goto resize_and_retry);
           CTRunGetPositions (run, range_all, position_buf);
@@ -1157,6 +1211,9 @@
         pos->x_advance = info->mask;
         pos->x_offset = info->var1.i32;
         pos->y_offset = info->var2.i32;
+
+        info->mask = HB_GLYPH_FLAG_UNSAFE_TO_BREAK;
+
         info++, pos++;
       }
     else
@@ -1165,6 +1222,9 @@
         pos->y_advance = info->mask;
         pos->x_offset = info->var1.i32;
         pos->y_offset = info->var2.i32;
+
+        info->mask = HB_GLYPH_FLAG_UNSAFE_TO_BREAK;
+
         info++, pos++;
       }
 
@@ -1202,6 +1262,8 @@
     }
   }
 
+  buffer->unsafe_to_break_all ();
+
 #undef FAIL
 
 fail:
@@ -1222,6 +1284,9 @@
  * AAT shaper
  */
 
+HB_SHAPER_DATA_ENSURE_DEFINE(coretext_aat, face)
+HB_SHAPER_DATA_ENSURE_DEFINE(coretext_aat, font)
+
 /*
  * shaper face data
  */
@@ -1231,22 +1296,20 @@
 hb_coretext_aat_shaper_face_data_t *
 _hb_coretext_aat_shaper_face_data_create (hb_face_t *face)
 {
-  hb_blob_t *mort_blob = face->reference_table (HB_CORETEXT_TAG_MORT);
-  /* Umm, we just reference the table to check whether it exists.
-   * Maybe add better API for this? */
-  if (!hb_blob_get_length (mort_blob))
+  static const hb_tag_t tags[] = {HB_CORETEXT_TAG_MORX, HB_CORETEXT_TAG_MORT, HB_CORETEXT_TAG_KERX};
+
+  for (unsigned int i = 0; i < ARRAY_LENGTH (tags); i++)
   {
-    hb_blob_destroy (mort_blob);
-    mort_blob = face->reference_table (HB_CORETEXT_TAG_MORX);
-    if (!hb_blob_get_length (mort_blob))
+    hb_blob_t *blob = face->reference_table (tags[i]);
+    if (hb_blob_get_length (blob))
     {
-      hb_blob_destroy (mort_blob);
-      return NULL;
+      hb_blob_destroy (blob);
+      return hb_coretext_shaper_face_data_ensure (face) ? (hb_coretext_aat_shaper_face_data_t *) HB_SHAPER_DATA_SUCCEEDED : nullptr;
     }
+    hb_blob_destroy (blob);
   }
-  hb_blob_destroy (mort_blob);
 
-  return hb_coretext_shaper_face_data_ensure (face) ? (hb_coretext_aat_shaper_face_data_t *) HB_SHAPER_DATA_SUCCEEDED : NULL;
+  return nullptr;
 }
 
 void
@@ -1264,7 +1327,7 @@
 hb_coretext_aat_shaper_font_data_t *
 _hb_coretext_aat_shaper_font_data_create (hb_font_t *font)
 {
-  return hb_coretext_shaper_font_data_ensure (font) ? (hb_coretext_aat_shaper_font_data_t *) HB_SHAPER_DATA_SUCCEEDED : NULL;
+  return hb_coretext_shaper_font_data_ensure (font) ? (hb_coretext_aat_shaper_font_data_t *) HB_SHAPER_DATA_SUCCEEDED : nullptr;
 }
 
 void
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-coretext.h	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-coretext.h	Wed Dec 13 10:25:38 2017 -0800
@@ -42,6 +42,7 @@
 
 #define HB_CORETEXT_TAG_MORT HB_TAG('m','o','r','t')
 #define HB_CORETEXT_TAG_MORX HB_TAG('m','o','r','x')
+#define HB_CORETEXT_TAG_KERX HB_TAG('k','e','r','x')
 
 
 HB_EXTERN hb_face_t *
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-debug.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,419 @@
+/*
+ * Copyright © 2017  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): Behdad Esfahbod
+ */
+
+#ifndef HB_DEBUG_HH
+#define HB_DEBUG_HH
+
+#include "hb-private.hh"
+
+
+#ifndef HB_DEBUG
+#define HB_DEBUG 0
+#endif
+
+static inline bool
+_hb_debug (unsigned int level,
+           unsigned int max_level)
+{
+  return level < max_level;
+}
+
+#define DEBUG_LEVEL_ENABLED(WHAT, LEVEL) (_hb_debug ((LEVEL), HB_DEBUG_##WHAT))
+#define DEBUG_ENABLED(WHAT) (DEBUG_LEVEL_ENABLED (WHAT, 0))
+
+static inline void
+_hb_print_func (const char *func)
+{
+  if (func)
+  {
+    unsigned int func_len = strlen (func);
+    /* Skip "static" */
+    if (0 == strncmp (func, "static ", 7))
+      func += 7;
+    /* Skip "typename" */
+    if (0 == strncmp (func, "typename ", 9))
+      func += 9;
+    /* Skip return type */
+    const char *space = strchr (func, ' ');
+    if (space)
+      func = space + 1;
+    /* Skip parameter list */
+    const char *paren = strchr (func, '(');
+    if (paren)
+      func_len = paren - func;
+    fprintf (stderr, "%.*s", func_len, func);
+  }
+}
+
+template <int max_level> static inline void
+_hb_debug_msg_va (const char *what,
+                  const void *obj,
+                  const char *func,
+                  bool indented,
+                  unsigned int level,
+                  int level_dir,
+                  const char *message,
+                  va_list ap) HB_PRINTF_FUNC(7, 0);
+template <int max_level> static inline void
+_hb_debug_msg_va (const char *what,
+                  const void *obj,
+                  const char *func,
+                  bool indented,
+                  unsigned int level,
+                  int level_dir,
+                  const char *message,
+                  va_list ap)
+{
+  if (!_hb_debug (level, max_level))
+    return;
+
+  fprintf (stderr, "%-10s", what ? what : "");
+
+  if (obj)
+    fprintf (stderr, "(%0*lx) ", (unsigned int) (2 * sizeof (void *)), (unsigned long) obj);
+  else
+    fprintf (stderr, " %*s  ", (unsigned int) (2 * sizeof (void *)), "");
+
+  if (indented) {
+#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
+      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) - 1, (unsigned int) (sizeof (VBAR) - 1) * level),
+             level_dir ? (level_dir > 0 ? DLBAR : ULBAR) : LBAR);
+  } else
+    fprintf (stderr, "   " VRBAR LBAR);
+
+  _hb_print_func (func);
+
+  if (message)
+  {
+    fprintf (stderr, ": ");
+    vfprintf (stderr, message, ap);
+  }
+
+  fprintf (stderr, "\n");
+}
+template <> inline void
+_hb_debug_msg_va<0> (const char *what HB_UNUSED,
+                     const void *obj HB_UNUSED,
+                     const char *func HB_UNUSED,
+                     bool indented HB_UNUSED,
+                     unsigned int level HB_UNUSED,
+                     int level_dir HB_UNUSED,
+                     const char *message HB_UNUSED,
+                     va_list ap HB_UNUSED) {}
+
+template <int max_level> static inline void
+_hb_debug_msg (const char *what,
+               const void *obj,
+               const char *func,
+               bool indented,
+               unsigned int level,
+               int level_dir,
+               const char *message,
+               ...) HB_PRINTF_FUNC(7, 8);
+template <int max_level> static inline void
+_hb_debug_msg (const char *what,
+               const void *obj,
+               const char *func,
+               bool indented,
+               unsigned int level,
+               int level_dir,
+               const char *message,
+               ...)
+{
+  va_list ap;
+  va_start (ap, message);
+  _hb_debug_msg_va<max_level> (what, obj, func, indented, level, level_dir, message, ap);
+  va_end (ap);
+}
+template <> inline void
+_hb_debug_msg<0> (const char *what HB_UNUSED,
+                  const void *obj HB_UNUSED,
+                  const char *func HB_UNUSED,
+                  bool indented HB_UNUSED,
+                  unsigned int level HB_UNUSED,
+                  int level_dir HB_UNUSED,
+                  const char *message HB_UNUSED,
+                  ...) HB_PRINTF_FUNC(7, 8);
+template <> inline void
+_hb_debug_msg<0> (const char *what HB_UNUSED,
+                  const void *obj HB_UNUSED,
+                  const char *func HB_UNUSED,
+                  bool indented HB_UNUSED,
+                  unsigned int level HB_UNUSED,
+                  int level_dir HB_UNUSED,
+                  const char *message HB_UNUSED,
+                  ...) {}
+
+#define DEBUG_MSG_LEVEL(WHAT, OBJ, LEVEL, LEVEL_DIR, ...)       _hb_debug_msg<HB_DEBUG_##WHAT> (#WHAT, (OBJ), nullptr,    true, (LEVEL), (LEVEL_DIR), __VA_ARGS__)
+#define DEBUG_MSG(WHAT, OBJ, ...)                               _hb_debug_msg<HB_DEBUG_##WHAT> (#WHAT, (OBJ), nullptr,    false, 0, 0, __VA_ARGS__)
+#define DEBUG_MSG_FUNC(WHAT, OBJ, ...)                          _hb_debug_msg<HB_DEBUG_##WHAT> (#WHAT, (OBJ), HB_FUNC, false, 0, 0, __VA_ARGS__)
+
+
+/*
+ * Printer
+ */
+
+template <typename T>
+struct hb_printer_t {
+  const char *print (const T&) { return "something"; }
+};
+
+template <>
+struct hb_printer_t<bool> {
+  const char *print (bool v) { return v ? "true" : "false"; }
+};
+
+template <>
+struct hb_printer_t<hb_void_t> {
+  const char *print (hb_void_t) { return ""; }
+};
+
+
+/*
+ * Trace
+ */
+
+template <typename T>
+static inline void _hb_warn_no_return (bool returned)
+{
+  if (unlikely (!returned)) {
+    fprintf (stderr, "OUCH, returned with no call to return_trace().  This is a bug, please report.\n");
+  }
+}
+template <>
+/*static*/ inline void _hb_warn_no_return<hb_void_t> (bool returned HB_UNUSED)
+{}
+
+template <int max_level, typename ret_t>
+struct hb_auto_trace_t {
+  explicit inline hb_auto_trace_t (unsigned int *plevel_,
+                                   const char *what_,
+                                   const void *obj_,
+                                   const char *func,
+                                   const char *message,
+                                   ...) : plevel (plevel_), what (what_), obj (obj_), returned (false)
+  {
+    if (plevel) ++*plevel;
+
+    va_list ap;
+    va_start (ap, message);
+    _hb_debug_msg_va<max_level> (what, obj, func, true, plevel ? *plevel : 0, +1, message, ap);
+    va_end (ap);
+  }
+  inline ~hb_auto_trace_t (void)
+  {
+    _hb_warn_no_return<ret_t> (returned);
+    if (!returned) {
+      _hb_debug_msg<max_level> (what, obj, nullptr, true, plevel ? *plevel : 1, -1, " ");
+    }
+    if (plevel) --*plevel;
+  }
+
+  inline ret_t ret (ret_t v, unsigned int line = 0)
+  {
+    if (unlikely (returned)) {
+      fprintf (stderr, "OUCH, double calls to return_trace().  This is a bug, please report.\n");
+      return v;
+    }
+
+    _hb_debug_msg<max_level> (what, obj, nullptr, true, plevel ? *plevel : 1, -1,
+                              "return %s (line %d)",
+                              hb_printer_t<ret_t>().print (v), line);
+    if (plevel) --*plevel;
+    plevel = nullptr;
+    returned = true;
+    return v;
+  }
+
+  private:
+  unsigned int *plevel;
+  const char *what;
+  const void *obj;
+  bool returned;
+};
+template <typename ret_t> /* Make sure we don't use hb_auto_trace_t when not tracing. */
+struct hb_auto_trace_t<0, ret_t>;
+
+/* For disabled tracing; optimize out everything.
+ * https://github.com/behdad/harfbuzz/pull/605 */
+template <typename ret_t>
+struct hb_no_trace_t {
+  inline ret_t ret (ret_t v, unsigned int line HB_UNUSED = 0) { return v; }
+};
+
+#define return_trace(RET) return trace.ret (RET, __LINE__)
+
+
+/*
+ * Instances.
+ */
+
+#ifndef HB_DEBUG_ARABIC
+#define HB_DEBUG_ARABIC (HB_DEBUG+0)
+#endif
+
+#ifndef HB_DEBUG_BLOB
+#define HB_DEBUG_BLOB (HB_DEBUG+0)
+#endif
+
+#ifndef HB_DEBUG_CORETEXT
+#define HB_DEBUG_CORETEXT (HB_DEBUG+0)
+#endif
+
+#ifndef HB_DEBUG_DIRECTWRITE
+#define HB_DEBUG_DIRECTWRITE (HB_DEBUG+0)
+#endif
+
+#ifndef HB_DEBUG_FT
+#define HB_DEBUG_FT (HB_DEBUG+0)
+#endif
+
+#ifndef HB_DEBUG_GET_COVERAGE
+#define HB_DEBUG_GET_COVERAGE (HB_DEBUG+0)
+#endif
+
+#ifndef HB_DEBUG_OBJECT
+#define HB_DEBUG_OBJECT (HB_DEBUG+0)
+#endif
+
+#ifndef HB_DEBUG_SHAPE_PLAN
+#define HB_DEBUG_SHAPE_PLAN (HB_DEBUG+0)
+#endif
+
+#ifndef HB_DEBUG_UNISCRIBE
+#define HB_DEBUG_UNISCRIBE (HB_DEBUG+0)
+#endif
+
+/*
+ * With tracing.
+ */
+
+#ifndef HB_DEBUG_APPLY
+#define HB_DEBUG_APPLY (HB_DEBUG+0)
+#endif
+#if HB_DEBUG_APPLY
+#define TRACE_APPLY(this) \
+        hb_auto_trace_t<HB_DEBUG_APPLY, bool> trace \
+        (&c->debug_depth, c->get_name (), this, HB_FUNC, \
+         "idx %d gid %u lookup %d", \
+         c->buffer->idx, c->buffer->cur().codepoint, (int) c->lookup_index)
+#else
+#define TRACE_APPLY(this) hb_no_trace_t<bool> trace
+#endif
+
+#ifndef HB_DEBUG_CLOSURE
+#define HB_DEBUG_CLOSURE (HB_DEBUG+0)
+#endif
+#if HB_DEBUG_CLOSURE
+#define TRACE_CLOSURE(this) \
+        hb_auto_trace_t<HB_DEBUG_CLOSURE, hb_void_t> trace \
+        (&c->debug_depth, c->get_name (), this, HB_FUNC, \
+         "")
+#else
+#define TRACE_CLOSURE(this) hb_no_trace_t<hb_void_t> trace HB_UNUSED
+#endif
+
+#ifndef HB_DEBUG_COLLECT_GLYPHS
+#define HB_DEBUG_COLLECT_GLYPHS (HB_DEBUG+0)
+#endif
+#if HB_DEBUG_COLLECT_GLYPHS
+#define TRACE_COLLECT_GLYPHS(this) \
+        hb_auto_trace_t<HB_DEBUG_COLLECT_GLYPHS, hb_void_t> trace \
+        (&c->debug_depth, c->get_name (), this, HB_FUNC, \
+         "")
+#else
+#define TRACE_COLLECT_GLYPHS(this) hb_no_trace_t<hb_void_t> trace HB_UNUSED
+#endif
+
+#ifndef HB_DEBUG_SANITIZE
+#define HB_DEBUG_SANITIZE (HB_DEBUG+0)
+#endif
+#if HB_DEBUG_SANITIZE
+#define TRACE_SANITIZE(this) \
+        hb_auto_trace_t<HB_DEBUG_SANITIZE, bool> trace \
+        (&c->debug_depth, c->get_name (), this, HB_FUNC, \
+         "");
+#else
+#define TRACE_SANITIZE(this) hb_no_trace_t<bool> trace
+#endif
+
+#ifndef HB_DEBUG_SERIALIZE
+#define HB_DEBUG_SERIALIZE (HB_DEBUG+0)
+#endif
+#if HB_DEBUG_SERIALIZE
+#define TRACE_SERIALIZE(this) \
+        hb_auto_trace_t<HB_DEBUG_SERIALIZE, bool> trace \
+        (&c->debug_depth, "SERIALIZE", c, HB_FUNC, \
+         "");
+#else
+#define TRACE_SERIALIZE(this) hb_no_trace_t<bool> trace
+#endif
+
+#ifndef HB_DEBUG_WOULD_APPLY
+#define HB_DEBUG_WOULD_APPLY (HB_DEBUG+0)
+#endif
+#if HB_DEBUG_WOULD_APPLY
+#define TRACE_WOULD_APPLY(this) \
+        hb_auto_trace_t<HB_DEBUG_WOULD_APPLY, bool> trace \
+        (&c->debug_depth, c->get_name (), this, HB_FUNC, \
+         "%d glyphs", c->len);
+#else
+#define TRACE_WOULD_APPLY(this) hb_no_trace_t<bool> trace
+#endif
+
+#ifndef HB_DEBUG_DISPATCH
+#define HB_DEBUG_DISPATCH ( \
+        HB_DEBUG_APPLY + \
+        HB_DEBUG_CLOSURE + \
+        HB_DEBUG_COLLECT_GLYPHS + \
+        HB_DEBUG_SANITIZE + \
+        HB_DEBUG_SERIALIZE + \
+        HB_DEBUG_WOULD_APPLY + \
+        0)
+#endif
+#if HB_DEBUG_DISPATCH
+#define TRACE_DISPATCH(this, format) \
+        hb_auto_trace_t<context_t::max_debug_depth, typename context_t::return_t> trace \
+        (&c->debug_depth, c->get_name (), this, HB_FUNC, \
+         "format %d", (int) format);
+#else
+#define TRACE_DISPATCH(this, format) hb_no_trace_t<typename context_t::return_t> trace
+#endif
+
+
+#endif /* HB_DEBUG_HH */
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-deprecated.h	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-deprecated.h	Wed Dec 13 10:25:38 2017 -0800
@@ -34,6 +34,7 @@
 #include "hb-common.h"
 #include "hb-unicode.h"
 #include "hb-font.h"
+#include "hb-set.h"
 
 HB_BEGIN_DECLS
 
@@ -54,6 +55,9 @@
                               hb_font_get_glyph_func_t func,
                               void *user_data, hb_destroy_func_t destroy);
 
+HB_EXTERN void
+hb_set_invert (hb_set_t *set);
+
 #endif
 
 HB_END_DECLS
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-dsalgs.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,165 @@
+/*
+ * Copyright © 2017  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): Behdad Esfahbod
+ */
+
+#ifndef HB_DSALGS_HH
+#define HB_DSALGS_HH
+
+#include "hb-private.hh"
+
+
+static inline void *
+hb_bsearch_r (const void *key, const void *base,
+              size_t nmemb, size_t size,
+              int (*compar)(const void *_key, const void *_item, void *_arg),
+              void *arg)
+{
+  int min = 0, max = (int) nmemb - 1;
+  while (min <= max)
+  {
+    int mid = (min + max) / 2;
+    const void *p = (const void *) (((const char *) base) + (mid * size));
+    int c = compar (key, p, arg);
+    if (c < 0)
+      max = mid - 1;
+    else if (c > 0)
+      min = mid + 1;
+    else
+      return (void *) p;
+  }
+  return NULL;
+}
+
+
+
+/* From https://github.com/noporpoise/sort_r */
+
+/* Isaac Turner 29 April 2014 Public Domain */
+
+/*
+
+hb_sort_r function to be exported.
+
+Parameters:
+  base is the array to be sorted
+  nel is the number of elements in the array
+  width is the size in bytes of each element of the array
+  compar is the comparison function
+  arg is a pointer to be passed to the comparison function
+
+void hb_sort_r(void *base, size_t nel, size_t width,
+               int (*compar)(const void *_a, const void *_b, void *_arg),
+               void *arg);
+*/
+
+
+/* swap a, b iff a>b */
+#ifndef __SUNPRO_CC
+/* __restrict is same as restrict but better support on old machines */
+static int sort_r_cmpswap(char *__restrict a, char *__restrict b, size_t w,
+#else
+static int sort_r_cmpswap(char *a, char *b, size_t w,
+#endif
+                          int (*compar)(const void *_a, const void *_b,
+                                        void *_arg),
+                          void *arg)
+{
+  char tmp, *end = a+w;
+  if(compar(a, b, arg) > 0) {
+    for(; a < end; a++, b++) { tmp = *a; *a = *b; *b = tmp; }
+    return 1;
+  }
+  return 0;
+}
+
+/* Note: quicksort is not stable, equivalent values may be swapped */
+static inline void sort_r_simple(void *base, size_t nel, size_t w,
+                                 int (*compar)(const void *_a, const void *_b,
+                                               void *_arg),
+                                 void *arg)
+{
+  char *b = (char *)base, *end = b + nel*w;
+  if(nel < 7) {
+    /* Insertion sort for arbitrarily small inputs */
+    char *pi, *pj;
+    for(pi = b+w; pi < end; pi += w) {
+      for(pj = pi; pj > b && sort_r_cmpswap(pj-w,pj,w,compar,arg); pj -= w) {}
+    }
+  }
+  else
+  {
+    /* nel > 6; Quicksort */
+
+    /* Use median of first, middle and last items as pivot */
+    char *x, *y, *xend, ch;
+    char *pl, *pr;
+    char *last = b+w*(nel-1), *tmp;
+    char *l[3];
+    l[0] = b;
+    l[1] = b+w*(nel/2);
+    l[2] = last;
+
+    if(compar(l[0],l[1],arg) > 0) { tmp=l[0]; l[0]=l[1]; l[1]=tmp; }
+    if(compar(l[1],l[2],arg) > 0) {
+      tmp=l[1]; l[1]=l[2]; l[2]=tmp; /* swap(l[1],l[2]) */
+      if(compar(l[0],l[1],arg) > 0) { tmp=l[0]; l[0]=l[1]; l[1]=tmp; }
+    }
+
+    /* swap l[id], l[2] to put pivot as last element */
+    for(x = l[1], y = last, xend = x+w; x<xend; x++, y++) {
+      ch = *x; *x = *y; *y = ch;
+    }
+
+    pl = b;
+    pr = last;
+
+    while(pl < pr) {
+      for(; pl < pr; pl += w) {
+        if(sort_r_cmpswap(pl, pr, w, compar, arg)) {
+          pr -= w; /* pivot now at pl */
+          break;
+        }
+      }
+      for(; pl < pr; pr -= w) {
+        if(sort_r_cmpswap(pl, pr, w, compar, arg)) {
+          pl += w; /* pivot now at pr */
+          break;
+        }
+      }
+    }
+
+    sort_r_simple(b, (pl-b)/w, w, compar, arg);
+    sort_r_simple(pl+w, (end-(pl+w))/w, w, compar, arg);
+  }
+}
+
+static inline void hb_sort_r(void *base, size_t nel, size_t width,
+                             int (*compar)(const void *_a, const void *_b, void *_arg),
+                             void *arg)
+{
+    sort_r_simple(base, nel, width, compar, arg);
+}
+
+#endif /* HB_DSALGS_HH */
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-face-private.hh	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-face-private.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -50,12 +50,16 @@
   void                      *user_data;
   hb_destroy_func_t          destroy;
 
-  unsigned int index;
-  mutable unsigned int upem;
-  mutable unsigned int num_glyphs;
+  unsigned int index;                   /* Face index in a collection, zero-based. */
+  mutable unsigned int upem;            /* Units-per-EM. */
+  mutable unsigned int num_glyphs;      /* Number of glyphs. */
 
-  struct hb_shaper_data_t shaper_data;
+  struct hb_shaper_data_t shaper_data;  /* Various shaper data. */
 
+  /* Various non-shaping data. */
+  /* ... */
+
+  /* Cache */
   struct plan_node_t {
     hb_shape_plan_t *shape_plan;
     plan_node_t *next;
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-face.cc	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-face.cc	Wed Dec 13 10:25:38 2017 -0800
@@ -28,15 +28,11 @@
 
 #include "hb-private.hh"
 
-#include "hb-ot-layout-private.hh"
-
-#include "hb-font-private.hh"
+#include "hb-face-private.hh"
 #include "hb-open-file-private.hh"
 #include "hb-ot-head-table.hh"
 #include "hb-ot-maxp-table.hh"
 
-#include <string.h>
-
 
 /*
  * hb_face_t
@@ -47,9 +43,9 @@
 
   true, /* immutable */
 
-  NULL, /* reference_table_func */
-  NULL, /* user_data */
-  NULL, /* destroy */
+  nullptr, /* reference_table_func */
+  nullptr, /* user_data */
+  nullptr, /* destroy */
 
   0,    /* index */
   1000, /* upem */
@@ -61,17 +57,17 @@
 #undef HB_SHAPER_IMPLEMENT
   },
 
-  NULL, /* shape_plans */
+  nullptr, /* shape_plans */
 };
 
 
 /**
  * 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)
  *
@@ -113,7 +109,7 @@
 
   closure = (hb_face_for_data_closure_t *) calloc (1, sizeof (hb_face_for_data_closure_t));
   if (unlikely (!closure))
-    return NULL;
+    return nullptr;
 
   closure->blob = blob;
   closure->index = index;
@@ -121,12 +117,20 @@
   return closure;
 }
 
+#ifdef __SUNPRO_CC
+extern "C" {
+#endif
 static void
-_hb_face_for_data_closure_destroy (hb_face_for_data_closure_t *closure)
+_hb_face_for_data_closure_destroy (void *data)
 {
+  hb_face_for_data_closure_t *closure = (hb_face_for_data_closure_t *) data;
+
   hb_blob_destroy (closure->blob);
   free (closure);
 }
+#ifdef __SUNPRO_CC
+}
+#endif
 
 static hb_blob_t *
 _hb_face_for_data_reference_table (hb_face_t *face HB_UNUSED, hb_tag_t tag, void *user_data)
@@ -148,10 +152,10 @@
 
 /**
  * hb_face_create: (Xconstructor)
- * @blob: 
- * @index: 
+ * @blob:
+ * @index:
  *
- * 
+ *
  *
  * Return value: (transfer full):
  *
@@ -173,9 +177,9 @@
 
   face = hb_face_create_for_tables (_hb_face_for_data_reference_table,
                                     closure,
-                                    (hb_destroy_func_t) _hb_face_for_data_closure_destroy);
+                                    _hb_face_for_data_closure_destroy);
 
-  hb_face_set_index (face, index);
+  face->index = index;
 
   return face;
 }
@@ -183,7 +187,7 @@
 /**
  * hb_face_get_empty:
  *
- * 
+ *
  *
  * Return value: (transfer full)
  *
@@ -200,9 +204,9 @@
  * hb_face_reference: (skip)
  * @face: a face.
  *
- * 
+ *
  *
- * Return value: 
+ * Return value:
  *
  * Since: 0.9.2
  **/
@@ -216,7 +220,7 @@
  * hb_face_destroy: (skip)
  * @face: a face.
  *
- * 
+ *
  *
  * Since: 0.9.2
  **/
@@ -246,14 +250,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
  **/
@@ -270,9 +274,9 @@
 /**
  * hb_face_get_user_data: (skip)
  * @face: a face.
- * @key: 
+ * @key:
  *
- * 
+ *
  *
  * Return value: (transfer none):
  *
@@ -289,7 +293,7 @@
  * hb_face_make_immutable:
  * @face: a face.
  *
- * 
+ *
  *
  * Since: 0.9.2
  **/
@@ -306,9 +310,9 @@
  * hb_face_is_immutable:
  * @face: a face.
  *
- * 
+ *
  *
- * Return value: 
+ * Return value:
  *
  * Since: 0.9.2
  **/
@@ -322,9 +326,9 @@
 /**
  * hb_face_reference_table:
  * @face: a face.
- * @tag: 
+ * @tag:
  *
- * 
+ *
  *
  * Return value: (transfer full):
  *
@@ -341,7 +345,7 @@
  * hb_face_reference_blob:
  * @face: a face.
  *
- * 
+ *
  *
  * Return value: (transfer full):
  *
@@ -356,9 +360,9 @@
 /**
  * hb_face_set_index:
  * @face: a face.
- * @index: 
+ * @index:
  *
- * 
+ *
  *
  * Since: 0.9.2
  **/
@@ -376,9 +380,9 @@
  * hb_face_get_index:
  * @face: a face.
  *
- * 
+ *
  *
- * Return value: 
+ * Return value:
  *
  * Since: 0.9.2
  **/
@@ -391,9 +395,9 @@
 /**
  * hb_face_set_upem:
  * @face: a face.
- * @upem: 
+ * @upem:
  *
- * 
+ *
  *
  * Since: 0.9.2
  **/
@@ -411,9 +415,9 @@
  * hb_face_get_upem:
  * @face: a face.
  *
- * 
+ *
  *
- * Return value: 
+ * Return value:
  *
  * Since: 0.9.2
  **/
@@ -435,9 +439,9 @@
 /**
  * hb_face_set_glyph_count:
  * @face: a face.
- * @glyph_count: 
+ * @glyph_count:
  *
- * 
+ *
  *
  * Since: 0.9.7
  **/
@@ -455,9 +459,9 @@
  * hb_face_get_glyph_count:
  * @face: a face.
  *
- * 
+ *
  *
- * Return value: 
+ * Return value:
  *
  * Since: 0.9.7
  **/
@@ -476,4 +480,33 @@
   hb_blob_destroy (maxp_blob);
 }
 
+/**
+ * hb_face_get_table_tags:
+ * @face: a face.
+ *
+ * Retrieves table tags for a face, if possible.
+ *
+ * Return value: total number of tables, or 0 if not possible to list.
+ *
+ * Since: 1.6.0
+ **/
+unsigned int
+hb_face_get_table_tags (hb_face_t    *face,
+                        unsigned int  start_offset,
+                        unsigned int *table_count, /* IN/OUT */
+                        hb_tag_t     *table_tags /* OUT */)
+{
+  if (face->destroy != _hb_face_for_data_closure_destroy)
+  {
+    if (table_count)
+      *table_count = 0;
+    return 0;
+  }
 
+  hb_face_for_data_closure_t *data = (hb_face_for_data_closure_t *) face->user_data;
+
+  const OT::OpenTypeFontFile &ot_file = *OT::Sanitizer<OT::OpenTypeFontFile>::lock_instance (data->blob);
+  const OT::OpenTypeFontFace &ot_face = ot_file.get_face (data->index);
+
+  return ot_face.get_table_tags (start_offset, table_count, table_tags);
+}
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-face.h	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-face.h	Wed Dec 13 10:25:38 2017 -0800
@@ -111,6 +111,11 @@
 HB_EXTERN unsigned int
 hb_face_get_glyph_count (hb_face_t *face);
 
+HB_EXTERN unsigned int
+hb_face_get_table_tags (hb_face_t    *face,
+                        unsigned int  start_offset,
+                        unsigned int *table_count, /* IN/OUT */
+                        hb_tag_t     *table_tags /* OUT */);
 
 HB_END_DECLS
 
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-fallback-shape.cc	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-fallback-shape.cc	Wed Dec 13 10:25:38 2017 -0800
@@ -28,6 +28,10 @@
 #include "hb-shaper-impl-private.hh"
 
 
+HB_SHAPER_DATA_ENSURE_DEFINE(fallback, face)
+HB_SHAPER_DATA_ENSURE_DEFINE(fallback, font)
+
+
 /*
  * shaper face data
  */
@@ -125,7 +129,7 @@
       pos[i].y_advance = 0;
       continue;
     }
-    font->get_nominal_glyph (info[i].codepoint, &info[i].codepoint);
+    (void) font->get_nominal_glyph (info[i].codepoint, &info[i].codepoint);
     font->get_glyph_advance_for_direction (info[i].codepoint,
                                            direction,
                                            &pos[i].x_advance,
@@ -139,5 +143,7 @@
   if (HB_DIRECTION_IS_BACKWARD (direction))
     hb_buffer_reverse (buffer);
 
+  buffer->safe_to_break_all ();
+
   return true;
 }
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-font-private.hh	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-font-private.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -108,6 +108,8 @@
   unsigned int x_ppem;
   unsigned int y_ppem;
 
+  float ptem;
+
   /* Font variation coordinates. */
   unsigned int num_coords;
   int *coords;
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-font.cc	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-font.cc	Wed Dec 13 10:25:38 2017 -0800
@@ -28,14 +28,7 @@
 
 #include "hb-private.hh"
 
-#include "hb-ot-layout-private.hh"
-
 #include "hb-font-private.hh"
-#include "hb-open-file-private.hh"
-#include "hb-ot-head-table.hh"
-#include "hb-ot-maxp-table.hh"
-
-#include <string.h>
 
 
 /*
@@ -43,7 +36,7 @@
  */
 
 static hb_bool_t
-hb_font_get_font_h_extents_nil (hb_font_t *font,
+hb_font_get_font_h_extents_nil (hb_font_t *font HB_UNUSED,
                                 void *font_data HB_UNUSED,
                                 hb_font_extents_t *metrics,
                                 void *user_data HB_UNUSED)
@@ -67,7 +60,7 @@
 }
 
 static hb_bool_t
-hb_font_get_font_v_extents_nil (hb_font_t *font,
+hb_font_get_font_v_extents_nil (hb_font_t *font HB_UNUSED,
                                 void *font_data HB_UNUSED,
                                 hb_font_extents_t *metrics,
                                 void *user_data HB_UNUSED)
@@ -354,12 +347,12 @@
   true, /* immutable */
 
   {
-#define HB_FONT_FUNC_IMPLEMENT(name) NULL,
+#define HB_FONT_FUNC_IMPLEMENT(name) nullptr,
     HB_FONT_FUNCS_IMPLEMENT_CALLBACKS
 #undef HB_FONT_FUNC_IMPLEMENT
   },
   {
-#define HB_FONT_FUNC_IMPLEMENT(name) NULL,
+#define HB_FONT_FUNC_IMPLEMENT(name) nullptr,
     HB_FONT_FUNCS_IMPLEMENT_CALLBACKS
 #undef HB_FONT_FUNC_IMPLEMENT
   },
@@ -377,12 +370,12 @@
   true, /* immutable */
 
   {
-#define HB_FONT_FUNC_IMPLEMENT(name) NULL,
+#define HB_FONT_FUNC_IMPLEMENT(name) nullptr,
     HB_FONT_FUNCS_IMPLEMENT_CALLBACKS
 #undef HB_FONT_FUNC_IMPLEMENT
   },
   {
-#define HB_FONT_FUNC_IMPLEMENT(name) NULL,
+#define HB_FONT_FUNC_IMPLEMENT(name) nullptr,
     HB_FONT_FUNCS_IMPLEMENT_CALLBACKS
 #undef HB_FONT_FUNC_IMPLEMENT
   },
@@ -399,9 +392,9 @@
 /**
  * hb_font_funcs_create: (Xconstructor)
  *
- * 
+ *
  *
- * Return value: (transfer full): 
+ * Return value: (transfer full):
  *
  * Since: 0.9.2
  **/
@@ -421,9 +414,9 @@
 /**
  * hb_font_funcs_get_empty:
  *
- * 
+ *
  *
- * Return value: (transfer full): 
+ * Return value: (transfer full):
  *
  * Since: 0.9.2
  **/
@@ -437,9 +430,9 @@
  * hb_font_funcs_reference: (skip)
  * @ffuncs: font functions.
  *
- * 
+ *
  *
- * Return value: 
+ * Return value:
  *
  * Since: 0.9.2
  **/
@@ -453,7 +446,7 @@
  * hb_font_funcs_destroy: (skip)
  * @ffuncs: font functions.
  *
- * 
+ *
  *
  * Since: 0.9.2
  **/
@@ -473,14 +466,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
  **/
@@ -497,11 +490,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
  **/
@@ -517,7 +510,7 @@
  * hb_font_funcs_make_immutable:
  * @ffuncs: font functions.
  *
- * 
+ *
  *
  * Since: 0.9.2
  **/
@@ -534,9 +527,9 @@
  * hb_font_funcs_is_immutable:
  * @ffuncs: font functions.
  *
- * 
+ *
  *
- * Return value: 
+ * Return value:
  *
  * Since: 0.9.2
  **/
@@ -570,8 +563,8 @@
     ffuncs->destroy.name = destroy;                                      \
   } else {                                                               \
     ffuncs->get.f.name = hb_font_get_##name##_parent;                    \
-    ffuncs->user_data.name = NULL;                                       \
-    ffuncs->destroy.name = NULL;                                         \
+    ffuncs->user_data.name = nullptr;                                       \
+    ffuncs->destroy.name = nullptr;                                         \
   }                                                                      \
 }
 
@@ -627,13 +620,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
  **/
@@ -650,12 +643,12 @@
 /**
  * hb_font_get_nominal_glyph:
  * @font: a font.
- * @unicode: 
- * @glyph: (out): 
+ * @unicode:
+ * @glyph: (out):
  *
- * 
+ *
  *
- * Return value: 
+ * Return value:
  *
  * Since: 1.2.3
  **/
@@ -670,13 +663,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
  **/
@@ -691,11 +684,11 @@
 /**
  * hb_font_get_glyph_h_advance:
  * @font: a font.
- * @glyph: 
+ * @glyph:
+ *
  *
- * 
  *
- * Return value: 
+ * Return value:
  *
  * Since: 0.9.2
  **/
@@ -709,11 +702,11 @@
 /**
  * hb_font_get_glyph_v_advance:
  * @font: a font.
- * @glyph: 
+ * @glyph:
+ *
  *
- * 
  *
- * Return value: 
+ * Return value:
  *
  * Since: 0.9.2
  **/
@@ -727,13 +720,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
  **/
@@ -748,13 +741,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
  **/
@@ -769,12 +762,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
  **/
@@ -788,12 +781,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
  **/
@@ -807,12 +800,12 @@
 /**
  * hb_font_get_glyph_extents:
  * @font: a font.
- * @glyph: 
- * @extents: (out): 
+ * @glyph:
+ * @extents: (out):
  *
- * 
+ *
  *
- * Return value: 
+ * Return value:
  *
  * Since: 0.9.2
  **/
@@ -827,14 +820,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
  **/
@@ -849,13 +842,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
  **/
@@ -870,13 +863,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
  **/
@@ -911,12 +904,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
  **/
@@ -932,12 +925,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
  **/
@@ -953,12 +946,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
  **/
@@ -974,12 +967,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
  **/
@@ -995,13 +988,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
  **/
@@ -1017,13 +1010,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
  **/
@@ -1039,15 +1032,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
  **/
@@ -1064,11 +1057,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
  **/
@@ -1084,13 +1077,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
  **/
@@ -1111,9 +1104,9 @@
  * hb_font_create: (Xconstructor)
  * @face: a face.
  *
- * 
+ *
  *
- * Return value: (transfer full): 
+ * Return value: (transfer full):
  *
  * Since: 0.9.2
  **/
@@ -1141,9 +1134,9 @@
  * hb_font_create_sub_font:
  * @parent: parent font.
  *
- * 
+ *
  *
- * Return value: (transfer full): 
+ * Return value: (transfer full):
  *
  * Since: 0.9.2
  **/
@@ -1164,8 +1157,20 @@
   font->y_scale = parent->y_scale;
   font->x_ppem = parent->x_ppem;
   font->y_ppem = parent->y_ppem;
+  font->ptem = parent->ptem;
 
-  /* TODO: copy variation coordinates. */
+  font->num_coords = parent->num_coords;
+  if (!font->num_coords)
+    font->coords = nullptr;
+  else
+  {
+    unsigned int size = parent->num_coords * sizeof (parent->coords[0]);
+    font->coords = (int *) malloc (size);
+    if (unlikely (!font->coords))
+      font->num_coords = 0;
+    else
+      memcpy (font->coords, parent->coords, size);
+  }
 
   return font;
 }
@@ -1173,7 +1178,7 @@
 /**
  * hb_font_get_empty:
  *
- * 
+ *
  *
  * Return value: (transfer full)
  *
@@ -1187,7 +1192,7 @@
 
     true, /* immutable */
 
-    NULL, /* parent */
+    nullptr, /* parent */
     const_cast<hb_face_t *> (&_hb_face_nil),
 
     1000, /* x_scale */
@@ -1195,13 +1200,14 @@
 
     0, /* x_ppem */
     0, /* y_ppem */
+    0, /* ptem */
 
     0, /* num_coords */
-    NULL, /* coords */
+    nullptr, /* coords */
 
     const_cast<hb_font_funcs_t *> (&_hb_font_funcs_nil), /* klass */
-    NULL, /* user_data */
-    NULL, /* destroy */
+    nullptr, /* user_data */
+    nullptr, /* destroy */
 
     {
 #define HB_SHAPER_IMPLEMENT(shaper) HB_SHAPER_DATA_INVALID,
@@ -1217,9 +1223,9 @@
  * hb_font_reference: (skip)
  * @font: a font.
  *
- * 
+ *
  *
- * Return value: (transfer full): 
+ * Return value: (transfer full):
  *
  * Since: 0.9.2
  **/
@@ -1233,7 +1239,7 @@
  * hb_font_destroy: (skip)
  * @font: a font.
  *
- * 
+ *
  *
  * Since: 0.9.2
  **/
@@ -1261,14 +1267,14 @@
 /**
  * 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
  **/
@@ -1285,11 +1291,11 @@
 /**
  * hb_font_get_user_data: (skip)
  * @font: a font.
- * @key: 
+ * @key:
+ *
  *
- * 
  *
- * Return value: (transfer none): 
+ * Return value: (transfer none):
  *
  * Since: 0.9.2
  **/
@@ -1304,7 +1310,7 @@
  * hb_font_make_immutable:
  * @font: a font.
  *
- * 
+ *
  *
  * Since: 0.9.2
  **/
@@ -1324,9 +1330,9 @@
  * hb_font_is_immutable:
  * @font: a font.
  *
- * 
+ *
  *
- * Return value: 
+ * Return value:
  *
  * Since: 0.9.2
  **/
@@ -1366,9 +1372,9 @@
  * hb_font_get_parent:
  * @font: a font.
  *
- * 
+ *
  *
- * Return value: (transfer none): 
+ * Return value: (transfer none):
  *
  * Since: 0.9.2
  **/
@@ -1379,12 +1385,38 @@
 }
 
 /**
+ * hb_font_set_face:
+ * @font: a font.
+ * @face: new face.
+ *
+ * Sets font-face of @font.
+ *
+ * Since: 1.4.3
+ **/
+void
+hb_font_set_face (hb_font_t *font,
+                  hb_face_t *face)
+{
+  if (font->immutable)
+    return;
+
+  if (unlikely (!face))
+    face = hb_face_get_empty ();
+
+  hb_face_t *old = font->face;
+
+  font->face = hb_face_reference (face);
+
+  hb_face_destroy (old);
+}
+
+/**
  * hb_font_get_face:
  * @font: a font.
  *
- * 
+ *
  *
- * Return value: (transfer none): 
+ * Return value: (transfer none):
  *
  * Since: 0.9.2
  **/
@@ -1399,10 +1431,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
  **/
@@ -1435,9 +1467,9 @@
  * hb_font_set_funcs_data:
  * @font: a font.
  * @font_data: (destroy destroy) (scope notified):
- * @destroy: 
+ * @destroy:
  *
- * 
+ *
  *
  * Since: 0.9.2
  **/
@@ -1464,10 +1496,10 @@
 /**
  * hb_font_set_scale:
  * @font: a font.
- * @x_scale: 
- * @y_scale: 
+ * @x_scale:
+ * @y_scale:
  *
- * 
+ *
  *
  * Since: 0.9.2
  **/
@@ -1486,10 +1518,10 @@
 /**
  * hb_font_get_scale:
  * @font: a font.
- * @x_scale: (out): 
- * @y_scale: (out): 
+ * @x_scale: (out):
+ * @y_scale: (out):
  *
- * 
+ *
  *
  * Since: 0.9.2
  **/
@@ -1505,10 +1537,10 @@
 /**
  * hb_font_set_ppem:
  * @font: a font.
- * @x_ppem: 
- * @y_ppem: 
+ * @x_ppem:
+ * @y_ppem:
  *
- * 
+ *
  *
  * Since: 0.9.2
  **/
@@ -1527,10 +1559,10 @@
 /**
  * hb_font_get_ppem:
  * @font: a font.
- * @x_ppem: (out): 
- * @y_ppem: (out): 
+ * @x_ppem: (out):
+ * @y_ppem: (out):
  *
- * 
+ *
  *
  * Since: 0.9.2
  **/
@@ -1543,30 +1575,146 @@
   if (y_ppem) *y_ppem = font->y_ppem;
 }
 
+/**
+ * hb_font_set_ptem:
+ * @font: a font.
+ * @ptem:
+ *
+ * Sets "point size" of the font.
+ *
+ * Since: 1.6.0
+ **/
+void
+hb_font_set_ptem (hb_font_t *font, float ptem)
+{
+  if (font->immutable)
+    return;
 
+  font->ptem = ptem;
+}
+
+/**
+ * hb_font_get_ptem:
+ * @font: a font.
+ *
+ * Gets the "point size" of the font.  A value of 0 means unset.
+ *
+ * Return value: Point size.
+ *
+ * Since: 0.9.2
+ **/
+float
+hb_font_get_ptem (hb_font_t *font)
+{
+  return font->ptem;
+}
+
+/*
+ * Variations
+ */
+
+static void
+_hb_font_adopt_var_coords_normalized (hb_font_t *font,
+                                      int *coords, /* 2.14 normalized */
+                                      unsigned int coords_length)
+{
+  free (font->coords);
+
+  font->coords = coords;
+  font->num_coords = coords_length;
+}
+
+/**
+ * hb_font_set_variations:
+ *
+ * Since: 1.4.2
+ */
+void
+hb_font_set_variations (hb_font_t *font,
+                        const hb_variation_t *variations,
+                        unsigned int variations_length)
+{
+  if (font->immutable)
+    return;
+
+  if (!variations_length)
+  {
+    hb_font_set_var_coords_normalized (font, nullptr, 0);
+    return;
+  }
+
+  unsigned int coords_length = hb_ot_var_get_axis_count (font->face);
+
+  int *normalized = coords_length ? (int *) calloc (coords_length, sizeof (int)) : nullptr;
+  if (unlikely (coords_length && !normalized))
+    return;
+
+  hb_ot_var_normalize_variations (font->face,
+                                  variations, variations_length,
+                                  normalized, coords_length);
+  _hb_font_adopt_var_coords_normalized (font, normalized, coords_length);
+}
+
+/**
+ * hb_font_set_var_coords_design:
+ *
+ * Since: 1.4.2
+ */
+void
+hb_font_set_var_coords_design (hb_font_t *font,
+                               const float *coords,
+                               unsigned int coords_length)
+{
+  if (font->immutable)
+    return;
+
+  int *normalized = coords_length ? (int *) calloc (coords_length, sizeof (int)) : nullptr;
+  if (unlikely (coords_length && !normalized))
+    return;
+
+  hb_ot_var_normalize_coords (font->face, coords_length, coords, normalized);
+  _hb_font_adopt_var_coords_normalized (font, normalized, coords_length);
+}
+
+/**
+ * hb_font_set_var_coords_normalized:
+ *
+ * Since: 1.4.2
+ */
 void
 hb_font_set_var_coords_normalized (hb_font_t *font,
-                                   int *coords, /* XXX 2.14 normalized */
+                                   const int *coords, /* 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;
+  int *copy = coords_length ? (int *) calloc (coords_length, sizeof (coords[0])) : nullptr;
   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;
+  _hb_font_adopt_var_coords_normalized (font, copy, coords_length);
+}
+
+/**
+ * hb_font_get_var_coords_normalized:
+ *
+ * Return value is valid as long as variation coordinates of the font
+ * are not modified.
+ *
+ * Since: 1.4.2
+ */
+const int *
+hb_font_get_var_coords_normalized (hb_font_t *font,
+                                   unsigned int *length)
+{
+  if (length)
+    *length = font->num_coords;
+
+  return font->coords;
 }
 
 
@@ -1601,7 +1749,7 @@
   trampoline_t *trampoline = (trampoline_t *) calloc (1, sizeof (trampoline_t));
 
   if (unlikely (!trampoline))
-    return NULL;
+    return nullptr;
 
   trampoline->closure.user_data = user_data;
   trampoline->closure.destroy = destroy;
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-font.h	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-font.h	Wed Dec 13 10:25:38 2017 -0800
@@ -563,6 +563,10 @@
 HB_EXTERN hb_font_t *
 hb_font_get_parent (hb_font_t *font);
 
+HB_EXTERN void
+hb_font_set_face (hb_font_t *font,
+                  hb_face_t *face);
+
 HB_EXTERN hb_face_t *
 hb_font_get_face (hb_font_t *font);
 
@@ -603,12 +607,35 @@
                   unsigned int *x_ppem,
                   unsigned int *y_ppem);
 
+/*
+ * Point size per EM.  Used for optical-sizing in CoreText.
+ * A value of zero means "not set".
+ */
+HB_EXTERN void
+hb_font_set_ptem (hb_font_t *font, float ptem);
+
+HB_EXTERN float
+hb_font_get_ptem (hb_font_t *font);
+
+HB_EXTERN void
+hb_font_set_variations (hb_font_t *font,
+                        const hb_variation_t *variations,
+                        unsigned int variations_length);
+
+HB_EXTERN void
+hb_font_set_var_coords_design (hb_font_t *font,
+                               const float *coords,
+                               unsigned int coords_length);
 
 HB_EXTERN void
 hb_font_set_var_coords_normalized (hb_font_t *font,
-                                   int *coords, /* XXX 2.14 normalized */
+                                   const int *coords, /* 2.14 normalized */
                                    unsigned int coords_length);
 
+HB_EXTERN const int *
+hb_font_get_var_coords_normalized (hb_font_t *font,
+                                   unsigned int *length);
+
 HB_END_DECLS
 
 #endif /* HB_FONT_H */
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ft.cc	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ft.cc	Wed Dec 13 10:25:38 2017 -0800
@@ -28,24 +28,17 @@
  */
 
 #include "hb-private.hh"
+#include "hb-debug.hh"
 
 #include "hb-ft.h"
 
 #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
 
 
-
-#ifndef HB_DEBUG_FT
-#define HB_DEBUG_FT (HB_DEBUG+0)
-#endif
-
-
 /* TODO:
  *
  * In general, this file does a fine job of what it's supposed to do.
@@ -83,7 +76,7 @@
   hb_ft_font_t *ft_font = (hb_ft_font_t *) calloc (1, sizeof (hb_ft_font_t));
 
   if (unlikely (!ft_font))
-    return NULL;
+    return nullptr;
 
   ft_font->ft_face = ft_face;
   ft_font->symbol = symbol;
@@ -95,14 +88,16 @@
 }
 
 static void
-_hb_ft_face_destroy (FT_Face ft_face)
+_hb_ft_face_destroy (void *data)
 {
-  FT_Done_Face (ft_face);
+  FT_Done_Face ((FT_Face) data);
 }
 
 static void
-_hb_ft_font_destroy (hb_ft_font_t *ft_font)
+_hb_ft_font_destroy (void *data)
 {
+  hb_ft_font_t *ft_font = (hb_ft_font_t *) data;
+
   if (ft_font->unref)
     _hb_ft_face_destroy (ft_font->ft_face);
 
@@ -114,7 +109,7 @@
  * @font:
  * @load_flags:
  *
- * 
+ *
  *
  * Since: 1.0.5
  **/
@@ -124,7 +119,7 @@
   if (font->immutable)
     return;
 
-  if (font->destroy != (hb_destroy_func_t) _hb_ft_font_destroy)
+  if (font->destroy != _hb_ft_font_destroy)
     return;
 
   hb_ft_font_t *ft_font = (hb_ft_font_t *) font->user_data;
@@ -136,7 +131,7 @@
  * hb_ft_font_get_load_flags:
  * @font:
  *
- * 
+ *
  *
  * Return value:
  * Since: 1.0.5
@@ -144,7 +139,7 @@
 int
 hb_ft_font_get_load_flags (hb_font_t *font)
 {
-  if (font->destroy != (hb_destroy_func_t) _hb_ft_font_destroy)
+  if (font->destroy != _hb_ft_font_destroy)
     return 0;
 
   const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font->user_data;
@@ -155,8 +150,8 @@
 FT_Face
 hb_ft_font_get_face (hb_font_t *font)
 {
-  if (font->destroy != (hb_destroy_func_t) _hb_ft_font_destroy)
-    return NULL;
+  if (font->destroy != _hb_ft_font_destroy)
+    return nullptr;
 
   const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font->user_data;
 
@@ -422,7 +417,7 @@
   return true;
 }
 
-static hb_font_funcs_t *static_ft_funcs = NULL;
+static hb_font_funcs_t *static_ft_funcs = nullptr;
 
 #ifdef HB_USE_ATEXIT
 static
@@ -442,24 +437,24 @@
   {
     funcs = hb_font_funcs_create ();
 
-    hb_font_funcs_set_font_h_extents_func (funcs, hb_ft_get_font_h_extents, NULL, NULL);
-    //hb_font_funcs_set_font_v_extents_func (funcs, hb_ft_get_font_v_extents, NULL, NULL);
-    hb_font_funcs_set_nominal_glyph_func (funcs, hb_ft_get_nominal_glyph, NULL, NULL);
-    hb_font_funcs_set_variation_glyph_func (funcs, hb_ft_get_variation_glyph, NULL, NULL);
-    hb_font_funcs_set_glyph_h_advance_func (funcs, hb_ft_get_glyph_h_advance, NULL, NULL);
-    hb_font_funcs_set_glyph_v_advance_func (funcs, hb_ft_get_glyph_v_advance, NULL, NULL);
-    //hb_font_funcs_set_glyph_h_origin_func (funcs, hb_ft_get_glyph_h_origin, NULL, NULL);
-    hb_font_funcs_set_glyph_v_origin_func (funcs, hb_ft_get_glyph_v_origin, NULL, NULL);
-    hb_font_funcs_set_glyph_h_kerning_func (funcs, hb_ft_get_glyph_h_kerning, NULL, NULL);
-    //hb_font_funcs_set_glyph_v_kerning_func (funcs, hb_ft_get_glyph_v_kerning, NULL, NULL);
-    hb_font_funcs_set_glyph_extents_func (funcs, hb_ft_get_glyph_extents, NULL, NULL);
-    hb_font_funcs_set_glyph_contour_point_func (funcs, hb_ft_get_glyph_contour_point, NULL, NULL);
-    hb_font_funcs_set_glyph_name_func (funcs, hb_ft_get_glyph_name, NULL, NULL);
-    hb_font_funcs_set_glyph_from_name_func (funcs, hb_ft_get_glyph_from_name, NULL, NULL);
+    hb_font_funcs_set_font_h_extents_func (funcs, hb_ft_get_font_h_extents, nullptr, nullptr);
+    //hb_font_funcs_set_font_v_extents_func (funcs, hb_ft_get_font_v_extents, nullptr, nullptr);
+    hb_font_funcs_set_nominal_glyph_func (funcs, hb_ft_get_nominal_glyph, nullptr, nullptr);
+    hb_font_funcs_set_variation_glyph_func (funcs, hb_ft_get_variation_glyph, nullptr, nullptr);
+    hb_font_funcs_set_glyph_h_advance_func (funcs, hb_ft_get_glyph_h_advance, nullptr, nullptr);
+    hb_font_funcs_set_glyph_v_advance_func (funcs, hb_ft_get_glyph_v_advance, nullptr, nullptr);
+    //hb_font_funcs_set_glyph_h_origin_func (funcs, hb_ft_get_glyph_h_origin, nullptr, nullptr);
+    hb_font_funcs_set_glyph_v_origin_func (funcs, hb_ft_get_glyph_v_origin, nullptr, nullptr);
+    hb_font_funcs_set_glyph_h_kerning_func (funcs, hb_ft_get_glyph_h_kerning, nullptr, nullptr);
+    //hb_font_funcs_set_glyph_v_kerning_func (funcs, hb_ft_get_glyph_v_kerning, nullptr, nullptr);
+    hb_font_funcs_set_glyph_extents_func (funcs, hb_ft_get_glyph_extents, nullptr, nullptr);
+    hb_font_funcs_set_glyph_contour_point_func (funcs, hb_ft_get_glyph_contour_point, nullptr, nullptr);
+    hb_font_funcs_set_glyph_name_func (funcs, hb_ft_get_glyph_name, nullptr, nullptr);
+    hb_font_funcs_set_glyph_from_name_func (funcs, hb_ft_get_glyph_from_name, nullptr, nullptr);
 
     hb_font_funcs_make_immutable (funcs);
 
-    if (!hb_atomic_ptr_cmpexch (&static_ft_funcs, NULL, funcs)) {
+    if (!hb_atomic_ptr_cmpexch (&static_ft_funcs, nullptr, funcs)) {
       hb_font_funcs_destroy (funcs);
       goto retry;
     }
@@ -474,7 +469,7 @@
   hb_font_set_funcs (font,
                      funcs,
                      _hb_ft_font_create (ft_face, symbol, unref),
-                     (hb_destroy_func_t) _hb_ft_font_destroy);
+                     _hb_ft_font_destroy);
 }
 
 
@@ -488,17 +483,17 @@
 
   /* Note: FreeType like HarfBuzz uses the NONE tag for fetching the entire blob */
 
-  error = FT_Load_Sfnt_Table (ft_face, tag, 0, NULL, &length);
+  error = FT_Load_Sfnt_Table (ft_face, tag, 0, nullptr, &length);
   if (error)
-    return NULL;
+    return nullptr;
 
   buffer = (FT_Byte *) malloc (length);
-  if (buffer == NULL)
-    return NULL;
+  if (!buffer)
+    return nullptr;
 
   error = FT_Load_Sfnt_Table (ft_face, tag, 0, buffer, &length);
   if (error)
-    return NULL;
+    return nullptr;
 
   return hb_blob_create ((const char *) buffer, length,
                          HB_MEMORY_MODE_WRITABLE,
@@ -507,12 +502,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 *
@@ -521,7 +516,7 @@
 {
   hb_face_t *face;
 
-  if (ft_face->stream->read == NULL) {
+  if (!ft_face->stream->read) {
     hb_blob_t *blob;
 
     blob = hb_blob_create ((const char *) ft_face->stream->base,
@@ -544,16 +539,16 @@
  * hb_ft_face_create_referenced:
  * @ft_face:
  *
- * 
+ *
  *
- * Return value: (transfer full): 
+ * Return value: (transfer full):
  * Since: 0.9.38
  **/
 hb_face_t *
 hb_ft_face_create_referenced (FT_Face ft_face)
 {
   FT_Reference_Face (ft_face);
-  return hb_ft_face_create (ft_face, (hb_destroy_func_t) _hb_ft_face_destroy);
+  return hb_ft_face_create (ft_face, _hb_ft_face_destroy);
 }
 
 static void
@@ -564,11 +559,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 *
@@ -579,7 +574,7 @@
     if (ft_face->generic.finalizer)
       ft_face->generic.finalizer (ft_face);
 
-    ft_face->generic.data = hb_ft_face_create (ft_face, NULL);
+    ft_face->generic.data = hb_ft_face_create (ft_face, nullptr);
     ft_face->generic.finalizer = (FT_Generic_Finalizer) hb_ft_face_finalize;
   }
 
@@ -589,12 +584,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 *
@@ -608,6 +603,19 @@
   font = hb_font_create (face);
   hb_face_destroy (face);
   _hb_ft_font_set_funcs (font, ft_face, false);
+  hb_ft_font_changed (font);
+  return font;
+}
+
+void
+hb_ft_font_changed (hb_font_t *font)
+{
+  if (font->destroy != _hb_ft_font_destroy)
+    return;
+
+  hb_ft_font_t *ft_font = (hb_ft_font_t *) font->user_data;
+  FT_Face ft_face = ft_font->ft_face;
+
   hb_font_set_scale (font,
                      (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));
@@ -618,39 +626,42 @@
 #endif
 
 #ifdef HAVE_FT_GET_VAR_BLEND_COORDINATES
-  FT_MM_Var *mm_var = NULL;
+  FT_MM_Var *mm_var = nullptr;
   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))
+    FT_Fixed *ft_coords = (FT_Fixed *) calloc (mm_var->num_axis, sizeof (FT_Fixed));
+    int *coords = (int *) calloc (mm_var->num_axis, sizeof (int));
+    if (coords && ft_coords)
     {
-      for (int i = 0; i < mm_var->num_axis; ++i)
-        hbCoords[i] = coords[i] >> 2;
+      if (!FT_Get_Var_Blend_Coordinates (ft_face, mm_var->num_axis, ft_coords))
+      {
+        for (unsigned int i = 0; i < mm_var->num_axis; ++i)
+          coords[i] = ft_coords[i] >>= 2;
 
-      hb_font_set_var_coords_normalized (font, hbCoords, mm_var->num_axis);
+        hb_font_set_var_coords_normalized (font, coords, mm_var->num_axis);
+      }
     }
+    free (coords);
+    free (ft_coords);
+    free (mm_var);
   }
-  free (mm_var);
 #endif
-
-  return font;
 }
 
 /**
  * hb_ft_font_create_referenced:
  * @ft_face:
  *
- * 
+ *
  *
- * Return value: (transfer full): 
+ * Return value: (transfer full):
  * Since: 0.9.38
  **/
 hb_font_t *
 hb_ft_font_create_referenced (FT_Face ft_face)
 {
   FT_Reference_Face (ft_face);
-  return hb_ft_font_create (ft_face, (hb_destroy_func_t) _hb_ft_face_destroy);
+  return hb_ft_font_create (ft_face, _hb_ft_face_destroy);
 }
 
 
@@ -676,9 +687,9 @@
   {
     /* Not found; allocate one. */
     if (FT_Init_FreeType (&library))
-      return NULL;
+      return nullptr;
 
-    if (!hb_atomic_ptr_cmpexch (&ft_library, NULL, library)) {
+    if (!hb_atomic_ptr_cmpexch (&ft_library, nullptr, library)) {
       FT_Done_FreeType (library);
       goto retry;
     }
@@ -706,7 +717,7 @@
   if (unlikely (!blob_length))
     DEBUG_MSG (FT, font, "Font face has empty blob");
 
-  FT_Face ft_face = NULL;
+  FT_Face ft_face = nullptr;
   FT_Error err = FT_New_Memory_Face (get_ft_library (),
                                      (const FT_Byte *) blob_data,
                                      blob_length,
@@ -733,7 +744,21 @@
   {
     FT_Matrix matrix = { font->x_scale < 0 ? -1 : +1, 0,
                           0, font->y_scale < 0 ? -1 : +1};
-    FT_Set_Transform (ft_face, &matrix, NULL);
+    FT_Set_Transform (ft_face, &matrix, nullptr);
+  }
+
+  unsigned int num_coords;
+  const int *coords = hb_font_get_var_coords_normalized (font, &num_coords);
+  if (num_coords)
+  {
+    FT_Fixed *ft_coords = (FT_Fixed *) calloc (num_coords, sizeof (FT_Fixed));
+    if (ft_coords)
+    {
+      for (unsigned int i = 0; i < num_coords; i++)
+        ft_coords[i] = coords[i] << 2;
+      FT_Set_Var_Blend_Coordinates (ft_face, num_coords, ft_coords);
+      free (ft_coords);
+    }
   }
 
   ft_face->generic.data = blob;
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ft.h	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ft.h	Wed Dec 13 10:25:38 2017 -0800
@@ -116,7 +116,13 @@
 HB_EXTERN int
 hb_ft_font_get_load_flags (hb_font_t *font);
 
-/* Makes an hb_font_t use FreeType internally to implement font functions. */
+/* Call when size or variations settings on underlying FT_Face change. */
+HB_EXTERN void
+hb_ft_font_changed (hb_font_t *font);
+
+/* Makes an hb_font_t use FreeType internally to implement font functions.
+ * Note: this internally creates an FT_Face.  Use it when you create your
+ * hb_face_t using hb_face_create(). */
 HB_EXTERN void
 hb_ft_font_set_funcs (hb_font_t *font);
 
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-mutex-private.hh	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-mutex-private.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -68,7 +68,7 @@
 #include <pthread.h>
 typedef pthread_mutex_t hb_mutex_impl_t;
 #define HB_MUTEX_IMPL_INIT      PTHREAD_MUTEX_INITIALIZER
-#define hb_mutex_impl_init(M)   pthread_mutex_init (M, NULL)
+#define hb_mutex_impl_init(M)   pthread_mutex_init (M, nullptr)
 #define hb_mutex_impl_lock(M)   pthread_mutex_lock (M)
 #define hb_mutex_impl_unlock(M) pthread_mutex_unlock (M)
 #define hb_mutex_impl_finish(M) pthread_mutex_destroy (M)
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-object-private.hh	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-object-private.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -33,18 +33,12 @@
 #define HB_OBJECT_PRIVATE_HH
 
 #include "hb-private.hh"
+#include "hb-debug.hh"
 
 #include "hb-atomic-private.hh"
 #include "hb-mutex-private.hh"
 
 
-/* Debug */
-
-#ifndef HB_DEBUG_OBJECT
-#define HB_DEBUG_OBJECT (HB_DEBUG+0)
-#endif
-
-
 /* reference_count */
 
 #define HB_REFERENCE_COUNT_INERT_VALUE -1
@@ -193,7 +187,7 @@
                                              hb_user_data_key_t *key)
 {
   if (unlikely (!obj || hb_object_is_inert (obj)))
-    return NULL;
+    return nullptr;
   assert (hb_object_is_valid (obj));
   return obj->header.user_data.get (key);
 }
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-open-file-private.hh	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-open-file-private.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -53,6 +53,9 @@
 
 typedef struct TableRecord
 {
+  int cmp (Tag t) const
+  { return t.cmp (tag); }
+
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
@@ -73,27 +76,39 @@
   friend struct OpenTypeFontFile;
 
   inline unsigned int get_table_count (void) const
-  { return numTables; }
+  { return tables.len; }
   inline const TableRecord& get_table (unsigned int i) const
   {
-    if (unlikely (i >= numTables)) return Null(TableRecord);
     return tables[i];
   }
+  inline unsigned int get_table_tags (unsigned int start_offset,
+                                      unsigned int *table_count, /* IN/OUT */
+                                      hb_tag_t     *table_tags /* OUT */) const
+  {
+    if (table_count)
+    {
+      if (start_offset >= tables.len)
+        *table_count = 0;
+      else
+        *table_count = MIN<unsigned int> (*table_count, tables.len - start_offset);
+
+      const TableRecord *sub_tables = tables.array + start_offset;
+      unsigned int count = *table_count;
+      for (unsigned int i = 0; i < count; i++)
+        table_tags[i] = sub_tables[i].tag;
+    }
+    return tables.len;
+  }
   inline bool find_table_index (hb_tag_t tag, unsigned int *table_index) const
   {
     Tag t;
     t.set (tag);
-    unsigned int count = numTables;
-    for (unsigned int i = 0; i < count; i++)
-    {
-      if (t == tables[i].tag)
-      {
-        if (table_index) *table_index = i;
-        return true;
-      }
-    }
-    if (table_index) *table_index = Index::NOT_FOUND_INDEX;
-    return false;
+    /* Linear-search for small tables to work around fonts with unsorted
+     * table list. */
+    int i = tables.len < 64 ? tables.lsearch (t) : tables.bsearch (t);
+    if (table_index)
+      *table_index = i == -1 ? Index::NOT_FOUND_INDEX : (unsigned int) i;
+    return i != -1;
   }
   inline const TableRecord& get_table_by_tag (hb_tag_t tag) const
   {
@@ -106,16 +121,13 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return_trace (c->check_struct (this) && c->check_array (tables, TableRecord::static_size, numTables));
+    return_trace (c->check_struct (this) && tables.sanitize (c));
   }
 
   protected:
   Tag           sfnt_version;   /* '\0\001\0\00' if TrueType / 'OTTO' if CFF */
-  USHORT        numTables;      /* Number of tables. */
-  USHORT        searchRangeZ;   /* (Maximum power of 2 <= numTables) x 16 */
-  USHORT        entrySelectorZ; /* Log2(maximum power of 2 <= numTables). */
-  USHORT        rangeShiftZ;    /* NumTables x 16-searchRange. */
-  TableRecord   tables[VAR];    /* TableRecord entries. numTables items */
+  BinSearchArrayOf<TableRecord>
+                tables;
   public:
   DEFINE_SIZE_ARRAY (12, tables);
 } OpenTypeFontFace;
@@ -142,7 +154,7 @@
   Tag           ttcTag;         /* TrueType Collection ID string: 'ttcf' */
   FixedVersion<>version;        /* Version of the TTC Header (1.0),
                                  * 0x00010000u */
-  ArrayOf<OffsetTo<OffsetTable, ULONG>, ULONG>
+  ArrayOf<LOffsetTo<OffsetTable>, ULONG>
                 table;          /* Array of offsets to the OffsetTable for each font
                                  * from the beginning of the file */
   public:
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-open-type-private.hh	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-open-type-private.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -30,6 +30,8 @@
 #define HB_OPEN_TYPE_PRIVATE_HH
 
 #include "hb-private.hh"
+#include "hb-debug.hh"
+#include "hb-face-private.hh"
 
 
 namespace OT {
@@ -84,7 +86,7 @@
 #define _DEFINE_INSTANCE_ASSERTION1(_line, _assertion) \
   inline void _instance_assertion_on_line_##_line (void) const \
   { \
-    ASSERT_STATIC (_assertion); \
+    static_assert ((_assertion), ""); \
     ASSERT_INSTANCE_POD (*this); /* Make sure it's POD. */ \
   }
 # define _DEFINE_INSTANCE_ASSERTION0(_line, _assertion) _DEFINE_INSTANCE_ASSERTION1 (_line, _assertion)
@@ -129,14 +131,16 @@
  */
 
 /* Global nul-content Null pool.  Enlarge as necessary. */
-/* TODO This really should be a extern HB_INTERNAL and defined somewhere... */
-static const void *_NullPool[(256+8) / sizeof (void *)];
+
+#define HB_NULL_POOL_SIZE 264
+static_assert (HB_NULL_POOL_SIZE % sizeof (void *) == 0, "Align HB_NULL_POOL_SIZE.");
+extern HB_INTERNAL const void * const _hb_NullPool[HB_NULL_POOL_SIZE / sizeof (void *)];
 
 /* Generic nul-content Null objects. */
 template <typename Type>
 static inline const Type& Null (void) {
-  ASSERT_STATIC (sizeof (Type) <= sizeof (_NullPool));
-  return *CastP<Type> (_NullPool);
+  static_assert (sizeof (Type) <= HB_NULL_POOL_SIZE, "Increase HB_NULL_POOL_SIZE.");
+  return *CastP<Type> (_hb_NullPool);
 }
 
 /* Specializaiton for arbitrary-content arbitrary-sized Null objects. */
@@ -146,7 +150,7 @@
 /*static*/ inline const Type& Null<Type> (void) { \
   return *CastP<Type> (_Null##Type); \
 } /* The following line really exists such that we end in a place needing semicolon */ \
-ASSERT_STATIC (Type::min_size + 1 <= sizeof (_Null##Type))
+static_assert (Type::min_size + 1 <= sizeof (_Null##Type), "Null pool too small.  Enlarge.")
 
 /* Accessor macro. */
 #define Null(Type) Null<Type>()
@@ -171,16 +175,6 @@
  * Sanitize
  */
 
-#ifndef HB_DEBUG_SANITIZE
-#define HB_DEBUG_SANITIZE (HB_DEBUG+0)
-#endif
-
-
-#define TRACE_SANITIZE(this) \
-        hb_auto_trace_t<HB_DEBUG_SANITIZE, bool> trace \
-        (&c->debug_depth, c->get_name (), this, HB_FUNC, \
-         "");
-
 /* This limits sanitizing time on really broken fonts. */
 #ifndef HB_SANITIZE_MAX_EDITS
 #define HB_SANITIZE_MAX_EDITS 32
@@ -191,9 +185,9 @@
 {
   inline hb_sanitize_context_t (void) :
         debug_depth (0),
-        start (NULL), end (NULL),
+        start (nullptr), end (nullptr),
         writable (false), edit_count (0),
-        blob (NULL) {}
+        blob (nullptr) {}
 
   inline const char *get_name (void) { return "SANITIZE"; }
   template <typename T, typename F>
@@ -213,7 +207,7 @@
 
   inline void start_processing (void)
   {
-    this->start = hb_blob_get_data (this->blob, NULL);
+    this->start = hb_blob_get_data (this->blob, nullptr);
     this->end = this->start + hb_blob_get_length (this->blob);
     assert (this->start <= this->end); /* Must not overflow. */
     this->edit_count = 0;
@@ -232,8 +226,8 @@
                      this->start, this->end, this->edit_count);
 
     hb_blob_destroy (this->blob);
-    this->blob = NULL;
-    this->start = this->end = NULL;
+    this->blob = nullptr;
+    this->start = this->end = nullptr;
   }
 
   inline bool check_range (const void *base, unsigned int len) const
@@ -348,7 +342,7 @@
     } else {
       unsigned int edit_count = c->edit_count;
       if (edit_count && !c->writable) {
-        c->start = hb_blob_get_data_writable (blob, NULL);
+        c->start = hb_blob_get_data_writable (blob, nullptr);
         c->end = c->start + hb_blob_get_length (blob);
 
         if (c->start) {
@@ -373,7 +367,7 @@
 
   static const Type* lock_instance (hb_blob_t *blob) {
     hb_blob_make_immutable (blob);
-    const char *base = hb_blob_get_data (blob, NULL);
+    const char *base = hb_blob_get_data (blob, nullptr);
     return unlikely (!base) ? &Null(Type) : CastP<Type> (base);
   }
 };
@@ -384,16 +378,6 @@
  * Serialize
  */
 
-#ifndef HB_DEBUG_SERIALIZE
-#define HB_DEBUG_SERIALIZE (HB_DEBUG+0)
-#endif
-
-
-#define TRACE_SERIALIZE(this) \
-        hb_auto_trace_t<HB_DEBUG_SERIALIZE, bool> trace \
-        (&c->debug_depth, "SERIALIZE", c, HB_FUNC, \
-         "");
-
 
 struct hb_serialize_context_t
 {
@@ -444,7 +428,7 @@
   {
     if (unlikely (this->ran_out_of_room || this->end - this->head < ptrdiff_t (size))) {
       this->ran_out_of_room = true;
-      return NULL;
+      return nullptr;
     }
     memset (this->head, 0, size);
     char *ret = this->head;
@@ -470,7 +454,7 @@
   {
     unsigned int size = obj.get_size ();
     Type *ret = this->allocate_size<Type> (size);
-    if (unlikely (!ret)) return NULL;
+    if (unlikely (!ret)) return nullptr;
     memcpy (ret, obj, size);
     return ret;
   }
@@ -480,7 +464,7 @@
   {
     unsigned int size = obj.min_size;
     assert (this->start <= (char *) &obj && (char *) &obj <= this->head && (char *) &obj + size >= this->head);
-    if (unlikely (!this->allocate_size<Type> (((char *) &obj) + size - this->head))) return NULL;
+    if (unlikely (!this->allocate_size<Type> (((char *) &obj) + size - this->head))) return nullptr;
     return reinterpret_cast<Type *> (&obj);
   }
 
@@ -489,7 +473,7 @@
   {
     unsigned int size = obj.get_size ();
     assert (this->start < (char *) &obj && (char *) &obj <= this->head && (char *) &obj + size >= this->head);
-    if (unlikely (!this->allocate_size<Type> (((char *) &obj) + size - this->head))) return NULL;
+    if (unlikely (!this->allocate_size<Type> (((char *) &obj) + size - this->head))) return nullptr;
     return reinterpret_cast<Type *> (&obj);
   }
 
@@ -631,10 +615,11 @@
   inline bool operator == (const IntType<Type,Size> &o) const { return (Type) v == (Type) o.v; }
   inline bool operator != (const IntType<Type,Size> &o) const { return !(*this == o); }
   static inline int cmp (const IntType<Type,Size> *a, const IntType<Type,Size> *b) { return b->cmp (*a); }
-  inline int cmp (Type a) const
+  template <typename Type2>
+  inline int cmp (Type2 a) const
   {
     Type b = v;
-    if (sizeof (Type) < sizeof (int))
+    if (sizeof (Type) < sizeof (int) && sizeof (Type2) < sizeof (int))
       return (int) a - (int) b;
     else
       return a < b ? -1 : a == b ? 0 : +1;
@@ -650,9 +635,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<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. */
@@ -712,10 +697,7 @@
 DEFINE_NULL_DATA (Tag, "    ");
 
 /* Glyph index number, same as uint16 (length = 16 bits) */
-struct GlyphID : USHORT {
-  static inline int cmp (const GlyphID *a, const GlyphID *b) { return b->USHORT::cmp (*a); }
-  inline int cmp (hb_codepoint_t a) const { return (int) a - (int) *this; }
-};
+typedef USHORT GlyphID;
 
 /* Script/language-system/feature index */
 struct Index : USHORT {
@@ -829,6 +811,7 @@
   }
   DEFINE_SIZE_STATIC (sizeof(OffsetType));
 };
+template <typename Type> struct LOffsetTo : OffsetTo<Type, ULONG> {};
 template <typename Base, typename OffsetType, typename Type>
 static inline const Type& operator + (const Base &base, const OffsetTo<Type, OffsetType> &offset) { return offset (base); }
 template <typename Base, typename OffsetType, typename Type>
@@ -941,7 +924,7 @@
   inline bool sanitize_shallow (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return_trace (c->check_struct (this) && c->check_array (array, Type::static_size, len));
+    return_trace (len.sanitize (c) && c->check_array (array, Type::static_size, len));
   }
 
   public:
@@ -950,6 +933,7 @@
   public:
   DEFINE_SIZE_ARRAY (sizeof (LenType), array);
 };
+template <typename Type> struct LArrayOf : ArrayOf<Type, ULONG> {};
 
 /* Array of Offset's */
 template <typename Type, typename OffsetType=USHORT>
@@ -1006,12 +990,6 @@
     return_trace (true);
   }
 
-  inline bool sanitize_shallow (hb_sanitize_context_t *c) const
-  {
-    return c->check_struct (this)
-        && c->check_array (this, Type::static_size, len);
-  }
-
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
@@ -1029,6 +1007,15 @@
     return_trace (true);
   }
 
+  private:
+  inline bool sanitize_shallow (hb_sanitize_context_t *c) const
+  {
+    TRACE_SANITIZE (this);
+    return_trace (len.sanitize (c) &&
+                  (!len || c->check_array (array, Type::static_size, len - 1)));
+  }
+
+  public:
   LenType len;
   Type array[VAR];
   public:
@@ -1036,7 +1023,9 @@
 };
 
 
-/* An array with sorted elements.  Supports binary searching. */
+/*
+ * An array with sorted elements.  Supports binary searching.
+ */
 template <typename Type, typename LenType=USHORT>
 struct SortedArrayOf : ArrayOf<Type, LenType>
 {
@@ -1044,11 +1033,12 @@
   inline int bsearch (const SearchType &x) const
   {
     /* Hand-coded bsearch here since this is in the hot inner loop. */
+    const Type *array = this->array;
     int min = 0, max = (int) this->len - 1;
     while (min <= max)
     {
       int mid = (min + max) / 2;
-      int c = this->array[mid].cmp (x);
+      int c = array[mid].cmp (x);
       if (c < 0)
         max = mid - 1;
       else if (c > 0)
@@ -1060,6 +1050,131 @@
   }
 };
 
+/*
+ * Binary-search arrays
+ */
+
+struct BinSearchHeader
+{
+  inline operator uint32_t (void) const { return len; }
+
+  inline bool sanitize (hb_sanitize_context_t *c) const
+  {
+    TRACE_SANITIZE (this);
+    return_trace (c->check_struct (this));
+  }
+
+  protected:
+  USHORT        len;
+  USHORT        searchRangeZ;
+  USHORT        entrySelectorZ;
+  USHORT        rangeShiftZ;
+
+  public:
+  DEFINE_SIZE_STATIC (8);
+};
+
+template <typename Type>
+struct BinSearchArrayOf : SortedArrayOf<Type, BinSearchHeader> {};
+
+
+/* Lazy struct and blob loaders. */
+
+/* Logic is shared between hb_lazy_loader_t and hb_lazy_table_loader_t */
+template <typename T>
+struct hb_lazy_loader_t
+{
+  inline void init (hb_face_t *face_)
+  {
+    face = face_;
+    instance = nullptr;
+  }
+
+  inline void fini (void)
+  {
+    if (instance && instance != &OT::Null(T))
+    {
+      instance->fini();
+      free (instance);
+    }
+  }
+
+  inline const T* get (void) const
+  {
+  retry:
+    T *p = (T *) hb_atomic_ptr_get (&instance);
+    if (unlikely (!p))
+    {
+      p = (T *) calloc (1, sizeof (T));
+      if (unlikely (!p))
+        p = const_cast<T *> (&OT::Null(T));
+      else
+        p->init (face);
+      if (unlikely (!hb_atomic_ptr_cmpexch (const_cast<T **>(&instance), nullptr, p)))
+      {
+        if (p != &OT::Null(T))
+          p->fini ();
+        goto retry;
+      }
+    }
+    return p;
+  }
+
+  inline const T* operator-> (void) const
+  {
+    return get ();
+  }
+
+  private:
+  hb_face_t *face;
+  T *instance;
+};
+
+/* Logic is shared between hb_lazy_loader_t and hb_lazy_table_loader_t */
+template <typename T>
+struct hb_lazy_table_loader_t
+{
+  inline void init (hb_face_t *face_)
+  {
+    face = face_;
+    instance = nullptr;
+    blob = nullptr;
+  }
+
+  inline void fini (void)
+  {
+    hb_blob_destroy (blob);
+  }
+
+  inline const T* get (void) const
+  {
+  retry:
+    T *p = (T *) hb_atomic_ptr_get (&instance);
+    if (unlikely (!p))
+    {
+      hb_blob_t *blob_ = OT::Sanitizer<T>::sanitize (face->reference_table (T::tableTag));
+      p = const_cast<T *>(OT::Sanitizer<T>::lock_instance (blob_));
+      if (!hb_atomic_ptr_cmpexch (const_cast<T **>(&instance), nullptr, p))
+      {
+        hb_blob_destroy (blob_);
+        goto retry;
+      }
+      blob = blob_;
+    }
+    return p;
+  }
+
+  inline const T* operator-> (void) const
+  {
+    return get();
+  }
+
+  private:
+  hb_face_t *face;
+  T *instance;
+  mutable hb_blob_t *blob;
+};
+
 
 } /* namespace OT */
 
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-cbdt-table.hh	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-cbdt-table.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -116,12 +116,12 @@
   {
     TRACE_SANITIZE (this);
     return_trace (c->check_struct (this) &&
-		  c->check_array (offsetArrayZ, offsetArrayZ[0].static_size, glyph_count + 1));
+                  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
+                       unsigned int *offset,
+                       unsigned int *length) const
   {
     if (unlikely (offsetArrayZ[idx + 1] <= offsetArrayZ[idx]))
       return false;
@@ -163,9 +163,9 @@
   }
 
   bool get_image_data (unsigned int idx,
-		       unsigned int *offset,
-		       unsigned int *length,
-		       unsigned int *format) const
+                       unsigned int *offset,
+                       unsigned int *length,
+                       unsigned int *format) const
   {
     *format = u.header.imageFormat;
     switch (u.header.indexFormat) {
@@ -177,9 +177,9 @@
 
   protected:
   union {
-  IndexSubtableHeader	header;
-  IndexSubtableFormat1	format1;
-  IndexSubtableFormat3	format3;
+  IndexSubtableHeader   header;
+  IndexSubtableFormat1  format1;
+  IndexSubtableFormat3  format3;
   /* TODO: Format 2, 4, 5. */
   } u;
   public:
@@ -192,8 +192,8 @@
   {
     TRACE_SANITIZE (this);
     return_trace (c->check_struct (this) &&
-		  firstGlyphIndex <= lastGlyphIndex &&
-		  offsetToSubtable.sanitize (c, this, lastGlyphIndex - firstGlyphIndex + 1));
+                  firstGlyphIndex <= lastGlyphIndex &&
+                  offsetToSubtable.sanitize (c, this, lastGlyphIndex - firstGlyphIndex + 1));
   }
 
   inline bool get_extents (hb_glyph_extents_t *extents) const
@@ -202,21 +202,21 @@
   }
 
   bool get_image_data (unsigned int gid,
-		       unsigned int *offset,
-		       unsigned int *length,
-		       unsigned int *format) const
+                       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);
+                                                   offset, length, format);
   }
 
   USHORT firstGlyphIndex;
   USHORT lastGlyphIndex;
-  OffsetTo<IndexSubtable, ULONG> offsetToSubtable;
+  LOffsetTo<IndexSubtable> offsetToSubtable;
 
   DEFINE_SIZE_STATIC(8);
 };
@@ -230,7 +230,7 @@
       return_trace (false);
     for (unsigned int i = 0; i < count; i++)
       if (unlikely (!indexSubtablesZ[i].sanitize (c, this)))
-	return_trace (false);
+        return_trace (false);
     return_trace (true);
   }
 
@@ -245,7 +245,7 @@
         return &indexSubtablesZ[i];
       }
     }
-    return NULL;
+    return nullptr;
   }
 
   protected:
@@ -263,10 +263,10 @@
   {
     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));
+                  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
@@ -275,7 +275,7 @@
   }
 
   protected:
-  OffsetTo<IndexSubtableArray, ULONG> indexSubtableArrayOffset;
+  LOffsetTo<IndexSubtableArray> indexSubtableArrayOffset;
   ULONG indexTablesSize;
   ULONG numberOfIndexSubtables;
   ULONG colorRef;
@@ -321,13 +321,13 @@
   {
     TRACE_SANITIZE (this);
     return_trace (c->check_struct (this) &&
-		  likely (version.major == 2 || version.major == 3) &&
-		  sizeTables.sanitize (c, 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
+                                         unsigned int *x_ppem, unsigned int *y_ppem) const
   {
     /* TODO: Make it possible to select strike. */
 
@@ -338,18 +338,18 @@
       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);
+        *x_ppem = sizeTables[i].ppemX;
+        *y_ppem = sizeTables[i].ppemY;
+        return sizeTables[i].find_table (glyph, this);
       }
     }
 
-    return NULL;
+    return nullptr;
   }
 
   protected:
-  FixedVersion<>version;
-  ArrayOf<BitmapSizeTable, ULONG> sizeTables;
+  FixedVersion<>                version;
+  LArrayOf<BitmapSizeTable>     sizeTables;
 
   public:
   DEFINE_SIZE_ARRAY(8, sizeTables);
@@ -368,7 +368,7 @@
   {
     TRACE_SANITIZE (this);
     return_trace (c->check_struct (this) &&
-		  likely (version.major == 2 || version.major == 3));
+                  likely (version.major == 2 || version.major == 3));
   }
 
   protected:
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-cmap-table.hh	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-cmap-table.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -380,9 +380,9 @@
   }
 
   UINT24        varSelector;    /* Variation selector. */
-  OffsetTo<DefaultUVS, ULONG>
+  LOffsetTo<DefaultUVS>
                 defaultUVS;     /* Offset to Default UVS Table. May be 0. */
-  OffsetTo<NonDefaultUVS, ULONG>
+  LOffsetTo<NonDefaultUVS>
                 nonDefaultUVS;  /* Offset to Non-Default UVS Table. May be 0. */
   public:
   DEFINE_SIZE_STATIC (11);
@@ -486,7 +486,7 @@
 
   USHORT        platformID;     /* Platform ID. */
   USHORT        encodingID;     /* Platform-specific encoding ID. */
-  OffsetTo<CmapSubtable, ULONG>
+  LOffsetTo<CmapSubtable>
                 subtable;       /* Byte offset from beginning of table to the subtable for this encoding. */
   public:
   DEFINE_SIZE_STATIC (8);
@@ -508,7 +508,7 @@
      * unsorted subtable list. */
     int result = encodingRecord./*bsearch*/lsearch (key);
     if (result == -1 || !encodingRecord[result].subtable)
-      return NULL;
+      return nullptr;
 
     return &(this+encodingRecord[result].subtable);
   }
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-font.cc	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-font.cc	Wed Dec 13 10:25:38 2017 -0800
@@ -36,8 +36,10 @@
 #include "hb-ot-head-table.hh"
 #include "hb-ot-hhea-table.hh"
 #include "hb-ot-hmtx-table.hh"
+#include "hb-ot-kern-table.hh"
 #include "hb-ot-os2-table.hh"
-//#include "hb-ot-post-table.hh"
+#include "hb-ot-post-table.hh"
+#include "hb-ot-var-hvar-table.hh"
 
 
 struct hb_ot_face_metrics_accelerator_t
@@ -50,12 +52,16 @@
   unsigned short line_gap;
   bool has_font_extents;
 
-  const OT::_mtx *table;
+  const OT::hmtxvmtx *table;
   hb_blob_t *blob;
 
+  const OT::HVARVVAR *var;
+  hb_blob_t *var_blob;
+
   inline void init (hb_face_t *face,
                     hb_tag_t _hea_tag,
                     hb_tag_t _mtx_tag,
+                    hb_tag_t _var_tag,
                     hb_tag_t os2_tag,
                     unsigned int default_advance = 0)
   {
@@ -91,7 +97,7 @@
 
     this->has_font_extents = got_font_extents;
 
-    this->blob = OT::Sanitizer<OT::_mtx>::sanitize (face->reference_table (_mtx_tag));
+    this->blob = OT::Sanitizer<OT::hmtxvmtx>::sanitize (face->reference_table (_mtx_tag));
 
     /* Cap num_metrics() and num_advances() based on table length. */
     unsigned int len = hb_blob_get_length (this->blob);
@@ -107,15 +113,20 @@
       hb_blob_destroy (this->blob);
       this->blob = hb_blob_get_empty ();
     }
-    this->table = OT::Sanitizer<OT::_mtx>::lock_instance (this->blob);
+    this->table = OT::Sanitizer<OT::hmtxvmtx>::lock_instance (this->blob);
+
+    this->var_blob = OT::Sanitizer<OT::HVARVVAR>::sanitize (face->reference_table (_var_tag));
+    this->var = OT::Sanitizer<OT::HVARVVAR>::lock_instance (this->var_blob);
   }
 
   inline void fini (void)
   {
     hb_blob_destroy (this->blob);
+    hb_blob_destroy (this->var_blob);
   }
 
-  inline unsigned int get_advance (hb_codepoint_t glyph) const
+  inline unsigned int get_advance (hb_codepoint_t  glyph,
+                                   hb_font_t      *font) const
   {
     if (unlikely (glyph >= this->num_metrics))
     {
@@ -128,10 +139,8 @@
         return this->default_advance;
     }
 
-    if (glyph >= this->num_advances)
-      glyph = this->num_advances - 1;
-
-    return this->table->longMetric[glyph].advance;
+    return this->table->longMetric[MIN (glyph, (uint32_t) this->num_advances - 1)].advance
+         + this->var->get_advance_var (glyph, font->coords, font->num_coords); // TODO Optimize?!
   }
 };
 
@@ -216,7 +225,7 @@
   const OT::CBDT *cbdt;
 
   unsigned int cbdt_len;
-  float upem;
+  unsigned int upem;
 
   inline void init (hb_face_t *face)
   {
@@ -227,8 +236,8 @@
     cbdt_len = hb_blob_get_length (cbdt_blob);
 
     if (hb_blob_get_length (cblc_blob) == 0) {
-      cblc = NULL;
-      cbdt = NULL;
+      cblc = nullptr;
+      cbdt = nullptr;
       return;  /* Not a bitmap font. */
     }
     cblc = OT::Sanitizer<OT::CBLC>::lock_instance (cblc_blob);
@@ -246,11 +255,11 @@
   {
     unsigned int x_ppem = upem, y_ppem = upem; /* TODO Use font ppem if available. */
 
-    if (cblc == NULL)
+    if (!cblc)
       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)
+    if (!subtable_record || !x_ppem || !y_ppem)
       return false;
 
     if (subtable_record->get_extents (extents))
@@ -293,6 +302,60 @@
   }
 };
 
+struct hb_ot_face_post_accelerator_t
+{
+  hb_blob_t *post_blob;
+  OT::post::accelerator_t accel;
+
+  inline void init (hb_face_t *face)
+  {
+    hb_blob_t *blob = this->post_blob = OT::Sanitizer<OT::post>::sanitize (face->reference_table (HB_OT_TAG_post));
+    accel.init (OT::Sanitizer<OT::post>::lock_instance (blob), hb_blob_get_length (blob));
+  }
+
+  inline void fini (void)
+  {
+    accel.fini ();
+    hb_blob_destroy (this->post_blob);
+  }
+
+  inline bool get_glyph_name (hb_codepoint_t glyph,
+                              char *name, unsigned int size) const
+  {
+    return this->accel.get_glyph_name (glyph, name, size);
+  }
+
+  inline bool get_glyph_from_name (const char *name, int len,
+                                   hb_codepoint_t *glyph) const
+  {
+    if (unlikely (!len))
+      return false;
+
+    return this->accel.get_glyph_from_name (name, len, glyph);
+  }
+};
+
+struct hb_ot_face_kern_accelerator_t
+{
+  hb_blob_t *kern_blob;
+  OT::kern::accelerator_t accel;
+
+  inline void init (hb_face_t *face)
+  {
+    hb_blob_t *blob = this->kern_blob = OT::Sanitizer<OT::kern>::sanitize (face->reference_table (HB_OT_TAG_kern));
+    accel.init (OT::Sanitizer<OT::kern>::lock_instance (blob), hb_blob_get_length (blob));
+  }
+
+  inline void fini (void)
+  {
+    accel.fini ();
+    hb_blob_destroy (this->kern_blob);
+  }
+
+  inline int get_h_kerning (hb_codepoint_t left, hb_codepoint_t right) const
+  { return accel.get_h_kerning (left, right); }
+};
+
 typedef bool (*hb_cmap_get_glyph_func_t) (const void *obj,
                                           hb_codepoint_t codepoint,
                                           hb_codepoint_t *glyph);
@@ -341,8 +404,8 @@
   {
     this->blob = OT::Sanitizer<OT::cmap>::sanitize (face->reference_table (HB_OT_TAG_cmap));
     const OT::cmap *cmap = OT::Sanitizer<OT::cmap>::lock_instance (this->blob);
-    const OT::CmapSubtable *subtable = NULL;
-    const OT::CmapSubtableFormat14 *subtable_uvs = NULL;
+    const OT::CmapSubtable *subtable = nullptr;
+    const OT::CmapSubtableFormat14 *subtable_uvs = nullptr;
 
     bool symbol = false;
     /* 32-bit subtables. */
@@ -421,55 +484,15 @@
   }
 };
 
-template <typename T>
-struct hb_lazy_loader_t
-{
-  inline void init (hb_face_t *face_)
-  {
-    face = face_;
-    instance = NULL;
-  }
-
-  inline void fini (void)
-  {
-    if (instance && instance != &OT::Null(T))
-    {
-      instance->fini();
-      free (instance);
-    }
-  }
-
-  inline const T* operator-> (void) const
-  {
-  retry:
-    T *p = (T *) hb_atomic_ptr_get (&instance);
-    if (unlikely (!p))
-    {
-      p = (T *) calloc (1, sizeof (T));
-      if (unlikely (!p))
-        return &OT::Null(T);
-      p->init (face);
-      if (unlikely (!hb_atomic_ptr_cmpexch (const_cast<T **>(&instance), NULL, p)))
-      {
-        p->fini ();
-        goto retry;
-      }
-    }
-    return p;
-  }
-
-  private:
-  hb_face_t *face;
-  T *instance;
-};
-
 struct hb_ot_font_t
 {
   hb_ot_face_cmap_accelerator_t cmap;
   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;
+  OT::hb_lazy_loader_t<hb_ot_face_glyf_accelerator_t> glyf;
+  OT::hb_lazy_loader_t<hb_ot_face_cbdt_accelerator_t> cbdt;
+  OT::hb_lazy_loader_t<hb_ot_face_post_accelerator_t> post;
+  OT::hb_lazy_loader_t<hb_ot_face_kern_accelerator_t> kern;
 };
 
 
@@ -479,26 +502,32 @@
   hb_ot_font_t *ot_font = (hb_ot_font_t *) calloc (1, sizeof (hb_ot_font_t));
 
   if (unlikely (!ot_font))
-    return NULL;
+    return nullptr;
 
   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,
+  ot_font->h_metrics.init (face, HB_OT_TAG_hhea, HB_OT_TAG_hmtx, HB_OT_TAG_HVAR, HB_OT_TAG_os2);
+  ot_font->v_metrics.init (face, HB_OT_TAG_vhea, HB_OT_TAG_vmtx, HB_OT_TAG_VVAR, 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);
+  ot_font->post.init (face);
+  ot_font->kern.init (face);
 
   return ot_font;
 }
 
 static void
-_hb_ot_font_destroy (hb_ot_font_t *ot_font)
+_hb_ot_font_destroy (void *data)
 {
+  hb_ot_font_t *ot_font = (hb_ot_font_t *) data;
+
   ot_font->cmap.fini ();
   ot_font->h_metrics.fini ();
   ot_font->v_metrics.fini ();
   ot_font->glyf.fini ();
   ot_font->cbdt.fini ();
+  ot_font->post.fini ();
+  ot_font->kern.fini ();
 
   free (ot_font);
 }
@@ -529,23 +558,34 @@
 }
 
 static hb_position_t
-hb_ot_get_glyph_h_advance (hb_font_t *font HB_UNUSED,
+hb_ot_get_glyph_h_advance (hb_font_t *font,
                            void *font_data,
                            hb_codepoint_t glyph,
                            void *user_data HB_UNUSED)
 {
   const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data;
-  return font->em_scale_x (ot_font->h_metrics.get_advance (glyph));
+  return font->em_scale_x (ot_font->h_metrics.get_advance (glyph, font));
 }
 
 static hb_position_t
-hb_ot_get_glyph_v_advance (hb_font_t *font HB_UNUSED,
+hb_ot_get_glyph_v_advance (hb_font_t *font,
                            void *font_data,
                            hb_codepoint_t glyph,
                            void *user_data HB_UNUSED)
 {
   const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data;
-  return font->em_scale_y (-(int) ot_font->v_metrics.get_advance (glyph));
+  return font->em_scale_y (-(int) ot_font->v_metrics.get_advance (glyph, font));
+}
+
+static hb_position_t
+hb_ot_get_glyph_h_kerning (hb_font_t *font,
+                           void *font_data,
+                           hb_codepoint_t left_glyph,
+                           hb_codepoint_t right_glyph,
+                           void *user_data HB_UNUSED)
+{
+  const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data;
+  return font->em_scale_x (ot_font->kern->get_h_kerning (left_glyph, right_glyph));
 }
 
 static hb_bool_t
@@ -559,6 +599,7 @@
   bool ret = ot_font->glyf->get_extents (glyph, extents);
   if (!ret)
     ret = ot_font->cbdt->get_extents (glyph, extents);
+  // TODO Hook up side-bearings variations.
   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);
@@ -567,6 +608,28 @@
 }
 
 static hb_bool_t
+hb_ot_get_glyph_name (hb_font_t *font HB_UNUSED,
+                      void *font_data,
+                      hb_codepoint_t glyph,
+                      char *name, unsigned int size,
+                      void *user_data HB_UNUSED)
+{
+  const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data;
+  return ot_font->post->get_glyph_name (glyph, name, size);
+}
+
+static hb_bool_t
+hb_ot_get_glyph_from_name (hb_font_t *font HB_UNUSED,
+                           void *font_data,
+                           const char *name, int len,
+                           hb_codepoint_t *glyph,
+                           void *user_data HB_UNUSED)
+{
+  const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data;
+  return ot_font->post->get_glyph_from_name (name, len, glyph);
+}
+
+static hb_bool_t
 hb_ot_get_font_h_extents (hb_font_t *font HB_UNUSED,
                           void *font_data,
                           hb_font_extents_t *metrics,
@@ -576,6 +639,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);
+  // TODO Hook up variations.
   return ot_font->h_metrics.has_font_extents;
 }
 
@@ -589,10 +653,11 @@
   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);
+  // TODO Hook up variations.
   return ot_font->v_metrics.has_font_extents;
 }
 
-static hb_font_funcs_t *static_ot_funcs = NULL;
+static hb_font_funcs_t *static_ot_funcs = nullptr;
 
 #ifdef HB_USE_ATEXIT
 static
@@ -612,24 +677,24 @@
   {
     funcs = hb_font_funcs_create ();
 
-    hb_font_funcs_set_font_h_extents_func (funcs, hb_ot_get_font_h_extents, NULL, NULL);
-    hb_font_funcs_set_font_v_extents_func (funcs, hb_ot_get_font_v_extents, NULL, NULL);
-    hb_font_funcs_set_nominal_glyph_func (funcs, hb_ot_get_nominal_glyph, NULL, NULL);
-    hb_font_funcs_set_variation_glyph_func (funcs, hb_ot_get_variation_glyph, NULL, NULL);
-    hb_font_funcs_set_glyph_h_advance_func (funcs, hb_ot_get_glyph_h_advance, NULL, NULL);
-    hb_font_funcs_set_glyph_v_advance_func (funcs, hb_ot_get_glyph_v_advance, NULL, NULL);
-    //hb_font_funcs_set_glyph_h_origin_func (funcs, hb_ot_get_glyph_h_origin, NULL, NULL);
-    //hb_font_funcs_set_glyph_v_origin_func (funcs, hb_ot_get_glyph_v_origin, NULL, NULL);
-    //hb_font_funcs_set_glyph_h_kerning_func (funcs, hb_ot_get_glyph_h_kerning, NULL, NULL); TODO
-    //hb_font_funcs_set_glyph_v_kerning_func (funcs, hb_ot_get_glyph_v_kerning, NULL, NULL);
-    hb_font_funcs_set_glyph_extents_func (funcs, hb_ot_get_glyph_extents, NULL, NULL);
-    //hb_font_funcs_set_glyph_contour_point_func (funcs, hb_ot_get_glyph_contour_point, NULL, NULL); TODO
-    //hb_font_funcs_set_glyph_name_func (funcs, hb_ot_get_glyph_name, NULL, NULL); TODO
-    //hb_font_funcs_set_glyph_from_name_func (funcs, hb_ot_get_glyph_from_name, NULL, NULL); TODO
+    hb_font_funcs_set_font_h_extents_func (funcs, hb_ot_get_font_h_extents, nullptr, nullptr);
+    hb_font_funcs_set_font_v_extents_func (funcs, hb_ot_get_font_v_extents, nullptr, nullptr);
+    hb_font_funcs_set_nominal_glyph_func (funcs, hb_ot_get_nominal_glyph, nullptr, nullptr);
+    hb_font_funcs_set_variation_glyph_func (funcs, hb_ot_get_variation_glyph, nullptr, nullptr);
+    hb_font_funcs_set_glyph_h_advance_func (funcs, hb_ot_get_glyph_h_advance, nullptr, nullptr);
+    hb_font_funcs_set_glyph_v_advance_func (funcs, hb_ot_get_glyph_v_advance, nullptr, nullptr);
+    //hb_font_funcs_set_glyph_h_origin_func (funcs, hb_ot_get_glyph_h_origin, nullptr, nullptr);
+    //hb_font_funcs_set_glyph_v_origin_func (funcs, hb_ot_get_glyph_v_origin, nullptr, nullptr);
+    hb_font_funcs_set_glyph_h_kerning_func (funcs, hb_ot_get_glyph_h_kerning, nullptr, nullptr);
+    //hb_font_funcs_set_glyph_v_kerning_func (funcs, hb_ot_get_glyph_v_kerning, nullptr, nullptr);
+    hb_font_funcs_set_glyph_extents_func (funcs, hb_ot_get_glyph_extents, nullptr, nullptr);
+    //hb_font_funcs_set_glyph_contour_point_func (funcs, hb_ot_get_glyph_contour_point, nullptr, nullptr); TODO
+    hb_font_funcs_set_glyph_name_func (funcs, hb_ot_get_glyph_name, nullptr, nullptr);
+    hb_font_funcs_set_glyph_from_name_func (funcs, hb_ot_get_glyph_from_name, nullptr, nullptr);
 
     hb_font_funcs_make_immutable (funcs);
 
-    if (!hb_atomic_ptr_cmpexch (&static_ot_funcs, NULL, funcs)) {
+    if (!hb_atomic_ptr_cmpexch (&static_ot_funcs, nullptr, funcs)) {
       hb_font_funcs_destroy (funcs);
       goto retry;
     }
@@ -658,5 +723,5 @@
   hb_font_set_funcs (font,
                      _hb_ot_get_font_funcs (),
                      ot_font,
-                     (hb_destroy_func_t) _hb_ot_font_destroy);
+                     _hb_ot_font_destroy);
 }
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-hmtx-table.hh	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-hmtx-table.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -50,10 +50,8 @@
   DEFINE_SIZE_STATIC (4);
 };
 
-struct _mtx
+struct hmtxvmtx
 {
-  static const hb_tag_t tableTag = HB_TAG('_','m','t','x');
-
   static const hb_tag_t hmtxTag = HB_OT_TAG_hmtx;
   static const hb_tag_t vmtxTag = HB_OT_TAG_vmtx;
 
@@ -91,10 +89,10 @@
   DEFINE_SIZE_ARRAY2 (0, longMetric, leadingBearingX);
 };
 
-struct hmtx : _mtx {
+struct hmtx : hmtxvmtx {
   static const hb_tag_t tableTag        = HB_OT_TAG_hmtx;
 };
-struct vmtx : _mtx {
+struct vmtx : hmtxvmtx {
   static const hb_tag_t tableTag        = HB_OT_TAG_vmtx;
 };
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-kern-table.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,389 @@
+/*
+ * Copyright © 2017  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): Behdad Esfahbod
+ */
+
+#ifndef HB_OT_KERN_TABLE_HH
+#define HB_OT_KERN_TABLE_HH
+
+#include "hb-open-type-private.hh"
+
+namespace OT {
+
+
+/*
+ * kern -- Kerning
+ */
+
+#define HB_OT_TAG_kern HB_TAG('k','e','r','n')
+
+struct hb_glyph_pair_t
+{
+  hb_codepoint_t left;
+  hb_codepoint_t right;
+};
+
+struct KernPair
+{
+  inline int get_kerning (void) const
+  { return value; }
+
+  inline int cmp (const hb_glyph_pair_t &o) const
+  {
+    int ret = left.cmp (o.left);
+    if (ret) return ret;
+    return right.cmp (o.right);
+  }
+
+  inline bool sanitize (hb_sanitize_context_t *c) const
+  {
+    TRACE_SANITIZE (this);
+    return_trace (c->check_struct (this));
+  }
+
+  protected:
+  GlyphID       left;
+  GlyphID       right;
+  FWORD         value;
+  public:
+  DEFINE_SIZE_STATIC (6);
+};
+
+struct KernSubTableFormat0
+{
+  inline int get_kerning (hb_codepoint_t left, hb_codepoint_t right) const
+  {
+    hb_glyph_pair_t pair = {left, right};
+    int i = pairs.bsearch (pair);
+    if (i == -1)
+      return 0;
+    return pairs[i].get_kerning ();
+  }
+
+  inline bool sanitize (hb_sanitize_context_t *c) const
+  {
+    TRACE_SANITIZE (this);
+    return_trace (pairs.sanitize (c));
+  }
+
+  protected:
+  BinSearchArrayOf<KernPair> pairs;     /* Array of kerning pairs. */
+  public:
+  DEFINE_SIZE_ARRAY (8, pairs);
+};
+
+struct KernClassTable
+{
+  inline unsigned int get_class (hb_codepoint_t g) const { return classes[g - firstGlyph]; }
+
+  inline bool sanitize (hb_sanitize_context_t *c) const
+  {
+    TRACE_SANITIZE (this);
+    return_trace (firstGlyph.sanitize (c) && classes.sanitize (c));
+  }
+
+  protected:
+  USHORT                firstGlyph;     /* First glyph in class range. */
+  ArrayOf<USHORT>       classes;        /* Glyph classes. */
+  public:
+  DEFINE_SIZE_ARRAY (4, classes);
+};
+
+struct KernSubTableFormat2
+{
+  inline int get_kerning (hb_codepoint_t left, hb_codepoint_t right, const char *end) const
+  {
+    unsigned int l = (this+leftClassTable).get_class (left);
+    unsigned int r = (this+leftClassTable).get_class (left);
+    unsigned int offset = l * rowWidth + r * sizeof (FWORD);
+    const FWORD *arr = &(this+array);
+    if (unlikely ((const void *) arr < (const void *) this || (const void *) arr >= (const void *) end))
+      return 0;
+    const FWORD *v = &StructAtOffset<FWORD> (arr, offset);
+    if (unlikely ((const void *) v < (const void *) arr || (const void *) (v + 1) > (const void *) end))
+      return 0;
+    return *v;
+  }
+
+  inline bool sanitize (hb_sanitize_context_t *c) const
+  {
+    TRACE_SANITIZE (this);
+    return_trace (rowWidth.sanitize (c) &&
+                  leftClassTable.sanitize (c, this) &&
+                  rightClassTable.sanitize (c, this) &&
+                  array.sanitize (c, this));
+  }
+
+  protected:
+  USHORT        rowWidth;       /* The width, in bytes, of a row in the table. */
+  OffsetTo<KernClassTable>
+                leftClassTable; /* Offset from beginning of this subtable to
+                                 * left-hand class table. */
+  OffsetTo<KernClassTable>
+                rightClassTable;/* Offset from beginning of this subtable to
+                                 * right-hand class table. */
+  OffsetTo<FWORD>
+                array;          /* Offset from beginning of this subtable to
+                                 * the start of the kerning array. */
+  public:
+  DEFINE_SIZE_MIN (8);
+};
+
+struct KernSubTable
+{
+  inline int get_kerning (hb_codepoint_t left, hb_codepoint_t right, const char *end, unsigned int format) const
+  {
+    switch (format) {
+    case 0: return u.format0.get_kerning (left, right);
+    case 2: return u.format2.get_kerning (left, right, end);
+    default:return 0;
+    }
+  }
+
+  inline bool sanitize (hb_sanitize_context_t *c, unsigned int format) const
+  {
+    TRACE_SANITIZE (this);
+    switch (format) {
+    case 0: return_trace (u.format0.sanitize (c));
+    case 2: return_trace (u.format2.sanitize (c));
+    default:return_trace (true);
+    }
+  }
+
+  protected:
+  union {
+  KernSubTableFormat0   format0;
+  KernSubTableFormat2   format2;
+  } u;
+  public:
+  DEFINE_SIZE_MIN (0);
+};
+
+
+template <typename T>
+struct KernSubTableWrapper
+{
+  /* https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern */
+  inline const T* thiz (void) const { return static_cast<const T *> (this); }
+
+  inline bool is_horizontal (void) const
+  { return (thiz()->coverage & T::COVERAGE_CHECK_FLAGS) == T::COVERAGE_CHECK_HORIZONTAL; }
+
+  inline bool is_override (void) const
+  { return bool (thiz()->coverage & T::COVERAGE_OVERRIDE_FLAG); }
+
+  inline int get_kerning (hb_codepoint_t left, hb_codepoint_t right, const char *end) const
+  { return thiz()->subtable.get_kerning (left, right, end, thiz()->format); }
+
+  inline int get_h_kerning (hb_codepoint_t left, hb_codepoint_t right, const char *end) const
+  { return is_horizontal () ? get_kerning (left, right, end) : 0; }
+
+  inline unsigned int get_size (void) const { return thiz()->length; }
+
+  inline bool sanitize (hb_sanitize_context_t *c) const
+  {
+    TRACE_SANITIZE (this);
+    return_trace (c->check_struct (thiz()) &&
+                  thiz()->length >= thiz()->min_size &&
+                  c->check_array (thiz(), 1, thiz()->length) &&
+                  thiz()->subtable.sanitize (c, thiz()->format));
+  }
+};
+
+template <typename T>
+struct KernTable
+{
+  /* https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern */
+  inline const T* thiz (void) const { return static_cast<const T *> (this); }
+
+  inline int get_h_kerning (hb_codepoint_t left, hb_codepoint_t right, unsigned int table_length) const
+  {
+    int v = 0;
+    const typename T::SubTableWrapper *st = CastP<typename T::SubTableWrapper> (thiz()->data);
+    unsigned int count = thiz()->nTables;
+    for (unsigned int i = 0; i < count; i++)
+    {
+      if (st->is_override ())
+        v = 0;
+      v += st->get_h_kerning (left, right, table_length + (const char *) this);
+      st = &StructAfter<typename T::SubTableWrapper> (*st);
+    }
+    return v;
+  }
+
+  inline bool sanitize (hb_sanitize_context_t *c) const
+  {
+    TRACE_SANITIZE (this);
+    if (unlikely (!c->check_struct (thiz()) ||
+                  thiz()->version != T::VERSION))
+      return_trace (false);
+
+    const typename T::SubTableWrapper *st = CastP<typename T::SubTableWrapper> (thiz()->data);
+    unsigned int count = thiz()->nTables;
+    for (unsigned int i = 0; i < count; i++)
+    {
+      if (unlikely (!st->sanitize (c)))
+        return_trace (false);
+      st = &StructAfter<typename T::SubTableWrapper> (*st);
+    }
+
+    return_trace (true);
+  }
+};
+
+struct KernOT : KernTable<KernOT>
+{
+  friend struct KernTable<KernOT>;
+
+  static const uint16_t VERSION = 0x0000u;
+
+  struct SubTableWrapper : KernSubTableWrapper<SubTableWrapper>
+  {
+    friend struct KernSubTableWrapper<SubTableWrapper>;
+
+    enum coverage_flags_t {
+      COVERAGE_DIRECTION_FLAG   = 0x01u,
+      COVERAGE_MINIMUM_FLAG     = 0x02u,
+      COVERAGE_CROSSSTREAM_FLAG = 0x04u,
+      COVERAGE_OVERRIDE_FLAG    = 0x08u,
+
+      COVERAGE_VARIATION_FLAG   = 0x00u, /* Not supported. */
+
+      COVERAGE_CHECK_FLAGS      = 0x07u,
+      COVERAGE_CHECK_HORIZONTAL = 0x01u
+    };
+
+    protected:
+    USHORT      versionZ;       /* Unused. */
+    USHORT      length;         /* Length of the subtable (including this header). */
+    BYTE        format;         /* Subtable format. */
+    BYTE        coverage;       /* Coverage bits. */
+    KernSubTable subtable;      /* Subtable data. */
+    public:
+    DEFINE_SIZE_MIN (6);
+  };
+
+  protected:
+  USHORT        version;        /* Version--0x0000u */
+  USHORT        nTables;        /* Number of subtables in the kerning table. */
+  BYTE          data[VAR];
+  public:
+  DEFINE_SIZE_ARRAY (4, data);
+};
+
+struct KernAAT : KernTable<KernAAT>
+{
+  friend struct KernTable<KernAAT>;
+
+  static const uint32_t VERSION = 0x00010000u;
+
+  struct SubTableWrapper : KernSubTableWrapper<SubTableWrapper>
+  {
+    friend struct KernSubTableWrapper<SubTableWrapper>;
+
+    enum coverage_flags_t {
+      COVERAGE_DIRECTION_FLAG   = 0x80u,
+      COVERAGE_CROSSSTREAM_FLAG = 0x40u,
+      COVERAGE_VARIATION_FLAG   = 0x20u,
+
+      COVERAGE_OVERRIDE_FLAG    = 0x00u, /* Not supported. */
+
+      COVERAGE_CHECK_FLAGS      = 0xE0u,
+      COVERAGE_CHECK_HORIZONTAL = 0x00u
+    };
+
+    protected:
+    ULONG       length;         /* Length of the subtable (including this header). */
+    BYTE        coverage;       /* Coverage bits. */
+    BYTE        format;         /* Subtable format. */
+    USHORT      tupleIndex;     /* The tuple index (used for variations fonts).
+                                 * This value specifies which tuple this subtable covers. */
+    KernSubTable subtable;      /* Subtable data. */
+    public:
+    DEFINE_SIZE_MIN (8);
+  };
+
+  protected:
+  ULONG         version;        /* Version--0x00010000u */
+  ULONG         nTables;        /* Number of subtables in the kerning table. */
+  BYTE          data[VAR];
+  public:
+  DEFINE_SIZE_ARRAY (8, data);
+};
+
+struct kern
+{
+  static const hb_tag_t tableTag = HB_OT_TAG_kern;
+
+  inline int get_h_kerning (hb_codepoint_t left, hb_codepoint_t right, unsigned int table_length) const
+  {
+    switch (u.major) {
+    case 0: return u.ot.get_h_kerning (left, right, table_length);
+    case 1: return u.aat.get_h_kerning (left, right, table_length);
+    default:return 0;
+    }
+  }
+
+  inline bool sanitize (hb_sanitize_context_t *c) const
+  {
+    TRACE_SANITIZE (this);
+    if (!u.major.sanitize (c)) return_trace (false);
+    switch (u.major) {
+    case 0: return_trace (u.ot.sanitize (c));
+    case 1: return_trace (u.aat.sanitize (c));
+    default:return_trace (true);
+    }
+  }
+
+  struct accelerator_t
+  {
+    inline void init (const kern *table_, unsigned int table_length_)
+    {
+      table = table_;
+      table_length = table_length_;
+    }
+    inline void fini (void) {}
+
+    inline int get_h_kerning (hb_codepoint_t left, hb_codepoint_t right) const
+    { return table->get_h_kerning (left, right, table_length); }
+
+    private:
+    const kern *table;
+    unsigned int table_length;
+  };
+
+  protected:
+  union {
+  USHORT                major;
+  KernOT                ot;
+  KernAAT               aat;
+  } u;
+  public:
+  DEFINE_SIZE_UNION (2, major);
+};
+
+} /* namespace OT */
+
+
+#endif /* HB_OT_KERN_TABLE_HH */
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-common-private.hh	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-common-private.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -29,6 +29,8 @@
 #ifndef HB_OT_LAYOUT_COMMON_PRIVATE_HH
 #define HB_OT_LAYOUT_COMMON_PRIVATE_HH
 
+#include "hb-private.hh"
+#include "hb-debug.hh"
 #include "hb-ot-layout-private.hh"
 #include "hb-open-type-private.hh"
 #include "hb-set-private.hh"
@@ -45,12 +47,6 @@
 namespace OT {
 
 
-#define TRACE_DISPATCH(this, format) \
-        hb_auto_trace_t<context_t::max_debug_depth, typename context_t::return_t> trace \
-        (&c->debug_depth, c->get_name (), this, HB_FUNC, \
-         "format %d", (int) format);
-
-
 #define NOT_COVERED             ((unsigned int) -1)
 
 
@@ -214,7 +210,7 @@
   }
 
   inline bool sanitize (hb_sanitize_context_t *c,
-                        const Record<LangSys>::sanitize_closure_t * = NULL) const
+                        const Record<LangSys>::sanitize_closure_t * = nullptr) const
   {
     TRACE_SANITIZE (this);
     return_trace (c->check_struct (this) && featureIndex.sanitize (c));
@@ -254,7 +250,7 @@
   inline const LangSys& get_default_lang_sys (void) const { return this+defaultLangSys; }
 
   inline bool sanitize (hb_sanitize_context_t *c,
-                        const Record<Script>::sanitize_closure_t * = NULL) const
+                        const Record<Script>::sanitize_closure_t * = nullptr) const
   {
     TRACE_SANITIZE (this);
     return_trace (defaultLangSys.sanitize (c, this) && langSys.sanitize (c, this));
@@ -435,17 +431,17 @@
                                          * specifies a string (or strings,
                                          * for multiple languages) for a
                                          * user-interface label for this
-                                         * feature. (May be NULL.) */
+                                         * feature. (May be nullptr.) */
   USHORT        featUITooltipTextNameID;/* The ‘name’ table name ID that
                                          * specifies a string (or strings,
                                          * for multiple languages) that an
                                          * application can use for tooltip
                                          * text for this feature. (May be
-                                         * NULL.) */
+                                         * nullptr.) */
   USHORT        sampleTextNameID;       /* The ‘name’ table name ID that
                                          * specifies sample text that
                                          * illustrates the effect of this
-                                         * feature. (May be NULL.) */
+                                         * feature. (May be nullptr.) */
   USHORT        numNamedParameters;     /* Number of named parameters. (May
                                          * be zero.) */
   USHORT        firstParamUILabelNameID;/* The first ‘name’ table name ID
@@ -507,7 +503,7 @@
   { return this+featureParams; }
 
   inline bool sanitize (hb_sanitize_context_t *c,
-                        const Record<Feature>::sanitize_closure_t *closure = NULL) const
+                        const Record<Feature>::sanitize_closure_t *closure = nullptr) const
   {
     TRACE_SANITIZE (this);
     if (unlikely (!(c->check_struct (this) && lookupIndex.sanitize (c))))
@@ -690,7 +686,7 @@
   inline unsigned int get_coverage (hb_codepoint_t glyph_id) const
   {
     int i = glyphArray.bsearch (glyph_id);
-    ASSERT_STATIC (((unsigned int) -1) == NOT_COVERED);
+    static_assert ((((unsigned int) -1) == NOT_COVERED), "");
     return i;
   }
 
@@ -941,7 +937,7 @@
   }
 
   struct Iter {
-    Iter (void) : format (0) {};
+    Iter (void) : format (0), u () {};
     inline void init (const Coverage &c_) {
       format = c_.u.format;
       switch (format) {
@@ -982,8 +978,8 @@
     private:
     unsigned int format;
     union {
+    CoverageFormat2::Iter       format2; /* Put this one first since it's larger; helps shut up compiler. */
     CoverageFormat1::Iter       format1;
-    CoverageFormat2::Iter       format2;
     } u;
   };
 
@@ -1323,6 +1319,14 @@
                                              this+regions);
   }
 
+  inline float get_delta (unsigned int index,
+                          int *coords, unsigned int coord_count) const
+  {
+    unsigned int outer = index >> 16;
+    unsigned int inner = index & 0xFFFF;
+    return get_delta (outer, inner, coords, coord_count);
+  }
+
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
@@ -1334,7 +1338,7 @@
 
   protected:
   USHORT                                format;
-  OffsetTo<VarRegionList, ULONG>        regions;
+  LOffsetTo<VarRegionList>              regions;
   OffsetArrayOf<VarData, ULONG>         dataSets;
   public:
   DEFINE_SIZE_ARRAY (8, dataSets);
@@ -1433,8 +1437,8 @@
   }
 
   protected:
-  USHORT                        featureIndex;
-  OffsetTo<Feature, ULONG>      feature;
+  USHORT                featureIndex;
+  LOffsetTo<Feature>    feature;
   public:
   DEFINE_SIZE_STATIC (6);
 };
@@ -1450,7 +1454,7 @@
       if (record.featureIndex == feature_index)
         return &(this+record.feature);
     }
-    return NULL;
+    return nullptr;
   }
 
   inline bool sanitize (hb_sanitize_context_t *c) const
@@ -1481,9 +1485,9 @@
   }
 
   protected:
-  OffsetTo<ConditionSet, ULONG>
+  LOffsetTo<ConditionSet>
                         conditions;
-  OffsetTo<FeatureTableSubstitution, ULONG>
+  LOffsetTo<FeatureTableSubstitution>
                         substitutions;
   public:
   DEFINE_SIZE_STATIC (8);
@@ -1527,7 +1531,7 @@
 
   protected:
   FixedVersion<>        version;        /* Version--0x00010000u */
-  ArrayOf<FeatureVariationRecord, ULONG>
+  LArrayOf<FeatureVariationRecord>
                         varRecords;
   public:
   DEFINE_SIZE_ARRAY (8, varRecords);
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-gdef-table.hh	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-gdef-table.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -295,7 +295,7 @@
 
   protected:
   USHORT        format;                 /* Format identifier--format = 1 */
-  ArrayOf<OffsetTo<Coverage, ULONG> >
+  ArrayOf<LOffsetTo<Coverage> >
                 coverage;               /* Array of long offsets to mark set
                                          * coverage tables */
   public:
@@ -404,9 +404,9 @@
   {
     unsigned int klass = get_glyph_class (glyph);
 
-    ASSERT_STATIC ((unsigned int) HB_OT_LAYOUT_GLYPH_PROPS_BASE_GLYPH == (unsigned int) LookupFlag::IgnoreBaseGlyphs);
-    ASSERT_STATIC ((unsigned int) HB_OT_LAYOUT_GLYPH_PROPS_LIGATURE == (unsigned int) LookupFlag::IgnoreLigatures);
-    ASSERT_STATIC ((unsigned int) HB_OT_LAYOUT_GLYPH_PROPS_MARK == (unsigned int) LookupFlag::IgnoreMarks);
+    static_assert (((unsigned int) HB_OT_LAYOUT_GLYPH_PROPS_BASE_GLYPH == (unsigned int) LookupFlag::IgnoreBaseGlyphs), "");
+    static_assert (((unsigned int) HB_OT_LAYOUT_GLYPH_PROPS_LIGATURE == (unsigned int) LookupFlag::IgnoreLigatures), "");
+    static_assert (((unsigned int) HB_OT_LAYOUT_GLYPH_PROPS_MARK == (unsigned int) LookupFlag::IgnoreMarks), "");
 
     switch (klass) {
     default:                    return 0;
@@ -443,7 +443,7 @@
                                          * definitions--from beginning of GDEF
                                          * header (may be NULL).  Introduced
                                          * in version 0x00010002. */
-  OffsetTo<VariationStore, ULONG>
+  LOffsetTo<VariationStore>
                 varStore;               /* Offset to the table of Item Variation
                                          * Store--from beginning of GDEF
                                          * header (may be NULL).  Introduced
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-gpos-table.hh	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-gpos-table.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -432,6 +432,7 @@
 
     hb_position_t mark_x, mark_y, base_x, base_y;
 
+    buffer->unsafe_to_break (glyph_pos, buffer->idx);
     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);
 
@@ -643,6 +644,7 @@
         min = mid + 1;
       else
       {
+        buffer->unsafe_to_break (buffer->idx, pos + 1);
         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)
@@ -790,6 +792,7 @@
     unsigned int klass2 = (this+classDef2).get_class (buffer->info[skippy_iter.idx].codepoint);
     if (unlikely (klass1 >= class1Count || klass2 >= class2Count)) return_trace (false);
 
+    buffer->unsafe_to_break (buffer->idx, skippy_iter.idx + 1);
     const Value *v = &values[record_len * (klass1 * class2Count + klass2)];
     valueFormat1.apply_value (c, this, v, buffer->cur_pos());
     valueFormat2.apply_value (c, this, v + len1, buffer->pos[skippy_iter.idx]);
@@ -929,6 +932,7 @@
     unsigned int i = buffer->idx;
     unsigned int j = skippy_iter.idx;
 
+    buffer->unsafe_to_break (i, j);
     hb_position_t entry_x, entry_y, exit_x, exit_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);
@@ -1083,7 +1087,9 @@
     do {
       if (!skippy_iter.prev ()) return_trace (false);
       /* We only want to attach to the first of a MultipleSubst sequence.  Reject others. */
-      if (0 == _hb_glyph_info_get_lig_comp (&buffer->info[skippy_iter.idx])) break;
+      if (!_hb_glyph_info_multiplied (&buffer->info[skippy_iter.idx]) ||
+          0 == _hb_glyph_info_get_lig_comp (&buffer->info[skippy_iter.idx]))
+        break;
       skippy_iter.reject ();
     } while (1);
 
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-gsub-table.hh	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-gsub-table.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -658,7 +658,7 @@
     if (likely (!match_input (c, count,
                               &component[1],
                               match_glyph,
-                              NULL,
+                              nullptr,
                               &match_length,
                               match_positions,
                               &is_mark_ligature,
@@ -1014,14 +1014,17 @@
     const OffsetArrayOf<Coverage> &lookahead = StructAfter<OffsetArrayOf<Coverage> > (backtrack);
     const ArrayOf<GlyphID> &substitute = StructAfter<ArrayOf<GlyphID> > (lookahead);
 
+  unsigned int start_index = 0, end_index = 0;
     if (match_backtrack (c,
                          backtrack.len, (USHORT *) backtrack.array,
-                         match_coverage, this) &&
+                         match_coverage, this,
+                         &start_index) &&
         match_lookahead (c,
                          lookahead.len, (USHORT *) lookahead.array,
                          match_coverage, this,
-                         1))
+                         1, &end_index))
     {
+      c->buffer->unsafe_to_break_from_outbuffer (start_index, end_index);
       c->replace_glyph_inplace (substitute[index]);
       /* Note: We DON'T decrease buffer->idx.  The main loop does it
        * for us.  This is useful for preventing surprises if someone
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-gsubgpos-private.hh	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-gsubgpos-private.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -29,6 +29,8 @@
 #ifndef HB_OT_LAYOUT_GSUBGPOS_PRIVATE_HH
 #define HB_OT_LAYOUT_GSUBGPOS_PRIVATE_HH
 
+#include "hb-private.hh"
+#include "hb-debug.hh"
 #include "hb-buffer-private.hh"
 #include "hb-ot-layout-gdef-table.hh"
 #include "hb-set-private.hh"
@@ -37,15 +39,6 @@
 namespace OT {
 
 
-#ifndef HB_DEBUG_CLOSURE
-#define HB_DEBUG_CLOSURE (HB_DEBUG+0)
-#endif
-
-#define TRACE_CLOSURE(this) \
-        hb_auto_trace_t<HB_DEBUG_CLOSURE, hb_void_t> trace \
-        (&c->debug_depth, c->get_name (), this, HB_FUNC, \
-         "");
-
 struct hb_closure_context_t :
        hb_dispatch_context_t<hb_closure_context_t, hb_void_t, HB_DEBUG_CLOSURE>
 {
@@ -77,7 +70,7 @@
                         unsigned int nesting_level_left_ = HB_MAX_NESTING_LEVEL) :
                           face (face_),
                           glyphs (glyphs_),
-                          recurse_func (NULL),
+                          recurse_func (nullptr),
                           nesting_level_left (nesting_level_left_),
                           debug_depth (0) {}
 
@@ -85,16 +78,6 @@
 };
 
 
-
-#ifndef HB_DEBUG_WOULD_APPLY
-#define HB_DEBUG_WOULD_APPLY (HB_DEBUG+0)
-#endif
-
-#define TRACE_WOULD_APPLY(this) \
-        hb_auto_trace_t<HB_DEBUG_WOULD_APPLY, bool> trace \
-        (&c->debug_depth, c->get_name (), this, HB_FUNC, \
-         "%d glyphs", c->len);
-
 struct hb_would_apply_context_t :
        hb_dispatch_context_t<hb_would_apply_context_t, bool, HB_DEBUG_WOULD_APPLY>
 {
@@ -122,16 +105,6 @@
 };
 
 
-
-#ifndef HB_DEBUG_COLLECT_GLYPHS
-#define HB_DEBUG_COLLECT_GLYPHS (HB_DEBUG+0)
-#endif
-
-#define TRACE_COLLECT_GLYPHS(this) \
-        hb_auto_trace_t<HB_DEBUG_COLLECT_GLYPHS, hb_void_t> trace \
-        (&c->debug_depth, c->get_name (), this, HB_FUNC, \
-         "");
-
 struct hb_collect_glyphs_context_t :
        hb_dispatch_context_t<hb_collect_glyphs_context_t, hb_void_t, HB_DEBUG_COLLECT_GLYPHS>
 {
@@ -146,7 +119,7 @@
     if (unlikely (nesting_level_left == 0 || !recurse_func))
       return default_return_value ();
 
-    /* Note that GPOS sets recurse_func to NULL already, so it doesn't get
+    /* Note that GPOS sets recurse_func to nullptr already, so it doesn't get
      * past the previous check.  For GSUB, we only want to collect the output
      * glyphs in the recursion.  If output is not requested, we can go home now.
      *
@@ -160,7 +133,7 @@
       return HB_VOID;
 
     /* Return if new lookup was recursed to before. */
-    if (recursed_lookups.has (lookup_index))
+    if (recursed_lookups->has (lookup_index))
       return HB_VOID;
 
     hb_set_t *old_before = before;
@@ -176,7 +149,7 @@
     input  = old_input;
     after  = old_after;
 
-    recursed_lookups.add (lookup_index);
+    recursed_lookups->add (lookup_index);
 
     return HB_VOID;
   }
@@ -187,31 +160,31 @@
   hb_set_t *after;
   hb_set_t *output;
   recurse_func_t recurse_func;
-  hb_set_t recursed_lookups;
+  hb_set_t *recursed_lookups;
   unsigned int nesting_level_left;
   unsigned int debug_depth;
 
   hb_collect_glyphs_context_t (hb_face_t *face_,
-                               hb_set_t  *glyphs_before, /* OUT. May be NULL */
-                               hb_set_t  *glyphs_input,  /* OUT. May be NULL */
-                               hb_set_t  *glyphs_after,  /* OUT. May be NULL */
-                               hb_set_t  *glyphs_output, /* OUT. May be NULL */
+                               hb_set_t  *glyphs_before, /* OUT. May be nullptr */
+                               hb_set_t  *glyphs_input,  /* OUT. May be nullptr */
+                               hb_set_t  *glyphs_after,  /* OUT. May be nullptr */
+                               hb_set_t  *glyphs_output, /* OUT. May be nullptr */
                                unsigned int nesting_level_left_ = HB_MAX_NESTING_LEVEL) :
                               face (face_),
                               before (glyphs_before ? glyphs_before : hb_set_get_empty ()),
                               input  (glyphs_input  ? glyphs_input  : hb_set_get_empty ()),
                               after  (glyphs_after  ? glyphs_after  : hb_set_get_empty ()),
                               output (glyphs_output ? glyphs_output : hb_set_get_empty ()),
-                              recurse_func (NULL),
-                              recursed_lookups (),
+                              recurse_func (nullptr),
+                              recursed_lookups (nullptr),
                               nesting_level_left (nesting_level_left_),
                               debug_depth (0)
   {
-    recursed_lookups.init ();
+    recursed_lookups = hb_set_create ();
   }
   ~hb_collect_glyphs_context_t (void)
   {
-    recursed_lookups.fini ();
+    hb_set_destroy (recursed_lookups);
   }
 
   void set_recurse_func (recurse_func_t func) { recurse_func = func; }
@@ -219,10 +192,6 @@
 
 
 
-#ifndef HB_DEBUG_GET_COVERAGE
-#define HB_DEBUG_GET_COVERAGE (HB_DEBUG+0)
-#endif
-
 /* XXX Can we remove this? */
 
 template <typename set_t>
@@ -249,17 +218,6 @@
 };
 
 
-
-#ifndef HB_DEBUG_APPLY
-#define HB_DEBUG_APPLY (HB_DEBUG+0)
-#endif
-
-#define TRACE_APPLY(this) \
-        hb_auto_trace_t<HB_DEBUG_APPLY, bool> trace \
-        (&c->debug_depth, c->get_name (), this, HB_FUNC, \
-         "idx %d gid %u lookup %d", \
-         c->buffer->idx, c->buffer->cur().codepoint, (int) c->lookup_index);
-
 struct hb_apply_context_t :
        hb_dispatch_context_t<hb_apply_context_t, bool, HB_DEBUG_APPLY>
 {
@@ -273,8 +231,8 @@
 #define arg1(arg) (arg) /* Remove the macro to see why it's needed! */
              syllable arg1(0),
 #undef arg1
-             match_func (NULL),
-             match_data (NULL) {};
+             match_func (nullptr),
+             match_data (nullptr) {};
 
     typedef bool (*match_func_t) (hb_codepoint_t glyph_id, const USHORT &value, const void *data);
 
@@ -319,7 +277,7 @@
       if (!c->check_glyph_property (&info, lookup_props))
         return SKIP_YES;
 
-      if (unlikely (_hb_glyph_info_is_default_ignorable_and_not_fvs (&info) &&
+      if (unlikely (_hb_glyph_info_is_default_ignorable_and_not_hidden (&info) &&
                     (ignore_zwnj || !_hb_glyph_info_is_zwnj (&info)) &&
                     (ignore_zwj || !_hb_glyph_info_is_zwj (&info))))
         return SKIP_MAYBE;
@@ -342,13 +300,13 @@
     inline void init (hb_apply_context_t *c_, bool context_match = false)
     {
       c = c_;
-      match_glyph_data = NULL,
-      matcher.set_match_func (NULL, NULL);
+      match_glyph_data = nullptr;
+      matcher.set_match_func (nullptr, nullptr);
       matcher.set_lookup_props (c->lookup_props);
       /* Ignore ZWNJ if we are matching GSUB context, or matching GPOS. */
-      matcher.set_ignore_zwnj (context_match || c->table_index == 1);
+      matcher.set_ignore_zwnj (c->table_index == 1 || (context_match && c->auto_zwnj));
       /* Ignore ZWJ if we are matching GSUB context, or matching GPOS, or if asked to. */
-      matcher.set_ignore_zwj (context_match || c->table_index == 1 || c->auto_zwj);
+      matcher.set_ignore_zwj  (c->table_index == 1 || (context_match || c->auto_zwj));
       matcher.set_mask (context_match ? -1 : c->lookup_mask);
     }
     inline void set_lookup_props (unsigned int lookup_props)
@@ -374,6 +332,13 @@
 
     inline void reject (void) { num_items++; match_glyph_data--; }
 
+    inline matcher_t::may_skip_t
+    may_skip (const hb_apply_context_t *c,
+              const hb_glyph_info_t    &info) const
+    {
+      return matcher.may_skip (c, info);
+    }
+
     inline bool next (void)
     {
       assert (num_items > 0);
@@ -457,45 +422,50 @@
     return ret;
   }
 
-  unsigned int table_index; /* GSUB/GPOS */
+  skipping_iterator_t iter_input, iter_context;
+
   hb_font_t *font;
   hb_face_t *face;
   hb_buffer_t *buffer;
+  recurse_func_t recurse_func;
+  const GDEF &gdef;
+  const VariationStore &var_store;
+
   hb_direction_t direction;
   hb_mask_t lookup_mask;
-  bool auto_zwj;
-  recurse_func_t recurse_func;
-  unsigned int nesting_level_left;
+  unsigned int table_index; /* GSUB/GPOS */
+  unsigned int lookup_index;
   unsigned int lookup_props;
-  const GDEF &gdef;
+  unsigned int nesting_level_left;
+  unsigned int debug_depth;
+
+  bool auto_zwnj;
+  bool auto_zwj;
   bool has_glyph_classes;
-  const VariationStore &var_store;
-  skipping_iterator_t iter_input, iter_context;
-  unsigned int lookup_index;
-  unsigned int debug_depth;
 
 
   hb_apply_context_t (unsigned int table_index_,
                       hb_font_t *font_,
                       hb_buffer_t *buffer_) :
-                        table_index (table_index_),
+                        iter_input (), iter_context (),
                         font (font_), face (font->face), buffer (buffer_),
+                        recurse_func (nullptr),
+                        gdef (*hb_ot_layout_from_face (face)->gdef),
+                        var_store (gdef.get_var_store ()),
                         direction (buffer_->props.direction),
                         lookup_mask (1),
-                        auto_zwj (true),
-                        recurse_func (NULL),
-                        nesting_level_left (HB_MAX_NESTING_LEVEL),
+                        table_index (table_index_),
+                        lookup_index ((unsigned int) -1),
                         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),
-                        debug_depth (0) {}
+                        nesting_level_left (HB_MAX_NESTING_LEVEL),
+                        debug_depth (0),
+                        auto_zwnj (true),
+                        auto_zwj (true),
+                        has_glyph_classes (gdef.has_glyph_classes ()) {}
 
   inline void set_lookup_mask (hb_mask_t mask) { lookup_mask = mask; }
   inline void set_auto_zwj (bool auto_zwj_) { auto_zwj = auto_zwj_; }
+  inline void set_auto_zwnj (bool auto_zwnj_) { auto_zwnj = auto_zwnj_; }
   inline void set_recurse_func (recurse_func_t func) { recurse_func = func; }
   inline void set_lookup_index (unsigned int lookup_index_) { lookup_index = lookup_index_; }
   inline void set_lookup_props (unsigned int lookup_props_)
@@ -707,10 +677,10 @@
                                 const void *match_data,
                                 unsigned int *end_offset,
                                 unsigned int match_positions[HB_MAX_CONTEXT_LENGTH],
-                                bool *p_is_mark_ligature = NULL,
-                                unsigned int *p_total_component_count = NULL)
+                                bool *p_is_mark_ligature = nullptr,
+                                unsigned int *p_total_component_count = nullptr)
 {
-  TRACE_APPLY (NULL);
+  TRACE_APPLY (nullptr);
 
   if (unlikely (count > HB_MAX_CONTEXT_LENGTH)) return_trace (false);
 
@@ -731,11 +701,17 @@
    * - Ligatures cannot be formed across glyphs attached to different components
    *   of previous ligatures.  Eg. the sequence is LAM,SHADDA,LAM,FATHA,HEH, and
    *   LAM,LAM,HEH form a ligature, leaving SHADDA,FATHA next to eachother.
-   *   However, it would be wrong to ligate that SHADDA,FATHA sequence.o
-   *   There is an exception to this: If a ligature tries ligating with marks that
-   *   belong to it itself, go ahead, assuming that the font designer knows what
-   *   they are doing (otherwise it can break Indic stuff when a matra wants to
-   *   ligate with a conjunct...)
+   *   However, it would be wrong to ligate that SHADDA,FATHA sequence.
+   *   There are a couple of exceptions to this:
+   *
+   *   o If a ligature tries ligating with marks that belong to it itself, go ahead,
+   *     assuming that the font designer knows what they are doing (otherwise it can
+   *     break Indic stuff when a matra wants to ligate with a conjunct,
+   *
+   *   o If two marks want to ligate and they belong to different components of the
+   *     same ligature glyph, and said ligature glyph is to be ignored according to
+   *     mark-filtering rules, then allow.
+   *     https://github.com/behdad/harfbuzz/issues/545
    */
 
   bool is_mark_ligature = _hb_glyph_info_is_mark (&buffer->cur());
@@ -746,6 +722,12 @@
   unsigned int first_lig_id = _hb_glyph_info_get_lig_id (&buffer->cur());
   unsigned int first_lig_comp = _hb_glyph_info_get_lig_comp (&buffer->cur());
 
+  enum {
+    LIGBASE_NOT_CHECKED,
+    LIGBASE_MAY_NOT_SKIP,
+    LIGBASE_MAY_SKIP
+  } ligbase = LIGBASE_NOT_CHECKED;
+
   match_positions[0] = buffer->idx;
   for (unsigned int i = 1; i < count; i++)
   {
@@ -756,13 +738,43 @@
     unsigned int this_lig_id = _hb_glyph_info_get_lig_id (&buffer->info[skippy_iter.idx]);
     unsigned int this_lig_comp = _hb_glyph_info_get_lig_comp (&buffer->info[skippy_iter.idx]);
 
-    if (first_lig_id && first_lig_comp) {
+    if (first_lig_id && first_lig_comp)
+    {
       /* If first component was attached to a previous ligature component,
        * all subsequent components should be attached to the same ligature
-       * component, otherwise we shouldn't ligate them. */
+       * component, otherwise we shouldn't ligate them... */
       if (first_lig_id != this_lig_id || first_lig_comp != this_lig_comp)
-        return_trace (false);
-    } else {
+      {
+        /* ...unless, we are attached to a base ligature and that base
+         * ligature is ignorable. */
+        if (ligbase == LIGBASE_NOT_CHECKED)
+        {
+          bool found = false;
+          const hb_glyph_info_t *out = buffer->out_info;
+          unsigned int j = buffer->out_len;
+          while (j && _hb_glyph_info_get_lig_id (&out[j - 1]) == first_lig_id)
+          {
+            if (_hb_glyph_info_get_lig_comp (&out[j - 1]) == 0)
+            {
+              j--;
+              found = true;
+              break;
+            }
+            j--;
+          }
+
+          if (found && skippy_iter.may_skip (c, out[j]) == hb_apply_context_t::matcher_t::SKIP_YES)
+            ligbase = LIGBASE_MAY_SKIP;
+          else
+            ligbase = LIGBASE_MAY_NOT_SKIP;
+        }
+
+        if (ligbase == LIGBASE_MAY_NOT_SKIP)
+          return_trace (false);
+      }
+    }
+    else
+    {
       /* If first component was NOT attached to a previous ligature component,
        * all subsequent components should also NOT be attached to any ligature
        * component, unless they are attached to the first component itself! */
@@ -792,7 +804,7 @@
                                  bool is_mark_ligature,
                                  unsigned int total_component_count)
 {
-  TRACE_APPLY (NULL);
+  TRACE_APPLY (nullptr);
 
   hb_buffer_t *buffer = c->buffer;
 
@@ -886,9 +898,10 @@
                                     unsigned int count,
                                     const USHORT backtrack[],
                                     match_func_t match_func,
-                                    const void *match_data)
+                                    const void *match_data,
+                                    unsigned int *match_start)
 {
-  TRACE_APPLY (NULL);
+  TRACE_APPLY (nullptr);
 
   hb_apply_context_t::skipping_iterator_t &skippy_iter = c->iter_context;
   skippy_iter.reset (c->buffer->backtrack_len (), count);
@@ -898,6 +911,8 @@
     if (!skippy_iter.prev ())
       return_trace (false);
 
+  *match_start = skippy_iter.idx;
+
   return_trace (true);
 }
 
@@ -906,9 +921,10 @@
                                     const USHORT lookahead[],
                                     match_func_t match_func,
                                     const void *match_data,
-                                    unsigned int offset)
+                                    unsigned int offset,
+                                    unsigned int *end_index)
 {
-  TRACE_APPLY (NULL);
+  TRACE_APPLY (nullptr);
 
   hb_apply_context_t::skipping_iterator_t &skippy_iter = c->iter_context;
   skippy_iter.reset (c->buffer->idx + offset - 1, count);
@@ -918,6 +934,8 @@
     if (!skippy_iter.next ())
       return_trace (false);
 
+  *end_index = skippy_iter.idx + 1;
+
   return_trace (true);
 }
 
@@ -956,10 +974,10 @@
                                  const LookupRecord lookupRecord[], /* Array of LookupRecords--in design order */
                                  unsigned int match_length)
 {
-  TRACE_APPLY (NULL);
+  TRACE_APPLY (nullptr);
 
   hb_buffer_t *buffer = c->buffer;
-  unsigned int end;
+  int end;
 
   /* All positions are distance from beginning of *output* buffer.
    * Adjust. */
@@ -996,10 +1014,32 @@
     if (!delta)
         continue;
 
-    /* Recursed lookup changed buffer len.  Adjust. */
+    /* Recursed lookup changed buffer len.  Adjust.
+     *
+     * TODO:
+     *
+     * Right now, if buffer length increased by n, we assume n new glyphs
+     * were added right after the current position, and if buffer length
+     * was decreased by n, we assume n match positions after the current
+     * one where removed.  The former (buffer length increased) case is
+     * fine, but the decrease case can be improved in at least two ways,
+     * both of which are significant:
+     *
+     *   - If recursed-to lookup is MultipleSubst and buffer length
+     *     decreased, then it's current match position that was deleted,
+     *     NOT the one after it.
+     *
+     *   - If buffer length was decreased by n, it does not necessarily
+     *     mean that n match positions where removed, as there might
+     *     have been marks and default-ignorables in the sequence.  We
+     *     should instead drop match positions between current-position
+     *     and current-position + n instead.
+     *
+     * It should be possible to construct tests for both of these cases.
+     */
 
-    end = int (end) + delta;
-    if (end <= match_positions[idx])
+    end += delta;
+    if (end <= int (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.
@@ -1118,10 +1158,11 @@
                       inputCount, input,
                       lookup_context.funcs.match, lookup_context.match_data,
                       &match_length, match_positions)
-      && apply_lookup (c,
+      && (c->buffer->unsafe_to_break (c->buffer->idx, c->buffer->idx + match_length),
+          apply_lookup (c,
                        inputCount, match_positions,
                        lookupCount, lookupRecord,
-                       match_length);
+                       match_length));
 }
 
 struct Rule
@@ -1164,11 +1205,11 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return inputCount.sanitize (c)
-        && lookupCount.sanitize (c)
-        && c->check_range (inputZ,
-                           inputZ[0].static_size * inputCount
-                           + lookupRecordX[0].static_size * lookupCount);
+    return_trace (inputCount.sanitize (c) &&
+                  lookupCount.sanitize (c) &&
+                  c->check_range (inputZ,
+                                  inputZ[0].static_size * inputCount +
+                                  lookupRecordX[0].static_size * lookupCount));
   }
 
   protected:
@@ -1251,7 +1292,7 @@
 
     struct ContextClosureLookupContext lookup_context = {
       {intersects_glyph},
-      NULL
+      nullptr
     };
 
     unsigned int count = ruleSet.len;
@@ -1269,7 +1310,7 @@
 
     struct ContextCollectGlyphsLookupContext lookup_context = {
       {collect_glyph},
-      NULL
+      nullptr
     };
 
     unsigned int count = ruleSet.len;
@@ -1284,7 +1325,7 @@
     const RuleSet &rule_set = this+ruleSet[(this+coverage).get_coverage (c->glyphs[0])];
     struct ContextApplyLookupContext lookup_context = {
       {match_glyph},
-      NULL
+      nullptr
     };
     return_trace (rule_set.would_apply (c, lookup_context));
   }
@@ -1304,7 +1345,7 @@
     const RuleSet &rule_set = this+ruleSet[index];
     struct ContextApplyLookupContext lookup_context = {
       {match_glyph},
-      NULL
+      nullptr
     };
     return_trace (rule_set.apply (c, lookup_context));
   }
@@ -1639,7 +1680,7 @@
                                                const LookupRecord lookupRecord[],
                                                ChainContextApplyLookupContext &lookup_context)
 {
-  unsigned int match_length = 0;
+  unsigned int start_index = 0, match_length = 0, end_index = 0;
   unsigned int match_positions[HB_MAX_CONTEXT_LENGTH];
   return match_input (c,
                       inputCount, input,
@@ -1647,15 +1688,17 @@
                       &match_length, match_positions)
       && match_backtrack (c,
                           backtrackCount, backtrack,
-                          lookup_context.funcs.match, lookup_context.match_data[0])
+                          lookup_context.funcs.match, lookup_context.match_data[0],
+                          &start_index)
       && match_lookahead (c,
                           lookaheadCount, lookahead,
                           lookup_context.funcs.match, lookup_context.match_data[2],
-                          match_length)
-      && apply_lookup (c,
+                          match_length, &end_index)
+      && (c->buffer->unsafe_to_break_from_outbuffer (start_index, end_index),
+          apply_lookup (c,
                        inputCount, match_positions,
                        lookupCount, lookupRecord,
-                       match_length);
+                       match_length));
 }
 
 struct ChainRule
@@ -1807,7 +1850,7 @@
 
     struct ChainContextClosureLookupContext lookup_context = {
       {intersects_glyph},
-      {NULL, NULL, NULL}
+      {nullptr, nullptr, nullptr}
     };
 
     unsigned int count = ruleSet.len;
@@ -1825,7 +1868,7 @@
 
     struct ChainContextCollectGlyphsLookupContext lookup_context = {
       {collect_glyph},
-      {NULL, NULL, NULL}
+      {nullptr, nullptr, nullptr}
     };
 
     unsigned int count = ruleSet.len;
@@ -1840,7 +1883,7 @@
     const ChainRuleSet &rule_set = this+ruleSet[(this+coverage).get_coverage (c->glyphs[0])];
     struct ChainContextApplyLookupContext lookup_context = {
       {match_glyph},
-      {NULL, NULL, NULL}
+      {nullptr, nullptr, nullptr}
     };
     return_trace (rule_set.would_apply (c, lookup_context));
   }
@@ -1859,7 +1902,7 @@
     const ChainRuleSet &rule_set = this+ruleSet[index];
     struct ChainContextApplyLookupContext lookup_context = {
       {match_glyph},
-      {NULL, NULL, NULL}
+      {nullptr, nullptr, nullptr}
     };
     return_trace (rule_set.apply (c, lookup_context));
   }
@@ -2313,7 +2356,7 @@
                 featureList;    /* FeatureList table */
   OffsetTo<LookupList>
                 lookupList;     /* LookupList table */
-  OffsetTo<FeatureVariations, ULONG>
+  LOffsetTo<FeatureVariations>
                 featureVars;    /* Offset to Feature Variations
                                    table--from beginning of table
                                  * (may be NULL).  Introduced
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-jstf-table.hh	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-jstf-table.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -124,7 +124,7 @@
 struct JstfLangSys : OffsetListOf<JstfPriority>
 {
   inline bool sanitize (hb_sanitize_context_t *c,
-                        const Record<JstfLangSys>::sanitize_closure_t * = NULL) const
+                        const Record<JstfLangSys>::sanitize_closure_t * = nullptr) const
   {
     TRACE_SANITIZE (this);
     return_trace (OffsetListOf<JstfPriority>::sanitize (c));
@@ -165,7 +165,7 @@
   inline const JstfLangSys& get_default_lang_sys (void) const { return this+defaultLangSys; }
 
   inline bool sanitize (hb_sanitize_context_t *c,
-                        const Record<JstfScript>::sanitize_closure_t * = NULL) const
+                        const Record<JstfScript>::sanitize_closure_t * = nullptr) const
   {
     TRACE_SANITIZE (this);
     return_trace (extenderGlyphs.sanitize (c, this) &&
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-private.hh	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-private.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -33,7 +33,8 @@
 
 #include "hb-font-private.hh"
 #include "hb-buffer-private.hh"
-#include "hb-set-private.hh"
+#include "hb-set-digest-private.hh"
+#include "hb-open-type-private.hh"
 
 
 /* Private API corresponding to hb-ot-layout.h: */
@@ -125,6 +126,8 @@
   struct GSUB;
   struct GPOS;
   struct MATH;
+  struct fvar;
+  struct avar;
 }
 
 struct hb_ot_layout_lookup_accelerator_t
@@ -153,12 +156,15 @@
   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;
+
+  /* TODO Move the following out of this struct. */
+  OT::hb_lazy_table_loader_t<struct OT::MATH> math;
+  OT::hb_lazy_table_loader_t<struct OT::fvar> fvar;
+  OT::hb_lazy_table_loader_t<struct OT::avar> avar;
 
   unsigned int gsub_lookup_count;
   unsigned int gpos_lookup_count;
@@ -191,8 +197,7 @@
 #define syllable()              var1.u8[3] /* GSUB/GPOS shaping boundaries */
 
 
-/* loop over syllables */
-
+/* Loop over syllables. Based on foreach_cluster(). */
 #define foreach_syllable(buffer, start, end) \
   for (unsigned int \
        _count = buffer->len, \
@@ -221,7 +226,9 @@
  * - General_Category: 5 bits.
  * - A bit each for:
  *   * Is it Default_Ignorable(); we have a modified Default_Ignorable().
- *   * Whether it's one of the three Mongolian Free Variation Selectors.
+ *   * Whether it's one of the three Mongolian Free Variation Selectors,
+ *     CGJ, or other characters that are hidden but should not be ignored
+ *     like most other Default_Ignorable()s do during matching.
  *   * One free bit right now.
  *
  * The high-byte has different meanings, switched by the Gen-Cat:
@@ -234,7 +241,8 @@
 enum hb_unicode_props_flags_t {
   UPROPS_MASK_GEN_CAT   = 0x001Fu,
   UPROPS_MASK_IGNORABLE = 0x0020u,
-  UPROPS_MASK_FVS       = 0x0040u, /* MONGOLIAN FREE VARIATION SELECTOR 1..3 */
+  UPROPS_MASK_HIDDEN    = 0x0040u, /* MONGOLIAN FREE VARIATION SELECTOR 1..3,
+                                    * or TAG characters */
 
   /* If GEN_CAT=FORMAT, top byte masks: */
   UPROPS_MASK_Cf_ZWJ    = 0x0100u,
@@ -258,16 +266,21 @@
       buffer->scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_DEFAULT_IGNORABLES;
       props |=  UPROPS_MASK_IGNORABLE;
       if (u == 0x200Cu) props |= UPROPS_MASK_Cf_ZWNJ;
-      if (u == 0x200Du) props |= UPROPS_MASK_Cf_ZWJ;
+      else if (u == 0x200Du) props |= UPROPS_MASK_Cf_ZWJ;
       /* Mongolian Free Variation Selectors need to be remembered
        * because although we need to hide them like default-ignorables,
        * they need to non-ignorable during shaping.  This is similar to
        * what we do for joiners in Indic-like shapers, but since the
        * FVSes are GC=Mn, we have use a separate bit to remember them.
        * Fixes:
-       * https://github.com/behdad/harfbuzz/issues/234
-       */
-      if (unlikely (hb_in_range (u, 0x180Bu, 0x180Du))) props |= UPROPS_MASK_FVS;
+       * https://github.com/behdad/harfbuzz/issues/234 */
+      else if (unlikely (hb_in_range (u, 0x180Bu, 0x180Du))) props |= UPROPS_MASK_HIDDEN;
+      /* TAG characters need similar treatment. Fixes:
+       * https://github.com/behdad/harfbuzz/issues/463 */
+      else if (unlikely (hb_in_range (u, 0xE0020u, 0xE007Fu))) props |= UPROPS_MASK_HIDDEN;
+      /* COMBINING GRAPHEME JOINER should not be skipped; at least some times.
+       * https://github.com/behdad/harfbuzz/issues/554 */
+      else if (unlikely (u == 0x034Fu)) props |= UPROPS_MASK_HIDDEN;
     }
     else if (unlikely (HB_UNICODE_GENERAL_CATEGORY_IS_NON_ENCLOSING_MARK_OR_MODIFIER_SYMBOL (gen_cat)))
     {
@@ -337,6 +350,8 @@
   return _hb_glyph_info_is_unicode_mark (info) ? info->unicode_props()>>8 : 0;
 }
 
+#define info_cc(info) (_hb_glyph_info_get_modified_combining_class (&(info)))
+
 static inline bool
 _hb_glyph_info_is_unicode_space (const hb_glyph_info_t *info)
 {
@@ -367,9 +382,9 @@
          !_hb_glyph_info_ligated (info);
 }
 static inline hb_bool_t
-_hb_glyph_info_is_default_ignorable_and_not_fvs (const hb_glyph_info_t *info)
+_hb_glyph_info_is_default_ignorable_and_not_hidden (const hb_glyph_info_t *info)
 {
-  return ((info->unicode_props() & (UPROPS_MASK_IGNORABLE|UPROPS_MASK_FVS))
+  return ((info->unicode_props() & (UPROPS_MASK_IGNORABLE|UPROPS_MASK_HIDDEN))
           == UPROPS_MASK_IGNORABLE) &&
          !_hb_glyph_info_ligated (info);
 }
@@ -617,5 +632,4 @@
 #undef lig_props
 #undef glyph_props
 
-
 #endif /* HB_OT_LAYOUT_PRIVATE_HH */
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout.cc	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout.cc	Wed Dec 13 10:25:38 2017 -0800
@@ -34,22 +34,21 @@
 #include "hb-ot-layout-gdef-table.hh"
 #include "hb-ot-layout-gsub-table.hh"
 #include "hb-ot-layout-gpos-table.hh"
-#include "hb-ot-layout-jstf-table.hh"
+#include "hb-ot-layout-jstf-table.hh" // Just so we compile it; unused otherwise.
+#include "hb-ot-name-table.hh" // Just so we compile it; unused otherwise.
 
 #include "hb-ot-map-private.hh"
 
-#include <stdlib.h>
-#include <string.h>
 
+const void * const OT::_hb_NullPool[HB_NULL_POOL_SIZE / sizeof (void *)] = {};
 
-HB_SHAPER_DATA_ENSURE_DECLARE(ot, face)
 
 hb_ot_layout_t *
 _hb_ot_layout_create (hb_face_t *face)
 {
   hb_ot_layout_t *layout = (hb_ot_layout_t *) calloc (1, sizeof (hb_ot_layout_t));
   if (unlikely (!layout))
-    return NULL;
+    return nullptr;
 
   layout->gdef_blob = OT::Sanitizer<OT::GDEF>::sanitize (face->reference_table (HB_OT_TAG_GDEF));
   layout->gdef = OT::Sanitizer<OT::GDEF>::lock_instance (layout->gdef_blob);
@@ -60,9 +59,9 @@
   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;
+  layout->math.init (face);
+  layout->fvar.init (face);
+  layout->avar.init (face);
 
   {
     /*
@@ -106,14 +105,28 @@
       || (928 == gdef_len && 59332 == gpos_len && 23298 == gsub_len)
       /* sha1sum:6d400781948517c3c0441ba42acb309584b73033  tahomabd.ttf from Windows 8.1 */
       || (940 == gdef_len && 60732 == gpos_len && 23310 == gsub_len)
+      /* tahoma.ttf v6.04 from Windows 8.1 x64, see https://bugzilla.mozilla.org/show_bug.cgi?id=1279925 */
+      || (964 == gdef_len && 60072 == gpos_len && 23836 == gsub_len)
+      /* tahomabd.ttf v6.04 from Windows 8.1 x64, see https://bugzilla.mozilla.org/show_bug.cgi?id=1279925 */
+      || (976 == gdef_len && 61456 == gpos_len && 23832 == gsub_len)
       /* sha1sum:e55fa2dfe957a9f7ec26be516a0e30b0c925f846  tahoma.ttf from Windows 10 */
       || (994 == gdef_len && 60336 == gpos_len && 24474 == gsub_len)
       /* sha1sum:7199385abb4c2cc81c83a151a7599b6368e92343  tahomabd.ttf from Windows 10 */
       || (1006 == gdef_len && 61740 == gpos_len && 24470 == gsub_len)
+      /* tahoma.ttf v6.91 from Windows 10 x64, see https://bugzilla.mozilla.org/show_bug.cgi?id=1279925 */
+      || (1006 == gdef_len && 61346 == gpos_len && 24576 == gsub_len)
+      /* tahomabd.ttf v6.91 from Windows 10 x64, see https://bugzilla.mozilla.org/show_bug.cgi?id=1279925 */
+      || (1018 == gdef_len && 62828 == gpos_len && 24572 == gsub_len)
+      /* sha1sum:b9c84d820c49850d3d27ec498be93955b82772b5  tahoma.ttf from Windows 10 AU */
+      || (1006 == gdef_len && 61352 == gpos_len && 24576 == gsub_len)
+      /* sha1sum:2bdfaab28174bdadd2f3d4200a30a7ae31db79d2  tahomabd.ttf from Windows 10 AU */
+      || (1018 == gdef_len && 62834 == gpos_len && 24572 == gsub_len)
       /* sha1sum:b0d36cf5a2fbe746a3dd277bffc6756a820807a7  Tahoma.ttf from Mac OS X 10.9 */
       || (832 == gdef_len && 47162 == gpos_len && 7324 == gsub_len)
       /* sha1sum:12fc4538e84d461771b30c18b5eb6bd434e30fba  Tahoma Bold.ttf from Mac OS X 10.9 */
       || (844 == gdef_len && 45474 == gpos_len && 7302 == gsub_len)
+      /* sha1sum:eb8afadd28e9cf963e886b23a30b44ab4fd83acc  himalaya.ttf from Windows 7 */
+      || (180 == gdef_len && 7254 == gpos_len && 13054 == gsub_len)
       /* sha1sum:73da7f025b238a3f737aa1fde22577a6370f77b0  himalaya.ttf from Windows 8 */
       || (192 == gdef_len && 7254 == gpos_len && 12638 == gsub_len)
       /* sha1sum:6e80fd1c0b059bbee49272401583160dc1e6a427  himalaya.ttf from Windows 8.1 */
@@ -124,6 +137,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)
+      /* d125afa82a77a6475ac0e74e7c207914af84b37a padauk-2.80/Padauk.ttf RHEL 7.2 */
+      || (1058 == gdef_len && 11818 == gpos_len && 47032 == gsub_len)
+      /* 0f7b80437227b90a577cc078c0216160ae61b031 padauk-2.80/Padauk-Bold.ttf RHEL 7.2*/
+      || (1046 == gdef_len && 12600 == gpos_len && 47030 == gsub_len)
+      /* d3dde9aa0a6b7f8f6a89ef1002e9aaa11b882290 padauk-2.80/Padauk.ttf Ubuntu 16.04 */
+      || (1058 == gdef_len && 16770 == gpos_len && 71796 == gsub_len)
+      /* 5f3c98ccccae8a953be2d122c1b3a77fd805093f padauk-2.80/Padauk-Bold.ttf Ubuntu 16.04 */
+      || (1046 == gdef_len && 17862 == gpos_len && 71790 == 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 */
@@ -132,6 +153,9 @@
       || (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)
+      /* sha1sum: c26e41d567ed821bed997e937bc0c41435689e85  Padauk.ttf
+       *  "Padauk Regular" "Version 2.5", see https://crbug.com/681813 */
+      || (1004 == gdef_len && 14836 == gpos_len && 59092 == gsub_len)
     )
     {
       /* Many versions of Tahoma have bad GDEF tables that incorrectly classify some spacing marks
@@ -156,7 +180,7 @@
                 (layout->gpos_lookup_count && !layout->gpos_accels)))
   {
     _hb_ot_layout_destroy (layout);
-    return NULL;
+    return nullptr;
   }
 
   for (unsigned int i = 0; i < layout->gsub_lookup_count; i++)
@@ -181,7 +205,10 @@
   hb_blob_destroy (layout->gdef_blob);
   hb_blob_destroy (layout->gsub_blob);
   hb_blob_destroy (layout->gpos_blob);
-  hb_blob_destroy (layout->math_blob);
+
+  layout->math.fini ();
+  layout->fvar.fini ();
+  layout->avar.fini ();
 
   free (layout);
 }
@@ -256,7 +283,7 @@
                                   hb_codepoint_t  glyph,
                                   unsigned int    start_offset,
                                   unsigned int   *caret_count /* IN/OUT */,
-                                  int            *caret_array /* OUT */)
+                                  hb_position_t  *caret_array /* OUT */)
 {
   return _get_gdef (font->face).get_lig_carets (font, direction, glyph, start_offset, caret_count, caret_array);
 }
@@ -298,7 +325,7 @@
                                 hb_tag_t      script_tag,
                                 unsigned int *script_index)
 {
-  ASSERT_STATIC (OT::Index::NOT_FOUND_INDEX == HB_OT_LAYOUT_NO_SCRIPT_INDEX);
+  static_assert ((OT::Index::NOT_FOUND_INDEX == HB_OT_LAYOUT_NO_SCRIPT_INDEX), "");
   const OT::GSUBGPOS &g = get_gsubgpos_table (face, table_tag);
 
   if (g.find_script_index (script_tag, script_index))
@@ -329,7 +356,7 @@
                                   unsigned int   *script_index,
                                   hb_tag_t       *chosen_script)
 {
-  ASSERT_STATIC (OT::Index::NOT_FOUND_INDEX == HB_OT_LAYOUT_NO_SCRIPT_INDEX);
+  static_assert ((OT::Index::NOT_FOUND_INDEX == HB_OT_LAYOUT_NO_SCRIPT_INDEX), "");
   const OT::GSUBGPOS &g = get_gsubgpos_table (face, table_tag);
 
   while (*script_tags)
@@ -388,7 +415,7 @@
                                  hb_tag_t      feature_tag,
                                  unsigned int *feature_index)
 {
-  ASSERT_STATIC (OT::Index::NOT_FOUND_INDEX == HB_OT_LAYOUT_NO_FEATURE_INDEX);
+  static_assert ((OT::Index::NOT_FOUND_INDEX == HB_OT_LAYOUT_NO_FEATURE_INDEX), "");
   const OT::GSUBGPOS &g = get_gsubgpos_table (face, table_tag);
 
   unsigned int num_features = g.get_feature_count ();
@@ -425,7 +452,7 @@
                                    hb_tag_t      language_tag,
                                    unsigned int *language_index)
 {
-  ASSERT_STATIC (OT::Index::NOT_FOUND_INDEX == HB_OT_LAYOUT_DEFAULT_LANGUAGE_INDEX);
+  static_assert ((OT::Index::NOT_FOUND_INDEX == HB_OT_LAYOUT_DEFAULT_LANGUAGE_INDEX), "");
   const OT::Script &s = get_gsubgpos_table (face, table_tag).get_script (script_index);
 
   if (s.find_lang_sys_index (language_tag, language_index))
@@ -451,7 +478,7 @@
                                                      script_index,
                                                      language_index,
                                                      feature_index,
-                                                     NULL);
+                                                     nullptr);
 }
 
 /**
@@ -504,7 +531,7 @@
   const OT::GSUBGPOS &g = get_gsubgpos_table (face, table_tag);
   const OT::LangSys &l = g.get_script (script_index).get_lang_sys (language_index);
 
-  ASSERT_STATIC (sizeof (unsigned int) == sizeof (hb_tag_t));
+  static_assert ((sizeof (unsigned int) == sizeof (hb_tag_t)), "");
   unsigned int ret = l.get_feature_indexes (start_offset, feature_count, (unsigned int *) feature_tags);
 
   if (feature_tags) {
@@ -525,7 +552,7 @@
                                     hb_tag_t      feature_tag,
                                     unsigned int *feature_index)
 {
-  ASSERT_STATIC (OT::Index::NOT_FOUND_INDEX == HB_OT_LAYOUT_NO_FEATURE_INDEX);
+  static_assert ((OT::Index::NOT_FOUND_INDEX == HB_OT_LAYOUT_NO_FEATURE_INDEX), "");
   const OT::GSUBGPOS &g = get_gsubgpos_table (face, table_tag);
   const OT::LangSys &l = g.get_script (script_index).get_lang_sys (language_index);
 
@@ -629,7 +656,7 @@
                                                     script_index,
                                                     language_index,
                                                     &required_feature_index,
-                                                    NULL))
+                                                    nullptr))
       _hb_ot_layout_collect_lookups_lookups (face,
                                              table_tag,
                                              required_feature_index,
@@ -698,7 +725,7 @@
     unsigned int count = hb_ot_layout_script_get_language_tags (face,
                                                                 table_tag,
                                                                 script_index,
-                                                                0, NULL, NULL);
+                                                                0, nullptr, nullptr);
     for (unsigned int language_index = 0; language_index < count; language_index++)
       _hb_ot_layout_collect_lookups_features (face,
                                               table_tag,
@@ -745,7 +772,7 @@
     /* All scripts */
     unsigned int count = hb_ot_layout_table_get_script_tags (face,
                                                              table_tag,
-                                                             0, NULL, NULL);
+                                                             0, nullptr, nullptr);
     for (unsigned int script_index = 0; script_index < count; script_index++)
       _hb_ot_layout_collect_lookups_languages (face,
                                                table_tag,
@@ -782,10 +809,10 @@
 hb_ot_layout_lookup_collect_glyphs (hb_face_t    *face,
                                     hb_tag_t      table_tag,
                                     unsigned int  lookup_index,
-                                    hb_set_t     *glyphs_before, /* OUT. May be NULL */
-                                    hb_set_t     *glyphs_input,  /* OUT. May be NULL */
-                                    hb_set_t     *glyphs_after,  /* OUT. May be NULL */
-                                    hb_set_t     *glyphs_output  /* OUT. May be NULL */)
+                                    hb_set_t     *glyphs_before, /* OUT. May be nullptr */
+                                    hb_set_t     *glyphs_input,  /* OUT. May be nullptr */
+                                    hb_set_t     *glyphs_after,  /* OUT. May be nullptr */
+                                    hb_set_t     *glyphs_output  /* OUT. May be nullptr */)
 {
   if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return;
 
@@ -836,7 +863,7 @@
                                                   unsigned int *lookup_count /* IN/OUT */,
                                                   unsigned int *lookup_indexes /* OUT */)
 {
-  ASSERT_STATIC (OT::FeatureVariations::NOT_FOUND_INDEX == HB_OT_LAYOUT_NO_VARIATIONS_INDEX);
+  static_assert ((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);
@@ -944,11 +971,11 @@
  **/
 hb_bool_t
 hb_ot_layout_get_size_params (hb_face_t    *face,
-                              unsigned int *design_size,       /* OUT.  May be NULL */
-                              unsigned int *subfamily_id,      /* OUT.  May be NULL */
-                              unsigned int *subfamily_name_id, /* OUT.  May be NULL */
-                              unsigned int *range_start,       /* OUT.  May be NULL */
-                              unsigned int *range_end          /* OUT.  May be NULL */)
+                              unsigned int *design_size,       /* OUT.  May be nullptr */
+                              unsigned int *subfamily_id,      /* OUT.  May be nullptr */
+                              unsigned int *subfamily_name_id, /* OUT.  May be nullptr */
+                              unsigned int *range_start,       /* OUT.  May be nullptr */
+                              unsigned int *range_end          /* OUT.  May be nullptr */)
 {
   const OT::GPOS &gpos = _get_gpos (face);
   const hb_tag_t tag = HB_TAG ('s','i','z','e');
@@ -1196,6 +1223,7 @@
       c.set_lookup_index (lookup_index);
       c.set_lookup_mask (lookups[table_index][i].mask);
       c.set_auto_zwj (lookups[table_index][i].auto_zwj);
+      c.set_auto_zwnj (lookups[table_index][i].auto_zwnj);
       apply_string<Proxy> (&c,
                            proxy.table.get_lookup (lookup_index),
                            proxy.accels[lookup_index]);
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-map-private.hh	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-map-private.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -50,19 +50,25 @@
     hb_mask_t mask;
     hb_mask_t _1_mask; /* mask for value=1, for quick access */
     unsigned int needs_fallback : 1;
+    unsigned int auto_zwnj : 1;
     unsigned int auto_zwj : 1;
 
-    static int cmp (const feature_map_t *a, const feature_map_t *b)
-    { return a->tag < b->tag ? -1 : a->tag > b->tag ? 1 : 0; }
+    inline int cmp (const hb_tag_t *tag_) const
+    { return *tag_ < tag ? -1 : *tag_ > tag ? 1 : 0; }
   };
 
   struct lookup_map_t {
     unsigned short index;
+    unsigned short auto_zwnj : 1;
     unsigned short auto_zwj : 1;
     hb_mask_t mask;
 
-    static int cmp (const lookup_map_t *a, const lookup_map_t *b)
-    { return a->index < b->index ? -1 : a->index > b->index ? 1 : 0; }
+    static int cmp (const void *pa, const void *pb)
+    {
+      const lookup_map_t *a = (const lookup_map_t *) pa;
+      const lookup_map_t *b = (const lookup_map_t *) pb;
+      return a->index < b->index ? -1 : a->index > b->index ? 1 : 0;
+    }
   };
 
   typedef void (*pause_func_t) (const struct hb_ot_shape_plan_t *plan, hb_font_t *font, hb_buffer_t *buffer);
@@ -77,7 +83,7 @@
 
   inline hb_mask_t get_global_mask (void) const { return global_mask; }
 
-  inline hb_mask_t get_mask (hb_tag_t feature_tag, unsigned int *shift = NULL) const {
+  inline hb_mask_t get_mask (hb_tag_t feature_tag, unsigned int *shift = nullptr) const {
     const feature_map_t *map = features.bsearch (&feature_tag);
     if (shift) *shift = map ? map->shift : 0;
     return map ? map->mask : 0;
@@ -106,14 +112,14 @@
   inline void get_stage_lookups (unsigned int table_index, unsigned int stage,
                                  const struct lookup_map_t **plookups, unsigned int *lookup_count) const {
     if (unlikely (stage == (unsigned int) -1)) {
-      *plookups = NULL;
+      *plookups = nullptr;
       *lookup_count = 0;
       return;
     }
     assert (stage <= stages[table_index].len);
     unsigned int start = stage ? stages[table_index][stage - 1].last_lookup : 0;
     unsigned int end   = stage < stages[table_index].len ? stages[table_index][stage].last_lookup : lookups[table_index].len;
-    *plookups = &lookups[table_index][start];
+    *plookups = end == start ? nullptr : &lookups[table_index][start];
     *lookup_count = end - start;
   }
 
@@ -150,8 +156,9 @@
   F_NONE                = 0x0000u,
   F_GLOBAL              = 0x0001u, /* Feature applies to all characters; results in no mask allocated for it. */
   F_HAS_FALLBACK        = 0x0002u, /* Has fallback implementation, so include mask bit even if feature not found. */
-  F_MANUAL_ZWJ          = 0x0004u, /* Don't skip over ZWJ when matching. */
-  F_GLOBAL_SEARCH       = 0x0008u  /* If feature not found in LangSys, look for it in global feature list and pick one. */
+  F_MANUAL_ZWNJ         = 0x0004u, /* Don't skip over ZWNJ when matching **context**. */
+  F_MANUAL_ZWJ          = 0x0008u, /* Don't skip over ZWJ when matching **input**. */
+  F_GLOBAL_SEARCH       = 0x0010u  /* If feature not found in LangSys, look for it in global feature list and pick one. */
 };
 HB_MARK_AS_FLAG_T (hb_ot_map_feature_flags_t);
 /* Macro version for where const is desired. */
@@ -196,7 +203,8 @@
                                 unsigned int  feature_index,
                                 unsigned int  variations_index,
                                 hb_mask_t     mask,
-                                bool          auto_zwj);
+                                bool          auto_zwnj = true,
+                                bool          auto_zwj = true);
 
   struct feature_info_t {
     hb_tag_t tag;
@@ -206,9 +214,13 @@
     unsigned int default_value; /* for non-global features, what should the unset glyphs take */
     unsigned int stage[2]; /* GSUB/GPOS */
 
-    static int cmp (const feature_info_t *a, const feature_info_t *b)
-    { return (a->tag != b->tag) ?  (a->tag < b->tag ? -1 : 1) :
-             (a->seq < b->seq ? -1 : a->seq > b->seq ? 1 : 0); }
+    static int cmp (const void *pa, const void *pb)
+    {
+      const feature_info_t *a = (const feature_info_t *) pa;
+      const feature_info_t *b = (const feature_info_t *) pb;
+      return (a->tag != b->tag) ?  (a->tag < b->tag ? -1 : 1) :
+             (a->seq < b->seq ? -1 : a->seq > b->seq ? 1 : 0);
+    }
   };
 
   struct stage_info_t {
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-map.cc	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-map.cc	Wed Dec 13 10:25:38 2017 -0800
@@ -85,6 +85,7 @@
                                   unsigned int  feature_index,
                                   unsigned int  variations_index,
                                   hb_mask_t     mask,
+                                  bool          auto_zwnj,
                                   bool          auto_zwj)
 {
   unsigned int lookup_indices[32];
@@ -112,6 +113,7 @@
         return;
       lookup->mask = mask;
       lookup->index = lookup_indices[i];
+      lookup->auto_zwnj = auto_zwnj;
       lookup->auto_zwj = auto_zwj;
     }
 
@@ -136,7 +138,11 @@
                               const int    *coords,
                               unsigned int  num_coords)
 {
-  m.global_mask = 1;
+  static_assert ((!(HB_GLYPH_FLAG_DEFINED & (HB_GLYPH_FLAG_DEFINED + 1))), "");
+  unsigned int global_bit_mask = HB_GLYPH_FLAG_DEFINED + 1;
+  unsigned int global_bit_shift = _hb_popcount32 (HB_GLYPH_FLAG_DEFINED);
+
+  m.global_mask = global_bit_mask;
 
   unsigned int required_feature_index[2];
   hb_tag_t required_feature_tag[2];
@@ -188,7 +194,8 @@
 
 
   /* Allocate bits now */
-  unsigned int next_bit = 1;
+  unsigned int next_bit = global_bit_shift + 1;
+
   for (unsigned int i = 0; i < feature_infos.len; i++)
   {
     const feature_info_t *info = &feature_infos[i];
@@ -243,11 +250,12 @@
     map->index[1] = feature_index[1];
     map->stage[0] = info->stage[0];
     map->stage[1] = info->stage[1];
+    map->auto_zwnj = !(info->flags & F_MANUAL_ZWNJ);
     map->auto_zwj = !(info->flags & F_MANUAL_ZWJ);
     if ((info->flags & F_GLOBAL) && info->max_value == 1) {
       /* Uses the global bit */
-      map->shift = 0;
-      map->mask = 1;
+      map->shift = global_bit_shift;
+      map->mask = global_bit_mask;
     } else {
       map->shift = next_bit;
       map->mask = (1u << (next_bit + bits_needed)) - (1u << next_bit);
@@ -261,8 +269,8 @@
   feature_infos.shrink (0); /* Done with these */
 
 
-  add_gsub_pause (NULL);
-  add_gpos_pause (NULL);
+  add_gsub_pause (nullptr);
+  add_gpos_pause (nullptr);
 
   for (unsigned int table_index = 0; table_index < 2; table_index++)
   {
@@ -284,8 +292,7 @@
         add_lookups (m, face, table_index,
                      required_feature_index[table_index],
                      variations_index,
-                     1 /* mask */,
-                     true /* auto_zwj */);
+                     global_bit_mask);
 
       for (unsigned i = 0; i < m.features.len; i++)
         if (m.features[i].stage[table_index] == stage)
@@ -293,6 +300,7 @@
                        m.features[i].index[table_index],
                        variations_index,
                        m.features[i].mask,
+                       m.features[i].auto_zwnj,
                        m.features[i].auto_zwj);
 
       /* Sort lookups and merge duplicates */
@@ -307,6 +315,7 @@
           else
           {
             m.lookups[table_index][j].mask |= m.lookups[table_index][i].mask;
+            m.lookups[table_index][j].auto_zwnj &= m.lookups[table_index][i].auto_zwnj;
             m.lookups[table_index][j].auto_zwj &= m.lookups[table_index][i].auto_zwj;
           }
         m.lookups[table_index].shrink (j + 1);
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-name-table.hh	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-name-table.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -42,8 +42,10 @@
 
 struct NameRecord
 {
-  static int cmp (const NameRecord *a, const NameRecord *b)
+  static int cmp (const void *pa, const void *pb)
   {
+    const NameRecord *a = (const NameRecord *) pa;
+    const NameRecord *b = (const NameRecord *) pb;
     int ret;
     ret = b->platformID.cmp (a->platformID);
     if (ret) return ret;
@@ -89,7 +91,7 @@
     key.encodingID.set (encoding_id);
     key.languageID.set (language_id);
     key.nameID.set (name_id);
-    NameRecord *match = (NameRecord *) bsearch (&key, nameRecord, count, sizeof (nameRecord[0]), (hb_compare_func_t) NameRecord::cmp);
+    NameRecord *match = (NameRecord *) bsearch (&key, nameRecord, count, sizeof (nameRecord[0]), NameRecord::cmp);
 
     if (!match)
       return 0;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-post-macroman.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,294 @@
+/*
+ * Copyright © 2017  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): Behdad Esfahbod
+ */
+
+#ifndef HB_OT_POST_MACROMAN_HH
+#if 0 /* Make checks happy. */
+#define HB_OT_POST_MACROMAN_HH
+#include "hb-private.hh"
+#endif
+
+
+_S(".notdef")
+_S(".null")
+_S("nonmarkingreturn")
+_S("space")
+_S("exclam")
+_S("quotedbl")
+_S("numbersign")
+_S("dollar")
+_S("percent")
+_S("ampersand")
+_S("quotesingle")
+_S("parenleft")
+_S("parenright")
+_S("asterisk")
+_S("plus")
+_S("comma")
+_S("hyphen")
+_S("period")
+_S("slash")
+_S("zero")
+_S("one")
+_S("two")
+_S("three")
+_S("four")
+_S("five")
+_S("six")
+_S("seven")
+_S("eight")
+_S("nine")
+_S("colon")
+_S("semicolon")
+_S("less")
+_S("equal")
+_S("greater")
+_S("question")
+_S("at")
+_S("A")
+_S("B")
+_S("C")
+_S("D")
+_S("E")
+_S("F")
+_S("G")
+_S("H")
+_S("I")
+_S("J")
+_S("K")
+_S("L")
+_S("M")
+_S("N")
+_S("O")
+_S("P")
+_S("Q")
+_S("R")
+_S("S")
+_S("T")
+_S("U")
+_S("V")
+_S("W")
+_S("X")
+_S("Y")
+_S("Z")
+_S("bracketleft")
+_S("backslash")
+_S("bracketright")
+_S("asciicircum")
+_S("underscore")
+_S("grave")
+_S("a")
+_S("b")
+_S("c")
+_S("d")
+_S("e")
+_S("f")
+_S("g")
+_S("h")
+_S("i")
+_S("j")
+_S("k")
+_S("l")
+_S("m")
+_S("n")
+_S("o")
+_S("p")
+_S("q")
+_S("r")
+_S("s")
+_S("t")
+_S("u")
+_S("v")
+_S("w")
+_S("x")
+_S("y")
+_S("z")
+_S("braceleft")
+_S("bar")
+_S("braceright")
+_S("asciitilde")
+_S("Adieresis")
+_S("Aring")
+_S("Ccedilla")
+_S("Eacute")
+_S("Ntilde")
+_S("Odieresis")
+_S("Udieresis")
+_S("aacute")
+_S("agrave")
+_S("acircumflex")
+_S("adieresis")
+_S("atilde")
+_S("aring")
+_S("ccedilla")
+_S("eacute")
+_S("egrave")
+_S("ecircumflex")
+_S("edieresis")
+_S("iacute")
+_S("igrave")
+_S("icircumflex")
+_S("idieresis")
+_S("ntilde")
+_S("oacute")
+_S("ograve")
+_S("ocircumflex")
+_S("odieresis")
+_S("otilde")
+_S("uacute")
+_S("ugrave")
+_S("ucircumflex")
+_S("udieresis")
+_S("dagger")
+_S("degree")
+_S("cent")
+_S("sterling")
+_S("section")
+_S("bullet")
+_S("paragraph")
+_S("germandbls")
+_S("registered")
+_S("copyright")
+_S("trademark")
+_S("acute")
+_S("dieresis")
+_S("notequal")
+_S("AE")
+_S("Oslash")
+_S("infinity")
+_S("plusminus")
+_S("lessequal")
+_S("greaterequal")
+_S("yen")
+_S("mu")
+_S("partialdiff")
+_S("summation")
+_S("product")
+_S("pi")
+_S("integral")
+_S("ordfeminine")
+_S("ordmasculine")
+_S("Omega")
+_S("ae")
+_S("oslash")
+_S("questiondown")
+_S("exclamdown")
+_S("logicalnot")
+_S("radical")
+_S("florin")
+_S("approxequal")
+_S("Delta")
+_S("guillemotleft")
+_S("guillemotright")
+_S("ellipsis")
+_S("nonbreakingspace")
+_S("Agrave")
+_S("Atilde")
+_S("Otilde")
+_S("OE")
+_S("oe")
+_S("endash")
+_S("emdash")
+_S("quotedblleft")
+_S("quotedblright")
+_S("quoteleft")
+_S("quoteright")
+_S("divide")
+_S("lozenge")
+_S("ydieresis")
+_S("Ydieresis")
+_S("fraction")
+_S("currency")
+_S("guilsinglleft")
+_S("guilsinglright")
+_S("fi")
+_S("fl")
+_S("daggerdbl")
+_S("periodcentered")
+_S("quotesinglbase")
+_S("quotedblbase")
+_S("perthousand")
+_S("Acircumflex")
+_S("Ecircumflex")
+_S("Aacute")
+_S("Edieresis")
+_S("Egrave")
+_S("Iacute")
+_S("Icircumflex")
+_S("Idieresis")
+_S("Igrave")
+_S("Oacute")
+_S("Ocircumflex")
+_S("apple")
+_S("Ograve")
+_S("Uacute")
+_S("Ucircumflex")
+_S("Ugrave")
+_S("dotlessi")
+_S("circumflex")
+_S("tilde")
+_S("macron")
+_S("breve")
+_S("dotaccent")
+_S("ring")
+_S("cedilla")
+_S("hungarumlaut")
+_S("ogonek")
+_S("caron")
+_S("Lslash")
+_S("lslash")
+_S("Scaron")
+_S("scaron")
+_S("Zcaron")
+_S("zcaron")
+_S("brokenbar")
+_S("Eth")
+_S("eth")
+_S("Yacute")
+_S("yacute")
+_S("Thorn")
+_S("thorn")
+_S("minus")
+_S("multiply")
+_S("onesuperior")
+_S("twosuperior")
+_S("threesuperior")
+_S("onehalf")
+_S("onequarter")
+_S("threequarters")
+_S("franc")
+_S("Gbreve")
+_S("gbreve")
+_S("Idotaccent")
+_S("Scedilla")
+_S("scedilla")
+_S("Cacute")
+_S("cacute")
+_S("Ccaron")
+_S("ccaron")
+_S("dcroat")
+
+
+#endif /* HB_OT_POST_MACROMAN_HH */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-post-table.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,276 @@
+/*
+ * 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): Behdad Esfahbod
+ */
+
+#ifndef HB_OT_POST_TABLE_HH
+#define HB_OT_POST_TABLE_HH
+
+#include "hb-open-type-private.hh"
+#include "hb-dsalgs.hh"
+
+#define HB_STRING_ARRAY_NAME format1_names
+#define HB_STRING_ARRAY_LIST "hb-ot-post-macroman.hh"
+#include "hb-string-array.hh"
+#undef HB_STRING_ARRAY_LIST
+#undef HB_STRING_ARRAY_NAME
+
+#define NUM_FORMAT1_NAMES 258
+
+namespace OT {
+
+
+/*
+ * post -- PostScript
+ */
+
+#define HB_OT_TAG_post HB_TAG('p','o','s','t')
+
+
+struct postV2Tail
+{
+  inline bool sanitize (hb_sanitize_context_t *c) const
+  {
+    TRACE_SANITIZE (this);
+    return_trace (glyphNameIndex.sanitize (c));
+  }
+
+  ArrayOf<USHORT>glyphNameIndex;        /* This is not an offset, but is the
+                                         * ordinal number of the glyph in 'post'
+                                         * string tables. */
+  BYTE          namesX[VAR];            /* Glyph names with length bytes [variable]
+                                         * (a Pascal string). */
+
+  DEFINE_SIZE_ARRAY2 (2, glyphNameIndex, namesX);
+};
+
+struct post
+{
+  static const hb_tag_t tableTag = HB_OT_TAG_post;
+
+  inline bool sanitize (hb_sanitize_context_t *c) const
+  {
+    TRACE_SANITIZE (this);
+    if (unlikely (!c->check_struct (this)))
+      return_trace (false);
+    if (version.to_int () == 0x00020000)
+    {
+      const postV2Tail &v2 = StructAfter<postV2Tail> (*this);
+      return_trace (v2.sanitize (c));
+    }
+    return_trace (true);
+  }
+
+  struct accelerator_t
+  {
+    inline void init (const post *table, unsigned int post_len)
+    {
+      version = table->version.to_int ();
+      index_to_offset.init ();
+      if (version != 0x00020000)
+        return;
+
+      const postV2Tail &v2 = StructAfter<postV2Tail> (*table);
+
+      glyphNameIndex = &v2.glyphNameIndex;
+      pool = &StructAfter<uint8_t> (v2.glyphNameIndex);
+
+      const uint8_t *end = (uint8_t *) table + post_len;
+      for (const uint8_t *data = pool; data < end && data + *data <= end; data += 1 + *data)
+      {
+        uint32_t *offset = index_to_offset.push ();
+        if (unlikely (!offset))
+          break;
+        *offset = data - pool;
+      }
+    }
+    inline void fini (void)
+    {
+      index_to_offset.finish ();
+      free (gids_sorted_by_name);
+    }
+
+    inline bool get_glyph_name (hb_codepoint_t glyph,
+                                char *buf, unsigned int buf_len) const
+    {
+      hb_string_t s = find_glyph_name (glyph);
+      if (!s.len)
+        return false;
+      if (!buf_len)
+        return true;
+      if (buf_len <= s.len) /* What to do with truncation? Returning false for now. */
+        return false;
+      strncpy (buf, s.bytes, s.len);
+      buf[s.len] = '\0';
+      return true;
+    }
+
+    inline bool get_glyph_from_name (const char *name, int len,
+                                     hb_codepoint_t *glyph) const
+    {
+      unsigned int count = get_glyph_count ();
+      if (unlikely (!count))
+        return false;
+
+      if (len < 0)
+        len = strlen (name);
+
+      if (unlikely (!len))
+        return false;
+
+    retry:
+      uint16_t *gids = (uint16_t *) hb_atomic_ptr_get (&gids_sorted_by_name);
+
+      if (unlikely (!gids))
+      {
+        gids = (uint16_t *) malloc (count * sizeof (gids[0]));
+        if (unlikely (!gids))
+          return false; /* Anything better?! */
+
+        for (unsigned int i = 0; i < count; i++)
+          gids[i] = i;
+        hb_sort_r (gids, count, sizeof (gids[0]), cmp_gids, (void *) this);
+
+        if (!hb_atomic_ptr_cmpexch (&gids_sorted_by_name, nullptr, gids)) {
+          free (gids);
+          goto retry;
+        }
+      }
+
+      hb_string_t st (name, len);
+      const uint16_t *gid = (const uint16_t *) hb_bsearch_r (&st, gids, count, sizeof (gids[0]), cmp_key, (void *) this);
+      if (gid)
+      {
+        *glyph = *gid;
+        return true;
+      }
+
+      return false;
+    }
+
+    protected:
+
+    inline unsigned int get_glyph_count (void) const
+    {
+      if (version == 0x00010000)
+        return NUM_FORMAT1_NAMES;
+
+      if (version == 0x00020000)
+        return glyphNameIndex->len;
+
+      return 0;
+    }
+
+    static inline int cmp_gids (const void *pa, const void *pb, void *arg)
+    {
+      const accelerator_t *thiz = (const accelerator_t *) arg;
+      uint16_t a = * (const uint16_t *) pa;
+      uint16_t b = * (const uint16_t *) pb;
+      return thiz->find_glyph_name (b).cmp (thiz->find_glyph_name (a));
+    }
+
+    static inline int cmp_key (const void *pk, const void *po, void *arg)
+    {
+      const accelerator_t *thiz = (const accelerator_t *) arg;
+      const hb_string_t *key = (const hb_string_t *) pk;
+      uint16_t o = * (const uint16_t *) po;
+      return thiz->find_glyph_name (o).cmp (*key);
+    }
+
+    inline hb_string_t find_glyph_name (hb_codepoint_t glyph) const
+    {
+      if (version == 0x00010000)
+      {
+        if (glyph >= NUM_FORMAT1_NAMES)
+          return hb_string_t ();
+
+        return format1_names (glyph);
+      }
+
+      if (version != 0x00020000 || glyph >= glyphNameIndex->len)
+        return hb_string_t ();
+
+      unsigned int index = glyphNameIndex->array[glyph];
+      if (index < NUM_FORMAT1_NAMES)
+        return format1_names (index);
+      index -= NUM_FORMAT1_NAMES;
+
+      if (index >= index_to_offset.len)
+        return hb_string_t ();
+      unsigned int offset = index_to_offset.array[index];
+
+      const uint8_t *data = pool + offset;
+      unsigned int name_length = *data;
+      data++;
+
+      return hb_string_t ((const char *) data, name_length);
+    }
+
+    uint32_t version;
+    const ArrayOf<USHORT> *glyphNameIndex;
+    hb_prealloced_array_t<uint32_t, 1> index_to_offset;
+    const uint8_t *pool;
+    mutable uint16_t *gids_sorted_by_name;
+  };
+
+  public:
+  FixedVersion<>version;                /* 0x00010000 for version 1.0
+                                         * 0x00020000 for version 2.0
+                                         * 0x00025000 for version 2.5 (deprecated)
+                                         * 0x00030000 for version 3.0 */
+  Fixed         italicAngle;            /* Italic angle in counter-clockwise degrees
+                                         * from the vertical. Zero for upright text,
+                                         * negative for text that leans to the right
+                                         * (forward). */
+  FWORD         underlinePosition;      /* This is the suggested distance of the top
+                                         * of the underline from the baseline
+                                         * (negative values indicate below baseline).
+                                         * The PostScript definition of this FontInfo
+                                         * dictionary key (the y coordinate of the
+                                         * center of the stroke) is not used for
+                                         * historical reasons. The value of the
+                                         * PostScript key may be calculated by
+                                         * subtracting half the underlineThickness
+                                         * from the value of this field. */
+  FWORD         underlineThickness;     /* Suggested values for the underline
+                                           thickness. */
+  ULONG         isFixedPitch;           /* Set to 0 if the font is proportionally
+                                         * spaced, non-zero if the font is not
+                                         * proportionally spaced (i.e. monospaced). */
+  ULONG         minMemType42;           /* Minimum memory usage when an OpenType font
+                                         * is downloaded. */
+  ULONG         maxMemType42;           /* Maximum memory usage when an OpenType font
+                                         * is downloaded. */
+  ULONG         minMemType1;            /* Minimum memory usage when an OpenType font
+                                         * is downloaded as a Type 1 font. */
+  ULONG         maxMemType1;            /* Maximum memory usage when an OpenType font
+                                         * is downloaded as a Type 1 font. */
+/*postV2Tail    v2[VAR];*/
+  DEFINE_SIZE_STATIC (32);
+};
+
+} /* namespace OT */
+
+
+#endif /* HB_OT_POST_TABLE_HH */
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-arabic-fallback.hh	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-arabic-fallback.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -73,7 +73,7 @@
   }
 
   if (!num_glyphs)
-    return NULL;
+    return nullptr;
 
   /* Bubble-sort or something equally good!
    * May not be good-enough for presidential candidate interviews, but good-enough for us... */
@@ -94,7 +94,7 @@
   c.end_serialize ();
   /* TODO sanitize the results? */
 
-  return ret ? c.copy<OT::SubstLookup> () : NULL;
+  return ret ? c.copy<OT::SubstLookup> () : nullptr;
 }
 
 static OT::SubstLookup *
@@ -153,7 +153,7 @@
   }
 
   if (!num_ligatures)
-    return NULL;
+    return nullptr;
 
   OT::Supplier<OT::GlyphID>   first_glyphs_supplier                      (first_glyphs, num_first_glyphs);
   OT::Supplier<unsigned int > ligature_per_first_glyph_count_supplier    (ligature_per_first_glyph_count_list, num_first_glyphs);
@@ -177,7 +177,7 @@
   c.end_serialize ();
   /* TODO sanitize the results? */
 
-  return ret ? c.copy<OT::SubstLookup> () : NULL;
+  return ret ? c.copy<OT::SubstLookup> () : nullptr;
 }
 
 static OT::SubstLookup *
@@ -237,8 +237,8 @@
     return false;
 
   const Manifest &manifest = reinterpret_cast<const Manifest&> (arabic_win1256_gsub_lookups.manifest);
-  ASSERT_STATIC (sizeof (arabic_win1256_gsub_lookups.manifestData) / sizeof (ManifestLookup)
-                 <= ARABIC_FALLBACK_MAX_LOOKUPS);
+  static_assert (sizeof (arabic_win1256_gsub_lookups.manifestData) / sizeof (ManifestLookup)
+                 <= ARABIC_FALLBACK_MAX_LOOKUPS, "");
   /* TODO sanitize the table? */
 
   unsigned j = 0;
@@ -271,7 +271,7 @@
                                    const hb_ot_shape_plan_t *plan,
                                    hb_font_t *font)
 {
-  ASSERT_STATIC (ARRAY_LENGTH_CONST(arabic_fallback_features) <= ARABIC_FALLBACK_MAX_LOOKUPS);
+  static_assert ((ARRAY_LENGTH_CONST(arabic_fallback_features) <= ARABIC_FALLBACK_MAX_LOOKUPS), "");
   unsigned int j = 0;
   for (unsigned int i = 0; i < ARRAY_LENGTH(arabic_fallback_features) ; i++)
   {
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-arabic-table.hh	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-arabic-table.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -6,10 +6,10 @@
  *
  * on files with these headers:
  *
- * # ArabicShaping-9.0.0.txt
- * # Date: 2016-02-24, 22:25:00 GMT [RP]
- * # Blocks-9.0.0.txt
- * # Date: 2016-02-05, 23:48:00 GMT [KW]
+ * # ArabicShaping-10.0.0.txt
+ * # Date: 2017-02-16, 00:00:00 GMT [RP, KW]
+ * # Blocks-10.0.0.txt
+ * # Date: 2017-04-12, 17:30:00 GMT [KW]
  * UnicodeData.txt does not have a header.
  */
 
@@ -72,7 +72,10 @@
   /* Mandaic */
 
   /* 0840 */ R,D,D,D,D,D,R,R,D,R,D,D,D,D,D,D,D,D,D,D,R,D,U,U,U,X,X,X,X,X,X,X,
-  /* 0860 */ X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
+
+  /* Syriac Supplement */
+
+  /* 0860 */ D,U,D,D,D,D,U,R,D,R,R,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
   /* 0880 */ X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
 
   /* Arabic Extended-A */
@@ -130,7 +133,7 @@
   /* 1E920 */ D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,
   /* 1E940 */ D,D,D,D,
 
-}; /* Table items: 1214; occupancy: 54% */
+}; /* Table items: 1214; occupancy: 55% */
 
 
 static unsigned int
@@ -139,28 +142,28 @@
   switch (u >> 12)
   {
     case 0x0u:
-      if (hb_in_range (u, 0x0600u, 0x08E2u)) return joining_table[u - 0x0600u + joining_offset_0x0600u];
+      if (hb_in_range<hb_codepoint_t> (u, 0x0600u, 0x08E2u)) return joining_table[u - 0x0600u + joining_offset_0x0600u];
       break;
 
     case 0x1u:
-      if (hb_in_range (u, 0x1806u, 0x18AAu)) return joining_table[u - 0x1806u + joining_offset_0x1806u];
+      if (hb_in_range<hb_codepoint_t> (u, 0x1806u, 0x18AAu)) return joining_table[u - 0x1806u + joining_offset_0x1806u];
       break;
 
     case 0x2u:
-      if (hb_in_range (u, 0x200Cu, 0x2069u)) return joining_table[u - 0x200Cu + joining_offset_0x200cu];
+      if (hb_in_range<hb_codepoint_t> (u, 0x200Cu, 0x2069u)) return joining_table[u - 0x200Cu + joining_offset_0x200cu];
       break;
 
     case 0xAu:
-      if (hb_in_range (u, 0xA840u, 0xA873u)) return joining_table[u - 0xA840u + joining_offset_0xa840u];
+      if (hb_in_range<hb_codepoint_t> (u, 0xA840u, 0xA873u)) return joining_table[u - 0xA840u + joining_offset_0xa840u];
       break;
 
     case 0x10u:
-      if (hb_in_range (u, 0x10AC0u, 0x10AEFu)) return joining_table[u - 0x10AC0u + joining_offset_0x10ac0u];
-      if (hb_in_range (u, 0x10B80u, 0x10BAFu)) return joining_table[u - 0x10B80u + joining_offset_0x10b80u];
+      if (hb_in_range<hb_codepoint_t> (u, 0x10AC0u, 0x10AEFu)) return joining_table[u - 0x10AC0u + joining_offset_0x10ac0u];
+      if (hb_in_range<hb_codepoint_t> (u, 0x10B80u, 0x10BAFu)) return joining_table[u - 0x10B80u + joining_offset_0x10b80u];
       break;
 
     case 0x1Eu:
-      if (hb_in_range (u, 0x1E900u, 0x1E943u)) return joining_table[u - 0x1E900u + joining_offset_0x1e900u];
+      if (hb_in_range<hb_codepoint_t> (u, 0x1E900u, 0x1E943u)) return joining_table[u - 0x1E900u + joining_offset_0x1e900u];
       break;
 
     default:
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-arabic.cc	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-arabic.cc	Wed Dec 13 10:25:38 2017 -0800
@@ -24,15 +24,12 @@
  * Google Author(s): Behdad Esfahbod
  */
 
+#include "hb-private.hh"
+#include "hb-debug.hh"
 #include "hb-ot-shape-complex-arabic-private.hh"
 #include "hb-ot-shape-private.hh"
 
 
-#ifndef HB_DEBUG_ARABIC
-#define HB_DEBUG_ARABIC (HB_DEBUG+0)
-#endif
-
-
 /* buffer var allocations */
 #define arabic_shaping_action() complex_var_u8_0() /* arabic shaping action */
 
@@ -41,7 +38,7 @@
 /* See:
  * https://github.com/behdad/harfbuzz/commit/6e6f82b6f3dde0fc6c3c7d991d9ec6cfff57823d#commitcomment-14248516 */
 #define HB_ARABIC_GENERAL_CATEGORY_IS_WORD(gen_cat) \
-        (FLAG_SAFE (gen_cat) & \
+        (FLAG_UNSAFE (gen_cat) & \
          (FLAG (HB_UNICODE_GENERAL_CATEGORY_UNASSIGNED) | \
           FLAG (HB_UNICODE_GENERAL_CATEGORY_PRIVATE_USE) | \
           /*FLAG (HB_UNICODE_GENERAL_CATEGORY_LOWERCASE_LETTER) |*/ \
@@ -90,7 +87,7 @@
   if (likely (j_type != JOINING_TYPE_X))
     return j_type;
 
-  return (FLAG_SAFE(gen_cat) &
+  return (FLAG_UNSAFE(gen_cat) &
           (FLAG(HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK) |
            FLAG(HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK) |
            FLAG(HB_UNICODE_GENERAL_CATEGORY_FORMAT))
@@ -199,6 +196,9 @@
    * work.  However, testing shows that rlig and calt are applied
    * together for Mongolian in Uniscribe.  As such, we only add a
    * pause for Arabic, not other scripts.
+   *
+   * A pause after calt is required to make KFGQPC Uthmanic Script HAFS
+   * work correctly.  See https://github.com/behdad/harfbuzz/issues/505
    */
 
   map->add_gsub_pause (nuke_joiners);
@@ -209,20 +209,23 @@
   map->add_global_bool_feature (HB_TAG('c','c','m','p'));
   map->add_global_bool_feature (HB_TAG('l','o','c','l'));
 
-  map->add_gsub_pause (NULL);
+  map->add_gsub_pause (nullptr);
 
   for (unsigned int i = 0; i < ARABIC_NUM_FEATURES; i++)
   {
     bool has_fallback = plan->props.script == HB_SCRIPT_ARABIC && !FEATURE_IS_SYRIAC (arabic_features[i]);
     map->add_feature (arabic_features[i], 1, has_fallback ? F_HAS_FALLBACK : F_NONE);
-    map->add_gsub_pause (NULL);
+    map->add_gsub_pause (nullptr);
   }
 
   map->add_feature (HB_TAG('r','l','i','g'), 1, F_GLOBAL|F_HAS_FALLBACK);
   if (plan->props.script == HB_SCRIPT_ARABIC)
     map->add_gsub_pause (arabic_fallback_shape);
 
+  /* No pause after rclt.  See 98460779bae19e4d64d29461ff154b3527bf8420. */
+  map->add_global_bool_feature (HB_TAG('r','c','l','t'));
   map->add_global_bool_feature (HB_TAG('c','a','l','t'));
+  map->add_gsub_pause (nullptr);
 
   /* The spec includes 'cswh'.  Earlier versions of Windows
    * used to enable this by default, but testing suggests
@@ -232,7 +235,6 @@
    * Note that IranNastaliq uses this feature extensively
    * to fixup broken glyph sequences.  Oh well...
    * Test case: U+0643,U+0640,U+0631. */
-  //map->add_gsub_pause (NULL);
   //map->add_global_bool_feature (HB_TAG('c','s','w','h'));
   map->add_global_bool_feature (HB_TAG('m','s','e','t'));
 }
@@ -260,7 +262,7 @@
 {
   arabic_shape_plan_t *arabic_plan = (arabic_shape_plan_t *) calloc (1, sizeof (arabic_shape_plan_t));
   if (unlikely (!arabic_plan))
-    return NULL;
+    return nullptr;
 
   arabic_plan->do_fallback = plan->props.script == HB_SCRIPT_ARABIC;
   arabic_plan->has_stch = !!plan->map.get_1_mask (HB_TAG ('s','t','c','h'));
@@ -316,7 +318,10 @@
     const arabic_state_table_entry *entry = &arabic_state_table[state][this_type];
 
     if (entry->prev_action != NONE && prev != (unsigned int) -1)
+    {
       info[prev].arabic_shaping_action() = entry->prev_action;
+      buffer->unsafe_to_break (prev, i + 1);
+    }
 
     info[i].arabic_shaping_action() = entry->curr_action;
 
@@ -345,7 +350,7 @@
   unsigned int count = buffer->len;
   hb_glyph_info_t *info = buffer->info;
   for (unsigned int i = 1; i < count; i++)
-    if (unlikely (hb_in_range (info[i].codepoint, 0x180Bu, 0x180Du)))
+    if (unlikely (hb_in_range<hb_codepoint_t> (info[i].codepoint, 0x180Bu, 0x180Du)))
       info[i].arabic_shaping_action() = info[i - 1].arabic_shaping_action();
 }
 
@@ -404,7 +409,7 @@
   {
     /* This sucks.  We need a font to build the fallback plan... */
     fallback_plan = arabic_fallback_plan_create (plan, font);
-    if (unlikely (!hb_atomic_ptr_cmpexch (&(const_cast<arabic_shape_plan_t *> (arabic_plan))->fallback_plan, NULL, fallback_plan))) {
+    if (unlikely (!hb_atomic_ptr_cmpexch (&(const_cast<arabic_shape_plan_t *> (arabic_plan))->fallback_plan, nullptr, fallback_plan))) {
       arabic_fallback_plan_destroy (fallback_plan);
       goto retry;
     }
@@ -524,11 +529,11 @@
       }
       i++; // Don't touch i again.
 
-      DEBUG_MSG (ARABIC, NULL, "%s stretch at (%d,%d,%d)",
+      DEBUG_MSG (ARABIC, nullptr, "%s stretch at (%d,%d,%d)",
                  step == MEASURE ? "measuring" : "cutting", context, start, end);
-      DEBUG_MSG (ARABIC, NULL, "rest of word:    count=%d width %d", start - context, w_total);
-      DEBUG_MSG (ARABIC, NULL, "fixed tiles:     count=%d width=%d", n_fixed, w_fixed);
-      DEBUG_MSG (ARABIC, NULL, "repeating tiles: count=%d width=%d", n_repeating, w_repeating);
+      DEBUG_MSG (ARABIC, nullptr, "rest of word:    count=%d width %d", start - context, w_total);
+      DEBUG_MSG (ARABIC, nullptr, "fixed tiles:     count=%d width=%d", n_fixed, w_fixed);
+      DEBUG_MSG (ARABIC, nullptr, "repeating tiles: count=%d width=%d", n_repeating, w_repeating);
 
       /* Number of additional times to repeat each repeating tile. */
       int n_copies = 0;
@@ -540,7 +545,7 @@
       /* See if we can improve the fit by adding an extra repeat and squeezing them together a bit. */
       hb_position_t extra_repeat_overlap = 0;
       hb_position_t shortfall = sign * w_remaining - sign * w_repeating * (n_copies + 1);
-      if (shortfall > 0)
+      if (shortfall > 0 && n_repeating > 0)
       {
         ++n_copies;
         hb_position_t excess = (n_copies + 1) * sign * w_repeating - sign * w_remaining;
@@ -551,10 +556,11 @@
       if (step == MEASURE)
       {
         extra_glyphs_needed += n_copies * n_repeating;
-        DEBUG_MSG (ARABIC, NULL, "will add extra %d copies of repeating tiles", n_copies);
+        DEBUG_MSG (ARABIC, nullptr, "will add extra %d copies of repeating tiles", n_copies);
       }
       else
       {
+        buffer->unsafe_to_break (context, end);
         hb_position_t x_offset = 0;
         for (unsigned int k = end; k > start; k--)
         {
@@ -564,7 +570,7 @@
           if (info[k - 1].arabic_shaping_action() == STCH_REPEATING)
             repeat += n_copies;
 
-          DEBUG_MSG (ARABIC, NULL, "appending %d copies of glyph %d; j=%d",
+          DEBUG_MSG (ARABIC, nullptr, "appending %d copies of glyph %d; j=%d",
                      repeat, info[k - 1].codepoint, j);
           for (unsigned int n = 0; n < repeat; n++)
           {
@@ -605,20 +611,94 @@
   HB_BUFFER_DEALLOCATE_VAR (buffer, arabic_shaping_action);
 }
 
+/* http://www.unicode.org/reports/tr53/tr53-1.pdf */
+
+static hb_codepoint_t
+modifier_combining_marks[] =
+{
+  0x0654u, /* ARABIC HAMZA ABOVE */
+  0x0655u, /* ARABIC HAMZA BELOW */
+  0x0658u, /* ARABIC MARK NOON GHUNNA */
+  0x06DCu, /* ARABIC SMALL HIGH SEEN */
+  0x06E3u, /* ARABIC SMALL LOW SEEN */
+  0x06E7u, /* ARABIC SMALL HIGH YEH */
+  0x06E8u, /* ARABIC SMALL HIGH NOON */
+  0x08F3u, /* ARABIC SMALL HIGH WAW */
+};
+
+static inline bool
+info_is_mcm (const hb_glyph_info_t &info)
+{
+  hb_codepoint_t u = info.codepoint;
+  for (unsigned int i = 0; i < ARRAY_LENGTH (modifier_combining_marks); i++)
+    if (u == modifier_combining_marks[i])
+      return true;
+  return false;
+}
+
+static void
+reorder_marks_arabic (const hb_ot_shape_plan_t *plan,
+                      hb_buffer_t              *buffer,
+                      unsigned int              start,
+                      unsigned int              end)
+{
+  hb_glyph_info_t *info = buffer->info;
+
+  unsigned int i = start;
+  for (unsigned int cc = 220; cc <= 230; cc += 10)
+  {
+    DEBUG_MSG (ARABIC, buffer, "Looking for %d's starting at %d\n", cc, i);
+    while (i < end && info_cc(info[i]) < cc)
+      i++;
+    DEBUG_MSG (ARABIC, buffer, "Looking for %d's stopped at %d\n", cc, i);
+
+    if (i == end)
+      break;
+
+    if (info_cc(info[i]) > cc)
+      continue;
+
+    /* Technically we should also check "info_cc(info[j]) == cc"
+     * in the following loop.  But not doing it is safe; we might
+     * end up moving all the 220 MCMs and 230 MCMs together in one
+     * move and be done. */
+    unsigned int j = i;
+    while (j < end && info_is_mcm (info[j]))
+      j++;
+    DEBUG_MSG (ARABIC, buffer, "Found %d's from %d to %d\n", cc, i, j);
+
+    if (i == j)
+      continue;
+
+    /* Shift it! */
+    DEBUG_MSG (ARABIC, buffer, "Shifting %d's: %d %d\n", cc, i, j);
+    hb_glyph_info_t temp[HB_OT_SHAPE_COMPLEX_MAX_COMBINING_MARKS];
+    assert (j - i <= ARRAY_LENGTH (temp));
+    buffer->merge_clusters (start, j);
+    memmove (temp, &info[i], (j - i) * sizeof (hb_glyph_info_t));
+    memmove (&info[start + j - i], &info[start], (i - start) * sizeof (hb_glyph_info_t));
+    memmove (&info[start], temp, (j - i) * sizeof (hb_glyph_info_t));
+
+    start += j - i;
+
+    i = j;
+  }
+}
+
 const hb_ot_complex_shaper_t _hb_ot_complex_shaper_arabic =
 {
-  "arabic",
   collect_features_arabic,
-  NULL, /* override_features */
+  nullptr, /* override_features */
   data_create_arabic,
   data_destroy_arabic,
-  NULL, /* preprocess_text */
+  nullptr, /* preprocess_text */
   postprocess_glyphs_arabic,
   HB_OT_SHAPE_NORMALIZATION_MODE_DEFAULT,
-  NULL, /* decompose */
-  NULL, /* compose */
+  nullptr, /* decompose */
+  nullptr, /* compose */
   setup_masks_arabic,
-  NULL, /* disable_otl */
+  nullptr, /* disable_otl */
+  reorder_marks_arabic,
   HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE,
   true, /* fallback_position */
 };
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-default.cc	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-default.cc	Wed Dec 13 10:25:38 2017 -0800
@@ -29,18 +29,18 @@
 
 const hb_ot_complex_shaper_t _hb_ot_complex_shaper_default =
 {
-  "default",
-  NULL, /* collect_features */
-  NULL, /* override_features */
-  NULL, /* data_create */
-  NULL, /* data_destroy */
-  NULL, /* preprocess_text */
-  NULL, /* postprocess_glyphs */
+  nullptr, /* collect_features */
+  nullptr, /* override_features */
+  nullptr, /* data_create */
+  nullptr, /* data_destroy */
+  nullptr, /* preprocess_text */
+  nullptr, /* postprocess_glyphs */
   HB_OT_SHAPE_NORMALIZATION_MODE_DEFAULT,
-  NULL, /* decompose */
-  NULL, /* compose */
-  NULL, /* setup_masks */
-  NULL, /* disable_otl */
+  nullptr, /* decompose */
+  nullptr, /* compose */
+  nullptr, /* setup_masks */
+  nullptr, /* disable_otl */
+  nullptr, /* reorder_marks */
   HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE,
   true, /* fallback_position */
 };
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-hangul.cc	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-hangul.cc	Wed Dec 13 10:25:38 2017 -0800
@@ -32,7 +32,7 @@
 
 /* Same order as the feature array below */
 enum {
-  NONE,
+  _JMO,
 
   LJMO,
   VJMO,
@@ -80,7 +80,7 @@
 {
   hangul_shape_plan_t *hangul_plan = (hangul_shape_plan_t *) calloc (1, sizeof (hangul_shape_plan_t));
   if (unlikely (!hangul_plan))
-    return NULL;
+    return nullptr;
 
   for (unsigned int i = 0; i < HANGUL_FEATURE_COUNT; i++)
     hangul_plan->mask_array[i] = plan->map.get_1_mask (hangul_features[i]);
@@ -105,16 +105,16 @@
 #define NCount (VCount * TCount)
 #define SCount (LCount * NCount)
 
-#define isCombiningL(u) (hb_in_range ((u), LBase, LBase+LCount-1))
-#define isCombiningV(u) (hb_in_range ((u), VBase, VBase+VCount-1))
-#define isCombiningT(u) (hb_in_range ((u), TBase+1, TBase+TCount-1))
-#define isCombinedS(u) (hb_in_range ((u), SBase, SBase+SCount-1))
+#define isCombiningL(u) (hb_in_range<hb_codepoint_t> ((u), LBase, LBase+LCount-1))
+#define isCombiningV(u) (hb_in_range<hb_codepoint_t> ((u), VBase, VBase+VCount-1))
+#define isCombiningT(u) (hb_in_range<hb_codepoint_t> ((u), TBase+1, TBase+TCount-1))
+#define isCombinedS(u) (hb_in_range<hb_codepoint_t> ((u), SBase, SBase+SCount-1))
 
-#define isL(u) (hb_in_ranges ((u), 0x1100u, 0x115Fu, 0xA960u, 0xA97Cu))
-#define isV(u) (hb_in_ranges ((u), 0x1160u, 0x11A7u, 0xD7B0u, 0xD7C6u))
-#define isT(u) (hb_in_ranges ((u), 0x11A8u, 0x11FFu, 0xD7CBu, 0xD7FBu))
+#define isL(u) (hb_in_ranges<hb_codepoint_t> ((u), 0x1100u, 0x115Fu, 0xA960u, 0xA97Cu))
+#define isV(u) (hb_in_ranges<hb_codepoint_t> ((u), 0x1160u, 0x11A7u, 0xD7B0u, 0xD7C6u))
+#define isT(u) (hb_in_ranges<hb_codepoint_t> ((u), 0x11A8u, 0x11FFu, 0xD7CBu, 0xD7FBu))
 
-#define isHangulTone(u) (hb_in_range ((u), 0x302Eu, 0x302Fu))
+#define isHangulTone(u) (hb_in_range<hb_codepoint_t> ((u), 0x302Eu, 0x302Fu))
 
 /* buffer var allocations */
 #define hangul_shaping_feature() complex_var_u8_0() /* hangul jamo shaping feature */
@@ -202,6 +202,7 @@
       if (start < end && end == buffer->out_len)
       {
         /* Tone mark follows a valid syllable; move it in front, unless it's zero width. */
+        buffer->unsafe_to_break_from_outbuffer (start, buffer->idx);
         buffer->next_glyph ();
         if (!is_zero_width_char (font, u))
         {
@@ -258,6 +259,7 @@
           else
             t = 0; /* The next character was not a trailing jamo. */
         }
+        buffer->unsafe_to_break (buffer->idx, buffer->idx + (t ? 3 : 2));
 
         /* We've got a syllable <L,V,T?>; see if it can potentially be composed. */
         if (isCombiningL (l) && isCombiningV (v) && (t == 0 || isCombiningT (t)))
@@ -322,6 +324,8 @@
           end = start + 1;
           continue;
         }
+        else
+          buffer->unsafe_to_break (buffer->idx, buffer->idx + 2); /* Mark unsafe between LV and T. */
       }
 
       /* Otherwise, decompose if font doesn't support <LV> or <LVT>,
@@ -368,6 +372,8 @@
             buffer->merge_out_clusters (start, end);
           continue;
         }
+        else if ((!tindex && buffer->idx + 1 < count && isT (buffer->cur(+1).codepoint)))
+          buffer->unsafe_to_break (buffer->idx, buffer->idx + 2); /* Mark unsafe between LV and T. */
       }
 
       if (has_glyph)
@@ -408,18 +414,18 @@
 
 const hb_ot_complex_shaper_t _hb_ot_complex_shaper_hangul =
 {
-  "hangul",
   collect_features_hangul,
   override_features_hangul,
   data_create_hangul,
   data_destroy_hangul,
   preprocess_text_hangul,
-  NULL, /* postprocess_glyphs */
+  nullptr, /* postprocess_glyphs */
   HB_OT_SHAPE_NORMALIZATION_MODE_NONE,
-  NULL, /* decompose */
-  NULL, /* compose */
+  nullptr, /* decompose */
+  nullptr, /* compose */
   setup_masks_hangul,
-  NULL, /* disable_otl */
+  nullptr, /* disable_otl */
+  nullptr, /* reorder_marks */
   HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE,
   false, /* fallback_position */
 };
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-hebrew.cc	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-hebrew.cc	Wed Dec 13 10:25:38 2017 -0800
@@ -169,18 +169,18 @@
 
 const hb_ot_complex_shaper_t _hb_ot_complex_shaper_hebrew =
 {
-  "hebrew",
-  NULL, /* collect_features */
-  NULL, /* override_features */
-  NULL, /* data_create */
-  NULL, /* data_destroy */
-  NULL, /* preprocess_text */
-  NULL, /* postprocess_glyphs */
+  nullptr, /* collect_features */
+  nullptr, /* override_features */
+  nullptr, /* data_create */
+  nullptr, /* data_destroy */
+  nullptr, /* preprocess_text */
+  nullptr, /* postprocess_glyphs */
   HB_OT_SHAPE_NORMALIZATION_MODE_DEFAULT,
-  NULL, /* decompose */
+  nullptr, /* decompose */
   compose_hebrew,
-  NULL, /* setup_masks */
+  nullptr, /* setup_masks */
   disable_otl_hebrew,
+  nullptr, /* reorder_marks */
   HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE,
   true, /* fallback_position */
 };
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-indic-machine.hh	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-indic-machine.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -34,1317 +34,1319 @@
 
 #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, 
-        9u, 10u, 9u, 9u, 5u, 10u, 0
+        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, 19u, 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, 1u, 16u, 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, 
-        2, 1, 6
+        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, 19, 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, 16
 };
 
 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, 
-        5895, 5898, 5900
+        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, 1079, 1095, 1111, 1126, 1143,
+        1159, 1175, 1190, 1207, 1223, 1239, 1254, 1271,
+        1287, 1303, 1318, 1335, 1351, 1367, 1382, 1393,
+        1404, 1411, 1414, 1416, 1419, 1422, 1424, 1431,
+        1443, 1452, 1459, 1468, 1480, 1493, 1506, 1518,
+        1529, 1542, 1554, 1565, 1578, 1590, 1601, 1614,
+        1626, 1637, 1650, 1667, 1679, 1695, 1711, 1728,
+        1745, 1762, 1779, 1796, 1812, 1828, 1845, 1862,
+        1879, 1896, 1913, 1929, 1945, 1962, 1979, 1996,
+        2013, 2030, 2046, 2062, 2079, 2096, 2113, 2130,
+        2147, 2163, 2179, 2195, 2211, 2226, 2243, 2259,
+        2275, 2290, 2307, 2323, 2339, 2354, 2371, 2387,
+        2403, 2418, 2435, 2451, 2467, 2482, 2493, 2504,
+        2511, 2514, 2516, 2519, 2522, 2524, 2531, 2543,
+        2552, 2559, 2568, 2580, 2593, 2606, 2618, 2629,
+        2642, 2654, 2665, 2678, 2690, 2701, 2714, 2726,
+        2737, 2750, 2767, 2779, 2795, 2811, 2828, 2845,
+        2862, 2879, 2896, 2912, 2928, 2945, 2962, 2979,
+        2996, 3013, 3029, 3045, 3062, 3079, 3096, 3113,
+        3130, 3146, 3162, 3179, 3196, 3213, 3230, 3242,
+        3259, 3275, 3291, 3306, 3323, 3339, 3355, 3370,
+        3387, 3403, 3419, 3434, 3451, 3467, 3483, 3498,
+        3515, 3531, 3547, 3562, 3573, 3584, 3591, 3594,
+        3596, 3599, 3602, 3604, 3611, 3623, 3632, 3639,
+        3648, 3660, 3673, 3686, 3698, 3709, 3722, 3734,
+        3745, 3758, 3770, 3781, 3794, 3806, 3817, 3830,
+        3847, 3859, 3875, 3891, 3908, 3925, 3942, 3959,
+        3976, 3992, 4008, 4025, 4042, 4059, 4076, 4093,
+        4109, 4125, 4142, 4159, 4176, 4193, 4210, 4226,
+        4242, 4259, 4276, 4293, 4310, 4327, 4339, 4355,
+        4367, 4383, 4399, 4414, 4431, 4447, 4463, 4478,
+        4495, 4511, 4527, 4542, 4559, 4575, 4591, 4606,
+        4623, 4639, 4655, 4670, 4681, 4692, 4699, 4702,
+        4704, 4707, 4710, 4712, 4719, 4731, 4740, 4747,
+        4756, 4768, 4781, 4794, 4806, 4817, 4830, 4842,
+        4853, 4866, 4878, 4889, 4902, 4914, 4925, 4938,
+        4955, 4967, 4983, 4999, 5016, 5033, 5050, 5067,
+        5084, 5100, 5116, 5133, 5150, 5167, 5184, 5201,
+        5217, 5233, 5250, 5267, 5284, 5301, 5318, 5334,
+        5350, 5367, 5384, 5401, 5418, 5435, 5451, 5469,
+        5485, 5503, 5515, 5522, 5525, 5527, 5530, 5533,
+        5535, 5542, 5559, 5575, 5591, 5606, 5622, 5638,
+        5655, 5668, 5680, 5691, 5704, 5716, 5727, 5740,
+        5752, 5763, 5776, 5788, 5799, 5811, 5820, 5827,
+        5836, 5848, 5865, 5874, 5881, 5888, 5891, 5893,
+        5896, 5899, 5901, 5908
 };
 
 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, 
-        549, 550, 546, 0
+        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, 202, 187, 204,
+        205, 206, 207, 6, 1, 208, 209, 203,
+        203, 38, 210, 203, 203, 211, 203, 212,
+        205, 213, 213, 6, 1, 208, 209, 203,
+        203, 203, 210, 203, 203, 211, 203, 205,
+        213, 213, 6, 1, 208, 209, 203, 203,
+        203, 210, 203, 203, 211, 203, 214, 203,
+        203, 203, 19, 215, 203, 1, 208, 209,
+        203, 203, 203, 216, 203, 214, 203, 217,
+        218, 219, 220, 6, 1, 208, 209, 203,
+        203, 36, 221, 203, 203, 211, 203, 222,
+        218, 223, 223, 6, 1, 208, 209, 203,
+        203, 203, 221, 203, 203, 211, 203, 218,
+        223, 223, 6, 1, 208, 209, 203, 203,
+        203, 221, 203, 203, 211, 203, 224, 203,
+        203, 203, 19, 225, 203, 1, 208, 209,
+        203, 203, 203, 216, 203, 224, 203, 226,
+        227, 228, 229, 6, 1, 208, 209, 203,
+        203, 34, 230, 203, 203, 211, 203, 231,
+        227, 232, 232, 6, 1, 208, 209, 203,
+        203, 203, 230, 203, 203, 211, 203, 227,
+        232, 232, 6, 1, 208, 209, 203, 203,
+        203, 230, 203, 203, 211, 203, 233, 203,
+        203, 203, 19, 234, 203, 1, 208, 209,
+        203, 203, 203, 216, 203, 233, 203, 235,
+        236, 237, 238, 6, 1, 208, 209, 203,
+        203, 32, 239, 203, 203, 211, 203, 240,
+        236, 241, 241, 6, 1, 208, 209, 203,
+        203, 203, 239, 203, 203, 211, 203, 236,
+        241, 241, 6, 1, 208, 209, 203, 203,
+        203, 239, 203, 203, 211, 203, 242, 203,
+        203, 203, 19, 243, 203, 1, 208, 209,
+        203, 203, 203, 216, 203, 242, 203, 244,
+        245, 246, 247, 6, 1, 208, 209, 203,
+        203, 30, 248, 203, 203, 211, 203, 249,
+        245, 250, 250, 6, 1, 208, 209, 203,
+        203, 203, 248, 203, 203, 211, 203, 245,
+        250, 250, 6, 1, 208, 209, 203, 203,
+        203, 248, 203, 203, 211, 203, 19, 251,
+        203, 1, 208, 209, 203, 203, 203, 216,
+        203, 252, 252, 203, 1, 208, 209, 203,
+        203, 203, 216, 203, 253, 203, 203, 254,
+        208, 209, 203, 208, 209, 203, 255, 203,
+        208, 256, 203, 208, 257, 203, 208, 203,
+        253, 203, 203, 203, 208, 209, 203, 258,
+        203, 259, 260, 203, 1, 208, 209, 203,
+        203, 4, 203, 3, 203, 252, 252, 203,
+        1, 208, 209, 203, 252, 252, 203, 1,
+        208, 209, 203, 258, 203, 252, 252, 203,
+        1, 208, 209, 203, 258, 203, 259, 252,
+        203, 1, 208, 209, 203, 203, 4, 203,
+        19, 203, 261, 261, 6, 1, 208, 209,
+        203, 203, 203, 216, 203, 262, 28, 263,
+        264, 9, 1, 208, 209, 203, 203, 203,
+        216, 203, 28, 263, 264, 9, 1, 208,
+        209, 203, 203, 203, 216, 203, 263, 263,
+        9, 1, 208, 209, 203, 203, 203, 216,
+        203, 265, 25, 266, 267, 12, 1, 208,
+        209, 203, 203, 203, 216, 203, 25, 266,
+        267, 12, 1, 208, 209, 203, 203, 203,
+        216, 203, 266, 266, 12, 1, 208, 209,
+        203, 203, 203, 216, 203, 268, 22, 269,
+        270, 15, 1, 208, 209, 203, 203, 203,
+        216, 203, 22, 269, 270, 15, 1, 208,
+        209, 203, 203, 203, 216, 203, 269, 269,
+        15, 1, 208, 209, 203, 203, 203, 216,
+        203, 271, 19, 252, 272, 203, 1, 208,
+        209, 203, 203, 203, 216, 203, 19, 252,
+        272, 203, 1, 208, 209, 203, 203, 203,
+        216, 203, 252, 273, 203, 1, 208, 209,
+        203, 203, 203, 216, 203, 19, 203, 252,
+        252, 203, 1, 208, 209, 203, 203, 203,
+        216, 203, 2, 3, 203, 203, 19, 251,
+        203, 1, 208, 209, 203, 203, 203, 216,
+        203, 2, 203, 245, 250, 250, 6, 1,
+        208, 209, 203, 203, 203, 248, 203, 244,
+        245, 250, 250, 6, 1, 208, 209, 203,
+        203, 203, 248, 203, 203, 211, 203, 244,
+        245, 246, 250, 6, 1, 208, 209, 203,
+        203, 30, 248, 203, 203, 211, 203, 242,
+        203, 274, 203, 261, 261, 6, 1, 208,
+        209, 203, 203, 203, 216, 203, 242, 203,
+        242, 203, 203, 203, 252, 252, 203, 1,
+        208, 209, 203, 203, 203, 216, 203, 242,
+        203, 242, 203, 203, 203, 252, 275, 203,
+        1, 208, 209, 203, 203, 203, 216, 203,
+        242, 203, 242, 203, 274, 203, 252, 252,
+        203, 1, 208, 209, 203, 203, 203, 216,
+        203, 242, 203, 242, 3, 203, 203, 19,
+        243, 203, 1, 208, 209, 203, 203, 203,
+        216, 203, 242, 203, 235, 236, 241, 241,
+        6, 1, 208, 209, 203, 203, 203, 239,
+        203, 203, 211, 203, 235, 236, 237, 241,
+        6, 1, 208, 209, 203, 203, 32, 239,
+        203, 203, 211, 203, 233, 203, 276, 203,
+        261, 261, 6, 1, 208, 209, 203, 203,
+        203, 216, 203, 233, 203, 233, 203, 203,
+        203, 252, 252, 203, 1, 208, 209, 203,
+        203, 203, 216, 203, 233, 203, 233, 203,
+        203, 203, 252, 277, 203, 1, 208, 209,
+        203, 203, 203, 216, 203, 233, 203, 233,
+        203, 276, 203, 252, 252, 203, 1, 208,
+        209, 203, 203, 203, 216, 203, 233, 203,
+        233, 3, 203, 203, 19, 234, 203, 1,
+        208, 209, 203, 203, 203, 216, 203, 233,
+        203, 226, 227, 232, 232, 6, 1, 208,
+        209, 203, 203, 203, 230, 203, 203, 211,
+        203, 226, 227, 228, 232, 6, 1, 208,
+        209, 203, 203, 34, 230, 203, 203, 211,
+        203, 224, 203, 278, 203, 261, 261, 6,
+        1, 208, 209, 203, 203, 203, 216, 203,
+        224, 203, 224, 203, 203, 203, 252, 252,
+        203, 1, 208, 209, 203, 203, 203, 216,
+        203, 224, 203, 224, 203, 203, 203, 252,
+        279, 203, 1, 208, 209, 203, 203, 203,
+        216, 203, 224, 203, 224, 203, 278, 203,
+        252, 252, 203, 1, 208, 209, 203, 203,
+        203, 216, 203, 224, 203, 224, 3, 203,
+        203, 19, 225, 203, 1, 208, 209, 203,
+        203, 203, 216, 203, 224, 203, 217, 218,
+        223, 223, 6, 1, 208, 209, 203, 203,
+        203, 221, 203, 203, 211, 203, 217, 218,
+        219, 223, 6, 1, 208, 209, 203, 203,
+        36, 221, 203, 203, 211, 203, 214, 203,
+        280, 203, 261, 261, 6, 1, 208, 209,
+        203, 203, 203, 216, 203, 214, 203, 214,
+        203, 203, 203, 252, 252, 203, 1, 208,
+        209, 203, 203, 203, 216, 203, 214, 203,
+        214, 203, 203, 203, 252, 281, 203, 1,
+        208, 209, 203, 203, 203, 216, 203, 214,
+        203, 214, 203, 280, 203, 252, 252, 203,
+        1, 208, 209, 203, 203, 203, 216, 203,
+        214, 203, 214, 3, 203, 203, 19, 215,
+        203, 1, 208, 209, 203, 203, 203, 216,
+        203, 214, 203, 204, 205, 213, 213, 6,
+        1, 208, 209, 203, 203, 203, 210, 203,
+        203, 211, 203, 204, 205, 206, 213, 6,
+        1, 208, 209, 203, 203, 38, 210, 203,
+        203, 211, 203, 283, 284, 285, 286, 45,
+        40, 287, 288, 282, 282, 77, 289, 282,
+        282, 290, 282, 291, 284, 292, 286, 45,
+        40, 287, 288, 282, 282, 282, 289, 282,
+        282, 290, 282, 284, 292, 286, 45, 40,
+        287, 288, 282, 282, 282, 289, 282, 282,
+        290, 282, 293, 282, 282, 282, 58, 294,
+        282, 40, 287, 288, 282, 282, 282, 295,
+        282, 293, 282, 296, 297, 298, 299, 45,
+        40, 287, 288, 282, 282, 75, 300, 282,
+        282, 290, 282, 301, 297, 302, 302, 45,
+        40, 287, 288, 282, 282, 282, 300, 282,
+        282, 290, 282, 297, 302, 302, 45, 40,
+        287, 288, 282, 282, 282, 300, 282, 282,
+        290, 282, 303, 282, 282, 282, 58, 304,
+        282, 40, 287, 288, 282, 282, 282, 295,
+        282, 303, 282, 305, 306, 307, 308, 45,
+        40, 287, 288, 282, 282, 73, 309, 282,
+        282, 290, 282, 310, 306, 311, 311, 45,
+        40, 287, 288, 282, 282, 282, 309, 282,
+        282, 290, 282, 306, 311, 311, 45, 40,
+        287, 288, 282, 282, 282, 309, 282, 282,
+        290, 282, 312, 282, 282, 282, 58, 313,
+        282, 40, 287, 288, 282, 282, 282, 295,
+        282, 312, 282, 314, 315, 316, 317, 45,
+        40, 287, 288, 282, 282, 71, 318, 282,
+        282, 290, 282, 319, 315, 320, 320, 45,
+        40, 287, 288, 282, 282, 282, 318, 282,
+        282, 290, 282, 315, 320, 320, 45, 40,
+        287, 288, 282, 282, 282, 318, 282, 282,
+        290, 282, 321, 282, 282, 282, 58, 322,
+        282, 40, 287, 288, 282, 282, 282, 295,
+        282, 321, 282, 323, 324, 325, 326, 45,
+        40, 287, 288, 282, 282, 69, 327, 282,
+        282, 290, 282, 328, 324, 329, 329, 45,
+        40, 287, 288, 282, 282, 282, 327, 282,
+        282, 290, 282, 324, 329, 329, 45, 40,
+        287, 288, 282, 282, 282, 327, 282, 282,
+        290, 282, 58, 330, 282, 40, 287, 288,
+        282, 282, 282, 295, 282, 331, 331, 282,
+        40, 287, 288, 282, 282, 282, 295, 282,
+        332, 282, 282, 333, 287, 288, 282, 287,
+        288, 282, 334, 282, 287, 335, 282, 287,
+        336, 282, 287, 282, 332, 282, 282, 282,
+        287, 288, 282, 337, 282, 338, 339, 282,
+        40, 287, 288, 282, 282, 43, 282, 42,
+        282, 331, 331, 282, 40, 287, 288, 282,
+        331, 331, 282, 40, 287, 288, 282, 337,
+        282, 331, 331, 282, 40, 287, 288, 282,
+        337, 282, 338, 331, 282, 40, 287, 288,
+        282, 282, 43, 282, 58, 282, 340, 340,
+        45, 40, 287, 288, 282, 282, 282, 295,
+        282, 341, 67, 342, 343, 48, 40, 287,
+        288, 282, 282, 282, 295, 282, 67, 342,
+        343, 48, 40, 287, 288, 282, 282, 282,
+        295, 282, 342, 342, 48, 40, 287, 288,
+        282, 282, 282, 295, 282, 344, 64, 345,
+        346, 51, 40, 287, 288, 282, 282, 282,
+        295, 282, 64, 345, 346, 51, 40, 287,
+        288, 282, 282, 282, 295, 282, 345, 345,
+        51, 40, 287, 288, 282, 282, 282, 295,
+        282, 347, 61, 348, 349, 54, 40, 287,
+        288, 282, 282, 282, 295, 282, 61, 348,
+        349, 54, 40, 287, 288, 282, 282, 282,
+        295, 282, 348, 348, 54, 40, 287, 288,
+        282, 282, 282, 295, 282, 350, 58, 331,
+        351, 282, 40, 287, 288, 282, 282, 282,
+        295, 282, 58, 331, 351, 282, 40, 287,
+        288, 282, 282, 282, 295, 282, 331, 352,
+        282, 40, 287, 288, 282, 282, 282, 295,
+        282, 58, 282, 331, 331, 282, 40, 287,
+        288, 282, 282, 282, 295, 282, 41, 42,
+        282, 282, 58, 330, 282, 40, 287, 288,
+        282, 282, 282, 295, 282, 41, 282, 324,
+        329, 329, 45, 40, 287, 288, 282, 282,
+        282, 327, 282, 323, 324, 329, 329, 45,
+        40, 287, 288, 282, 282, 282, 327, 282,
+        282, 290, 282, 323, 324, 325, 329, 45,
+        40, 287, 288, 282, 282, 69, 327, 282,
+        282, 290, 282, 321, 282, 353, 282, 340,
+        340, 45, 40, 287, 288, 282, 282, 282,
+        295, 282, 321, 282, 321, 282, 282, 282,
+        331, 331, 282, 40, 287, 288, 282, 282,
+        282, 295, 282, 321, 282, 321, 282, 282,
+        282, 331, 354, 282, 40, 287, 288, 282,
+        282, 282, 295, 282, 321, 282, 321, 282,
+        353, 282, 331, 331, 282, 40, 287, 288,
+        282, 282, 282, 295, 282, 321, 282, 321,
+        42, 282, 282, 58, 322, 282, 40, 287,
+        288, 282, 282, 282, 295, 282, 321, 282,
+        314, 315, 320, 320, 45, 40, 287, 288,
+        282, 282, 282, 318, 282, 282, 290, 282,
+        314, 315, 316, 320, 45, 40, 287, 288,
+        282, 282, 71, 318, 282, 282, 290, 282,
+        312, 282, 355, 282, 340, 340, 45, 40,
+        287, 288, 282, 282, 282, 295, 282, 312,
+        282, 312, 282, 282, 282, 331, 331, 282,
+        40, 287, 288, 282, 282, 282, 295, 282,
+        312, 282, 312, 282, 282, 282, 331, 356,
+        282, 40, 287, 288, 282, 282, 282, 295,
+        282, 312, 282, 312, 282, 355, 282, 331,
+        331, 282, 40, 287, 288, 282, 282, 282,
+        295, 282, 312, 282, 312, 42, 282, 282,
+        58, 313, 282, 40, 287, 288, 282, 282,
+        282, 295, 282, 312, 282, 305, 306, 311,
+        311, 45, 40, 287, 288, 282, 282, 282,
+        309, 282, 282, 290, 282, 305, 306, 307,
+        311, 45, 40, 287, 288, 282, 282, 73,
+        309, 282, 282, 290, 282, 303, 282, 357,
+        282, 340, 340, 45, 40, 287, 288, 282,
+        282, 282, 295, 282, 303, 282, 303, 282,
+        282, 282, 331, 331, 282, 40, 287, 288,
+        282, 282, 282, 295, 282, 303, 282, 303,
+        282, 282, 282, 331, 358, 282, 40, 287,
+        288, 282, 282, 282, 295, 282, 303, 282,
+        303, 282, 357, 282, 331, 331, 282, 40,
+        287, 288, 282, 282, 282, 295, 282, 303,
+        282, 303, 42, 282, 282, 58, 304, 282,
+        40, 287, 288, 282, 282, 282, 295, 282,
+        303, 282, 296, 297, 302, 302, 45, 40,
+        287, 288, 282, 282, 282, 300, 282, 282,
+        290, 282, 296, 297, 298, 302, 45, 40,
+        287, 288, 282, 282, 75, 300, 282, 282,
+        290, 282, 293, 282, 359, 282, 340, 340,
+        45, 40, 287, 288, 282, 282, 282, 295,
+        282, 293, 282, 293, 282, 282, 282, 331,
+        331, 282, 40, 287, 288, 282, 282, 282,
+        295, 282, 293, 282, 293, 282, 282, 282,
+        331, 360, 282, 40, 287, 288, 282, 282,
+        282, 295, 282, 293, 282, 293, 282, 359,
+        282, 331, 331, 282, 40, 287, 288, 282,
+        282, 282, 295, 282, 293, 282, 76, 44,
+        44, 45, 40, 282, 282, 282, 282, 282,
+        76, 282, 293, 42, 282, 282, 58, 294,
+        282, 40, 287, 288, 282, 282, 282, 295,
+        282, 293, 282, 283, 284, 292, 286, 45,
+        40, 287, 288, 282, 282, 282, 289, 282,
+        282, 290, 282, 362, 191, 363, 363, 84,
+        79, 194, 195, 361, 361, 361, 197, 361,
+        361, 200, 361, 191, 363, 363, 84, 79,
+        194, 195, 361, 361, 361, 197, 361, 361,
+        200, 361, 364, 361, 361, 361, 98, 365,
+        361, 79, 194, 195, 361, 361, 361, 366,
+        361, 364, 361, 367, 368, 369, 370, 84,
+        79, 194, 195, 361, 361, 115, 371, 361,
+        361, 200, 361, 372, 368, 373, 373, 84,
+        79, 194, 195, 361, 361, 361, 371, 361,
+        361, 200, 361, 368, 373, 373, 84, 79,
+        194, 195, 361, 361, 361, 371, 361, 361,
+        200, 361, 374, 361, 361, 361, 98, 375,
+        361, 79, 194, 195, 361, 361, 361, 366,
+        361, 374, 361, 376, 377, 378, 379, 84,
+        79, 194, 195, 361, 361, 113, 380, 361,
+        361, 200, 361, 381, 377, 382, 382, 84,
+        79, 194, 195, 361, 361, 361, 380, 361,
+        361, 200, 361, 377, 382, 382, 84, 79,
+        194, 195, 361, 361, 361, 380, 361, 361,
+        200, 361, 383, 361, 361, 361, 98, 384,
+        361, 79, 194, 195, 361, 361, 361, 366,
+        361, 383, 361, 385, 386, 387, 388, 84,
+        79, 194, 195, 361, 361, 111, 389, 361,
+        361, 200, 361, 390, 386, 391, 391, 84,
+        79, 194, 195, 361, 361, 361, 389, 361,
+        361, 200, 361, 386, 391, 391, 84, 79,
+        194, 195, 361, 361, 361, 389, 361, 361,
+        200, 361, 392, 361, 361, 361, 98, 393,
+        361, 79, 194, 195, 361, 361, 361, 366,
+        361, 392, 361, 394, 395, 396, 397, 84,
+        79, 194, 195, 361, 361, 109, 398, 361,
+        361, 200, 361, 399, 395, 400, 400, 84,
+        79, 194, 195, 361, 361, 361, 398, 361,
+        361, 200, 361, 395, 400, 400, 84, 79,
+        194, 195, 361, 361, 361, 398, 361, 361,
+        200, 361, 98, 401, 361, 79, 194, 195,
+        361, 361, 361, 366, 361, 402, 402, 361,
+        79, 194, 195, 361, 361, 361, 366, 361,
+        403, 361, 361, 404, 194, 195, 361, 194,
+        195, 361, 405, 361, 194, 406, 361, 194,
+        407, 361, 194, 361, 403, 361, 361, 361,
+        194, 195, 361, 408, 361, 409, 410, 361,
+        79, 194, 195, 361, 361, 82, 361, 81,
+        361, 402, 402, 361, 79, 194, 195, 361,
+        402, 402, 361, 79, 194, 195, 361, 408,
+        361, 402, 402, 361, 79, 194, 195, 361,
+        408, 361, 409, 402, 361, 79, 194, 195,
+        361, 361, 82, 361, 98, 361, 411, 411,
+        84, 79, 194, 195, 361, 361, 361, 366,
+        361, 412, 107, 413, 414, 88, 79, 194,
+        195, 361, 361, 361, 366, 361, 107, 413,
+        414, 88, 79, 194, 195, 361, 361, 361,
+        366, 361, 413, 413, 88, 79, 194, 195,
+        361, 361, 361, 366, 361, 415, 104, 416,
+        417, 91, 79, 194, 195, 361, 361, 361,
+        366, 361, 104, 416, 417, 91, 79, 194,
+        195, 361, 361, 361, 366, 361, 416, 416,
+        91, 79, 194, 195, 361, 361, 361, 366,
+        361, 418, 101, 419, 420, 94, 79, 194,
+        195, 361, 361, 361, 366, 361, 101, 419,
+        420, 94, 79, 194, 195, 361, 361, 361,
+        366, 361, 419, 419, 94, 79, 194, 195,
+        361, 361, 361, 366, 361, 421, 98, 402,
+        422, 361, 79, 194, 195, 361, 361, 361,
+        366, 361, 98, 402, 422, 361, 79, 194,
+        195, 361, 361, 361, 366, 361, 402, 423,
+        361, 79, 194, 195, 361, 361, 361, 366,
+        361, 98, 361, 402, 402, 361, 79, 194,
+        195, 361, 361, 361, 366, 361, 80, 81,
+        361, 361, 98, 401, 361, 79, 194, 195,
+        361, 361, 361, 366, 361, 80, 361, 395,
+        400, 400, 84, 79, 194, 195, 361, 361,
+        361, 398, 361, 394, 395, 400, 400, 84,
+        79, 194, 195, 361, 361, 361, 398, 361,
+        361, 200, 361, 394, 395, 396, 400, 84,
+        79, 194, 195, 361, 361, 109, 398, 361,
+        361, 200, 361, 392, 361, 424, 361, 411,
+        411, 84, 79, 194, 195, 361, 361, 361,
+        366, 361, 392, 361, 392, 361, 361, 361,
+        402, 402, 361, 79, 194, 195, 361, 361,
+        361, 366, 361, 392, 361, 392, 361, 361,
+        361, 402, 425, 361, 79, 194, 195, 361,
+        361, 361, 366, 361, 392, 361, 392, 361,
+        424, 361, 402, 402, 361, 79, 194, 195,
+        361, 361, 361, 366, 361, 392, 361, 392,
+        81, 361, 361, 98, 393, 361, 79, 194,
+        195, 361, 361, 361, 366, 361, 392, 361,
+        385, 386, 391, 391, 84, 79, 194, 195,
+        361, 361, 361, 389, 361, 361, 200, 361,
+        385, 386, 387, 391, 84, 79, 194, 195,
+        361, 361, 111, 389, 361, 361, 200, 361,
+        383, 361, 426, 361, 411, 411, 84, 79,
+        194, 195, 361, 361, 361, 366, 361, 383,
+        361, 383, 361, 361, 361, 402, 402, 361,
+        79, 194, 195, 361, 361, 361, 366, 361,
+        383, 361, 383, 361, 361, 361, 402, 427,
+        361, 79, 194, 195, 361, 361, 361, 366,
+        361, 383, 361, 383, 361, 426, 361, 402,
+        402, 361, 79, 194, 195, 361, 361, 361,
+        366, 361, 383, 361, 383, 81, 361, 361,
+        98, 384, 361, 79, 194, 195, 361, 361,
+        361, 366, 361, 383, 361, 376, 377, 382,
+        382, 84, 79, 194, 195, 361, 361, 361,
+        380, 361, 361, 200, 361, 376, 377, 378,
+        382, 84, 79, 194, 195, 361, 361, 113,
+        380, 361, 361, 200, 361, 374, 361, 428,
+        361, 411, 411, 84, 79, 194, 195, 361,
+        361, 361, 366, 361, 374, 361, 374, 361,
+        361, 361, 402, 402, 361, 79, 194, 195,
+        361, 361, 361, 366, 361, 374, 361, 374,
+        361, 361, 361, 402, 429, 361, 79, 194,
+        195, 361, 361, 361, 366, 361, 374, 361,
+        374, 361, 428, 361, 402, 402, 361, 79,
+        194, 195, 361, 361, 361, 366, 361, 374,
+        361, 374, 81, 361, 361, 98, 375, 361,
+        79, 194, 195, 361, 361, 361, 366, 361,
+        374, 361, 367, 368, 373, 373, 84, 79,
+        194, 195, 361, 361, 361, 371, 361, 361,
+        200, 361, 367, 368, 369, 373, 84, 79,
+        194, 195, 361, 361, 115, 371, 361, 361,
+        200, 361, 364, 361, 430, 361, 411, 411,
+        84, 79, 194, 195, 361, 361, 361, 366,
+        361, 364, 361, 364, 361, 361, 361, 402,
+        402, 361, 79, 194, 195, 361, 361, 361,
+        366, 361, 364, 361, 364, 361, 361, 361,
+        402, 431, 361, 79, 194, 195, 361, 361,
+        361, 366, 361, 364, 361, 364, 361, 430,
+        361, 402, 402, 361, 79, 194, 195, 361,
+        361, 361, 366, 361, 364, 361, 364, 81,
+        361, 361, 98, 365, 361, 79, 194, 195,
+        361, 361, 361, 366, 361, 364, 361, 116,
+        83, 83, 84, 79, 432, 432, 432, 432,
+        156, 116, 432, 190, 191, 363, 363, 84,
+        79, 194, 195, 361, 361, 361, 197, 361,
+        361, 200, 361, 116, 83, 83, 84, 79,
+        432, 432, 432, 432, 432, 116, 432, 434,
+        435, 436, 437, 123, 118, 438, 439, 433,
+        433, 155, 440, 433, 433, 441, 433, 442,
+        435, 437, 437, 123, 118, 438, 439, 433,
+        433, 433, 440, 433, 433, 441, 433, 435,
+        437, 437, 123, 118, 438, 439, 433, 433,
+        433, 440, 433, 433, 441, 433, 443, 433,
+        433, 433, 136, 444, 433, 118, 438, 439,
+        433, 433, 433, 445, 433, 443, 433, 446,
+        447, 448, 449, 123, 118, 438, 439, 433,
+        433, 153, 450, 433, 433, 441, 433, 451,
+        447, 452, 452, 123, 118, 438, 439, 433,
+        433, 433, 450, 433, 433, 441, 433, 447,
+        452, 452, 123, 118, 438, 439, 433, 433,
+        433, 450, 433, 433, 441, 433, 453, 433,
+        433, 433, 136, 454, 433, 118, 438, 439,
+        433, 433, 433, 445, 433, 453, 433, 455,
+        456, 457, 458, 123, 118, 438, 439, 433,
+        433, 151, 459, 433, 433, 441, 433, 460,
+        456, 461, 461, 123, 118, 438, 439, 433,
+        433, 433, 459, 433, 433, 441, 433, 456,
+        461, 461, 123, 118, 438, 439, 433, 433,
+        433, 459, 433, 433, 441, 433, 462, 433,
+        433, 433, 136, 463, 433, 118, 438, 439,
+        433, 433, 433, 445, 433, 462, 433, 464,
+        465, 466, 467, 123, 118, 438, 439, 433,
+        433, 149, 468, 433, 433, 441, 433, 469,
+        465, 470, 470, 123, 118, 438, 439, 433,
+        433, 433, 468, 433, 433, 441, 433, 465,
+        470, 470, 123, 118, 438, 439, 433, 433,
+        433, 468, 433, 433, 441, 433, 471, 433,
+        433, 433, 136, 472, 433, 118, 438, 439,
+        433, 433, 433, 445, 433, 471, 433, 473,
+        474, 475, 476, 123, 118, 438, 439, 433,
+        433, 147, 477, 433, 433, 441, 433, 478,
+        474, 479, 479, 123, 118, 438, 439, 433,
+        433, 433, 477, 433, 433, 441, 433, 474,
+        479, 479, 123, 118, 438, 439, 433, 433,
+        433, 477, 433, 433, 441, 433, 136, 480,
+        433, 118, 438, 439, 433, 433, 433, 445,
+        433, 481, 481, 433, 118, 438, 439, 433,
+        433, 433, 445, 433, 482, 433, 433, 483,
+        438, 439, 433, 438, 439, 433, 484, 433,
+        438, 485, 433, 438, 486, 433, 438, 433,
+        482, 433, 433, 433, 438, 439, 433, 487,
+        433, 488, 489, 433, 118, 438, 439, 433,
+        433, 121, 433, 120, 433, 481, 481, 433,
+        118, 438, 439, 433, 481, 481, 433, 118,
+        438, 439, 433, 487, 433, 481, 481, 433,
+        118, 438, 439, 433, 487, 433, 488, 481,
+        433, 118, 438, 439, 433, 433, 121, 433,
+        136, 433, 490, 490, 123, 118, 438, 439,
+        433, 433, 433, 445, 433, 491, 145, 492,
+        493, 126, 118, 438, 439, 433, 433, 433,
+        445, 433, 145, 492, 493, 126, 118, 438,
+        439, 433, 433, 433, 445, 433, 492, 492,
+        126, 118, 438, 439, 433, 433, 433, 445,
+        433, 494, 142, 495, 496, 129, 118, 438,
+        439, 433, 433, 433, 445, 433, 142, 495,
+        496, 129, 118, 438, 439, 433, 433, 433,
+        445, 433, 495, 495, 129, 118, 438, 439,
+        433, 433, 433, 445, 433, 497, 139, 498,
+        499, 132, 118, 438, 439, 433, 433, 433,
+        445, 433, 139, 498, 499, 132, 118, 438,
+        439, 433, 433, 433, 445, 433, 498, 498,
+        132, 118, 438, 439, 433, 433, 433, 445,
+        433, 500, 136, 481, 501, 433, 118, 438,
+        439, 433, 433, 433, 445, 433, 136, 481,
+        501, 433, 118, 438, 439, 433, 433, 433,
+        445, 433, 481, 502, 433, 118, 438, 439,
+        433, 433, 433, 445, 433, 136, 433, 481,
+        481, 433, 118, 438, 439, 433, 433, 433,
+        445, 433, 119, 120, 433, 433, 136, 480,
+        433, 118, 438, 439, 433, 433, 433, 445,
+        433, 119, 433, 474, 479, 479, 123, 118,
+        438, 439, 433, 433, 433, 477, 433, 473,
+        474, 479, 479, 123, 118, 438, 439, 433,
+        433, 433, 477, 433, 433, 441, 433, 473,
+        474, 475, 479, 123, 118, 438, 439, 433,
+        433, 147, 477, 433, 433, 441, 433, 471,
+        433, 503, 433, 490, 490, 123, 118, 438,
+        439, 433, 433, 433, 445, 433, 471, 433,
+        471, 433, 433, 433, 481, 481, 433, 118,
+        438, 439, 433, 433, 433, 445, 433, 471,
+        433, 471, 433, 433, 433, 481, 504, 433,
+        118, 438, 439, 433, 433, 433, 445, 433,
+        471, 433, 471, 433, 503, 433, 481, 481,
+        433, 118, 438, 439, 433, 433, 433, 445,
+        433, 471, 433, 471, 120, 433, 433, 136,
+        472, 433, 118, 438, 439, 433, 433, 433,
+        445, 433, 471, 433, 464, 465, 470, 470,
+        123, 118, 438, 439, 433, 433, 433, 468,
+        433, 433, 441, 433, 464, 465, 466, 470,
+        123, 118, 438, 439, 433, 433, 149, 468,
+        433, 433, 441, 433, 462, 433, 505, 433,
+        490, 490, 123, 118, 438, 439, 433, 433,
+        433, 445, 433, 462, 433, 462, 433, 433,
+        433, 481, 481, 433, 118, 438, 439, 433,
+        433, 433, 445, 433, 462, 433, 462, 433,
+        433, 433, 481, 506, 433, 118, 438, 439,
+        433, 433, 433, 445, 433, 462, 433, 462,
+        433, 505, 433, 481, 481, 433, 118, 438,
+        439, 433, 433, 433, 445, 433, 462, 433,
+        462, 120, 433, 433, 136, 463, 433, 118,
+        438, 439, 433, 433, 433, 445, 433, 462,
+        433, 455, 456, 461, 461, 123, 118, 438,
+        439, 433, 433, 433, 459, 433, 433, 441,
+        433, 455, 456, 457, 461, 123, 118, 438,
+        439, 433, 433, 151, 459, 433, 433, 441,
+        433, 453, 433, 507, 433, 490, 490, 123,
+        118, 438, 439, 433, 433, 433, 445, 433,
+        453, 433, 453, 433, 433, 433, 481, 481,
+        433, 118, 438, 439, 433, 433, 433, 445,
+        433, 453, 433, 453, 433, 433, 433, 481,
+        508, 433, 118, 438, 439, 433, 433, 433,
+        445, 433, 453, 433, 453, 433, 507, 433,
+        481, 481, 433, 118, 438, 439, 433, 433,
+        433, 445, 433, 453, 433, 453, 120, 433,
+        433, 136, 454, 433, 118, 438, 439, 433,
+        433, 433, 445, 433, 453, 433, 446, 447,
+        452, 452, 123, 118, 438, 439, 433, 433,
+        433, 450, 433, 433, 441, 433, 446, 447,
+        448, 452, 123, 118, 438, 439, 433, 433,
+        153, 450, 433, 433, 441, 433, 443, 433,
+        509, 433, 490, 490, 123, 118, 438, 439,
+        433, 433, 433, 445, 433, 443, 433, 443,
+        433, 433, 433, 481, 481, 433, 118, 438,
+        439, 433, 433, 433, 445, 433, 443, 433,
+        443, 433, 433, 433, 481, 510, 433, 118,
+        438, 439, 433, 433, 433, 445, 433, 443,
+        433, 443, 433, 509, 433, 481, 481, 433,
+        118, 438, 439, 433, 433, 433, 445, 433,
+        443, 433, 443, 120, 433, 433, 136, 444,
+        433, 118, 438, 439, 433, 433, 433, 445,
+        433, 443, 433, 434, 435, 437, 437, 123,
+        118, 438, 439, 433, 433, 433, 440, 433,
+        433, 441, 433, 188, 189, 190, 191, 511,
+        363, 84, 79, 194, 195, 196, 196, 156,
+        197, 361, 188, 200, 361, 204, 512, 206,
+        207, 6, 1, 208, 209, 203, 203, 38,
+        210, 203, 203, 211, 203, 214, 189, 190,
+        191, 513, 514, 84, 157, 515, 516, 203,
+        196, 156, 517, 203, 214, 200, 203, 116,
+        518, 518, 84, 157, 208, 209, 203, 203,
+        156, 519, 203, 520, 203, 203, 521, 515,
+        516, 203, 515, 516, 203, 255, 203, 515,
+        522, 203, 515, 523, 203, 515, 203, 520,
+        203, 203, 203, 515, 516, 203, 524, 3,
+        361, 361, 402, 431, 361, 79, 194, 195,
+        361, 361, 361, 366, 361, 524, 361, 525,
+        368, 526, 527, 84, 157, 515, 516, 203,
+        203, 158, 371, 203, 203, 200, 203, 528,
+        368, 529, 529, 84, 157, 515, 516, 203,
+        203, 203, 371, 203, 203, 200, 203, 368,
+        529, 529, 84, 157, 515, 516, 203, 203,
+        203, 371, 203, 203, 200, 203, 525, 368,
+        529, 529, 84, 157, 515, 516, 203, 203,
+        203, 371, 203, 203, 200, 203, 525, 368,
+        526, 529, 84, 157, 515, 516, 203, 203,
+        158, 371, 203, 203, 200, 203, 214, 203,
+        280, 116, 530, 530, 160, 157, 208, 209,
+        203, 203, 203, 519, 203, 214, 203, 531,
+        184, 532, 533, 162, 157, 515, 516, 203,
+        203, 203, 534, 203, 184, 532, 533, 162,
+        157, 515, 516, 203, 203, 203, 534, 203,
+        532, 532, 162, 157, 515, 516, 203, 203,
+        203, 534, 203, 535, 181, 536, 537, 165,
+        157, 515, 516, 203, 203, 203, 534, 203,
+        181, 536, 537, 165, 157, 515, 516, 203,
+        203, 203, 534, 203, 536, 536, 165, 157,
+        515, 516, 203, 203, 203, 534, 203, 538,
+        178, 539, 540, 168, 157, 515, 516, 203,
+        203, 203, 534, 203, 178, 539, 540, 168,
+        157, 515, 516, 203, 203, 203, 534, 203,
+        539, 539, 168, 157, 515, 516, 203, 203,
+        203, 534, 203, 541, 175, 542, 543, 203,
+        157, 515, 516, 203, 203, 203, 534, 203,
+        175, 542, 543, 203, 157, 515, 516, 203,
+        203, 203, 534, 203, 542, 542, 203, 157,
+        515, 516, 203, 203, 203, 534, 203, 544,
+        203, 545, 546, 203, 157, 515, 516, 203,
+        203, 172, 203, 171, 203, 542, 542, 203,
+        157, 515, 516, 203, 542, 542, 203, 157,
+        515, 516, 203, 544, 203, 542, 542, 203,
+        157, 515, 516, 203, 544, 203, 545, 542,
+        203, 157, 515, 516, 203, 203, 172, 203,
+        524, 171, 361, 361, 98, 365, 361, 79,
+        194, 195, 361, 361, 361, 366, 361, 524,
+        361, 548, 547, 549, 549, 547, 186, 550,
+        551, 547, 549, 549, 547, 186, 550, 551,
+        547, 552, 547, 547, 553, 550, 551, 547,
+        550, 551, 547, 554, 547, 550, 555, 547,
+        550, 556, 547, 550, 547, 552, 547, 547,
+        547, 550, 551, 547, 188, 432, 432, 432,
+        432, 432, 432, 432, 432, 432, 196, 432,
+        432, 432, 432, 188, 432, 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, 
-        538, 178, 536, 537
+        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, 539, 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, 
-        0, 24, 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, 0, 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, 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
 };
 
 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, 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
 };
 
 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, 
-        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, 204, 204, 204, 204, 204,
+        204, 204, 204, 204, 204, 204, 204, 204,
+        204, 204, 204, 204, 204, 204, 204, 204,
+        204, 204, 204, 204, 204, 204, 204, 204,
+        204, 204, 204, 204, 204, 204, 204, 204,
+        204, 204, 204, 204, 204, 204, 204, 204,
+        204, 204, 204, 204, 204, 204, 204, 204,
+        204, 204, 204, 204, 204, 204, 204, 204,
+        204, 204, 204, 204, 204, 204, 204, 204,
+        204, 204, 204, 204, 204, 204, 204, 204,
+        204, 204, 283, 283, 283, 283, 283, 283,
+        283, 283, 283, 283, 283, 283, 283, 283,
+        283, 283, 283, 283, 283, 283, 283, 283,
+        283, 283, 283, 283, 283, 283, 283, 283,
+        283, 283, 283, 283, 283, 283, 283, 283,
+        283, 283, 283, 283, 283, 283, 283, 283,
+        283, 283, 283, 283, 283, 283, 283, 283,
+        283, 283, 283, 283, 283, 283, 283, 283,
+        283, 283, 283, 283, 283, 283, 283, 283,
+        283, 283, 283, 283, 283, 283, 283, 283,
+        283, 362, 362, 362, 362, 362, 362, 362,
+        362, 362, 362, 362, 362, 362, 362, 362,
+        362, 362, 362, 362, 362, 362, 362, 362,
+        362, 362, 362, 362, 362, 362, 362, 362,
+        362, 362, 362, 362, 362, 362, 362, 362,
+        362, 362, 362, 362, 362, 362, 362, 362,
+        362, 362, 362, 362, 362, 362, 362, 362,
+        362, 362, 362, 362, 362, 362, 362, 362,
+        362, 362, 362, 362, 362, 362, 362, 362,
+        362, 362, 362, 362, 362, 433, 362, 433,
+        434, 434, 434, 434, 434, 434, 434, 434,
+        434, 434, 434, 434, 434, 434, 434, 434,
+        434, 434, 434, 434, 434, 434, 434, 434,
+        434, 434, 434, 434, 434, 434, 434, 434,
+        434, 434, 434, 434, 434, 434, 434, 434,
+        434, 434, 434, 434, 434, 434, 434, 434,
+        434, 434, 434, 434, 434, 434, 434, 434,
+        434, 434, 434, 434, 434, 434, 434, 434,
+        434, 434, 434, 434, 434, 434, 434, 434,
+        434, 434, 434, 434, 434, 434, 362, 204,
+        204, 204, 204, 204, 204, 204, 204, 204,
+        204, 362, 204, 204, 204, 204, 204, 204,
+        204, 204, 204, 204, 204, 204, 204, 204,
+        204, 204, 204, 204, 204, 204, 204, 204,
+        204, 362, 548, 548, 548, 548, 548, 548,
+        548, 548, 548, 433
 };
 
 static const int indic_syllable_machine_start = 178;
@@ -1358,7 +1360,7 @@
 
 
 
-#line 96 "hb-ot-shape-complex-indic-machine.rl"
+#line 97 "hb-ot-shape-complex-indic-machine.rl"
 
 
 #define found_syllable(syllable_type) \
@@ -1377,8 +1379,8 @@
   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"
+
+#line 1384 "hb-ot-shape-complex-indic-machine.hh"
         {
         cs = indic_syllable_machine_start;
         ts = 0;
@@ -1386,7 +1388,7 @@
         act = 0;
         }
 
-#line 117 "hb-ot-shape-complex-indic-machine.rl"
+#line 118 "hb-ot-shape-complex-indic-machine.rl"
 
 
   p = 0;
@@ -1394,8 +1396,8 @@
 
   unsigned int last = 0;
   unsigned int syllable_serial = 1;
-  
-#line 1399 "hb-ot-shape-complex-indic-machine.hh"
+
+#line 1401 "hb-ot-shape-complex-indic-machine.hh"
         {
         int _slen;
         int _trans;
@@ -1409,7 +1411,7 @@
 #line 1 "NONE"
         {ts = p;}
         break;
-#line 1413 "hb-ot-shape-complex-indic-machine.hh"
+#line 1415 "hb-ot-shape-complex-indic-machine.hh"
         }
 
         _keys = _indic_syllable_machine_trans_keys + (cs<<1);
@@ -1432,71 +1434,71 @@
         {te = p+1;}
         break;
         case 15:
-#line 87 "hb-ot-shape-complex-indic-machine.rl"
+#line 88 "hb-ot-shape-complex-indic-machine.rl"
         {te = p+1;{ found_syllable (consonant_syllable); }}
         break;
         case 17:
-#line 88 "hb-ot-shape-complex-indic-machine.rl"
+#line 89 "hb-ot-shape-complex-indic-machine.rl"
         {te = p+1;{ found_syllable (vowel_syllable); }}
         break;
         case 22:
-#line 89 "hb-ot-shape-complex-indic-machine.rl"
+#line 90 "hb-ot-shape-complex-indic-machine.rl"
         {te = p+1;{ found_syllable (standalone_cluster); }}
         break;
         case 24:
-#line 90 "hb-ot-shape-complex-indic-machine.rl"
+#line 91 "hb-ot-shape-complex-indic-machine.rl"
         {te = p+1;{ found_syllable (symbol_cluster); }}
         break;
         case 19:
-#line 91 "hb-ot-shape-complex-indic-machine.rl"
+#line 92 "hb-ot-shape-complex-indic-machine.rl"
         {te = p+1;{ found_syllable (broken_cluster); }}
         break;
         case 12:
-#line 92 "hb-ot-shape-complex-indic-machine.rl"
+#line 93 "hb-ot-shape-complex-indic-machine.rl"
         {te = p+1;{ found_syllable (non_indic_cluster); }}
         break;
         case 14:
-#line 87 "hb-ot-shape-complex-indic-machine.rl"
+#line 88 "hb-ot-shape-complex-indic-machine.rl"
         {te = p;p--;{ found_syllable (consonant_syllable); }}
         break;
         case 16:
-#line 88 "hb-ot-shape-complex-indic-machine.rl"
+#line 89 "hb-ot-shape-complex-indic-machine.rl"
         {te = p;p--;{ found_syllable (vowel_syllable); }}
         break;
         case 21:
-#line 89 "hb-ot-shape-complex-indic-machine.rl"
+#line 90 "hb-ot-shape-complex-indic-machine.rl"
         {te = p;p--;{ found_syllable (standalone_cluster); }}
         break;
         case 23:
-#line 90 "hb-ot-shape-complex-indic-machine.rl"
+#line 91 "hb-ot-shape-complex-indic-machine.rl"
         {te = p;p--;{ found_syllable (symbol_cluster); }}
         break;
         case 18:
-#line 91 "hb-ot-shape-complex-indic-machine.rl"
+#line 92 "hb-ot-shape-complex-indic-machine.rl"
         {te = p;p--;{ found_syllable (broken_cluster); }}
         break;
         case 20:
-#line 92 "hb-ot-shape-complex-indic-machine.rl"
+#line 93 "hb-ot-shape-complex-indic-machine.rl"
         {te = p;p--;{ found_syllable (non_indic_cluster); }}
         break;
         case 1:
-#line 87 "hb-ot-shape-complex-indic-machine.rl"
+#line 88 "hb-ot-shape-complex-indic-machine.rl"
         {{p = ((te))-1;}{ found_syllable (consonant_syllable); }}
         break;
         case 3:
-#line 88 "hb-ot-shape-complex-indic-machine.rl"
+#line 89 "hb-ot-shape-complex-indic-machine.rl"
         {{p = ((te))-1;}{ found_syllable (vowel_syllable); }}
         break;
         case 7:
-#line 89 "hb-ot-shape-complex-indic-machine.rl"
+#line 90 "hb-ot-shape-complex-indic-machine.rl"
         {{p = ((te))-1;}{ found_syllable (standalone_cluster); }}
         break;
         case 9:
-#line 90 "hb-ot-shape-complex-indic-machine.rl"
+#line 91 "hb-ot-shape-complex-indic-machine.rl"
         {{p = ((te))-1;}{ found_syllable (symbol_cluster); }}
         break;
         case 4:
-#line 91 "hb-ot-shape-complex-indic-machine.rl"
+#line 92 "hb-ot-shape-complex-indic-machine.rl"
         {{p = ((te))-1;}{ found_syllable (broken_cluster); }}
         break;
         case 5:
@@ -1517,22 +1519,22 @@
         case 8:
 #line 1 "NONE"
         {te = p+1;}
-#line 87 "hb-ot-shape-complex-indic-machine.rl"
+#line 88 "hb-ot-shape-complex-indic-machine.rl"
         {act = 1;}
         break;
         case 6:
 #line 1 "NONE"
         {te = p+1;}
-#line 91 "hb-ot-shape-complex-indic-machine.rl"
+#line 92 "hb-ot-shape-complex-indic-machine.rl"
         {act = 5;}
         break;
         case 13:
 #line 1 "NONE"
         {te = p+1;}
-#line 92 "hb-ot-shape-complex-indic-machine.rl"
+#line 93 "hb-ot-shape-complex-indic-machine.rl"
         {act = 6;}
         break;
-#line 1536 "hb-ot-shape-complex-indic-machine.hh"
+#line 1538 "hb-ot-shape-complex-indic-machine.hh"
         }
 
 _again:
@@ -1541,7 +1543,7 @@
 #line 1 "NONE"
         {ts = 0;}
         break;
-#line 1545 "hb-ot-shape-complex-indic-machine.hh"
+#line 1547 "hb-ot-shape-complex-indic-machine.hh"
         }
 
         if ( ++p != pe )
@@ -1557,7 +1559,7 @@
 
         }
 
-#line 126 "hb-ot-shape-complex-indic-machine.rl"
+#line 127 "hb-ot-shape-complex-indic-machine.rl"
 
 }
 
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-indic-private.hh	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-indic-private.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -60,7 +60,8 @@
   OT_Repha = 15, /* Atomically-encoded logical or visual repha. */
   OT_Ra = 16,
   OT_CM = 17,  /* Consonant-Medial. */
-  OT_Symbol = 18 /* Avagraha, etc that take marks (SM,A,VD). */
+  OT_Symbol = 18, /* Avagraha, etc that take marks (SM,A,VD). */
+  OT_CS = 19
 };
 
 #define MEDIAL_FLAGS (FLAG (OT_CM))
@@ -70,7 +71,7 @@
  * We treat Vowels and placeholders as if they were consonants.  This is safe because Vowels
  * cannot happen in a consonant syllable.  The plus side however is, we can call the
  * consonant syllable logic from the vowel syllable function and get it all right! */
-#define CONSONANT_FLAGS (FLAG (OT_C) | FLAG (OT_Ra) | MEDIAL_FLAGS | FLAG (OT_V) | FLAG (OT_PLACEHOLDER) | FLAG (OT_DOTTEDCIRCLE))
+#define CONSONANT_FLAGS (FLAG (OT_C) | FLAG (OT_CS) | FLAG (OT_Ra) | MEDIAL_FLAGS | FLAG (OT_V) | FLAG (OT_PLACEHOLDER) | FLAG (OT_DOTTEDCIRCLE))
 #define JOINER_FLAGS (FLAG (OT_ZWJ) | FLAG (OT_ZWNJ))
 #define HALANT_OR_COENG_FLAGS (FLAG (OT_H) | FLAG (OT_Coeng))
 
@@ -121,8 +122,8 @@
   INDIC_SYLLABIC_CATEGORY_CONSONANT_PREFIXED            = OT_X, /* Don't care. */
   INDIC_SYLLABIC_CATEGORY_CONSONANT_SUBJOINED           = OT_CM,
   INDIC_SYLLABIC_CATEGORY_CONSONANT_SUCCEEDING_REPHA    = OT_N,
-  INDIC_SYLLABIC_CATEGORY_CONSONANT_WITH_STACKER        = OT_Repha, /* TODO */
-  INDIC_SYLLABIC_CATEGORY_GEMINATION_MARK               = OT_SM,
+  INDIC_SYLLABIC_CATEGORY_CONSONANT_WITH_STACKER        = OT_CS,
+  INDIC_SYLLABIC_CATEGORY_GEMINATION_MARK               = OT_SM, /* https://github.com/behdad/harfbuzz/issues/552 */
   INDIC_SYLLABIC_CATEGORY_INVISIBLE_STACKER             = OT_Coeng,
   INDIC_SYLLABIC_CATEGORY_JOINER                        = OT_ZWJ,
   INDIC_SYLLABIC_CATEGORY_MODIFYING_LETTER              = OT_X,
@@ -132,7 +133,7 @@
   INDIC_SYLLABIC_CATEGORY_NUMBER_JOINER                 = OT_PLACEHOLDER, /* Don't care. */
   INDIC_SYLLABIC_CATEGORY_PURE_KILLER                   = OT_M, /* Is like a vowel matra. */
   INDIC_SYLLABIC_CATEGORY_REGISTER_SHIFTER              = OT_RS,
-  INDIC_SYLLABIC_CATEGORY_SYLLABLE_MODIFIER             = OT_M, /* Misc Khmer signs. */
+  INDIC_SYLLABIC_CATEGORY_SYLLABLE_MODIFIER             = OT_SM,
   INDIC_SYLLABIC_CATEGORY_TONE_LETTER                   = OT_X,
   INDIC_SYLLABIC_CATEGORY_TONE_MARK                     = OT_N,
   INDIC_SYLLABIC_CATEGORY_VIRAMA                        = OT_H,
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-indic-table.cc	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-indic-table.cc	Wed Dec 13 10:25:38 2017 -0800
@@ -6,61 +6,62 @@
  *
  * on files with these headers:
  *
- * # IndicSyllabicCategory-9.0.0.txt
- * # Date: 2016-05-21, 02:46:00 GMT [RP]
- * # IndicPositionalCategory-9.0.0.txt
- * # Date: 2016-02-25, 00:48:00 GMT [RP]
- * # Blocks-9.0.0.txt
- * # Date: 2016-02-05, 23:48:00 GMT [KW]
+ * # IndicSyllabicCategory-10.0.0.txt
+ * # Date: 2017-05-31, 01:07:00 GMT [KW, RP]
+ * # IndicPositionalCategory-10.0.0.txt
+ * # Date: 2017-05-31, 01:07:00 GMT [RP]
+ * # Blocks-10.0.0.txt
+ * # Date: 2017-04-12, 17:30:00 GMT [KW]
  */
 
 #include "hb-ot-shape-complex-indic-private.hh"
 
 
 #define ISC_A   INDIC_SYLLABIC_CATEGORY_AVAGRAHA                /*  15 chars; Avagraha */
-#define ISC_Bi  INDIC_SYLLABIC_CATEGORY_BINDU                   /*  67 chars; Bindu */
+#define ISC_Bi  INDIC_SYLLABIC_CATEGORY_BINDU                   /*  80 chars; Bindu */
 #define ISC_BJN INDIC_SYLLABIC_CATEGORY_BRAHMI_JOINING_NUMBER   /*  20 chars; Brahmi_Joining_Number */
-#define ISC_Ca  INDIC_SYLLABIC_CATEGORY_CANTILLATION_MARK       /*  53 chars; Cantillation_Mark */
-#define ISC_C   INDIC_SYLLABIC_CATEGORY_CONSONANT               /* 1907 chars; Consonant */
+#define ISC_Ca  INDIC_SYLLABIC_CATEGORY_CANTILLATION_MARK       /*  57 chars; Cantillation_Mark */
+#define ISC_C   INDIC_SYLLABIC_CATEGORY_CONSONANT               /* 2024 chars; Consonant */
 #define ISC_CD  INDIC_SYLLABIC_CATEGORY_CONSONANT_DEAD          /*  10 chars; Consonant_Dead */
-#define ISC_CF  INDIC_SYLLABIC_CATEGORY_CONSONANT_FINAL         /*  62 chars; Consonant_Final */
+#define ISC_CF  INDIC_SYLLABIC_CATEGORY_CONSONANT_FINAL         /*  68 chars; Consonant_Final */
 #define ISC_CHL INDIC_SYLLABIC_CATEGORY_CONSONANT_HEAD_LETTER   /*   5 chars; Consonant_Head_Letter */
 #define ISC_CK  INDIC_SYLLABIC_CATEGORY_CONSONANT_KILLER        /*   2 chars; Consonant_Killer */
-#define ISC_CM  INDIC_SYLLABIC_CATEGORY_CONSONANT_MEDIAL        /*  22 chars; Consonant_Medial */
-#define ISC_CP  INDIC_SYLLABIC_CATEGORY_CONSONANT_PLACEHOLDER   /*  16 chars; Consonant_Placeholder */
-#define ISC_CPR INDIC_SYLLABIC_CATEGORY_CONSONANT_PRECEDING_REPHA       /*   1 chars; Consonant_Preceding_Repha */
-#define ISC_CPrf        INDIC_SYLLABIC_CATEGORY_CONSONANT_PREFIXED      /*   2 chars; Consonant_Prefixed */
-#define ISC_CS  INDIC_SYLLABIC_CATEGORY_CONSONANT_SUBJOINED     /*  90 chars; Consonant_Subjoined */
-#define ISC_CSR INDIC_SYLLABIC_CATEGORY_CONSONANT_SUCCEEDING_REPHA      /*   4 chars; Consonant_Succeeding_Repha */
+#define ISC_CM  INDIC_SYLLABIC_CATEGORY_CONSONANT_MEDIAL        /*  27 chars; Consonant_Medial */
+#define ISC_CP  INDIC_SYLLABIC_CATEGORY_CONSONANT_PLACEHOLDER   /*  18 chars; Consonant_Placeholder */
+#define ISC_CPR INDIC_SYLLABIC_CATEGORY_CONSONANT_PRECEDING_REPHA       /*   2 chars; Consonant_Preceding_Repha */
+#define ISC_CPrf        INDIC_SYLLABIC_CATEGORY_CONSONANT_PREFIXED      /*   7 chars; Consonant_Prefixed */
+#define ISC_CS  INDIC_SYLLABIC_CATEGORY_CONSONANT_SUBJOINED     /*  95 chars; Consonant_Subjoined */
+#define ISC_CSR INDIC_SYLLABIC_CATEGORY_CONSONANT_SUCCEEDING_REPHA      /*   5 chars; Consonant_Succeeding_Repha */
 #define ISC_CWS INDIC_SYLLABIC_CATEGORY_CONSONANT_WITH_STACKER  /*   4 chars; Consonant_With_Stacker */
-#define ISC_GM  INDIC_SYLLABIC_CATEGORY_GEMINATION_MARK         /*   2 chars; Gemination_Mark */
-#define ISC_IS  INDIC_SYLLABIC_CATEGORY_INVISIBLE_STACKER       /*   7 chars; Invisible_Stacker */
+#define ISC_GM  INDIC_SYLLABIC_CATEGORY_GEMINATION_MARK         /*   3 chars; Gemination_Mark */
+#define ISC_IS  INDIC_SYLLABIC_CATEGORY_INVISIBLE_STACKER       /*  10 chars; Invisible_Stacker */
 #define ISC_ZWJ INDIC_SYLLABIC_CATEGORY_JOINER                  /*   1 chars; Joiner */
 #define ISC_ML  INDIC_SYLLABIC_CATEGORY_MODIFYING_LETTER        /*   1 chars; Modifying_Letter */
 #define ISC_ZWNJ        INDIC_SYLLABIC_CATEGORY_NON_JOINER              /*   1 chars; Non_Joiner */
-#define ISC_N   INDIC_SYLLABIC_CATEGORY_NUKTA                   /*  24 chars; Nukta */
-#define ISC_Nd  INDIC_SYLLABIC_CATEGORY_NUMBER                  /* 459 chars; Number */
+#define ISC_N   INDIC_SYLLABIC_CATEGORY_NUKTA                   /*  28 chars; Nukta */
+#define ISC_Nd  INDIC_SYLLABIC_CATEGORY_NUMBER                  /* 469 chars; Number */
 #define ISC_NJ  INDIC_SYLLABIC_CATEGORY_NUMBER_JOINER           /*   1 chars; Number_Joiner */
 #define ISC_x   INDIC_SYLLABIC_CATEGORY_OTHER                   /*   1 chars; Other */
-#define ISC_PK  INDIC_SYLLABIC_CATEGORY_PURE_KILLER             /*  16 chars; Pure_Killer */
+#define ISC_PK  INDIC_SYLLABIC_CATEGORY_PURE_KILLER             /*  21 chars; Pure_Killer */
 #define ISC_RS  INDIC_SYLLABIC_CATEGORY_REGISTER_SHIFTER        /*   2 chars; Register_Shifter */
 #define ISC_SM  INDIC_SYLLABIC_CATEGORY_SYLLABLE_MODIFIER       /*  22 chars; Syllable_Modifier */
 #define ISC_TL  INDIC_SYLLABIC_CATEGORY_TONE_LETTER             /*   7 chars; Tone_Letter */
 #define ISC_TM  INDIC_SYLLABIC_CATEGORY_TONE_MARK               /*  42 chars; Tone_Mark */
 #define ISC_V   INDIC_SYLLABIC_CATEGORY_VIRAMA                  /*  24 chars; Virama */
-#define ISC_Vs  INDIC_SYLLABIC_CATEGORY_VISARGA                 /*  31 chars; Visarga */
+#define ISC_Vs  INDIC_SYLLABIC_CATEGORY_VISARGA                 /*  34 chars; Visarga */
 #define ISC_Vo  INDIC_SYLLABIC_CATEGORY_VOWEL                   /*  30 chars; Vowel */
-#define ISC_M   INDIC_SYLLABIC_CATEGORY_VOWEL_DEPENDENT         /* 602 chars; Vowel_Dependent */
-#define ISC_VI  INDIC_SYLLABIC_CATEGORY_VOWEL_INDEPENDENT       /* 431 chars; Vowel_Independent */
+#define ISC_M   INDIC_SYLLABIC_CATEGORY_VOWEL_DEPENDENT         /* 633 chars; Vowel_Dependent */
+#define ISC_VI  INDIC_SYLLABIC_CATEGORY_VOWEL_INDEPENDENT       /* 443 chars; Vowel_Independent */
 
-#define IMC_B   INDIC_MATRA_CATEGORY_BOTTOM                     /* 300 chars; Bottom */
+#define IMC_B   INDIC_MATRA_CATEGORY_BOTTOM                     /* 330 chars; Bottom */
+#define IMC_BL  INDIC_MATRA_CATEGORY_BOTTOM_AND_LEFT            /*   1 chars; Bottom_And_Left */
 #define IMC_BR  INDIC_MATRA_CATEGORY_BOTTOM_AND_RIGHT           /*   2 chars; Bottom_And_Right */
 #define IMC_L   INDIC_MATRA_CATEGORY_LEFT                       /*  57 chars; Left */
 #define IMC_LR  INDIC_MATRA_CATEGORY_LEFT_AND_RIGHT             /*  21 chars; Left_And_Right */
 #define IMC_x   INDIC_MATRA_CATEGORY_NOT_APPLICABLE             /*   1 chars; Not_Applicable */
 #define IMC_O   INDIC_MATRA_CATEGORY_OVERSTRUCK                 /*  10 chars; Overstruck */
-#define IMC_R   INDIC_MATRA_CATEGORY_RIGHT                      /* 258 chars; Right */
-#define IMC_T   INDIC_MATRA_CATEGORY_TOP                        /* 342 chars; Top */
+#define IMC_R   INDIC_MATRA_CATEGORY_RIGHT                      /* 262 chars; Right */
+#define IMC_T   INDIC_MATRA_CATEGORY_TOP                        /* 380 chars; Top */
 #define IMC_TB  INDIC_MATRA_CATEGORY_TOP_AND_BOTTOM             /*  10 chars; Top_And_Bottom */
 #define IMC_TBR INDIC_MATRA_CATEGORY_TOP_AND_BOTTOM_AND_RIGHT   /*   1 chars; Top_And_Bottom_And_Right */
 #define IMC_TL  INDIC_MATRA_CATEGORY_TOP_AND_LEFT               /*   6 chars; Top_And_Left */
@@ -133,7 +134,7 @@
   /* 09E0 */ _(VI,x), _(VI,x),  _(M,B),  _(M,B),  _(x,x),  _(x,x), _(Nd,x), _(Nd,x),
   /* 09E8 */ _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x),
   /* 09F0 */  _(C,x),  _(C,x),  _(x,x),  _(x,x),  _(x,x),  _(x,x),  _(x,x),  _(x,x),
-  /* 09F8 */  _(x,x),  _(x,x),  _(x,x),  _(x,x),  _(x,x),  _(x,x),  _(x,x),  _(x,x),
+  /* 09F8 */  _(x,x),  _(x,x),  _(x,x),  _(x,x), _(Bi,x),  _(x,x),  _(x,x),  _(x,x),
 
   /* Gurmukhi */
 
@@ -171,7 +172,7 @@
   /* 0AE0 */ _(VI,x), _(VI,x),  _(M,B),  _(M,B),  _(x,x),  _(x,x), _(Nd,x), _(Nd,x),
   /* 0AE8 */ _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x),
   /* 0AF0 */  _(x,x),  _(x,x),  _(x,x),  _(x,x),  _(x,x),  _(x,x),  _(x,x),  _(x,x),
-  /* 0AF8 */  _(x,x),  _(C,x),  _(x,x),  _(x,x),  _(x,x),  _(x,x),  _(x,x),  _(x,x),
+  /* 0AF8 */  _(x,x),  _(C,x), _(Ca,T), _(Ca,T), _(Ca,T),  _(N,T),  _(N,T),  _(N,T),
 
   /* Oriya */
 
@@ -251,14 +252,14 @@
 
   /* Malayalam */
 
-  /* 0D00 */  _(x,x), _(Bi,T), _(Bi,R), _(Vs,R),  _(x,x), _(VI,x), _(VI,x), _(VI,x),
+  /* 0D00 */ _(Bi,T), _(Bi,T), _(Bi,R), _(Vs,R),  _(x,x), _(VI,x), _(VI,x), _(VI,x),
   /* 0D08 */ _(VI,x), _(VI,x), _(VI,x), _(VI,x), _(VI,x),  _(x,x), _(VI,x), _(VI,x),
   /* 0D10 */ _(VI,x),  _(x,x), _(VI,x), _(VI,x), _(VI,x),  _(C,x),  _(C,x),  _(C,x),
   /* 0D18 */  _(C,x),  _(C,x),  _(C,x),  _(C,x),  _(C,x),  _(C,x),  _(C,x),  _(C,x),
   /* 0D20 */  _(C,x),  _(C,x),  _(C,x),  _(C,x),  _(C,x),  _(C,x),  _(C,x),  _(C,x),
   /* 0D28 */  _(C,x),  _(C,x),  _(C,x),  _(C,x),  _(C,x),  _(C,x),  _(C,x),  _(C,x),
   /* 0D30 */  _(C,x),  _(C,x),  _(C,x),  _(C,x),  _(C,x),  _(C,x),  _(C,x),  _(C,x),
-  /* 0D38 */  _(C,x),  _(C,x),  _(C,x),  _(x,x),  _(x,x),  _(A,x),  _(M,R),  _(M,R),
+  /* 0D38 */  _(C,x),  _(C,x),  _(C,x), _(PK,T), _(PK,T),  _(A,x),  _(M,R),  _(M,R),
   /* 0D40 */  _(M,R),  _(M,R),  _(M,R),  _(M,B),  _(M,B),  _(x,x),  _(M,L),  _(M,L),
   /* 0D48 */  _(M,L),  _(x,x), _(M,LR), _(M,LR), _(M,LR),  _(V,T),_(CPR,x),  _(x,x),
   /* 0D50 */  _(x,x),  _(x,x),  _(x,x),  _(x,x), _(CD,x), _(CD,x), _(CD,x),  _(M,R),
@@ -341,7 +342,7 @@
   /* 1CD8 */ _(Ca,B), _(Ca,B), _(Ca,T), _(Ca,T), _(Ca,B), _(Ca,B), _(Ca,B), _(Ca,B),
   /* 1CE0 */ _(Ca,T), _(Ca,R),  _(x,O),  _(x,O),  _(x,O),  _(x,O),  _(x,O),  _(x,O),
   /* 1CE8 */  _(x,O),  _(x,x),  _(x,x),  _(x,x),  _(x,x),  _(x,B),  _(x,x),  _(x,x),
-  /* 1CF0 */  _(x,x),  _(x,x), _(Vs,x), _(Vs,x), _(Ca,T),  _(x,x),  _(x,x),  _(x,x),
+  /* 1CF0 */  _(x,x),  _(x,x), _(Vs,x), _(Vs,x), _(Ca,T),  _(x,x),  _(x,x), _(Ca,R),
   /* 1CF8 */ _(Ca,x), _(Ca,x),  _(x,x),  _(x,x),  _(x,x),  _(x,x),  _(x,x),  _(x,x),
 
 #define indic_offset_0x2008u 1656
@@ -368,7 +369,7 @@
 
   /* A8E0 */ _(Ca,T), _(Ca,T), _(Ca,T), _(Ca,T), _(Ca,T), _(Ca,T), _(Ca,T), _(Ca,T),
   /* A8E8 */ _(Ca,T), _(Ca,T), _(Ca,T), _(Ca,T), _(Ca,T), _(Ca,T), _(Ca,T), _(Ca,T),
-  /* A8F0 */ _(Ca,T), _(Ca,T),  _(x,x),  _(x,x),  _(x,x),  _(x,x),  _(x,x),  _(x,x),
+  /* A8F0 */ _(Ca,T), _(Ca,T), _(Bi,x), _(Bi,x),  _(x,x),  _(x,x),  _(x,x),  _(x,x),
 
 #define indic_offset_0xa9e0u 1720
 
@@ -390,7 +391,7 @@
   /* AA70 */  _(x,x),  _(C,x),  _(C,x),  _(C,x), _(CP,x), _(CP,x), _(CP,x),  _(x,x),
   /* AA78 */  _(x,x),  _(x,x),  _(C,x), _(TM,R), _(TM,T), _(TM,R),  _(C,x),  _(C,x),
 
-}; /* Table items: 1784; occupancy: 69% */
+}; /* Table items: 1784; occupancy: 70% */
 
 INDIC_TABLE_ELEMENT_TYPE
 hb_indic_get_categories (hb_codepoint_t u)
@@ -398,28 +399,28 @@
   switch (u >> 12)
   {
     case 0x0u:
-      if (hb_in_range (u, 0x0028u, 0x003Fu)) return indic_table[u - 0x0028u + indic_offset_0x0028u];
-      if (hb_in_range (u, 0x00B0u, 0x00D7u)) return indic_table[u - 0x00B0u + indic_offset_0x00b0u];
-      if (hb_in_range (u, 0x0900u, 0x0DF7u)) return indic_table[u - 0x0900u + indic_offset_0x0900u];
+      if (hb_in_range<hb_codepoint_t> (u, 0x0028u, 0x003Fu)) return indic_table[u - 0x0028u + indic_offset_0x0028u];
+      if (hb_in_range<hb_codepoint_t> (u, 0x00B0u, 0x00D7u)) return indic_table[u - 0x00B0u + indic_offset_0x00b0u];
+      if (hb_in_range<hb_codepoint_t> (u, 0x0900u, 0x0DF7u)) return indic_table[u - 0x0900u + indic_offset_0x0900u];
       if (unlikely (u == 0x00A0u)) return _(CP,x);
       break;
 
     case 0x1u:
-      if (hb_in_range (u, 0x1000u, 0x109Fu)) return indic_table[u - 0x1000u + indic_offset_0x1000u];
-      if (hb_in_range (u, 0x1780u, 0x17EFu)) return indic_table[u - 0x1780u + indic_offset_0x1780u];
-      if (hb_in_range (u, 0x1CD0u, 0x1CFFu)) return indic_table[u - 0x1CD0u + indic_offset_0x1cd0u];
+      if (hb_in_range<hb_codepoint_t> (u, 0x1000u, 0x109Fu)) return indic_table[u - 0x1000u + indic_offset_0x1000u];
+      if (hb_in_range<hb_codepoint_t> (u, 0x1780u, 0x17EFu)) return indic_table[u - 0x1780u + indic_offset_0x1780u];
+      if (hb_in_range<hb_codepoint_t> (u, 0x1CD0u, 0x1CFFu)) return indic_table[u - 0x1CD0u + indic_offset_0x1cd0u];
       break;
 
     case 0x2u:
-      if (hb_in_range (u, 0x2008u, 0x2017u)) return indic_table[u - 0x2008u + indic_offset_0x2008u];
-      if (hb_in_range (u, 0x2070u, 0x2087u)) return indic_table[u - 0x2070u + indic_offset_0x2070u];
+      if (hb_in_range<hb_codepoint_t> (u, 0x2008u, 0x2017u)) return indic_table[u - 0x2008u + indic_offset_0x2008u];
+      if (hb_in_range<hb_codepoint_t> (u, 0x2070u, 0x2087u)) return indic_table[u - 0x2070u + indic_offset_0x2070u];
       if (unlikely (u == 0x25CCu)) return _(CP,x);
       break;
 
     case 0xAu:
-      if (hb_in_range (u, 0xA8E0u, 0xA8F7u)) return indic_table[u - 0xA8E0u + indic_offset_0xa8e0u];
-      if (hb_in_range (u, 0xA9E0u, 0xA9FFu)) return indic_table[u - 0xA9E0u + indic_offset_0xa9e0u];
-      if (hb_in_range (u, 0xAA60u, 0xAA7Fu)) return indic_table[u - 0xAA60u + indic_offset_0xaa60u];
+      if (hb_in_range<hb_codepoint_t> (u, 0xA8E0u, 0xA8F7u)) return indic_table[u - 0xA8E0u + indic_offset_0xa8e0u];
+      if (hb_in_range<hb_codepoint_t> (u, 0xA9E0u, 0xA9FFu)) return indic_table[u - 0xA9E0u + indic_offset_0xa9e0u];
+      if (hb_in_range<hb_codepoint_t> (u, 0xAA60u, 0xAA7Fu)) return indic_table[u - 0xAA60u + indic_offset_0xaa60u];
       break;
 
     default:
@@ -467,6 +468,7 @@
 #undef ISC_VI
 
 #undef IMC_B
+#undef IMC_BL
 #undef IMC_BR
 #undef IMC_L
 #undef IMC_LR
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-indic.cc	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-indic.cc	Wed Dec 13 10:25:38 2017 -0800
@@ -142,7 +142,7 @@
 {
   /* If it ligated, all bets are off. */
   if (_hb_glyph_info_ligated (&info)) return false;
-  return !!(FLAG_SAFE (info.indic_category()) & flags);
+  return !!(FLAG_UNSAFE (info.indic_category()) & flags);
 }
 
 static inline bool
@@ -177,15 +177,15 @@
    */
 
   /* The following act more like the Bindus. */
-  if (unlikely (hb_in_range (u, 0x0953u, 0x0954u)))
+  if (unlikely (hb_in_range<hb_codepoint_t> (u, 0x0953u, 0x0954u)))
     cat = OT_SM;
   /* The following act like consonants. */
-  else if (unlikely (hb_in_ranges (u, 0x0A72u, 0x0A73u,
+  else if (unlikely (hb_in_ranges<hb_codepoint_t> (u, 0x0A72u, 0x0A73u,
                                       0x1CF5u, 0x1CF6u)))
     cat = OT_C;
   /* TODO: The following should only be allowed after a Visarga.
    * For now, just treat them like regular tone marks. */
-  else if (unlikely (hb_in_range (u, 0x1CE2u, 0x1CE8u)))
+  else if (unlikely (hb_in_range<hb_codepoint_t> (u, 0x1CE2u, 0x1CE8u)))
     cat = OT_A;
   /* TODO: The following should only be allowed after some of
    * the nasalization marks, maybe only for U+1CE9..U+1CF1.
@@ -193,15 +193,38 @@
   else if (unlikely (u == 0x1CEDu))
     cat = OT_A;
   /* The following take marks in standalone clusters, similar to Avagraha. */
-  else if (unlikely (hb_in_ranges (u, 0xA8F2u, 0xA8F7u,
+  else if (unlikely (hb_in_ranges<hb_codepoint_t> (u, 0xA8F2u, 0xA8F7u,
                                       0x1CE9u, 0x1CECu,
                                       0x1CEEu, 0x1CF1u)))
   {
     cat = OT_Symbol;
-    ASSERT_STATIC ((int) INDIC_SYLLABIC_CATEGORY_AVAGRAHA == OT_Symbol);
+    static_assert (((int) INDIC_SYLLABIC_CATEGORY_AVAGRAHA == OT_Symbol), "");
+  }
+  else if (unlikely (hb_in_range<hb_codepoint_t> (u, 0x17CDu, 0x17D1u) ||
+                     u == 0x17CBu || u == 0x17D3u || u == 0x17DDu)) /* Khmer Various signs */
+  {
+    /* These can occur mid-syllable (eg. before matras), even though Unicode marks them as Syllable_Modifier.
+     * https://github.com/roozbehp/unicode-data/issues/5 */
+    cat = OT_M;
+    pos = POS_ABOVE_C;
   }
+  else if (unlikely (u == 0x0A51u))
+  {
+    /* https://github.com/behdad/harfbuzz/issues/524 */
+    cat = OT_M;
+    pos = POS_BELOW_C;
+  }
+
+  /* According to ScriptExtensions.txt, these Grantha marks may also be used in Tamil,
+   * so the Indic shaper needs to know their categories. */
+  else if (unlikely (u == 0x11301u || u == 0x11303u)) cat = OT_SM;
+  else if (unlikely (u == 0x1133cu)) cat = OT_N;
+
+  else if (unlikely (u == 0x0AFBu)) cat = OT_N; /* https://github.com/behdad/harfbuzz/issues/552 */
+
+  else if (unlikely (u == 0x0980u)) cat = OT_PLACEHOLDER; /* https://github.com/behdad/harfbuzz/issues/538 */
   else if (unlikely (u == 0x17C6u)) cat = OT_N; /* Khmer Bindu doesn't like to be repositioned. */
-  else if (unlikely (hb_in_range (u, 0x2010u, 0x2011u)))
+  else if (unlikely (hb_in_range<hb_codepoint_t> (u, 0x2010u, 0x2011u)))
                                     cat = OT_PLACEHOLDER;
   else if (unlikely (u == 0x25CCu)) cat = OT_DOTTEDCIRCLE;
 
@@ -210,7 +233,7 @@
    * Re-assign position.
    */
 
-  if ((FLAG_SAFE (cat) & CONSONANT_FLAGS))
+  if ((FLAG_UNSAFE (cat) & CONSONANT_FLAGS))
   {
     pos = POS_BASE_C;
     if (is_ra (u))
@@ -220,7 +243,7 @@
   {
     pos = matra_position (u, pos);
   }
-  else if ((FLAG_SAFE (cat) & (FLAG (OT_SM) | FLAG (OT_VD) | FLAG (OT_A) | FLAG (OT_Symbol))))
+  else if ((FLAG_UNSAFE (cat) & (FLAG (OT_SM) | FLAG (OT_VD) | FLAG (OT_A) | FLAG (OT_Symbol))))
   {
     pos = POS_SMVD;
   }
@@ -411,12 +434,12 @@
   unsigned int i = 0;
   map->add_gsub_pause (initial_reordering);
   for (; i < INDIC_BASIC_FEATURES; i++) {
-    map->add_feature (indic_features[i].tag, 1, indic_features[i].flags | F_MANUAL_ZWJ);
-    map->add_gsub_pause (NULL);
+    map->add_feature (indic_features[i].tag, 1, indic_features[i].flags | F_MANUAL_ZWJ | F_MANUAL_ZWNJ);
+    map->add_gsub_pause (nullptr);
   }
   map->add_gsub_pause (final_reordering);
   for (; i < INDIC_NUM_FEATURES; i++) {
-    map->add_feature (indic_features[i].tag, 1, indic_features[i].flags | F_MANUAL_ZWJ);
+    map->add_feature (indic_features[i].tag, 1, indic_features[i].flags | F_MANUAL_ZWJ | F_MANUAL_ZWNJ);
   }
 
   map->add_global_bool_feature (HB_TAG('c','a','l','t'));
@@ -485,7 +508,7 @@
 
       /* Our get_nominal_glyph() function needs a font, so we can't get the virama glyph
        * during shape planning...  Instead, overwrite it here.  It's safe.  Don't worry! */
-      (const_cast<indic_shape_plan_t *> (this))->virama_glyph = glyph;
+      virama_glyph = glyph;
     }
 
     *pglyph = glyph;
@@ -495,7 +518,7 @@
   const indic_config_t *config;
 
   bool is_old_spec;
-  hb_codepoint_t virama_glyph;
+  mutable hb_codepoint_t virama_glyph;
 
   would_substitute_feature_t rphf;
   would_substitute_feature_t pref;
@@ -510,7 +533,7 @@
 {
   indic_shape_plan_t *indic_plan = (indic_shape_plan_t *) calloc (1, sizeof (indic_shape_plan_t));
   if (unlikely (!indic_plan))
-    return NULL;
+    return nullptr;
 
   indic_plan->config = &indic_configs[0];
   for (unsigned int i = 1; i < ARRAY_LENGTH (indic_configs); i++)
@@ -615,6 +638,8 @@
                  hb_buffer_t *buffer)
 {
   find_syllables (buffer);
+  foreach_syllable (buffer, start, end)
+    buffer->unsafe_to_break (start, end);
 }
 
 static int
@@ -666,6 +691,21 @@
   const indic_shape_plan_t *indic_plan = (const indic_shape_plan_t *) plan->data;
   hb_glyph_info_t *info = buffer->info;
 
+  /* https://github.com/behdad/harfbuzz/issues/435#issuecomment-335560167
+   * // For compatibility with legacy usage in Kannada,
+   * // Ra+h+ZWJ must behave like Ra+ZWJ+h...
+   */
+  if (buffer->props.script == HB_SCRIPT_KANNADA &&
+      start + 3 <= end &&
+      is_one_of (info[start  ], FLAG (OT_Ra)) &&
+      is_one_of (info[start+1], FLAG (OT_H)) &&
+      is_one_of (info[start+2], FLAG (OT_ZWJ)))
+  {
+    buffer->merge_clusters (start+1, start+3);
+    hb_glyph_info_t tmp = info[start+1];
+    info[start+1] = info[start+2];
+    info[start+2] = tmp;
+  }
 
   /* 1. Find base consonant:
    *
@@ -831,8 +871,8 @@
 
   /* 2. Decompose and reorder Matras:
    *
-   * Each matra and any syllable modifier sign in the cluster are moved to the
-   * appropriate position relative to the consonant(s) in the cluster. The
+   * Each matra and any syllable modifier sign in the syllable are moved to the
+   * appropriate position relative to the consonant(s) in the syllable. The
    * shaping engine decomposes two- or three-part matras into their constituent
    * parts before any repositioning. Matra characters are classified by which
    * consonant in a conjunct they have affinity for and are reordered to the
@@ -928,7 +968,7 @@
     indic_position_t last_pos = POS_START;
     for (unsigned int i = start; i < end; i++)
     {
-      if ((FLAG_SAFE (info[i].indic_category()) & (JOINER_FLAGS | FLAG (OT_N) | FLAG (OT_RS) | MEDIAL_FLAGS | HALANT_OR_COENG_FLAGS)))
+      if ((FLAG_UNSAFE (info[i].indic_category()) & (JOINER_FLAGS | FLAG (OT_N) | FLAG (OT_RS) | MEDIAL_FLAGS | HALANT_OR_COENG_FLAGS)))
       {
         info[i].indic_position() = last_pos;
         if (unlikely (info[i].indic_category() == OT_H &&
@@ -1258,7 +1298,7 @@
 
 
   /* This function relies heavily on halant glyphs.  Lots of ligation
-   * and possibly multiplication substitutions happened prior to this
+   * and possibly multiple substitutions happened prior to this
    * phase, and that might have messed up our properties.  Recover
    * from a particular case of that where we're fairly sure that a
    * class of OT_H is desired but has been lost. */
@@ -1282,7 +1322,7 @@
    * After the localized forms and basic shaping forms GSUB features have been
    * applied (see below), the shaping engine performs some final glyph
    * reordering before applying all the remaining font features to the entire
-   * cluster.
+   * syllable.
    */
 
   bool try_pref = !!indic_plan->mask_array[PREF];
@@ -1497,8 +1537,8 @@
     if (reph_pos == REPH_POS_AFTER_SUB)
     {
       new_reph_pos = base;
-      while (new_reph_pos < end &&
-             !( FLAG_SAFE (info[new_reph_pos + 1].indic_position()) & (FLAG (POS_POST_C) | FLAG (POS_AFTER_POST) | FLAG (POS_SMVD))))
+      while (new_reph_pos + 1 < end &&
+             !( FLAG_UNSAFE (info[new_reph_pos + 1].indic_position()) & (FLAG (POS_POST_C) | FLAG (POS_AFTER_POST) | FLAG (POS_SMVD))))
         new_reph_pos++;
       if (new_reph_pos < end)
         goto reph_move;
@@ -1646,11 +1686,15 @@
 
 
   /* Apply 'init' to the Left Matra if it's a word start. */
-  if (info[start].indic_position () == POS_PRE_M &&
-      (!start ||
-       !(FLAG_SAFE (_hb_glyph_info_get_general_category (&info[start - 1])) &
-         FLAG_RANGE (HB_UNICODE_GENERAL_CATEGORY_FORMAT, HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK))))
-    info[start].mask |= indic_plan->mask_array[INIT];
+  if (info[start].indic_position () == POS_PRE_M)
+  {
+    if (!start ||
+        !(FLAG_UNSAFE (_hb_glyph_info_get_general_category (&info[start - 1])) &
+         FLAG_RANGE (HB_UNICODE_GENERAL_CATEGORY_FORMAT, HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK)))
+      info[start].mask |= indic_plan->mask_array[INIT];
+    else
+      buffer->unsafe_to_break (start - 1, start + 1);
+  }
 
 
   /*
@@ -1665,8 +1709,8 @@
         break;
 
       default:
-        /* Uniscribe merges the entire cluster... Except for Tamil & Sinhala.
-         * This means, half forms are submerged into the main consonants cluster.
+        /* Uniscribe merges the entire syllable into a single cluster... Except for Tamil & Sinhala.
+         * This means, half forms are submerged into the main consonant's cluster.
          * This is unnecessary, and makes cursor positioning harder, but that's what
          * Uniscribe does. */
         buffer->merge_clusters (start, end);
@@ -1738,7 +1782,7 @@
 #endif
   }
 
-  if ((ab == 0x0DDAu || hb_in_range (ab, 0x0DDCu, 0x0DDEu)))
+  if ((ab == 0x0DDAu || hb_in_range<hb_codepoint_t> (ab, 0x0DDCu, 0x0DDEu)))
   {
     /*
      * Sinhala split matras...  Let the fun begin.
@@ -1803,18 +1847,18 @@
 
 const hb_ot_complex_shaper_t _hb_ot_complex_shaper_indic =
 {
-  "indic",
   collect_features_indic,
   override_features_indic,
   data_create_indic,
   data_destroy_indic,
-  NULL, /* preprocess_text */
-  NULL, /* postprocess_glyphs */
+  nullptr, /* preprocess_text */
+  nullptr, /* postprocess_glyphs */
   HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_DIACRITICS_NO_SHORT_CIRCUIT,
   decompose_indic,
   compose_indic,
   setup_masks_indic,
-  NULL, /* disable_otl */
+  nullptr, /* disable_otl */
+  nullptr, /* reorder_marks */
   HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE,
   false, /* fallback_position */
 };
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-myanmar-machine.hh	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-myanmar-machine.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -1,5 +1,5 @@
 
-#line 1 "../../src/hb-ot-shape-complex-myanmar-machine.rl"
+#line 1 "hb-ot-shape-complex-myanmar-machine.rl"
 /*
  * Copyright © 2011,2012  Google, Inc.
  *
@@ -32,226 +32,230 @@
 #include "hb-private.hh"
 
 
-#line 36 "../../src/hb-ot-shape-complex-myanmar-machine.hh.tmp"
+#line 36 "hb-ot-shape-complex-myanmar-machine.hh"
 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, 
-        3u, 29u, 3u, 29u, 3u, 29u, 3u, 29u, 8u, 8u, 0
+        1u, 32u, 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, 32u, 3u, 29u, 3u, 29u, 3u, 29u, 3u, 29u, 3u, 29u,
+        3u, 29u, 3u, 29u, 3u, 29u, 3u, 29u, 1u, 32u, 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, 
-        27, 27, 27, 27, 1
+        32, 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, 32, 27, 27, 27, 27, 27,
+        27, 27, 27, 27, 32, 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, 
-        1032, 1060, 1088, 1116, 1144
+        0, 33, 62, 88, 93, 119, 143, 165,
+        187, 215, 243, 271, 299, 316, 344, 372,
+        400, 428, 456, 484, 512, 540, 568, 594,
+        599, 625, 649, 671, 693, 721, 749, 777,
+        805, 834, 862, 895, 923, 951, 979, 1007,
+        1035, 1063, 1091, 1119, 1147, 1180
 };
 
 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, 
-        51, 50, 0
+        1, 1, 2, 3, 4, 4, 0, 5,
+        0, 6, 1, 0, 0, 0, 0, 7,
+        0, 8, 9, 0, 10, 11, 12, 13,
+        14, 15, 16, 17, 18, 19, 20, 1,
+        0, 22, 23, 24, 24, 21, 25, 21,
+        26, 21, 21, 21, 21, 21, 21, 21,
+        27, 21, 21, 28, 29, 30, 31, 32,
+        33, 34, 35, 36, 37, 21, 24, 24,
+        21, 25, 21, 21, 21, 21, 21, 21,
+        21, 21, 21, 38, 21, 21, 21, 21,
+        21, 21, 32, 21, 21, 21, 36, 21,
+        24, 24, 21, 25, 21, 24, 24, 21,
+        25, 21, 21, 21, 21, 21, 21, 21,
+        21, 21, 21, 21, 21, 21, 21, 21,
+        21, 32, 21, 21, 21, 36, 21, 39,
+        21, 24, 24, 21, 25, 21, 32, 21,
+        21, 21, 21, 21, 21, 21, 40, 21,
+        21, 21, 21, 21, 21, 32, 21, 24,
+        24, 21, 25, 21, 21, 21, 21, 21,
+        21, 21, 21, 21, 40, 21, 21, 21,
+        21, 21, 21, 32, 21, 24, 24, 21,
+        25, 21, 21, 21, 21, 21, 21, 21,
+        21, 21, 21, 21, 21, 21, 21, 21,
+        21, 32, 21, 22, 21, 24, 24, 21,
+        25, 21, 26, 21, 21, 21, 21, 21,
+        21, 21, 41, 21, 21, 41, 21, 21,
+        21, 32, 42, 21, 21, 36, 21, 22,
+        21, 24, 24, 21, 25, 21, 26, 21,
+        21, 21, 21, 21, 21, 21, 21, 21,
+        21, 21, 21, 21, 21, 32, 21, 21,
+        21, 36, 21, 22, 21, 24, 24, 21,
+        25, 21, 26, 21, 21, 21, 21, 21,
+        21, 21, 41, 21, 21, 21, 21, 21,
+        21, 32, 42, 21, 21, 36, 21, 22,
+        21, 24, 24, 21, 25, 21, 26, 21,
+        21, 21, 21, 21, 21, 21, 21, 21,
+        21, 21, 21, 21, 21, 32, 42, 21,
+        21, 36, 21, 1, 1, 21, 21, 21,
+        21, 21, 21, 21, 21, 21, 21, 21,
+        21, 21, 1, 21, 22, 21, 24, 24,
+        21, 25, 21, 26, 21, 21, 21, 21,
+        21, 21, 21, 27, 21, 21, 28, 29,
+        30, 31, 32, 33, 34, 35, 36, 21,
+        22, 21, 24, 24, 21, 25, 21, 26,
+        21, 21, 21, 21, 21, 21, 21, 35,
+        21, 21, 21, 21, 21, 21, 32, 33,
+        34, 35, 36, 21, 22, 21, 24, 24,
+        21, 25, 21, 26, 21, 21, 21, 21,
+        21, 21, 21, 21, 21, 21, 21, 21,
+        21, 21, 32, 33, 34, 35, 36, 21,
+        22, 21, 24, 24, 21, 25, 21, 26,
+        21, 21, 21, 21, 21, 21, 21, 21,
+        21, 21, 21, 21, 21, 21, 32, 33,
+        34, 21, 36, 21, 22, 21, 24, 24,
+        21, 25, 21, 26, 21, 21, 21, 21,
+        21, 21, 21, 21, 21, 21, 21, 21,
+        21, 21, 32, 21, 34, 21, 36, 21,
+        22, 21, 24, 24, 21, 25, 21, 26,
+        21, 21, 21, 21, 21, 21, 21, 35,
+        21, 21, 28, 21, 30, 21, 32, 33,
+        34, 35, 36, 21, 22, 21, 24, 24,
+        21, 25, 21, 26, 21, 21, 21, 21,
+        21, 21, 21, 35, 21, 21, 28, 21,
+        21, 21, 32, 33, 34, 35, 36, 21,
+        22, 21, 24, 24, 21, 25, 21, 26,
+        21, 21, 21, 21, 21, 21, 21, 35,
+        21, 21, 28, 29, 30, 21, 32, 33,
+        34, 35, 36, 21, 22, 23, 24, 24,
+        21, 25, 21, 26, 21, 21, 21, 21,
+        21, 21, 21, 27, 21, 21, 28, 29,
+        30, 31, 32, 33, 34, 35, 36, 21,
+        3, 3, 43, 5, 43, 43, 43, 43,
+        43, 43, 43, 43, 43, 44, 43, 43,
+        43, 43, 43, 43, 14, 43, 43, 43,
+        18, 43, 3, 3, 43, 5, 43, 3,
+        3, 43, 5, 43, 43, 43, 43, 43,
+        43, 43, 43, 43, 43, 43, 43, 43,
+        43, 43, 43, 14, 43, 43, 43, 18,
+        43, 45, 43, 3, 3, 43, 5, 43,
+        14, 43, 43, 43, 43, 43, 43, 43,
+        46, 43, 43, 43, 43, 43, 43, 14,
+        43, 3, 3, 43, 5, 43, 43, 43,
+        43, 43, 43, 43, 43, 43, 46, 43,
+        43, 43, 43, 43, 43, 14, 43, 3,
+        3, 43, 5, 43, 43, 43, 43, 43,
+        43, 43, 43, 43, 43, 43, 43, 43,
+        43, 43, 43, 14, 43, 2, 43, 3,
+        3, 43, 5, 43, 6, 43, 43, 43,
+        43, 43, 43, 43, 47, 43, 43, 47,
+        43, 43, 43, 14, 48, 43, 43, 18,
+        43, 2, 43, 3, 3, 43, 5, 43,
+        6, 43, 43, 43, 43, 43, 43, 43,
+        43, 43, 43, 43, 43, 43, 43, 14,
+        43, 43, 43, 18, 43, 2, 43, 3,
+        3, 43, 5, 43, 6, 43, 43, 43,
+        43, 43, 43, 43, 47, 43, 43, 43,
+        43, 43, 43, 14, 48, 43, 43, 18,
+        43, 2, 43, 3, 3, 43, 5, 43,
+        6, 43, 43, 43, 43, 43, 43, 43,
+        43, 43, 43, 43, 43, 43, 43, 14,
+        48, 43, 43, 18, 43, 22, 23, 24,
+        24, 21, 25, 21, 26, 21, 21, 21,
+        21, 21, 21, 21, 49, 21, 21, 28,
+        29, 30, 31, 32, 33, 34, 35, 36,
+        37, 21, 22, 50, 24, 24, 21, 25,
+        21, 26, 21, 21, 21, 21, 21, 21,
+        21, 27, 21, 21, 28, 29, 30, 31,
+        32, 33, 34, 35, 36, 21, 1, 1,
+        2, 3, 3, 3, 43, 5, 43, 6,
+        1, 43, 43, 43, 43, 1, 43, 8,
+        43, 43, 10, 11, 12, 13, 14, 15,
+        16, 17, 18, 19, 43, 1, 43, 2,
+        43, 3, 3, 43, 5, 43, 6, 43,
+        43, 43, 43, 43, 43, 43, 8, 43,
+        43, 10, 11, 12, 13, 14, 15, 16,
+        17, 18, 43, 2, 43, 3, 3, 43,
+        5, 43, 6, 43, 43, 43, 43, 43,
+        43, 43, 17, 43, 43, 43, 43, 43,
+        43, 14, 15, 16, 17, 18, 43, 2,
+        43, 3, 3, 43, 5, 43, 6, 43,
+        43, 43, 43, 43, 43, 43, 43, 43,
+        43, 43, 43, 43, 43, 14, 15, 16,
+        17, 18, 43, 2, 43, 3, 3, 43,
+        5, 43, 6, 43, 43, 43, 43, 43,
+        43, 43, 43, 43, 43, 43, 43, 43,
+        43, 14, 15, 16, 43, 18, 43, 2,
+        43, 3, 3, 43, 5, 43, 6, 43,
+        43, 43, 43, 43, 43, 43, 43, 43,
+        43, 43, 43, 43, 43, 14, 43, 16,
+        43, 18, 43, 2, 43, 3, 3, 43,
+        5, 43, 6, 43, 43, 43, 43, 43,
+        43, 43, 17, 43, 43, 10, 43, 12,
+        43, 14, 15, 16, 17, 18, 43, 2,
+        43, 3, 3, 43, 5, 43, 6, 43,
+        43, 43, 43, 43, 43, 43, 17, 43,
+        43, 10, 43, 43, 43, 14, 15, 16,
+        17, 18, 43, 2, 43, 3, 3, 43,
+        5, 43, 6, 43, 43, 43, 43, 43,
+        43, 43, 17, 43, 43, 10, 11, 12,
+        43, 14, 15, 16, 17, 18, 43, 2,
+        3, 3, 3, 43, 5, 43, 6, 43,
+        43, 43, 43, 43, 43, 43, 8, 43,
+        43, 10, 11, 12, 13, 14, 15, 16,
+        17, 18, 43, 1, 1, 51, 51, 51,
+        51, 51, 51, 51, 51, 1, 51, 51,
+        51, 51, 1, 51, 51, 51, 51, 51,
+        51, 51, 51, 51, 51, 51, 51, 51,
+        51, 51, 1, 51, 52, 51, 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, 
-        33, 34, 0, 0
+        0, 1, 22, 0, 0, 23, 29, 32,
+        35, 44, 36, 40, 41, 42, 25, 38,
+        39, 37, 28, 43, 45, 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, 
-        0, 0, 9, 10
+        3, 0, 0, 4, 5, 0, 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, 
-        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, 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, 
-        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, 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, 
-        43, 43, 43, 43, 51
+        0, 22, 22, 22, 22, 22, 22, 22,
+        22, 22, 22, 22, 22, 22, 22, 22,
+        22, 22, 22, 22, 22, 22, 44, 44,
+        44, 44, 44, 44, 44, 44, 44, 44,
+        22, 22, 44, 44, 44, 44, 44, 44,
+        44, 44, 44, 44, 52, 52
 };
 
 static const int myanmar_syllable_machine_start = 0;
@@ -261,11 +265,11 @@
 static const int myanmar_syllable_machine_en_main = 0;
 
 
-#line 36 "../../src/hb-ot-shape-complex-myanmar-machine.rl"
+#line 36 "hb-ot-shape-complex-myanmar-machine.rl"
 
 
 
-#line 93 "../../src/hb-ot-shape-complex-myanmar-machine.rl"
+#line 94 "hb-ot-shape-complex-myanmar-machine.rl"
 
 
 #define found_syllable(syllable_type) \
@@ -284,8 +288,8 @@
   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"
+
+#line 293 "hb-ot-shape-complex-myanmar-machine.hh"
         {
         cs = myanmar_syllable_machine_start;
         ts = 0;
@@ -293,7 +297,7 @@
         act = 0;
         }
 
-#line 114 "../../src/hb-ot-shape-complex-myanmar-machine.rl"
+#line 115 "hb-ot-shape-complex-myanmar-machine.rl"
 
 
   p = 0;
@@ -301,8 +305,8 @@
 
   unsigned int last = 0;
   unsigned int syllable_serial = 1;
-  
-#line 306 "../../src/hb-ot-shape-complex-myanmar-machine.hh.tmp"
+
+#line 310 "hb-ot-shape-complex-myanmar-machine.hh"
         {
         int _slen;
         int _trans;
@@ -316,7 +320,7 @@
 #line 1 "NONE"
         {ts = p;}
         break;
-#line 320 "../../src/hb-ot-shape-complex-myanmar-machine.hh.tmp"
+#line 324 "hb-ot-shape-complex-myanmar-machine.hh"
         }
 
         _keys = _myanmar_syllable_machine_trans_keys + (cs<<1);
@@ -335,38 +339,38 @@
 
         switch ( _myanmar_syllable_machine_trans_actions[_trans] ) {
         case 7:
-#line 85 "../../src/hb-ot-shape-complex-myanmar-machine.rl"
+#line 86 "hb-ot-shape-complex-myanmar-machine.rl"
         {te = p+1;{ found_syllable (consonant_syllable); }}
         break;
         case 5:
-#line 86 "../../src/hb-ot-shape-complex-myanmar-machine.rl"
+#line 87 "hb-ot-shape-complex-myanmar-machine.rl"
         {te = p+1;{ found_syllable (non_myanmar_cluster); }}
         break;
         case 10:
-#line 87 "../../src/hb-ot-shape-complex-myanmar-machine.rl"
+#line 88 "hb-ot-shape-complex-myanmar-machine.rl"
         {te = p+1;{ found_syllable (punctuation_cluster); }}
         break;
         case 4:
-#line 88 "../../src/hb-ot-shape-complex-myanmar-machine.rl"
+#line 89 "hb-ot-shape-complex-myanmar-machine.rl"
         {te = p+1;{ found_syllable (broken_cluster); }}
         break;
         case 3:
-#line 89 "../../src/hb-ot-shape-complex-myanmar-machine.rl"
+#line 90 "hb-ot-shape-complex-myanmar-machine.rl"
         {te = p+1;{ found_syllable (non_myanmar_cluster); }}
         break;
         case 6:
-#line 85 "../../src/hb-ot-shape-complex-myanmar-machine.rl"
+#line 86 "hb-ot-shape-complex-myanmar-machine.rl"
         {te = p;p--;{ found_syllable (consonant_syllable); }}
         break;
         case 8:
-#line 88 "../../src/hb-ot-shape-complex-myanmar-machine.rl"
+#line 89 "hb-ot-shape-complex-myanmar-machine.rl"
         {te = p;p--;{ found_syllable (broken_cluster); }}
         break;
         case 9:
-#line 89 "../../src/hb-ot-shape-complex-myanmar-machine.rl"
+#line 90 "hb-ot-shape-complex-myanmar-machine.rl"
         {te = p;p--;{ found_syllable (non_myanmar_cluster); }}
         break;
-#line 370 "../../src/hb-ot-shape-complex-myanmar-machine.hh.tmp"
+#line 374 "hb-ot-shape-complex-myanmar-machine.hh"
         }
 
 _again:
@@ -375,7 +379,7 @@
 #line 1 "NONE"
         {ts = 0;}
         break;
-#line 379 "../../src/hb-ot-shape-complex-myanmar-machine.hh.tmp"
+#line 383 "hb-ot-shape-complex-myanmar-machine.hh"
         }
 
         if ( ++p != pe )
@@ -391,7 +395,7 @@
 
         }
 
-#line 123 "../../src/hb-ot-shape-complex-myanmar-machine.rl"
+#line 124 "hb-ot-shape-complex-myanmar-machine.rl"
 
 }
 
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-myanmar.cc	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-myanmar.cc	Wed Dec 13 10:25:38 2017 -0800
@@ -103,7 +103,7 @@
   for (unsigned int i = 0; i < ARRAY_LENGTH (basic_features); i++)
   {
     map->add_feature (basic_features[i], 1, F_GLOBAL | F_MANUAL_ZWJ);
-    map->add_gsub_pause (NULL);
+    map->add_gsub_pause (nullptr);
   }
   map->add_gsub_pause (final_reordering);
   for (unsigned int i = 0; i < ARRAY_LENGTH (other_features); i++)
@@ -130,8 +130,7 @@
 /* Note: This enum is duplicated in the -machine.rl source file.
  * Not sure how to avoid duplication. */
 enum myanmar_category_t {
-  OT_As  = 18, /* Asat */
-  OT_D   = 19, /* Digits except zero */
+  OT_As  = 18,  /* Asat */
   OT_D0  = 20, /* Digit zero */
   OT_DB  = OT_N, /* Dot below */
   OT_GB  = OT_PLACEHOLDER,
@@ -145,7 +144,8 @@
   OT_VPre = 28,
   OT_VPst = 29,
   OT_VS   = 30, /* Variation selectors */
-  OT_P    = 31  /* Punctuation */
+  OT_P    = 31, /* Punctuation */
+  OT_D    = 32, /* Digits except zero */
 };
 
 
@@ -154,7 +154,7 @@
 {
   /* If it ligated, all bets are off. */
   if (_hb_glyph_info_ligated (&info)) return false;
-  return !!(FLAG_SAFE (info.myanmar_category()) & flags);
+  return !!(FLAG_UNSAFE (info.myanmar_category()) & flags);
 }
 
 static inline bool
@@ -175,7 +175,7 @@
   /* Myanmar
    * http://www.microsoft.com/typography/OpenTypeDev/myanmar/intro.htm#analyze
    */
-  if (unlikely (hb_in_range (u, 0xFE00u, 0xFE0Fu)))
+  if (unlikely (hb_in_range<hb_codepoint_t> (u, 0xFE00u, 0xFE0Fu)))
     cat = (indic_category_t) OT_VS;
 
   switch (u)
@@ -297,6 +297,8 @@
                  hb_buffer_t *buffer)
 {
   find_syllables (buffer);
+  foreach_syllable (buffer, start, end)
+    buffer->unsafe_to_break (start, end);
 }
 
 static int
@@ -510,36 +512,36 @@
  * generic shaper, except that it zeros mark advances GDEF_LATE. */
 const hb_ot_complex_shaper_t _hb_ot_complex_shaper_myanmar_old =
 {
-  "default",
-  NULL, /* collect_features */
-  NULL, /* override_features */
-  NULL, /* data_create */
-  NULL, /* data_destroy */
-  NULL, /* preprocess_text */
-  NULL, /* postprocess_glyphs */
+  nullptr, /* collect_features */
+  nullptr, /* override_features */
+  nullptr, /* data_create */
+  nullptr, /* data_destroy */
+  nullptr, /* preprocess_text */
+  nullptr, /* postprocess_glyphs */
   HB_OT_SHAPE_NORMALIZATION_MODE_DEFAULT,
-  NULL, /* decompose */
-  NULL, /* compose */
-  NULL, /* setup_masks */
-  NULL, /* disable_otl */
+  nullptr, /* decompose */
+  nullptr, /* compose */
+  nullptr, /* setup_masks */
+  nullptr, /* disable_otl */
+  nullptr, /* reorder_marks */
   HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE,
   true, /* fallback_position */
 };
 
 const hb_ot_complex_shaper_t _hb_ot_complex_shaper_myanmar =
 {
-  "myanmar",
   collect_features_myanmar,
   override_features_myanmar,
-  NULL, /* data_create */
-  NULL, /* data_destroy */
-  NULL, /* preprocess_text */
-  NULL, /* postprocess_glyphs */
+  nullptr, /* data_create */
+  nullptr, /* data_destroy */
+  nullptr, /* preprocess_text */
+  nullptr, /* postprocess_glyphs */
   HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_DIACRITICS_NO_SHORT_CIRCUIT,
-  NULL, /* decompose */
-  NULL, /* compose */
+  nullptr, /* decompose */
+  nullptr, /* compose */
   setup_masks_myanmar,
-  NULL, /* disable_otl */
+  nullptr, /* disable_otl */
+  nullptr, /* reorder_marks */
   HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_EARLY,
   false, /* fallback_position */
 };
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-private.hh	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-private.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -39,6 +39,8 @@
 #define complex_var_u8_1()      var2.u8[3]
 
 
+#define HB_OT_SHAPE_COMPLEX_MAX_COMBINING_MARKS 32
+
 enum hb_ot_shape_zero_width_marks_type_t {
   HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE,
   HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_EARLY,
@@ -63,12 +65,10 @@
 
 struct hb_ot_complex_shaper_t
 {
-  char name[8];
-
   /* collect_features()
    * Called during shape_plan().
    * Shapers should use plan->map to add their features and callbacks.
-   * May be NULL.
+   * May be nullptr.
    */
   void (*collect_features) (hb_ot_shape_planner_t *plan);
 
@@ -76,7 +76,7 @@
    * Called during shape_plan().
    * Shapers should use plan->map to override features and add callbacks after
    * common features are added.
-   * May be NULL.
+   * May be nullptr.
    */
   void (*override_features) (hb_ot_shape_planner_t *plan);
 
@@ -84,15 +84,15 @@
   /* data_create()
    * Called at the end of shape_plan().
    * Whatever shapers return will be accessible through plan->data later.
-   * If NULL is returned, means a plan failure.
+   * If nullptr is returned, means a plan failure.
    */
   void *(*data_create) (const hb_ot_shape_plan_t *plan);
 
   /* data_destroy()
    * Called when the shape_plan is being destroyed.
    * plan->data is passed here for destruction.
-   * If NULL is returned, means a plan failure.
-   * May be NULL.
+   * If nullptr is returned, means a plan failure.
+   * May be nullptr.
    */
   void (*data_destroy) (void *data);
 
@@ -100,7 +100,7 @@
   /* preprocess_text()
    * Called during shape().
    * Shapers can use to modify text before shaping starts.
-   * May be NULL.
+   * May be nullptr.
    */
   void (*preprocess_text) (const hb_ot_shape_plan_t *plan,
                            hb_buffer_t              *buffer,
@@ -109,7 +109,7 @@
   /* postprocess_glyphs()
    * Called during shape().
    * Shapers can use to modify glyphs after shaping ends.
-   * May be NULL.
+   * May be nullptr.
    */
   void (*postprocess_glyphs) (const hb_ot_shape_plan_t *plan,
                               hb_buffer_t              *buffer,
@@ -120,7 +120,7 @@
 
   /* decompose()
    * Called during shape()'s normalization.
-   * May be NULL.
+   * May be nullptr.
    */
   bool (*decompose) (const hb_ot_shape_normalize_context_t *c,
                      hb_codepoint_t  ab,
@@ -129,7 +129,7 @@
 
   /* compose()
    * Called during shape()'s normalization.
-   * May be NULL.
+   * May be nullptr.
    */
   bool (*compose) (const hb_ot_shape_normalize_context_t *c,
                    hb_codepoint_t  a,
@@ -140,7 +140,7 @@
    * Called during shape().
    * Shapers should use map to get feature masks and set on buffer.
    * Shapers may NOT modify characters.
-   * May be NULL.
+   * May be nullptr.
    */
   void (*setup_masks) (const hb_ot_shape_plan_t *plan,
                        hb_buffer_t              *buffer,
@@ -150,10 +150,20 @@
    * Called during shape().
    * If set and returns true, GDEF/GSUB/GPOS of the font are ignored
    * and fallback operations used.
-   * May be NULL.
+   * May be nullptr.
    */
   bool (*disable_otl) (const hb_ot_shape_plan_t *plan);
 
+  /* reorder_marks()
+   * Called during shape().
+   * Shapers can use to modify ordering of combining marks.
+   * May be nullptr.
+   */
+  void (*reorder_marks) (const hb_ot_shape_plan_t *plan,
+                         hb_buffer_t              *buffer,
+                         unsigned int              start,
+                         unsigned int              end);
+
   hb_ot_shape_zero_width_marks_type_t zero_width_marks;
 
   bool fallback_position;
@@ -191,6 +201,9 @@
     case HB_SCRIPT_MANICHAEAN:
     case HB_SCRIPT_PSALTER_PAHLAVI:
 
+    /* Unicode-9.0 additions */
+    case HB_SCRIPT_ADLAM:
+
       /* For Arabic script, use the Arabic shaper even if no OT script tag was found.
        * This is because we do fallback shaping for Arabic script (and not others).
        * But note that Arabic shaping is applicable only to horizontal layout; for
@@ -250,10 +263,12 @@
     case HB_SCRIPT_SINHALA:
 
       /* If the designer designed the font for the 'DFLT' script,
-       * use the default shaper.  Otherwise, use the specific shaper.
+       * (or we ended up arbitrarily pick 'latn'), use the default shaper.
+       * Otherwise, use the specific shaper.
        * Note that for some simple scripts, there may not be *any*
        * GSUB/GPOS needed, so there may be no scripts found! */
-      if (planner->map.chosen_script[0] == HB_TAG ('D','F','L','T'))
+      if (planner->map.chosen_script[0] == HB_TAG ('D','F','L','T') ||
+          planner->map.chosen_script[0] == HB_TAG ('l','a','t','n'))
         return &_hb_ot_complex_shaper_default;
       else
         return &_hb_ot_complex_shaper_indic;
@@ -269,7 +284,7 @@
                                               planner->map.script_index[0],
                                               planner->map.language_index[0],
                                               HB_TAG ('p','r','e','f'),
-                                              NULL))
+                                              nullptr))
         return &_hb_ot_complex_shaper_indic;
       else
         return &_hb_ot_complex_shaper_default;
@@ -359,11 +374,18 @@
     case HB_SCRIPT_MARCHEN:
     case HB_SCRIPT_NEWA:
 
+    /* Unicode-10.0 additions */
+    case HB_SCRIPT_MASARAM_GONDI:
+    case HB_SCRIPT_SOYOMBO:
+    case HB_SCRIPT_ZANABAZAR_SQUARE:
+
       /* If the designer designed the font for the 'DFLT' script,
-       * use the default shaper.  Otherwise, use the specific shaper.
+       * (or we ended up arbitrarily pick 'latn'), use the default shaper.
+       * Otherwise, use the specific shaper.
        * Note that for some simple scripts, there may not be *any*
        * GSUB/GPOS needed, so there may be no scripts found! */
-      if (planner->map.chosen_script[0] == HB_TAG ('D','F','L','T'))
+      if (planner->map.chosen_script[0] == HB_TAG ('D','F','L','T') ||
+          planner->map.chosen_script[0] == HB_TAG ('l','a','t','n'))
         return &_hb_ot_complex_shaper_default;
       else
         return &_hb_ot_complex_shaper_use;
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-thai.cc	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-thai.cc	Wed Dec 13 10:25:38 2017 -0800
@@ -52,7 +52,7 @@
     return RC;
   if (u == 0x0E0Eu || u == 0x0E0Fu)
     return DC;
-  if (hb_in_range (u, 0x0E01u, 0x0E2Eu))
+  if (hb_in_range<hb_codepoint_t> (u, 0x0E01u, 0x0E2Eu))
     return NC;
   return NOT_CONSONANT;
 }
@@ -70,12 +70,12 @@
 static thai_mark_type_t
 get_mark_type (hb_codepoint_t u)
 {
-  if (u == 0x0E31u || hb_in_range (u, 0x0E34u, 0x0E37u) ||
-      u == 0x0E47u || hb_in_range (u, 0x0E4Du, 0x0E4Eu))
+  if (u == 0x0E31u || hb_in_range<hb_codepoint_t> (u, 0x0E34u, 0x0E37u) ||
+      u == 0x0E47u || hb_in_range<hb_codepoint_t> (u, 0x0E4Du, 0x0E4Eu))
     return AV;
-  if (hb_in_range (u, 0x0E38u, 0x0E3Au))
+  if (hb_in_range<hb_codepoint_t> (u, 0x0E38u, 0x0E3Au))
     return BV;
-  if (hb_in_range (u, 0x0E48u, 0x0E4Cu))
+  if (hb_in_range<hb_codepoint_t> (u, 0x0E48u, 0x0E4Cu))
     return T;
   return NOT_MARK;
 }
@@ -97,7 +97,7 @@
     hb_codepoint_t u;
     hb_codepoint_t win_pua;
     hb_codepoint_t mac_pua;
-  } const *pua_mappings = NULL;
+  } const *pua_mappings = nullptr;
   static const thai_pua_mapping_t SD_mappings[] = {
     {0x0E48u, 0xF70Au, 0xF88Bu}, /* MAI EK */
     {0x0E49u, 0xF70Bu, 0xF88Eu}, /* MAI THO */
@@ -244,6 +244,7 @@
     /* At least one of the above/below actions is NOP. */
     thai_action_t action = above_edge.action != NOP ? above_edge.action : below_edge.action;
 
+    buffer->unsafe_to_break (base, i);
     if (action == RD)
       info[base].codepoint = thai_pua_shape (info[base].codepoint, action, font);
     else
@@ -310,7 +311,7 @@
 #define IS_SARA_AM(x) (((x) & ~0x0080u) == 0x0E33u)
 #define NIKHAHIT_FROM_SARA_AM(x) ((x) - 0x0E33u + 0x0E4Du)
 #define SARA_AA_FROM_SARA_AM(x) ((x) - 1)
-#define IS_TONE_MARK(x) (hb_in_ranges ((x) & ~0x0080u, 0x0E34u, 0x0E37u, 0x0E47u, 0x0E4Eu, 0x0E31u, 0x0E31u))
+#define IS_TONE_MARK(x) (hb_in_ranges<hb_codepoint_t> ((x) & ~0x0080u, 0x0E34u, 0x0E37u, 0x0E47u, 0x0E4Eu, 0x0E31u, 0x0E31u))
 
   buffer->clear_output ();
   unsigned int count = buffer->len;
@@ -365,18 +366,18 @@
 
 const hb_ot_complex_shaper_t _hb_ot_complex_shaper_thai =
 {
-  "thai",
-  NULL, /* collect_features */
-  NULL, /* override_features */
-  NULL, /* data_create */
-  NULL, /* data_destroy */
+  nullptr, /* collect_features */
+  nullptr, /* override_features */
+  nullptr, /* data_create */
+  nullptr, /* data_destroy */
   preprocess_text_thai,
-  NULL, /* postprocess_glyphs */
+  nullptr, /* postprocess_glyphs */
   HB_OT_SHAPE_NORMALIZATION_MODE_DEFAULT,
-  NULL, /* decompose */
-  NULL, /* compose */
-  NULL, /* setup_masks */
-  NULL, /* disable_otl */
+  nullptr, /* decompose */
+  nullptr, /* compose */
+  nullptr, /* setup_masks */
+  nullptr, /* disable_otl */
+  nullptr, /* reorder_marks */
   HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE,
   false,/* fallback_position */
 };
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-tibetan.cc	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-tibetan.cc	Wed Dec 13 10:25:38 2017 -0800
@@ -46,18 +46,18 @@
 
 const hb_ot_complex_shaper_t _hb_ot_complex_shaper_tibetan =
 {
-  "default",
   collect_features_tibetan,
-  NULL, /* override_features */
-  NULL, /* data_create */
-  NULL, /* data_destroy */
-  NULL, /* preprocess_text */
-  NULL, /* postprocess_glyphs */
+  nullptr, /* override_features */
+  nullptr, /* data_create */
+  nullptr, /* data_destroy */
+  nullptr, /* preprocess_text */
+  nullptr, /* postprocess_glyphs */
   HB_OT_SHAPE_NORMALIZATION_MODE_DEFAULT,
-  NULL, /* decompose */
-  NULL, /* compose */
-  NULL, /* setup_masks */
-  NULL, /* disable_otl */
+  nullptr, /* decompose */
+  nullptr, /* compose */
+  nullptr, /* setup_masks */
+  nullptr, /* disable_otl */
+  nullptr, /* reorder_marks */
   HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE,
   true, /* fallback_position */
 };
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-use-machine.hh	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-use-machine.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -36,248 +36,257 @@
 
 #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, 
-        42u, 42u, 0
+        1u, 1u, 0u, 43u, 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, 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, 8u, 39u, 1u, 1u, 1u, 39u, 8u, 39u,
+        21u, 42u, 41u, 42u, 42u, 42u, 1u, 5u, 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
+        1, 44, 1, 32, 32, 1, 32, 32,
+        32, 19, 19, 19, 32, 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, 32, 1, 39, 32,
+        22, 2, 1, 5
 };
 
 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, 
-        1272
+        0, 2, 47, 49, 82, 115, 117, 150,
+        183, 216, 236, 256, 276, 309, 342, 375,
+        408, 441, 474, 507, 540, 573, 606, 639,
+        672, 682, 684, 686, 719, 752, 785, 818,
+        838, 858, 878, 911, 944, 977, 1010, 1043,
+        1076, 1109, 1142, 1175, 1208, 1241, 1243, 1283,
+        1316, 1339, 1342, 1344
 };
 
 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, 
-        60, 58, 0
+        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, 4, 4, 26, 4, 28,
+        27, 30, 29, 29, 31, 32, 29, 29,
+        29, 29, 29, 29, 29, 29, 33, 34,
+        35, 36, 37, 38, 39, 40, 34, 41,
+        33, 42, 43, 44, 45, 29, 46, 47,
+        48, 29, 30, 29, 29, 31, 32, 29,
+        29, 29, 29, 29, 29, 29, 29, 49,
+        34, 35, 36, 37, 38, 39, 40, 34,
+        41, 42, 42, 43, 44, 45, 29, 46,
+        47, 48, 29, 31, 50, 30, 29, 29,
+        31, 32, 29, 29, 29, 29, 29, 29,
+        29, 29, 29, 34, 35, 36, 37, 38,
+        39, 40, 34, 41, 42, 42, 43, 44,
+        45, 29, 46, 47, 48, 29, 30, 29,
+        29, 29, 29, 29, 29, 29, 29, 29,
+        29, 29, 29, 29, 34, 35, 36, 37,
+        38, 29, 29, 29, 29, 29, 29, 43,
+        44, 45, 29, 46, 47, 48, 29, 30,
+        29, 29, 29, 29, 29, 29, 29, 29,
+        29, 29, 29, 29, 29, 29, 35, 36,
+        37, 38, 29, 29, 29, 29, 29, 29,
+        29, 29, 29, 29, 46, 47, 48, 29,
+        30, 29, 29, 29, 29, 29, 29, 29,
+        29, 29, 29, 29, 29, 29, 29, 29,
+        36, 37, 38, 29, 30, 29, 29, 29,
+        29, 29, 29, 29, 29, 29, 29, 29,
+        29, 29, 29, 29, 29, 37, 38, 29,
+        30, 29, 29, 29, 29, 29, 29, 29,
+        29, 29, 29, 29, 29, 29, 29, 29,
+        29, 29, 38, 29, 30, 29, 29, 29,
+        29, 29, 29, 29, 29, 29, 29, 29,
+        29, 29, 29, 29, 36, 37, 38, 29,
+        29, 29, 29, 29, 29, 29, 29, 29,
+        29, 46, 47, 48, 29, 30, 29, 29,
+        29, 29, 29, 29, 29, 29, 29, 29,
+        29, 29, 29, 29, 29, 36, 37, 38,
+        29, 29, 29, 29, 29, 29, 29, 29,
+        29, 29, 29, 47, 48, 29, 30, 29,
+        29, 29, 29, 29, 29, 29, 29, 29,
+        29, 29, 29, 29, 29, 29, 36, 37,
+        38, 29, 29, 29, 29, 29, 29, 29,
+        29, 29, 29, 29, 29, 48, 29, 30,
+        29, 29, 29, 29, 29, 29, 29, 29,
+        29, 29, 29, 29, 29, 29, 35, 36,
+        37, 38, 29, 29, 29, 29, 29, 29,
+        43, 44, 45, 29, 46, 47, 48, 29,
+        30, 29, 29, 29, 29, 29, 29, 29,
+        29, 29, 29, 29, 29, 29, 29, 35,
+        36, 37, 38, 29, 29, 29, 29, 29,
+        29, 29, 44, 45, 29, 46, 47, 48,
+        29, 30, 29, 29, 29, 29, 29, 29,
+        29, 29, 29, 29, 29, 29, 29, 29,
+        35, 36, 37, 38, 29, 29, 29, 29,
+        29, 29, 29, 29, 45, 29, 46, 47,
+        48, 29, 30, 29, 29, 29, 29, 29,
+        29, 29, 29, 29, 29, 29, 29, 29,
+        34, 35, 36, 37, 38, 29, 40, 34,
+        29, 29, 29, 43, 44, 45, 29, 46,
+        47, 48, 29, 30, 29, 29, 29, 29,
+        29, 29, 29, 29, 29, 29, 29, 29,
+        29, 34, 35, 36, 37, 38, 29, 51,
+        34, 29, 29, 29, 43, 44, 45, 29,
+        46, 47, 48, 29, 30, 29, 29, 29,
+        29, 29, 29, 29, 29, 29, 29, 29,
+        29, 29, 34, 35, 36, 37, 38, 29,
+        29, 34, 29, 29, 29, 43, 44, 45,
+        29, 46, 47, 48, 29, 30, 29, 29,
+        29, 29, 29, 29, 29, 29, 29, 29,
+        29, 29, 29, 34, 35, 36, 37, 38,
+        39, 40, 34, 29, 29, 29, 43, 44,
+        45, 29, 46, 47, 48, 29, 30, 29,
+        29, 31, 32, 29, 29, 29, 29, 29,
+        29, 29, 29, 29, 34, 35, 36, 37,
+        38, 39, 40, 34, 41, 29, 42, 43,
+        44, 45, 29, 46, 47, 48, 29, 30,
+        29, 29, 31, 32, 29, 29, 29, 29,
+        29, 29, 29, 29, 29, 34, 35, 36,
+        37, 38, 39, 40, 34, 41, 33, 42,
+        43, 44, 45, 29, 46, 47, 48, 29,
+        53, 52, 52, 52, 52, 52, 52, 52,
+        54, 52, 5, 55, 53, 52, 6, 56,
+        56, 1, 57, 56, 56, 56, 56, 56,
+        56, 56, 56, 58, 10, 11, 12, 13,
+        14, 15, 16, 10, 17, 19, 19, 20,
+        21, 22, 56, 23, 24, 25, 56, 6,
+        56, 56, 1, 57, 56, 56, 56, 56,
+        56, 56, 56, 56, 56, 10, 11, 12,
+        13, 14, 15, 16, 10, 17, 19, 19,
+        20, 21, 22, 56, 23, 24, 25, 56,
+        6, 56, 56, 56, 56, 56, 56, 56,
+        56, 56, 56, 56, 56, 56, 10, 11,
+        12, 13, 14, 56, 56, 56, 56, 56,
+        56, 20, 21, 22, 56, 23, 24, 25,
+        56, 6, 56, 56, 56, 56, 56, 56,
+        56, 56, 56, 56, 56, 56, 56, 56,
+        11, 12, 13, 14, 56, 56, 56, 56,
+        56, 56, 56, 56, 56, 56, 23, 24,
+        25, 56, 6, 56, 56, 56, 56, 56,
+        56, 56, 56, 56, 56, 56, 56, 56,
+        56, 56, 12, 13, 14, 56, 6, 56,
+        56, 56, 56, 56, 56, 56, 56, 56,
+        56, 56, 56, 56, 56, 56, 56, 13,
+        14, 56, 6, 56, 56, 56, 56, 56,
+        56, 56, 56, 56, 56, 56, 56, 56,
+        56, 56, 56, 56, 14, 56, 6, 56,
+        56, 56, 56, 56, 56, 56, 56, 56,
+        56, 56, 56, 56, 56, 56, 12, 13,
+        14, 56, 56, 56, 56, 56, 56, 56,
+        56, 56, 56, 23, 24, 25, 56, 6,
+        56, 56, 56, 56, 56, 56, 56, 56,
+        56, 56, 56, 56, 56, 56, 56, 12,
+        13, 14, 56, 56, 56, 56, 56, 56,
+        56, 56, 56, 56, 56, 24, 25, 56,
+        6, 56, 56, 56, 56, 56, 56, 56,
+        56, 56, 56, 56, 56, 56, 56, 56,
+        12, 13, 14, 56, 56, 56, 56, 56,
+        56, 56, 56, 56, 56, 56, 56, 25,
+        56, 6, 56, 56, 56, 56, 56, 56,
+        56, 56, 56, 56, 56, 56, 56, 56,
+        11, 12, 13, 14, 56, 56, 56, 56,
+        56, 56, 20, 21, 22, 56, 23, 24,
+        25, 56, 6, 56, 56, 56, 56, 56,
+        56, 56, 56, 56, 56, 56, 56, 56,
+        56, 11, 12, 13, 14, 56, 56, 56,
+        56, 56, 56, 56, 21, 22, 56, 23,
+        24, 25, 56, 6, 56, 56, 56, 56,
+        56, 56, 56, 56, 56, 56, 56, 56,
+        56, 56, 11, 12, 13, 14, 56, 56,
+        56, 56, 56, 56, 56, 56, 22, 56,
+        23, 24, 25, 56, 6, 56, 56, 56,
+        56, 56, 56, 56, 56, 56, 56, 56,
+        56, 56, 10, 11, 12, 13, 14, 56,
+        16, 10, 56, 56, 56, 20, 21, 22,
+        56, 23, 24, 25, 56, 6, 56, 56,
+        56, 56, 56, 56, 56, 56, 56, 56,
+        56, 56, 56, 10, 11, 12, 13, 14,
+        56, 59, 10, 56, 56, 56, 20, 21,
+        22, 56, 23, 24, 25, 56, 6, 56,
+        56, 56, 56, 56, 56, 56, 56, 56,
+        56, 56, 56, 56, 10, 11, 12, 13,
+        14, 56, 56, 10, 56, 56, 56, 20,
+        21, 22, 56, 23, 24, 25, 56, 6,
+        56, 56, 56, 56, 56, 56, 56, 56,
+        56, 56, 56, 56, 56, 10, 11, 12,
+        13, 14, 15, 16, 10, 56, 56, 56,
+        20, 21, 22, 56, 23, 24, 25, 56,
+        6, 56, 56, 1, 57, 56, 56, 56,
+        56, 56, 56, 56, 56, 56, 10, 11,
+        12, 13, 14, 15, 16, 10, 17, 56,
+        19, 20, 21, 22, 56, 23, 24, 25,
+        56, 1, 60, 3, 56, 56, 56, 3,
+        56, 56, 6, 56, 56, 1, 57, 56,
+        56, 56, 56, 56, 56, 56, 56, 56,
+        10, 11, 12, 13, 14, 15, 16, 10,
+        17, 18, 19, 20, 21, 22, 56, 23,
+        24, 25, 56, 6, 56, 56, 1, 57,
+        56, 56, 56, 56, 56, 56, 56, 56,
+        56, 10, 11, 12, 13, 14, 15, 16,
+        10, 17, 18, 19, 20, 21, 22, 56,
+        23, 24, 25, 56, 62, 61, 61, 61,
+        61, 61, 61, 61, 61, 61, 61, 61,
+        61, 61, 61, 61, 61, 61, 61, 61,
+        62, 63, 61, 62, 63, 61, 63, 61,
+        3, 60, 60, 60, 3, 60, 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, 
-        27, 1, 1, 47, 48
+        1, 27, 2, 3, 1, 24, 1, 45,
+        46, 48, 29, 30, 31, 32, 33, 40,
+        41, 43, 47, 44, 37, 38, 39, 34,
+        35, 36, 51, 1, 1, 1, 1, 4,
+        5, 23, 7, 8, 9, 10, 11, 18,
+        19, 21, 22, 15, 16, 17, 12, 13,
+        14, 6, 1, 20, 1, 25, 26, 1,
+        1, 0, 28, 42, 1, 1, 49, 50
 };
 
 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, 
-        2, 15, 16, 0, 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, 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, 0, 12, 0, 0, 13,
+        14, 0, 2, 0, 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
+        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, 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
+        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, 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, 
-        59
+        1, 0, 28, 30, 30, 51, 30, 30,
+        30, 30, 30, 30, 30, 30, 30, 30,
+        30, 30, 30, 30, 30, 30, 30, 30,
+        53, 56, 53, 57, 57, 57, 57, 57,
+        57, 57, 57, 57, 57, 57, 57, 57,
+        57, 57, 57, 57, 57, 61, 57, 57,
+        62, 62, 62, 61
 };
 
 static const int use_syllable_machine_start = 1;
@@ -291,7 +300,7 @@
 
 
 
-#line 138 "hb-ot-shape-complex-use-machine.rl"
+#line 140 "hb-ot-shape-complex-use-machine.rl"
 
 
 #define found_syllable(syllable_type) \
@@ -310,8 +319,8 @@
   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"
+
+#line 324 "hb-ot-shape-complex-use-machine.hh"
         {
         cs = use_syllable_machine_start;
         ts = 0;
@@ -319,7 +328,7 @@
         act = 0;
         }
 
-#line 159 "hb-ot-shape-complex-use-machine.rl"
+#line 161 "hb-ot-shape-complex-use-machine.rl"
 
 
   p = 0;
@@ -327,8 +336,8 @@
 
   unsigned int last = 0;
   unsigned int syllable_serial = 1;
-  
-#line 332 "hb-ot-shape-complex-use-machine.hh"
+
+#line 341 "hb-ot-shape-complex-use-machine.hh"
         {
         int _slen;
         int _trans;
@@ -342,7 +351,7 @@
 #line 1 "NONE"
         {ts = p;}
         break;
-#line 346 "hb-ot-shape-complex-use-machine.hh"
+#line 355 "hb-ot-shape-complex-use-machine.hh"
         }
 
         _keys = _use_syllable_machine_trans_keys + (cs<<1);
@@ -365,58 +374,58 @@
         {te = p+1;}
         break;
         case 8:
-#line 127 "hb-ot-shape-complex-use-machine.rl"
+#line 129 "hb-ot-shape-complex-use-machine.rl"
         {te = p+1;{ found_syllable (independent_cluster); }}
         break;
         case 10:
-#line 129 "hb-ot-shape-complex-use-machine.rl"
+#line 131 "hb-ot-shape-complex-use-machine.rl"
         {te = p+1;{ found_syllable (standard_cluster); }}
         break;
         case 6:
-#line 133 "hb-ot-shape-complex-use-machine.rl"
+#line 135 "hb-ot-shape-complex-use-machine.rl"
         {te = p+1;{ found_syllable (broken_cluster); }}
         break;
         case 5:
-#line 134 "hb-ot-shape-complex-use-machine.rl"
+#line 136 "hb-ot-shape-complex-use-machine.rl"
         {te = p+1;{ found_syllable (non_cluster); }}
         break;
         case 7:
-#line 127 "hb-ot-shape-complex-use-machine.rl"
+#line 129 "hb-ot-shape-complex-use-machine.rl"
         {te = p;p--;{ found_syllable (independent_cluster); }}
         break;
         case 11:
-#line 128 "hb-ot-shape-complex-use-machine.rl"
+#line 130 "hb-ot-shape-complex-use-machine.rl"
         {te = p;p--;{ found_syllable (virama_terminated_cluster); }}
         break;
         case 9:
-#line 129 "hb-ot-shape-complex-use-machine.rl"
+#line 131 "hb-ot-shape-complex-use-machine.rl"
         {te = p;p--;{ found_syllable (standard_cluster); }}
         break;
         case 13:
-#line 130 "hb-ot-shape-complex-use-machine.rl"
+#line 132 "hb-ot-shape-complex-use-machine.rl"
         {te = p;p--;{ found_syllable (number_joiner_terminated_cluster); }}
         break;
         case 12:
-#line 131 "hb-ot-shape-complex-use-machine.rl"
+#line 133 "hb-ot-shape-complex-use-machine.rl"
         {te = p;p--;{ found_syllable (numeral_cluster); }}
         break;
         case 16:
-#line 132 "hb-ot-shape-complex-use-machine.rl"
+#line 134 "hb-ot-shape-complex-use-machine.rl"
         {te = p;p--;{ found_syllable (symbol_cluster); }}
         break;
         case 14:
-#line 133 "hb-ot-shape-complex-use-machine.rl"
+#line 135 "hb-ot-shape-complex-use-machine.rl"
         {te = p;p--;{ found_syllable (broken_cluster); }}
         break;
         case 15:
-#line 134 "hb-ot-shape-complex-use-machine.rl"
+#line 136 "hb-ot-shape-complex-use-machine.rl"
         {te = p;p--;{ found_syllable (non_cluster); }}
         break;
         case 1:
-#line 133 "hb-ot-shape-complex-use-machine.rl"
+#line 135 "hb-ot-shape-complex-use-machine.rl"
         {{p = ((te))-1;}{ found_syllable (broken_cluster); }}
         break;
-#line 420 "hb-ot-shape-complex-use-machine.hh"
+#line 429 "hb-ot-shape-complex-use-machine.hh"
         }
 
 _again:
@@ -425,7 +434,7 @@
 #line 1 "NONE"
         {ts = 0;}
         break;
-#line 429 "hb-ot-shape-complex-use-machine.hh"
+#line 438 "hb-ot-shape-complex-use-machine.hh"
         }
 
         if ( ++p != pe )
@@ -441,7 +450,7 @@
 
         }
 
-#line 168 "hb-ot-shape-complex-use-machine.rl"
+#line 170 "hb-ot-shape-complex-use-machine.rl"
 
 }
 
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-use-private.hh	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-use-private.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -87,7 +87,8 @@
   USE_VMPst     = 39,   /* VOWEL_MOD_POST */
   USE_VMPre     = 23,   /* VOWEL_MOD_PRE */
   USE_SMAbv     = 41,   /* SYM_MOD_ABOVE */
-  USE_SMBlw     = 42    /* SYM_MOD_BELOW */
+  USE_SMBlw     = 42,   /* SYM_MOD_BELOW */
+  USE_CS        = 43    /* CONS_WITH_STACKER */
 };
 
 HB_INTERNAL USE_TABLE_ELEMENT_TYPE
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-use-table.cc	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-use-table.cc	Wed Dec 13 10:25:38 2017 -0800
@@ -6,12 +6,12 @@
  *
  * on files with these headers:
  *
- * # IndicSyllabicCategory-9.0.0.txt
- * # Date: 2016-05-21, 02:46:00 GMT [RP]
- * # IndicPositionalCategory-9.0.0.txt
- * # Date: 2016-02-25, 00:48:00 GMT [RP]
- * # Blocks-9.0.0.txt
- * # Date: 2016-02-05, 23:48:00 GMT [KW]
+ * # IndicSyllabicCategory-10.0.0.txt
+ * # Date: 2017-05-31, 01:07:00 GMT [KW, RP]
+ * # IndicPositionalCategory-10.0.0.txt
+ * # Date: 2017-05-31, 01:07:00 GMT [RP]
+ * # Blocks-10.0.0.txt
+ * # Date: 2017-04-12, 17:30:00 GMT [KW]
  * UnicodeData.txt does not have a header.
  */
 
@@ -19,6 +19,7 @@
 
 #define B       USE_B   /* BASE */
 #define CGJ     USE_CGJ /* CGJ */
+#define CS      USE_CS  /* CONS_WITH_STACKER */
 #define FM      USE_FM  /* CONS_FINAL_MOD */
 #define GB      USE_GB  /* BASE_OTHER */
 #define H       USE_H   /* HALANT */
@@ -97,7 +98,7 @@
   /* 09C0 */  VPst,  VBlw,  VBlw,  VBlw,  VBlw,     O,     O,  VPre,  VPre,     O,     O,  VPre,  VPre,     H,   IND,     O,
   /* 09D0 */     O,     O,     O,     O,     O,     O,     O,  VPst,     O,     O,     O,     O,     B,     B,     O,     B,
   /* 09E0 */     B,     B,  VBlw,  VBlw,     O,     O,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,
-  /* 09F0 */     B,     B,     O,     O,     O,     O,     O,     O,     O,     O,     O,     O,     O,     O,     O,     O,
+  /* 09F0 */     B,     B,     O,     O,     O,     O,     O,     O,     O,     O,     O,     O,     B,     O,     O,     O,
 
   /* Gurmukhi */
 
@@ -119,7 +120,7 @@
   /* 0AC0 */  VPst,  VBlw,  VBlw,  VBlw,  VBlw,  VAbv,     O,  VAbv,  VAbv,  VAbv,     O,  VPst,  VPst,     H,     O,     O,
   /* 0AD0 */     O,     O,     O,     O,     O,     O,     O,     O,     O,     O,     O,     O,     O,     O,     O,     O,
   /* 0AE0 */     B,     B,  VBlw,  VBlw,     O,     O,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,
-  /* 0AF0 */     O,     O,     O,     O,     O,     O,     O,     O,     O,     B,     O,     O,     O,     O,     O,     O,
+  /* 0AF0 */     O,     O,     O,     O,     O,     O,     O,     O,     O,     B, VMAbv, VMAbv, VMAbv, CMAbv, CMAbv, CMAbv,
 
   /* Oriya */
 
@@ -163,14 +164,14 @@
   /* 0CC0 */  VAbv,  VPst,  VPst,  VPst,  VPst,     O,  VAbv,  VAbv,  VAbv,     O,  VAbv,  VAbv,  VAbv,     H,     O,     O,
   /* 0CD0 */     O,     O,     O,     O,     O,  VPst,  VPst,     O,     O,     O,     O,     O,     O,     O,     B,     O,
   /* 0CE0 */     B,     B,  VBlw,  VBlw,     O,     O,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,
-  /* 0CF0 */     O,     R,     R,     O,     O,     O,     O,     O,     O,     O,     O,     O,     O,     O,     O,     O,
+  /* 0CF0 */     O,    CS,    CS,     O,     O,     O,     O,     O,     O,     O,     O,     O,     O,     O,     O,     O,
 
   /* Malayalam */
 
-  /* 0D00 */     O, VMAbv, VMPst, VMPst,     O,     B,     B,     B,     B,     B,     B,     B,     B,     O,     B,     B,
+  /* 0D00 */ VMAbv, VMAbv, VMPst, VMPst,     O,     B,     B,     B,     B,     B,     B,     B,     B,     O,     B,     B,
   /* 0D10 */     B,     O,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,
   /* 0D20 */     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,
-  /* 0D30 */     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     O,     O,     B,  VPst,  VPst,
+  /* 0D30 */     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,  VAbv,  VAbv,     B,  VPst,  VPst,
   /* 0D40 */  VPst,  VPst,  VPst,  VBlw,  VBlw,     O,  VPre,  VPre,  VPre,     O,  VPre,  VPre,  VPre,     H,     R,     O,
   /* 0D50 */     O,     O,     O,     O,   IND,   IND,   IND,  VPst,     O,     O,     O,     O,     O,     O,     O,     B,
   /* 0D60 */     B,     B,  VBlw,  VBlw,     O,     O,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,
@@ -274,9 +275,9 @@
   /* 1A20 */     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,
   /* 1A30 */     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,
   /* 1A40 */     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,
-  /* 1A50 */     B,     B,     B,     B,     B,  MPre,  MBlw,  FPst,  FAbv,  FAbv,  FAbv,  FBlw,  FBlw,  FBlw,  FBlw,     O,
+  /* 1A50 */     B,     B,     B,     B,     B,  MPre,  MBlw,   SUB,  FAbv,  FAbv,  FAbv,   SUB,   SUB,   SUB,   SUB,     O,
   /* 1A60 */     H,  VPst,  VAbv,  VPst,  VPst,  VAbv,  VAbv,  VAbv,  VAbv,  VBlw,  VBlw,  VAbv,  VBlw,  VPst,  VPre,  VPre,
-  /* 1A70 */  VPre,  VPre,  VPre,  VAbv,  VAbv, VMAbv, VMAbv, VMAbv, VMAbv, VMAbv,    FM,    FM,    FM,     O,     O,    FM,
+  /* 1A70 */  VPre,  VPre,  VPre,  VAbv, VMAbv, VMAbv, VMAbv, VMAbv, VMAbv, VMAbv,  VAbv,    FM,    FM,     O,     O,  FBlw,
   /* 1A80 */     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     O,     O,     O,     O,     O,     O,
   /* 1A90 */     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     O,     O,     O,     O,     O,     O,
 
@@ -323,7 +324,7 @@
 
   /* 1CD0 */ VMAbv, VMAbv, VMAbv,     O, VMBlw, VMBlw, VMBlw, VMBlw, VMBlw, VMBlw, VMAbv, VMAbv, VMBlw, VMBlw, VMBlw, VMBlw,
   /* 1CE0 */ VMAbv, VMPst, VMBlw, VMBlw, VMBlw, VMBlw, VMBlw, VMBlw, VMBlw,     O,     O,     O,     O, VMBlw,     O,     O,
-  /* 1CF0 */     O,     O, VMPst, VMPst, VMAbv,     O,     O,     O, VMAbv, VMAbv,     O,     O,     O,     O,     O,     O,
+  /* 1CF0 */     O,     O, VMPst, VMPst, VMAbv,     O,     O, VMPst, VMAbv, VMAbv,     O,     O,     O,     O,     O,     O,
 
 #define use_offset_0x1df8u 2552
 
@@ -376,7 +377,7 @@
   /* Devanagari Extended */
 
   /* A8E0 */ VMAbv, VMAbv, VMAbv, VMAbv, VMAbv, VMAbv, VMAbv, VMAbv, VMAbv, VMAbv, VMAbv, VMAbv, VMAbv, VMAbv, VMAbv, VMAbv,
-  /* A8F0 */ VMAbv, VMAbv,     O,     O,     O,     O,     O,     O,     O,     O,     O,     O,     O,     O,     O,     O,
+  /* A8F0 */ VMAbv, VMAbv,     B,     B,     O,     O,     O,     O,     O,     O,     O,     O,     O,     O,     O,     O,
 
   /* Kayah Li */
 
@@ -397,7 +398,7 @@
   /* A980 */ VMAbv, VMAbv,  FAbv, VMPst,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,
   /* A990 */     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,
   /* A9A0 */     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,
-  /* A9B0 */     B,     B,     B, CMAbv,  VPst,  VPst,  VAbv,  VAbv,  VBlw,  VBlw,  VPre,  VPre,  VAbv,   SUB,  MPst,  MPst,
+  /* A9B0 */     B,     B,     B, CMAbv,  VPst,  VPst,  VAbv,  VAbv,  VBlw,  VBlw,  VPre,  VPre,  VAbv,   SUB,  MPst,  MBlw,
   /* A9C0 */     H,     O,     O,     O,     O,     O,     O,     O,     O,     O,     O,     O,     O,     O,     O,     O,
   /* A9D0 */     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     O,     O,     O,     O,     O,     O,
 
@@ -410,7 +411,7 @@
 
   /* AA00 */     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,
   /* AA10 */     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,
-  /* AA20 */     B,     B,     B,     B,     B,     B,     B,     B,     B,  VAbv,  VAbv,  VAbv,  VAbv,  VBlw,  VAbv,  VPre,
+  /* AA20 */     B,     B,     B,     B,     B,     B,     B,     B,     B, VMAbv,  VAbv,  VAbv,  VAbv,  VBlw,  VAbv,  VPre,
   /* AA30 */  VPre,  VAbv,  VBlw,  MPst,  MPre,  MBlw,  MBlw,     O,     O,     O,     O,     O,     O,     O,     O,     O,
   /* AA40 */     B,     B,     B,  FAbv,     B,     B,     B,     B,     B,     B,     B,     B,  FAbv,  FPst,     O,     O,
   /* AA50 */     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     O,     O,     O,     O,     O,     O,
@@ -467,7 +468,7 @@
 
   /* Brahmi */
 
-  /* 11000 */ VMPst, VMAbv, VMPst,     R,     R,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,
+  /* 11000 */ VMPst, VMAbv, VMPst,    CS,    CS,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,
   /* 11010 */     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,
   /* 11020 */     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,
   /* 11030 */     B,     B,     B,     B,     B,     B,     B,     B,  VAbv,  VAbv,  VAbv,  VAbv,  VBlw,  VBlw,  VBlw,  VBlw,
@@ -545,7 +546,7 @@
   /* 11320 */     B,     B,     B,     B,     B,     B,     B,     B,     B,     O,     B,     B,     B,     B,     B,     B,
   /* 11330 */     B,     O,     B,     B,     O,     B,     B,     B,     B,     B,     O,     O, CMBlw,     B,  VPst,  VPst,
   /* 11340 */  VAbv,  VPst,  VPst,  VPst,  VPst,     O,     O,  VPre,  VPre,     O,     O,  VPre,  VPre,     H,     O,     O,
-  /* 11350 */     O,     O,     O,     O,     O,     O,     O,  VPst,     O,     O,     O,     O,     O,     O,     O,     O,
+  /* 11350 */     O,     O,     O,     O,     O,     O,     O,  VPst,     O,     O,     O,     O,     O,     O,     B,     B,
   /* 11360 */     B,     B,  VPst,  VPst,     O,     O, VMAbv, VMAbv, VMAbv, VMAbv, VMAbv, VMAbv, VMAbv,     O,     O,     O,
   /* 11370 */ VMAbv, VMAbv, VMAbv, VMAbv, VMAbv,     O,     O,     O,
 
@@ -615,7 +616,26 @@
   /* 11720 */  VPst,  VPst,  VAbv,  VAbv,  VBlw,  VBlw,  VPre,  VAbv,  VBlw,  VAbv,  VAbv,  VAbv,     O,     O,     O,     O,
   /* 11730 */     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     O,     O,     O,     O,
 
-#define use_offset_0x11c00u 4960
+#define use_offset_0x11a00u 4960
+
+
+  /* Zanabazar Square */
+
+  /* 11A00 */     B,  VAbv,  VBlw,  VBlw,  VAbv,  VAbv,  VAbv,  VAbv,  VAbv,  VAbv,  VBlw,     B,     B,     B,     B,     B,
+  /* 11A10 */     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,
+  /* 11A20 */     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,
+  /* 11A30 */     B,     B,     B,    FM,  VBlw, VMAbv, VMAbv, VMAbv, VMAbv, VMPst,     R,  MBlw,  MBlw,  MBlw,  MBlw,    GB,
+  /* 11A40 */     O,     O,     O,     O,     O,    GB,     O,     H,     O,     O,     O,     O,     O,     O,     O,     O,
+
+  /* Soyombo */
+
+  /* 11A50 */     B,  VAbv,  VBlw,  VBlw,  VAbv,  VAbv,  VAbv,  VPst,  VPst,  VBlw,  VBlw,  VBlw,     B,     B,     B,     B,
+  /* 11A60 */     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,
+  /* 11A70 */     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,
+  /* 11A80 */     B,     B,     B,     B,     O,     O,     R,     R,     R,     R,  FBlw,  FBlw,  FBlw,  FBlw,  FBlw,  FBlw,
+  /* 11A90 */  FBlw,  FBlw,  FBlw,  FBlw,  FBlw,  FBlw, VMAbv, VMPst, CMAbv,     H,     O,     O,     O,     O,     O,     O,
+
+#define use_offset_0x11c00u 5120
 
 
   /* Bhaiksuki */
@@ -636,7 +656,19 @@
   /* 11CA0 */   SUB,   SUB,   SUB,   SUB,   SUB,   SUB,   SUB,   SUB,     O,   SUB,   SUB,   SUB,   SUB,   SUB,   SUB,   SUB,
   /* 11CB0 */  VBlw,  VPre,  VBlw,  VAbv,  VPst, VMAbv, VMAbv,     O,
 
-}; /* Table items: 5144; occupancy: 72% */
+#define use_offset_0x11d00u 5304
+
+
+  /* Masaram Gondi */
+
+  /* 11D00 */     B,     B,     B,     B,     B,     B,     B,     O,     B,     B,     O,     B,     B,     B,     B,     B,
+  /* 11D10 */     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,
+  /* 11D20 */     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,
+  /* 11D30 */     B,  VAbv,  VAbv,  VAbv,  VAbv,  VAbv,  VBlw,     O,     O,     O,  VAbv,     O,  VAbv,  VAbv,     O,  VAbv,
+  /* 11D40 */ VMAbv, VMAbv, CMBlw,  VAbv,  VBlw,     H,     R,  MBlw,     O,     O,     O,     O,     O,     O,     O,     O,
+  /* 11D50 */     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     O,     O,     O,     O,     O,     O,
+
+}; /* Table items: 5400; occupancy: 73% */
 
 USE_TABLE_ELEMENT_TYPE
 hb_use_get_categories (hb_codepoint_t u)
@@ -644,47 +676,49 @@
   switch (u >> 12)
   {
     case 0x0u:
-      if (hb_in_range (u, 0x0028u, 0x003Fu)) return use_table[u - 0x0028u + use_offset_0x0028u];
-      if (hb_in_range (u, 0x00A0u, 0x00D7u)) return use_table[u - 0x00A0u + use_offset_0x00a0u];
-      if (hb_in_range (u, 0x0900u, 0x0DF7u)) return use_table[u - 0x0900u + use_offset_0x0900u];
+      if (hb_in_range<hb_codepoint_t> (u, 0x0028u, 0x003Fu)) return use_table[u - 0x0028u + use_offset_0x0028u];
+      if (hb_in_range<hb_codepoint_t> (u, 0x00A0u, 0x00D7u)) return use_table[u - 0x00A0u + use_offset_0x00a0u];
+      if (hb_in_range<hb_codepoint_t> (u, 0x0900u, 0x0DF7u)) return use_table[u - 0x0900u + use_offset_0x0900u];
       if (unlikely (u == 0x034Fu)) return CGJ;
       break;
 
     case 0x1u:
-      if (hb_in_range (u, 0x1000u, 0x109Fu)) return use_table[u - 0x1000u + use_offset_0x1000u];
-      if (hb_in_range (u, 0x1700u, 0x17EFu)) return use_table[u - 0x1700u + use_offset_0x1700u];
-      if (hb_in_range (u, 0x1900u, 0x1A9Fu)) return use_table[u - 0x1900u + use_offset_0x1900u];
-      if (hb_in_range (u, 0x1B00u, 0x1C4Fu)) return use_table[u - 0x1B00u + use_offset_0x1b00u];
-      if (hb_in_range (u, 0x1CD0u, 0x1CFFu)) return use_table[u - 0x1CD0u + use_offset_0x1cd0u];
-      if (hb_in_range (u, 0x1DF8u, 0x1DFFu)) return use_table[u - 0x1DF8u + use_offset_0x1df8u];
+      if (hb_in_range<hb_codepoint_t> (u, 0x1000u, 0x109Fu)) return use_table[u - 0x1000u + use_offset_0x1000u];
+      if (hb_in_range<hb_codepoint_t> (u, 0x1700u, 0x17EFu)) return use_table[u - 0x1700u + use_offset_0x1700u];
+      if (hb_in_range<hb_codepoint_t> (u, 0x1900u, 0x1A9Fu)) return use_table[u - 0x1900u + use_offset_0x1900u];
+      if (hb_in_range<hb_codepoint_t> (u, 0x1B00u, 0x1C4Fu)) return use_table[u - 0x1B00u + use_offset_0x1b00u];
+      if (hb_in_range<hb_codepoint_t> (u, 0x1CD0u, 0x1CFFu)) return use_table[u - 0x1CD0u + use_offset_0x1cd0u];
+      if (hb_in_range<hb_codepoint_t> (u, 0x1DF8u, 0x1DFFu)) return use_table[u - 0x1DF8u + use_offset_0x1df8u];
       break;
 
     case 0x2u:
-      if (hb_in_range (u, 0x2008u, 0x2017u)) return use_table[u - 0x2008u + use_offset_0x2008u];
-      if (hb_in_range (u, 0x2060u, 0x2087u)) return use_table[u - 0x2060u + use_offset_0x2060u];
+      if (hb_in_range<hb_codepoint_t> (u, 0x2008u, 0x2017u)) return use_table[u - 0x2008u + use_offset_0x2008u];
+      if (hb_in_range<hb_codepoint_t> (u, 0x2060u, 0x2087u)) return use_table[u - 0x2060u + use_offset_0x2060u];
       if (unlikely (u == 0x25CCu)) return GB;
       break;
 
     case 0xAu:
-      if (hb_in_range (u, 0xA800u, 0xAAF7u)) return use_table[u - 0xA800u + use_offset_0xa800u];
-      if (hb_in_range (u, 0xABC0u, 0xABFFu)) return use_table[u - 0xABC0u + use_offset_0xabc0u];
+      if (hb_in_range<hb_codepoint_t> (u, 0xA800u, 0xAAF7u)) return use_table[u - 0xA800u + use_offset_0xa800u];
+      if (hb_in_range<hb_codepoint_t> (u, 0xABC0u, 0xABFFu)) return use_table[u - 0xABC0u + use_offset_0xabc0u];
       break;
 
     case 0xFu:
-      if (hb_in_range (u, 0xFE00u, 0xFE0Fu)) return use_table[u - 0xFE00u + use_offset_0xfe00u];
+      if (hb_in_range<hb_codepoint_t> (u, 0xFE00u, 0xFE0Fu)) return use_table[u - 0xFE00u + use_offset_0xfe00u];
       break;
 
     case 0x10u:
-      if (hb_in_range (u, 0x10A00u, 0x10A47u)) return use_table[u - 0x10A00u + use_offset_0x10a00u];
+      if (hb_in_range<hb_codepoint_t> (u, 0x10A00u, 0x10A47u)) return use_table[u - 0x10A00u + use_offset_0x10a00u];
       break;
 
     case 0x11u:
-      if (hb_in_range (u, 0x11000u, 0x110BFu)) return use_table[u - 0x11000u + use_offset_0x11000u];
-      if (hb_in_range (u, 0x11100u, 0x1123Fu)) return use_table[u - 0x11100u + use_offset_0x11100u];
-      if (hb_in_range (u, 0x11280u, 0x11377u)) return use_table[u - 0x11280u + use_offset_0x11280u];
-      if (hb_in_range (u, 0x11400u, 0x114DFu)) return use_table[u - 0x11400u + use_offset_0x11400u];
-      if (hb_in_range (u, 0x11580u, 0x1173Fu)) return use_table[u - 0x11580u + use_offset_0x11580u];
-      if (hb_in_range (u, 0x11C00u, 0x11CB7u)) return use_table[u - 0x11C00u + use_offset_0x11c00u];
+      if (hb_in_range<hb_codepoint_t> (u, 0x11000u, 0x110BFu)) return use_table[u - 0x11000u + use_offset_0x11000u];
+      if (hb_in_range<hb_codepoint_t> (u, 0x11100u, 0x1123Fu)) return use_table[u - 0x11100u + use_offset_0x11100u];
+      if (hb_in_range<hb_codepoint_t> (u, 0x11280u, 0x11377u)) return use_table[u - 0x11280u + use_offset_0x11280u];
+      if (hb_in_range<hb_codepoint_t> (u, 0x11400u, 0x114DFu)) return use_table[u - 0x11400u + use_offset_0x11400u];
+      if (hb_in_range<hb_codepoint_t> (u, 0x11580u, 0x1173Fu)) return use_table[u - 0x11580u + use_offset_0x11580u];
+      if (hb_in_range<hb_codepoint_t> (u, 0x11A00u, 0x11A9Fu)) return use_table[u - 0x11A00u + use_offset_0x11a00u];
+      if (hb_in_range<hb_codepoint_t> (u, 0x11C00u, 0x11CB7u)) return use_table[u - 0x11C00u + use_offset_0x11c00u];
+      if (hb_in_range<hb_codepoint_t> (u, 0x11D00u, 0x11D5Fu)) return use_table[u - 0x11D00u + use_offset_0x11d00u];
       if (unlikely (u == 0x1107Fu)) return HN;
       break;
 
@@ -696,6 +730,7 @@
 
 #undef B
 #undef CGJ
+#undef CS
 #undef FM
 #undef GB
 #undef H
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-use.cc	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-use.cc	Wed Dec 13 10:25:38 2017 -0800
@@ -144,7 +144,7 @@
   /* "Topographical features" */
   for (unsigned int i = 0; i < ARRAY_LENGTH (arabic_features); i++)
     map->add_feature (arabic_features[i], 1, F_NONE);
-  map->add_gsub_pause (NULL);
+  map->add_gsub_pause (nullptr);
 
   /* "Standard typographic presentation" and "Positional feature application" */
   for (unsigned int i = 0; i < ARRAY_LENGTH (other_features); i++)
@@ -199,7 +199,7 @@
 {
   use_shape_plan_t *use_plan = (use_shape_plan_t *) calloc (1, sizeof (use_shape_plan_t));
   if (unlikely (!use_plan))
-    return NULL;
+    return nullptr;
 
   use_plan->rphf_mask = plan->map.get_1_mask (HB_TAG('r','p','h','f'));
 
@@ -209,7 +209,7 @@
     if (unlikely (!use_plan->arabic_plan))
     {
       free (use_plan);
-      return NULL;
+      return nullptr;
     }
   }
 
@@ -292,7 +292,7 @@
   if (use_plan->arabic_plan)
     return;
 
-  ASSERT_STATIC (INIT < 4 && ISOL < 4 && MEDI < 4 && FINA < 4);
+  static_assert ((INIT < 4 && ISOL < 4 && MEDI < 4 && FINA < 4), "");
   hb_mask_t masks[4], all_masks = 0;
   for (unsigned int i = 0; i < 4; i++)
   {
@@ -354,6 +354,8 @@
                  hb_buffer_t *buffer)
 {
   find_syllables (buffer);
+  foreach_syllable (buffer, start, end)
+    buffer->unsafe_to_break (start, end);
   setup_rphf_mask (plan, buffer);
   setup_topographical_masks (plan, buffer);
 }
@@ -422,7 +424,7 @@
 {
   syllable_type_t syllable_type = (syllable_type_t) (buffer->info[start].syllable() & 0x0F);
   /* Only a few syllable types need reordering. */
-  if (unlikely (!(FLAG_SAFE (syllable_type) &
+  if (unlikely (!(FLAG_UNSAFE (syllable_type) &
                   (FLAG (virama_terminated_cluster) |
                    FLAG (standard_cluster) |
                    FLAG (broken_cluster) |
@@ -572,28 +574,6 @@
      */
     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);
@@ -615,18 +595,18 @@
 
 const hb_ot_complex_shaper_t _hb_ot_complex_shaper_use =
 {
-  "use",
   collect_features_use,
-  NULL, /* override_features */
+  nullptr, /* override_features */
   data_create_use,
   data_destroy_use,
-  NULL, /* preprocess_text */
-  NULL, /* postprocess_glyphs */
+  nullptr, /* preprocess_text */
+  nullptr, /* postprocess_glyphs */
   HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_DIACRITICS_NO_SHORT_CIRCUIT,
   decompose_use,
   compose_use,
   setup_masks_use,
-  NULL, /* disable_otl */
+  nullptr, /* disable_otl */
+  nullptr, /* reorder_marks */
   HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_EARLY,
   false, /* fallback_position */
 };
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-fallback.cc	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-fallback.cc	Wed Dec 13 10:25:38 2017 -0800
@@ -210,7 +210,7 @@
   pos.x_offset = pos.y_offset = 0;
 
 
-  /* We dont position LEFT and RIGHT marks. */
+  /* We don't position LEFT and RIGHT marks. */
 
   /* X positioning */
   switch (combining_class)
@@ -307,6 +307,9 @@
                       unsigned int end)
 {
   hb_direction_t horiz_dir = HB_DIRECTION_INVALID;
+
+  buffer->unsafe_to_break (base, end);
+
   hb_glyph_extents_t base_extents;
   if (!font->get_glyph_extents (buffer->info[base].codepoint,
                                 &base_extents))
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-normalize.cc	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-normalize.cc	Wed Dec 13 10:25:38 2017 -0800
@@ -91,7 +91,7 @@
 static inline void
 set_glyph (hb_glyph_info_t &info, hb_font_t *font)
 {
-  font->get_nominal_glyph (info.codepoint, &info.glyph_index());
+  (void) font->get_nominal_glyph (info.codepoint, &info.glyph_index());
 }
 
 static inline void
@@ -345,14 +345,18 @@
       if (_hb_glyph_info_get_modified_combining_class (&buffer->info[end]) == 0)
         break;
 
-    /* We are going to do a O(n^2).  Only do this if the sequence is short. */
-    if (end - i > 10) {
+    /* We are going to do a O(n^2).  Only do this if the sequence is short,
+     * but not too short ;). */
+    if (end - i < 2 || end - i > HB_OT_SHAPE_COMPLEX_MAX_COMBINING_MARKS) {
       i = end;
       continue;
     }
 
     buffer->sort (i, end, compare_combining_class);
 
+    if (plan->shaper->reorder_marks)
+      plan->shaper->reorder_marks (plan, buffer, i, end);
+
     i = end;
   }
 
@@ -369,46 +373,58 @@
   buffer->clear_output ();
   count = buffer->len;
   unsigned int starter = 0;
+  bool combine = true;
   buffer->next_glyph ();
   while (buffer->idx < count && !buffer->in_error)
   {
     hb_codepoint_t composed, glyph;
-    if (/* We don't try to compose a non-mark character with it's preceding starter.
+    if (combine &&
+        /* We don't try to compose a non-mark character with it's preceding starter.
          * This is both an optimization to avoid trying to compose every two neighboring
          * glyphs in most scripts AND a desired feature for Hangul.  Apparently Hangul
          * fonts are not designed to mix-and-match pre-composed syllables and Jamo. */
-        HB_UNICODE_GENERAL_CATEGORY_IS_MARK (_hb_glyph_info_get_general_category (&buffer->cur())) &&
-        /* If there's anything between the starter and this char, they should have CCC
-         * smaller than this character's. */
-        (starter == buffer->out_len - 1 ||
-         _hb_glyph_info_get_modified_combining_class (&buffer->prev()) < _hb_glyph_info_get_modified_combining_class (&buffer->cur())) &&
-        /* And compose. */
-        c.compose (&c,
-                   buffer->out_info[starter].codepoint,
-                   buffer->cur().codepoint,
-                   &composed) &&
-        /* And the font has glyph for the composite. */
-        font->get_nominal_glyph (composed, &glyph))
+        HB_UNICODE_GENERAL_CATEGORY_IS_MARK (_hb_glyph_info_get_general_category (&buffer->cur())))
     {
-      /* Composes. */
-      buffer->next_glyph (); /* Copy to out-buffer. */
-      if (unlikely (buffer->in_error))
-        return;
-      buffer->merge_out_clusters (starter, buffer->out_len);
-      buffer->out_len--; /* Remove the second composable. */
-      /* Modify starter and carry on. */
-      buffer->out_info[starter].codepoint = composed;
-      buffer->out_info[starter].glyph_index() = glyph;
-      _hb_glyph_info_set_unicode_props (&buffer->out_info[starter], buffer);
+      if (/* If there's anything between the starter and this char, they should have CCC
+           * smaller than this character's. */
+          (starter == buffer->out_len - 1 ||
+           info_cc (buffer->prev()) < info_cc (buffer->cur())) &&
+          /* And compose. */
+          c.compose (&c,
+                     buffer->out_info[starter].codepoint,
+                     buffer->cur().codepoint,
+                     &composed) &&
+          /* And the font has glyph for the composite. */
+          font->get_nominal_glyph (composed, &glyph))
+      {
+        /* Composes. */
+        buffer->next_glyph (); /* Copy to out-buffer. */
+        if (unlikely (buffer->in_error))
+          return;
+        buffer->merge_out_clusters (starter, buffer->out_len);
+        buffer->out_len--; /* Remove the second composable. */
+        /* Modify starter and carry on. */
+        buffer->out_info[starter].codepoint = composed;
+        buffer->out_info[starter].glyph_index() = glyph;
+        _hb_glyph_info_set_unicode_props (&buffer->out_info[starter], buffer);
 
-      continue;
+        continue;
+      }
+      else if (/* We sometimes custom-tailor the sorted order of marks. In that case, stop
+                * trying to combine as soon as combining-class drops. */
+               starter < buffer->out_len - 1 &&
+               info_cc (buffer->prev()) > info_cc (buffer->cur()))
+        combine = false;
     }
 
     /* Blocked, or doesn't compose. */
     buffer->next_glyph ();
 
-    if (_hb_glyph_info_get_modified_combining_class (&buffer->prev()) == 0)
+    if (info_cc (buffer->prev()) == 0)
+    {
       starter = buffer->out_len - 1;
+      combine = true;
+    }
   }
   buffer->swap_buffers ();
 
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-private.hh	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-private.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -73,7 +73,7 @@
   hb_ot_shape_planner_t (const hb_shape_plan_t *master_plan) :
                          face (master_plan->face_unsafe),
                          props (master_plan->props),
-                         shaper (NULL),
+                         shaper (nullptr),
                          map (face, &props) {}
   ~hb_ot_shape_planner_t (void) { map.finish (); }
 
@@ -99,7 +99,9 @@
   }
 
   private:
-  NO_COPY (hb_ot_shape_planner_t);
+  /* No copy. */
+  hb_ot_shape_planner_t (const hb_ot_shape_planner_t &);
+  hb_ot_shape_planner_t &operator = (const hb_ot_shape_planner_t &);
 };
 
 
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape.cc	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape.cc	Wed Dec 13 10:25:38 2017 -0800
@@ -70,7 +70,7 @@
   hb_ot_map_builder_t *map = &planner->map;
 
   map->add_global_bool_feature (HB_TAG('r','v','r','n'));
-  map->add_gsub_pause (NULL);
+  map->add_gsub_pause (nullptr);
 
   switch (props->direction) {
     case HB_DIRECTION_LTR:
@@ -128,6 +128,8 @@
  * shaper face data
  */
 
+HB_SHAPER_DATA_ENSURE_DEFINE(ot, face)
+
 hb_ot_shaper_face_data_t *
 _hb_ot_shaper_face_data_create (hb_face_t *face)
 {
@@ -145,6 +147,8 @@
  * shaper font data
  */
 
+HB_SHAPER_DATA_ENSURE_DEFINE(ot, font)
+
 struct hb_ot_shaper_font_data_t {};
 
 hb_ot_shaper_font_data_t *
@@ -172,7 +176,7 @@
 {
   hb_ot_shape_plan_t *plan = (hb_ot_shape_plan_t *) calloc (1, sizeof (hb_ot_shape_plan_t));
   if (unlikely (!plan))
-    return NULL;
+    return nullptr;
 
   hb_ot_shape_planner_t planner (shape_plan);
 
@@ -186,7 +190,7 @@
   if (plan->shaper->data_create) {
     plan->data = plan->shaper->data_create (plan);
     if (unlikely (!plan->data))
-      return NULL;
+      return nullptr;
   }
 
   return plan;
@@ -271,8 +275,7 @@
 static void
 hb_form_clusters (hb_buffer_t *buffer)
 {
-  if (!(buffer->scratch_flags & HB_BUFFER_SCRATCH_FLAG_HAS_NON_ASCII) ||
-      buffer->cluster_level != HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES)
+  if (!(buffer->scratch_flags & HB_BUFFER_SCRATCH_FLAG_HAS_NON_ASCII))
     return;
 
   /* Loop duplicated in hb_ensure_native_direction(), and in _hb-coretext.cc */
@@ -284,11 +287,17 @@
     if (likely (!HB_UNICODE_GENERAL_CATEGORY_IS_MARK (_hb_glyph_info_get_general_category (&info[i])) &&
                 !_hb_glyph_info_is_joiner (&info[i])))
     {
-      buffer->merge_clusters (base, i);
+      if (buffer->cluster_level == HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES)
+        buffer->merge_clusters (base, i);
+      else
+        buffer->unsafe_to_break (base, i);
       base = i;
     }
   }
-  buffer->merge_clusters (base, count);
+  if (buffer->cluster_level == HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES)
+    buffer->merge_clusters (base, count);
+  else
+    buffer->unsafe_to_break (base, count);
 }
 
 static void
@@ -362,7 +371,18 @@
 
   hb_buffer_t *buffer = c->buffer;
 
-  /* TODO look in pre/post context text also. */
+  hb_mask_t pre_mask, post_mask;
+  if (HB_DIRECTION_IS_FORWARD (buffer->props.direction))
+  {
+    pre_mask = c->plan->numr_mask | c->plan->frac_mask;
+    post_mask = c->plan->frac_mask | c->plan->dnom_mask;
+  }
+  else
+  {
+    pre_mask = c->plan->frac_mask | c->plan->dnom_mask;
+    post_mask = c->plan->numr_mask | c->plan->frac_mask;
+  }
+
   unsigned int count = buffer->len;
   hb_glyph_info_t *info = buffer->info;
   for (unsigned int i = 0; i < count; i++)
@@ -379,11 +399,13 @@
              HB_UNICODE_GENERAL_CATEGORY_DECIMAL_NUMBER)
         end++;
 
+      buffer->unsafe_to_break (start, end);
+
       for (unsigned int j = start; j < i; j++)
-        info[j].mask |= c->plan->numr_mask | c->plan->frac_mask;
+        info[j].mask |= pre_mask;
       info[i].mask |= c->plan->frac_mask;
       for (unsigned int j = i + 1; j < end; j++)
-        info[j].mask |= c->plan->frac_mask | c->plan->dnom_mask;
+        info[j].mask |= post_mask;
 
       i = end - 1;
     }
@@ -494,9 +516,10 @@
           /* Merge cluster backward. */
           if (cluster < info[j - 1].cluster)
           {
+            unsigned int mask = info[i].mask;
             unsigned int old_cluster = info[j - 1].cluster;
             for (unsigned k = j; k && info[k - 1].cluster == old_cluster; k--)
-              info[k - 1].cluster = cluster;
+              buffer->set_cluster (info[k - 1], cluster, mask);
           }
           continue;
         }
@@ -562,8 +585,6 @@
 {
   hb_buffer_t *buffer = c->buffer;
 
-  hb_ot_shape_initialize_masks (c);
-
   hb_ot_mirror_chars (c);
 
   HB_BUFFER_ALLOCATE_VAR (buffer, glyph_index);
@@ -672,9 +693,9 @@
 static inline void
 hb_ot_position_complex (hb_ot_shape_context_t *c)
 {
-  hb_ot_layout_position_start (c->font, c->buffer);
-
   unsigned int count = c->buffer->len;
+  hb_glyph_info_t *info = c->buffer->info;
+  hb_glyph_position_t *pos = c->buffer->pos;
 
   /* If the font has no GPOS, AND, no fallback positioning will
    * happen, AND, direction is forward, then when zeroing mark
@@ -689,6 +710,17 @@
                                      !c->plan->shaper->fallback_position &&
                                      HB_DIRECTION_IS_FORWARD (c->buffer->props.direction);
 
+  /* We change glyph origin to what GPOS expects (horizontal), apply GPOS, change it back. */
+
+  /* The nil glyph_h_origin() func returns 0, so no need to apply it. */
+  if (c->font->has_glyph_h_origin_func ())
+    for (unsigned int i = 0; i < count; i++)
+      c->font->add_glyph_h_origin (info[i].codepoint,
+                                   &pos[i].x_offset,
+                                   &pos[i].y_offset);
+
+  hb_ot_layout_position_start (c->font, c->buffer);
+
   switch (c->plan->shaper->zero_width_marks)
   {
     case HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_EARLY:
@@ -702,30 +734,8 @@
   }
 
   if (likely (!c->fallback_positioning))
-  {
-    hb_glyph_info_t *info = c->buffer->info;
-    hb_glyph_position_t *pos = c->buffer->pos;
-
-    /* Change glyph origin to what GPOS expects (horizontal), apply GPOS, change it back. */
-
-    /* The nil glyph_h_origin() func returns 0, so no need to apply it. */
-    if (c->font->has_glyph_h_origin_func ())
-      for (unsigned int i = 0; i < count; i++)
-        c->font->add_glyph_h_origin (info[i].codepoint,
-                                     &pos[i].x_offset,
-                                     &pos[i].y_offset);
-
     c->plan->position (c->font, c->buffer);
 
-    /* The nil glyph_h_origin() func returns 0, so no need to apply it. */
-    if (c->font->has_glyph_h_origin_func ())
-      for (unsigned int i = 0; i < count; i++)
-        c->font->subtract_glyph_h_origin (info[i].codepoint,
-                                          &pos[i].x_offset,
-                                          &pos[i].y_offset);
-
-  }
-
   switch (c->plan->shaper->zero_width_marks)
   {
     case HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE:
@@ -742,6 +752,13 @@
   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);
+
+  /* The nil glyph_h_origin() func returns 0, so no need to apply it. */
+  if (c->font->has_glyph_h_origin_func ())
+    for (unsigned int i = 0; i < count; i++)
+      c->font->subtract_glyph_h_origin (info[i].codepoint,
+                                        &pos[i].x_offset,
+                                        &pos[i].y_offset);
 }
 
 static inline void
@@ -767,6 +784,31 @@
   _hb_buffer_deallocate_gsubgpos_vars (c->buffer);
 }
 
+static inline void
+hb_propagate_flags (hb_buffer_t *buffer)
+{
+  /* Propagate cluster-level glyph flags to be the same on all cluster glyphs.
+   * Simplifies using them. */
+
+  if (!(buffer->scratch_flags & HB_BUFFER_SCRATCH_FLAG_HAS_UNSAFE_TO_BREAK))
+    return;
+
+  hb_glyph_info_t *info = buffer->info;
+
+  foreach_cluster (buffer, start, end)
+  {
+    unsigned int mask = 0;
+    for (unsigned int i = start; i < end; i++)
+      if (info[i].mask & HB_GLYPH_FLAG_UNSAFE_TO_BREAK)
+      {
+         mask = HB_GLYPH_FLAG_UNSAFE_TO_BREAK;
+         break;
+      }
+    if (mask)
+      for (unsigned int i = start; i < end; i++)
+        info[i].mask |= mask;
+  }
+}
 
 /* Pull it all together! */
 
@@ -793,8 +835,10 @@
 
   c->buffer->clear_output ();
 
+  hb_ot_shape_initialize_masks (c);
   hb_set_unicode_props (c->buffer);
   hb_insert_dotted_circle (c->buffer, c->font);
+
   hb_form_clusters (c->buffer);
 
   hb_ensure_native_direction (c->buffer);
@@ -810,6 +854,8 @@
   if (c->plan->shaper->postprocess_glyphs)
     c->plan->shaper->postprocess_glyphs (c->plan, c->buffer, c->font);
 
+  hb_propagate_flags (c->buffer);
+
   _hb_buffer_deallocate_unicode_vars (c->buffer);
 
   c->buffer->props.direction = c->target_direction;
@@ -882,7 +928,7 @@
 {
   hb_ot_shape_plan_t plan;
 
-  const char *shapers[] = {"ot", NULL};
+  const char *shapers[] = {"ot", nullptr};
   hb_shape_plan_t *shape_plan = hb_shape_plan_create_cached (font->face, &buffer->props,
                                                              features, num_features, shapers);
 
@@ -893,18 +939,19 @@
   for (unsigned int i = 0; i < count; i++)
     add_char (font, buffer->unicode, mirror, info[i].codepoint, glyphs);
 
-  hb_set_t lookups;
-  lookups.init ();
-  hb_ot_shape_plan_collect_lookups (shape_plan, HB_OT_TAG_GSUB, &lookups);
+  hb_set_t *lookups = hb_set_create ();
+  hb_ot_shape_plan_collect_lookups (shape_plan, HB_OT_TAG_GSUB, lookups);
 
   /* And find transitive closure. */
-  hb_set_t copy;
-  copy.init ();
+  hb_set_t *copy = hb_set_create ();
   do {
-    copy.set (glyphs);
-    for (hb_codepoint_t lookup_index = -1; hb_set_next (&lookups, &lookup_index);)
+    copy->set (glyphs);
+    for (hb_codepoint_t lookup_index = -1; hb_set_next (lookups, &lookup_index);)
       hb_ot_layout_lookup_substitute_closure (font->face, lookup_index, glyphs);
-  } while (!copy.is_equal (glyphs));
+  } while (!copy->is_equal (glyphs));
+  hb_set_destroy (copy);
+
+  hb_set_destroy (lookups);
 
   hb_shape_plan_destroy (shape_plan);
 }
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-tag.cc	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-tag.cc	Wed Dec 13 10:25:38 2017 -0800
@@ -28,9 +28,6 @@
 
 #include "hb-private.hh"
 
-#include <string.h>
-
-
 
 /* hb_script_t */
 
@@ -201,6 +198,7 @@
   {"alt",       HB_TAG('A','L','T',' ')},       /* [Southern] Altai */
   {"am",        HB_TAG('A','M','H',' ')},       /* Amharic */
   {"amf",       HB_TAG('H','B','N',' ')},       /* Hammer-Banna */
+  {"amw",       HB_TAG('S','Y','R',' ')},       /* Western Neo-Aramaic */
   {"an",        HB_TAG('A','R','G',' ')},       /* Aragonese */
   {"ang",       HB_TAG('A','N','G',' ')},       /* Old English (ca. 450-1100) */
   {"ar",        HB_TAG('A','R','A',' ')},       /* Arabic [macrolanguage] */
@@ -239,6 +237,7 @@
   {"bg",        HB_TAG('B','G','R',' ')},       /* Bulgarian */
   {"bgc",       HB_TAG('B','G','C',' ')},       /* Haryanvi */
   {"bgq",       HB_TAG('B','G','Q',' ')},       /* Bagri */
+  {"bgr",       HB_TAG('Q','I','N',' ')},       /* Bawm Chin */
   {"bhb",       HB_TAG('B','H','I',' ')},       /* Bhili */
   {"bhk",       HB_TAG('B','I','K',' ')},       /* Albay Bicolano (retired code) */
   {"bho",       HB_TAG('B','H','O',' ')},       /* Bhojpuri */
@@ -270,18 +269,37 @@
   {"ca",        HB_TAG('C','A','T',' ')},       /* Catalan */
   {"cak",       HB_TAG('C','A','K',' ')},       /* Kaqchikel */
   {"cbk",       HB_TAG('C','B','K',' ')},       /* Chavacano */
+  {"cbl",       HB_TAG('Q','I','N',' ')},       /* Bualkhaw Chin */
+  {"cco",       HB_TAG('C','C','H','N')},       /* Chinantec */
   {"ce",        HB_TAG('C','H','E',' ')},       /* Chechen */
   {"ceb",       HB_TAG('C','E','B',' ')},       /* Cebuano */
+  {"cfm",       HB_TAG('H','A','L',' ')},       /* Halam/Falam Chin */
   {"cgg",       HB_TAG('C','G','G',' ')},       /* Chiga */
   {"ch",        HB_TAG('C','H','A',' ')},       /* Chamorro */
+  {"chj",       HB_TAG('C','C','H','N')},       /* Chinantec */
   {"chk",       HB_TAG('C','H','K','0')},       /* Chuukese */
   {"cho",       HB_TAG('C','H','O',' ')},       /* Choctaw */
   {"chp",       HB_TAG('C','H','P',' ')},       /* Chipewyan */
+  {"chq",       HB_TAG('C','C','H','N')},       /* Chinantec */
   {"chr",       HB_TAG('C','H','R',' ')},       /* Cherokee */
   {"chy",       HB_TAG('C','H','Y',' ')},       /* Cheyenne */
+  {"chz",       HB_TAG('C','C','H','N')},       /* Chinantec */
+  {"cja",       HB_TAG('C','J','A',' ')},       /* Western Cham */
+  {"cjm",       HB_TAG('C','J','M',' ')},       /* Eastern Cham */
+  {"cka",       HB_TAG('Q','I','N',' ')},       /* Khumi Awa Chin */
   {"ckb",       HB_TAG('K','U','R',' ')},       /* Central Kurdish (Sorani) */
   {"ckt",       HB_TAG('C','H','K',' ')},       /* Chukchi */
+  {"cld",       HB_TAG('S','Y','R',' ')},       /* Chaldean Neo-Aramaic */
+  {"cle",       HB_TAG('C','C','H','N')},       /* Chinantec */
+  {"cmr",       HB_TAG('Q','I','N',' ')},       /* Mro-Khimi Chin */
+  {"cnb",       HB_TAG('Q','I','N',' ')},       /* Chinbon Chin */
+  {"cnh",       HB_TAG('Q','I','N',' ')},       /* Hakha Chin */
+  {"cnk",       HB_TAG('Q','I','N',' ')},       /* Khumi Chin */
+  {"cnl",       HB_TAG('C','C','H','N')},       /* Chinantec */
+  {"cnt",       HB_TAG('C','C','H','N')},       /* Chinantec */
+  {"cnw",       HB_TAG('Q','I','N',' ')},       /* Ngawn Chin */
   {"cop",       HB_TAG('C','O','P',' ')},       /* Coptic */
+  {"cpa",       HB_TAG('C','C','H','N')},       /* Chinantec */
   {"cpp",       HB_TAG('C','P','P',' ')},       /* Creoles */
   {"cr",        HB_TAG('C','R','E',' ')},       /* Cree */
   {"cre",       HB_TAG('Y','C','R',' ')},       /* Y-Cree */
@@ -292,15 +310,26 @@
   {"crm",       HB_TAG('M','C','R',' ')},       /* Moose Cree */
   {"crx",       HB_TAG('C','R','R',' ')},       /* Carrier */
   {"cs",        HB_TAG('C','S','Y',' ')},       /* Czech */
+  {"csa",       HB_TAG('C','C','H','N')},       /* Chinantec */
   {"csb",       HB_TAG('C','S','B',' ')},       /* Kashubian */
+  {"csh",       HB_TAG('Q','I','N',' ')},       /* Asho Chin */
+  {"cso",       HB_TAG('C','C','H','N')},       /* Chinantec */
+  {"csy",       HB_TAG('Q','I','N',' ')},       /* Siyin Chin */
+  {"ctd",       HB_TAG('Q','I','N',' ')},       /* Tedim Chin */
+  {"cte",       HB_TAG('C','C','H','N')},       /* Chinantec */
   {"ctg",       HB_TAG('C','T','G',' ')},       /* Chittagonian */
+  {"ctl",       HB_TAG('C','C','H','N')},       /* Chinantec */
   {"cts",       HB_TAG('B','I','K',' ')},       /* Northern Catanduanes Bikol */
   {"cu",        HB_TAG('C','S','L',' ')},       /* Church Slavic */
+  {"cuc",       HB_TAG('C','C','H','N')},       /* Chinantec */
   {"cuk",       HB_TAG('C','U','K',' ')},       /* San Blas Kuna */
   {"cv",        HB_TAG('C','H','U',' ')},       /* Chuvash */
+  {"cvn",       HB_TAG('C','C','H','N')},       /* Chinantec */
   {"cwd",       HB_TAG('D','C','R',' ')},       /* Woods Cree */
   {"cy",        HB_TAG('W','E','L',' ')},       /* Welsh */
+  {"czt",       HB_TAG('Q','I','N',' ')},       /* Zotung Chin */
   {"da",        HB_TAG('D','A','N',' ')},       /* Danish */
+  {"dao",       HB_TAG('Q','I','N',' ')},       /* Daai Chin */
   {"dap",       HB_TAG('N','I','S',' ')},       /* Nisi (India) */
   {"dar",       HB_TAG('D','A','R',' ')},       /* Dargwa */
   {"dax",       HB_TAG('D','A','X',' ')},       /* Dayi */
@@ -343,7 +372,7 @@
   {"fi",        HB_TAG('F','I','N',' ')},       /* Finnish */
   {"fil",       HB_TAG('P','I','L',' ')},       /* Filipino */
   {"fj",        HB_TAG('F','J','I',' ')},       /* Fijian */
-  {"flm",       HB_TAG('H','A','L',' ')},       /* Halam */
+  {"flm",       HB_TAG('H','A','L',' ')},       /* Halam/Falam Chin [retired ISO639 code] */
   {"fo",        HB_TAG('F','O','S',' ')},       /* Faroese */
   {"fon",       HB_TAG('F','O','N',' ')},       /* Fon */
   {"fr",        HB_TAG('F','R','A',' ')},       /* French */
@@ -365,7 +394,6 @@
   {"gkp",       HB_TAG('G','K','P',' ')},       /* Kpelle (Guinea) */
   {"gl",        HB_TAG('G','A','L',' ')},       /* Galician */
   {"gld",       HB_TAG('N','A','N',' ')},       /* Nanai */
-  {"gle",       HB_TAG('I','R','T',' ')},       /* Irish Traditional */
   {"glk",       HB_TAG('G','L','K',' ')},       /* Gilaki */
   {"gn",        HB_TAG('G','U','A',' ')},       /* Guarani [macrolanguage] */
   {"gnn",       HB_TAG('G','N','N',' ')},       /* Gumatj */
@@ -390,6 +418,7 @@
   {"he",        HB_TAG('I','W','R',' ')},       /* Hebrew */
   {"hi",        HB_TAG('H','I','N',' ')},       /* Hindi */
   {"hil",       HB_TAG('H','I','L',' ')},       /* Hiligaynon */
+  {"hlt",       HB_TAG('Q','I','N',' ')},       /* Matu Chin */
   {"hmn",       HB_TAG('H','M','N',' ')},       /* Hmong */
   {"hnd",       HB_TAG('H','N','D',' ')},       /* [Southern] Hindko */
   {"hne",       HB_TAG('C','H','H',' ')},       /* Chattisgarhi */
@@ -522,7 +551,6 @@
   {"mag",       HB_TAG('M','A','G',' ')},       /* Magahi */
   {"mai",       HB_TAG('M','T','H',' ')},       /* Maithili */
   {"mak",       HB_TAG('M','K','R',' ')},       /* Makasar */
-  {"mal",       HB_TAG('M','A','L',' ')},       /* Malayalam */
   {"mam",       HB_TAG('M','A','M',' ')},       /* Mam */
   {"man",       HB_TAG('M','N','K',' ')},       /* Manding/Mandingo [macrolanguage] */
   {"mdc",       HB_TAG('M','L','E',' ')},       /* Male (Papua New Guinea) */
@@ -553,6 +581,7 @@
   {"mos",       HB_TAG('M','O','S',' ')},       /* Mossi */
   {"mpe",       HB_TAG('M','A','J',' ')},       /* Majang */
   {"mr",        HB_TAG('M','A','R',' ')},       /* Marathi */
+  {"mrh",       HB_TAG('Q','I','N',' ')},       /* Mara Chin */
   {"mrj",       HB_TAG('H','M','A',' ')},       /* High Mari */
   {"ms",        HB_TAG('M','L','Y',' ')},       /* Malay [macrolanguage] */
   {"msc",       HB_TAG('M','N','K',' ')},       /* Sankaran Maninka */
@@ -617,6 +646,7 @@
   {"pcc",       HB_TAG('P','C','C',' ')},       /* Bouyei */
   {"pcd",       HB_TAG('P','C','D',' ')},       /* Picard */
   {"pce",       HB_TAG('P','L','G',' ')},       /* [Ruching] Palaung */
+  {"pck",       HB_TAG('Q','I','N',' ')},       /* Paite Chin */
   {"pdc",       HB_TAG('P','D','C',' ')},       /* Pennsylvania German */
   {"pes",       HB_TAG('F','A','R',' ')},       /* Iranian Persian */
   {"phk",       HB_TAG('P','H','K',' ')},       /* Phake */
@@ -674,6 +704,7 @@
   {"se",        HB_TAG('N','S','M',' ')},       /* Northern Sami */
   {"seh",       HB_TAG('S','N','A',' ')},       /* Sena */
   {"sel",       HB_TAG('S','E','L',' ')},       /* Selkup */
+  {"sez",       HB_TAG('Q','I','N',' ')},       /* Senthang Chin */
   {"sg",        HB_TAG('S','G','O',' ')},       /* Sango */
   {"sga",       HB_TAG('S','G','A',' ')},       /* Old Irish (to 900) */
   {"sgs",       HB_TAG('S','G','S',' ')},       /* Samogitian */
@@ -713,12 +744,15 @@
   {"swh",       HB_TAG('S','W','K',' ')},       /* Kiswahili/Swahili */
   {"swv",       HB_TAG('M','A','W',' ')},       /* Shekhawati */
   {"sxu",       HB_TAG('S','X','U',' ')},       /* Upper Saxon */
+  {"syc",       HB_TAG('S','Y','R',' ')},       /* Classical Syriac */
   {"syl",       HB_TAG('S','Y','L',' ')},       /* Sylheti */
   {"syr",       HB_TAG('S','Y','R',' ')},       /* Syriac [macrolanguage] */
   {"szl",       HB_TAG('S','Z','L',' ')},       /* Silesian */
   {"ta",        HB_TAG('T','A','M',' ')},       /* Tamil */
   {"tab",       HB_TAG('T','A','B',' ')},       /* Tabasaran */
+  {"tcp",       HB_TAG('Q','I','N',' ')},       /* Tawr Chin */
   {"tcy",       HB_TAG('T','U','L',' ')},       /* Tulu */
+  {"tcz",       HB_TAG('Q','I','N',' ')},       /* Thado Chin */
   {"tdd",       HB_TAG('T','D','D',' ')},       /* Tai Nüa */
   {"te",        HB_TAG('T','E','L',' ')},       /* Telugu */
   {"tem",       HB_TAG('T','M','N',' ')},       /* Temne */
@@ -786,11 +820,13 @@
   {"yap",       HB_TAG('Y','A','P',' ')},       /* Yapese */
   {"yi",        HB_TAG('J','I','I',' ')},       /* Yiddish [macrolanguage] */
   {"yo",        HB_TAG('Y','B','A',' ')},       /* Yoruba */
+  {"yos",       HB_TAG('Q','I','N',' ')},       /* Yos, deprecated by IANA in favor of Zou [zom] */
   {"yso",       HB_TAG('N','I','S',' ')},       /* Nisi (China) */
   {"za",        HB_TAG('Z','H','A',' ')},       /* Chuang/Zhuang [macrolanguage] */
   {"zea",       HB_TAG('Z','E','A',' ')},       /* Zeeuws */
   {"zgh",       HB_TAG('Z','G','H',' ')},       /* Standard Morrocan Tamazigh */
   {"zne",       HB_TAG('Z','N','D',' ')},       /* Zande */
+  {"zom",       HB_TAG('Q','I','N',' ')},       /* Zou */
   {"zu",        HB_TAG('Z','U','L',' ')},       /* Zulu */
   {"zum",       HB_TAG('L','R','C',' ')},       /* Kumzari */
   {"zza",       HB_TAG('Z','Z','A',' ')},       /* Zazaki */
@@ -843,9 +879,11 @@
 };
 
 static int
-lang_compare_first_component (const char *a,
-                              const char *b)
+lang_compare_first_component (const void *pa,
+                              const void *pb)
 {
+  const char *a = (const char *) pa;
+  const char *b = (const char *) pb;
   unsigned int da, db;
   const char *p;
 
@@ -887,7 +925,7 @@
     if (i) {
       for (; i < 4; i++)
         tag[i] = ' ';
-      return HB_TAG_CHAR4 (tag);
+      return HB_TAG (tag[0], tag[1], tag[2], tag[3]);
     }
   }
 
@@ -907,12 +945,36 @@
     return HB_TAG('A','P','P','H');  /* Phonetic transcription—Americanist conventions */
   }
 
+  /*
+   * "Syre" is a BCP-47 script tag, meaning the Estrangela variant of the Syriac script.
+   * It can be applied to any language.
+   */
+  if (strstr (lang_str, "-syre")) {
+    return HB_TAG('S','Y','R','E');  /* Estrangela Syriac */
+  }
+
+  /*
+   * "Syrj" is a BCP-47 script tag, meaning the Western variant of the Syriac script.
+   * It can be applied to any language.
+   */
+  if (strstr (lang_str, "-syrj")) {
+    return HB_TAG('S','Y','R','J');  /* Western Syriac */
+  }
+
+  /*
+   * "Syrn" is a BCP-47 script tag, meaning the Eastern variant of the Syriac script.
+   * It can be applied to any language.
+   */
+  if (strstr (lang_str, "-syrn")) {
+    return HB_TAG('S','Y','R','N');  /* Eastern Syriac */
+  }
+
   /* Find a language matching in the first component */
   {
     const LangTag *lang_tag;
     lang_tag = (LangTag *) bsearch (lang_str, ot_languages,
                                     ARRAY_LENGTH (ot_languages), sizeof (LangTag),
-                                    (hb_compare_func_t) lang_compare_first_component);
+                                    lang_compare_first_component);
     if (lang_tag)
       return lang_tag->tag;
   }
@@ -948,7 +1010,7 @@
 /**
  * hb_ot_tag_to_language:
  *
- * 
+ *
  *
  * Return value: (transfer none):
  *
@@ -960,7 +1022,23 @@
   unsigned int i;
 
   if (tag == HB_OT_TAG_DEFAULT_LANGUAGE)
-    return NULL;
+    return nullptr;
+
+  /* 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);
+  case HB_TAG('S','Y','R',' '):  /* Syriac [macrolanguage] */
+    return hb_language_from_string ("syr", -1);
+  case HB_TAG('S','Y','R','E'):  /* Estrangela Syriac */
+    return hb_language_from_string ("und-Syre", -1);
+  case HB_TAG('S','Y','R','J'):  /* Western Syriac */
+    return hb_language_from_string ("und-Syrj", -1);
+  case HB_TAG('S','Y','R','N'):  /* Eastern Syriac */
+    return hb_language_from_string ("und-Syrn", -1);
+  }
 
   for (i = 0; i < ARRAY_LENGTH (ot_languages); i++)
     if (ot_languages[i].tag == tag)
@@ -976,14 +1054,6 @@
     }
   }
 
-  /* 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);
-  }
-
   /* Else return a custom language in the form of "x-hbotABCD" */
   {
     unsigned char buf[11] = "x-hbot";
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-var-avar-table.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,149 @@
+/*
+ * Copyright © 2017  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): Behdad Esfahbod
+ */
+
+#ifndef HB_OT_VAR_AVAR_TABLE_HH
+#define HB_OT_VAR_AVAR_TABLE_HH
+
+#include "hb-open-type-private.hh"
+
+namespace OT {
+
+
+struct AxisValueMap
+{
+  inline bool sanitize (hb_sanitize_context_t *c) const
+  {
+    TRACE_SANITIZE (this);
+    return_trace (c->check_struct (this));
+  }
+
+  public:
+  F2DOT14       fromCoord;      /* A normalized coordinate value obtained using
+                                 * default normalization. */
+  F2DOT14       toCoord;        /* The modified, normalized coordinate value. */
+
+  public:
+  DEFINE_SIZE_STATIC (4);
+};
+
+struct SegmentMaps : ArrayOf<AxisValueMap>
+{
+  inline int map (int value) const
+  {
+    /* The following special-cases are not part of OpenType, which requires
+     * that at least -1, 0, and +1 must be mapped. But we include these as
+     * part of a better error recovery scheme. */
+
+    if (len < 2)
+    {
+      if (!len)
+        return value;
+      else /* len == 1*/
+        return value - array[0].fromCoord + array[0].toCoord;
+    }
+
+    if (value <= array[0].fromCoord)
+      return value - array[0].fromCoord + array[0].toCoord;
+
+    unsigned int i;
+    unsigned int count = len;
+    for (i = 1; i < count && value > array[i].fromCoord; i++)
+      ;
+
+    if (value >= array[i].fromCoord)
+      return value - array[i].fromCoord + array[i].toCoord;
+
+    if (unlikely (array[i-1].fromCoord == array[i].fromCoord))
+      return array[i-1].toCoord;
+
+    int denom = array[i].fromCoord - array[i-1].fromCoord;
+    return array[i-1].toCoord +
+           ((array[i].toCoord - array[i-1].toCoord) *
+            (value - array[i-1].fromCoord) + denom/2) / denom;
+  }
+
+  DEFINE_SIZE_ARRAY (2, array);
+};
+
+/*
+ * avar — Axis Variations Table
+ */
+
+#define HB_OT_TAG_avar HB_TAG('a','v','a','r')
+
+struct avar
+{
+  static const hb_tag_t tableTag        = HB_OT_TAG_avar;
+
+  inline bool sanitize (hb_sanitize_context_t *c) const
+  {
+    TRACE_SANITIZE (this);
+    if (unlikely (!(version.sanitize (c) &&
+                    version.major == 1 &&
+                    c->check_struct (this))))
+      return_trace (false);
+
+    const SegmentMaps *map = &axisSegmentMapsZ;
+    unsigned int count = axisCount;
+    for (unsigned int i = 0; i < count; i++)
+    {
+      if (unlikely (!map->sanitize (c)))
+        return_trace (false);
+      map = &StructAfter<SegmentMaps> (*map);
+    }
+
+    return_trace (true);
+  }
+
+  inline void map_coords (int *coords, unsigned int coords_length) const
+  {
+    unsigned int count = MIN<unsigned int> (coords_length, axisCount);
+
+    const SegmentMaps *map = &axisSegmentMapsZ;
+    for (unsigned int i = 0; i < count; i++)
+    {
+      coords[i] = map->map (coords[i]);
+      map = &StructAfter<SegmentMaps> (*map);
+    }
+  }
+
+  protected:
+  FixedVersion<>version;        /* Version of the avar table
+                                 * initially set to 0x00010000u */
+  USHORT        reserved;       /* This field is permanently reserved. Set to 0. */
+  USHORT        axisCount;      /* The number of variation axes in the font. This
+                                 * must be the same number as axisCount in the
+                                 * 'fvar' table. */
+  SegmentMaps   axisSegmentMapsZ;
+
+  public:
+  DEFINE_SIZE_MIN (8);
+};
+
+} /* namespace OT */
+
+
+#endif /* HB_OT_VAR_AVAR_TABLE_HH */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-var-fvar-table.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,209 @@
+/*
+ * Copyright © 2017  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): Behdad Esfahbod
+ */
+
+#ifndef HB_OT_VAR_FVAR_TABLE_HH
+#define HB_OT_VAR_FVAR_TABLE_HH
+
+#include "hb-open-type-private.hh"
+
+namespace OT {
+
+
+struct InstanceRecord
+{
+  inline bool sanitize (hb_sanitize_context_t *c, unsigned int axis_count) const
+  {
+    TRACE_SANITIZE (this);
+    return_trace (c->check_struct (this) &&
+                  c->check_array (coordinates, coordinates[0].static_size, axis_count));
+  }
+
+  protected:
+  USHORT        subfamilyNameID;/* The name ID for entries in the 'name' table
+                                 * that provide subfamily names for this instance. */
+  USHORT        reserved;       /* Reserved for future use — set to 0. */
+  Fixed         coordinates[VAR];/* The coordinates array for this instance. */
+  //USHORT      postScriptNameIDX;/*Optional. The name ID for entries in the 'name'
+  //                              * table that provide PostScript names for this
+  //                              * instance. */
+
+  public:
+  DEFINE_SIZE_ARRAY (4, coordinates);
+};
+
+struct AxisRecord
+{
+  inline bool sanitize (hb_sanitize_context_t *c) const
+  {
+    TRACE_SANITIZE (this);
+    return_trace (c->check_struct (this));
+  }
+
+  public:
+  Tag           axisTag;        /* Tag identifying the design variation for the axis. */
+  Fixed         minValue;       /* The minimum coordinate value for the axis. */
+  Fixed         defaultValue;   /* The default coordinate value for the axis. */
+  Fixed         maxValue;       /* The maximum coordinate value for the axis. */
+  USHORT        reserved;       /* Reserved for future use — set to 0. */
+  USHORT        axisNameID;     /* The name ID for entries in the 'name' table that
+                                 * provide a display name for this axis. */
+
+  public:
+  DEFINE_SIZE_STATIC (20);
+};
+
+
+/*
+ * fvar — Font Variations Table
+ */
+
+#define HB_OT_TAG_fvar HB_TAG('f','v','a','r')
+
+struct fvar
+{
+  static const hb_tag_t tableTag        = HB_OT_TAG_fvar;
+
+  inline bool sanitize (hb_sanitize_context_t *c) const
+  {
+    TRACE_SANITIZE (this);
+    return_trace (version.sanitize (c) &&
+                  likely (version.major == 1) &&
+                  c->check_struct (this) &&
+                  instanceSize >= axisCount * 4 + 4 &&
+                  axisSize <= 1024 && /* Arbitrary, just to simplify overflow checks. */
+                  instanceSize <= 1024 && /* Arbitrary, just to simplify overflow checks. */
+                  c->check_range (this, things) &&
+                  c->check_range (&StructAtOffset<char> (this, things),
+                                  axisCount * axisSize + instanceCount * instanceSize));
+  }
+
+  inline unsigned int get_axis_count (void) const
+  { return axisCount; }
+
+  inline bool get_axis (unsigned int index, hb_ot_var_axis_t *info) const
+  {
+    if (unlikely (index >= axisCount))
+      return false;
+
+    if (info)
+    {
+      const AxisRecord &axis = get_axes ()[index];
+      info->tag = axis.axisTag;
+      info->name_id =  axis.axisNameID;
+      info->default_value = axis.defaultValue / 65536.;
+      /* Ensure order, to simplify client math. */
+      info->min_value = MIN<float> (info->default_value, axis.minValue / 65536.);
+      info->max_value = MAX<float> (info->default_value, axis.maxValue / 65536.);
+    }
+
+    return true;
+  }
+
+  inline unsigned int get_axis_infos (unsigned int      start_offset,
+                                      unsigned int     *axes_count /* IN/OUT */,
+                                      hb_ot_var_axis_t *axes_array /* OUT */) const
+  {
+    if (axes_count)
+    {
+      unsigned int count = axisCount;
+      start_offset = MIN (start_offset, count);
+
+      count -= start_offset;
+      axes_array += start_offset;
+
+      count = MIN (count, *axes_count);
+      *axes_count = count;
+
+      for (unsigned int i = 0; i < count; i++)
+        get_axis (start_offset + i, axes_array + i);
+    }
+    return axisCount;
+  }
+
+  inline bool find_axis (hb_tag_t tag, unsigned int *index, hb_ot_var_axis_t *info) const
+  {
+    const AxisRecord *axes = get_axes ();
+    unsigned int count = get_axis_count ();
+    for (unsigned int i = 0; i < count; i++)
+      if (axes[i].axisTag == tag)
+      {
+        if (index)
+          *index = i;
+        return get_axis (i, info);
+      }
+    if (index)
+      *index = HB_OT_VAR_NO_AXIS_INDEX;
+    return false;
+  }
+
+  inline int normalize_axis_value (unsigned int axis_index, float v) const
+  {
+    hb_ot_var_axis_t axis;
+    if (!get_axis (axis_index, &axis))
+      return 0;
+
+    v = MAX (MIN (v, axis.max_value), axis.min_value); /* Clamp. */
+
+    if (v == axis.default_value)
+      return 0;
+    else if (v < axis.default_value)
+      v = (v - axis.default_value) / (axis.default_value - axis.min_value);
+    else
+      v = (v - axis.default_value) / (axis.max_value - axis.default_value);
+    return (int) (v * 16384. + (v >= 0. ? .5 : -.5));
+  }
+
+  protected:
+  inline const AxisRecord * get_axes (void) const
+  { return &StructAtOffset<AxisRecord> (this, things); }
+
+  inline const InstanceRecord * get_instances (void) const
+  { return &StructAtOffset<InstanceRecord> (get_axes () + axisCount, 0); }
+
+  protected:
+  FixedVersion<>version;        /* Version of the fvar table
+                                 * initially set to 0x00010000u */
+  Offset<>      things;         /* Offset in bytes from the beginning of the table
+                                 * to the start of the AxisRecord array. */
+  USHORT        reserved;       /* This field is permanently reserved. Set to 2. */
+  USHORT        axisCount;      /* The number of variation axes in the font (the
+                                 * number of records in the axes array). */
+  USHORT        axisSize;       /* The size in bytes of each VariationAxisRecord —
+                                 * set to 20 (0x0014) for this version. */
+  USHORT        instanceCount;  /* The number of named instances defined in the font
+                                 * (the number of records in the instances array). */
+  USHORT        instanceSize;   /* The size in bytes of each InstanceRecord — set
+                                 * to either axisCount * sizeof(Fixed) + 4, or to
+                                 * axisCount * sizeof(Fixed) + 6. */
+
+  public:
+  DEFINE_SIZE_STATIC (16);
+};
+
+} /* namespace OT */
+
+
+#endif /* HB_OT_VAR_FVAR_TABLE_HH */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-var-hvar-table.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,165 @@
+/*
+ * Copyright © 2017  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): Behdad Esfahbod
+ */
+
+#ifndef HB_OT_VAR_HVAR_TABLE_HH
+#define HB_OT_VAR_HVAR_TABLE_HH
+
+#include "hb-ot-layout-common-private.hh"
+
+
+namespace OT {
+
+
+struct DeltaSetIndexMap
+{
+  inline bool sanitize (hb_sanitize_context_t *c) const
+  {
+    TRACE_SANITIZE (this);
+    return_trace (c->check_struct (this) &&
+                  c->check_array (mapData, get_width (), mapCount));
+  }
+
+  unsigned int map (unsigned int v) const /* Returns 16.16 outer.inner. */
+  {
+    /* If count is zero, pass value unchanged.  This takes
+     * care of direct mapping for advance map. */
+    if (!mapCount)
+      return v;
+
+    if (v >= mapCount)
+      v = mapCount - 1;
+
+    unsigned int u = 0;
+    { /* Fetch it. */
+      unsigned int w = get_width ();
+      const BYTE *p = mapData + w * v;
+      for (; w; w--)
+        u = (u << 8) + *p++;
+    }
+
+    { /* Repack it. */
+      unsigned int n = get_inner_bitcount ();
+      unsigned int outer = u >> n;
+      unsigned int inner = u & ((1 << n) - 1);
+      u = (outer<<16) | inner;
+    }
+
+    return u;
+  }
+
+  protected:
+  inline unsigned int get_width (void) const
+  { return ((format >> 4) & 3) + 1; }
+
+  inline unsigned int get_inner_bitcount (void) const
+  { return (format & 0xF) + 1; }
+
+  protected:
+  USHORT        format;         /* A packed field that describes the compressed
+                                 * representation of delta-set indices. */
+  USHORT        mapCount;       /* The number of mapping entries. */
+  BYTE          mapData[VAR];   /* The delta-set index mapping data. */
+
+  public:
+  DEFINE_SIZE_ARRAY (4, mapData);
+};
+
+
+/*
+ * HVAR -- The Horizontal Metrics Variations Table
+ * VVAR -- The Vertical Metrics Variations Table
+ */
+
+#define HB_OT_TAG_HVAR HB_TAG('H','V','A','R')
+#define HB_OT_TAG_VVAR HB_TAG('V','V','A','R')
+
+struct HVARVVAR
+{
+  static const hb_tag_t HVARTag = HB_OT_TAG_HVAR;
+  static const hb_tag_t VVARTag = HB_OT_TAG_VVAR;
+
+  inline bool sanitize (hb_sanitize_context_t *c) const
+  {
+    TRACE_SANITIZE (this);
+    return_trace (version.sanitize (c) &&
+                  likely (version.major == 1) &&
+                  varStore.sanitize (c, this) &&
+                  advMap.sanitize (c, this) &&
+                  lsbMap.sanitize (c, this) &&
+                  rsbMap.sanitize (c, this));
+  }
+
+  inline float get_advance_var (hb_codepoint_t glyph,
+                                int *coords, unsigned int coord_count) const
+  {
+    unsigned int varidx = (this+advMap).map (glyph);
+    return (this+varStore).get_delta (varidx, coords, coord_count);
+  }
+
+  inline bool has_sidebearing_deltas (void) const
+  { return lsbMap && rsbMap; }
+
+  protected:
+  FixedVersion<>version;        /* Version of the metrics variation table
+                                 * initially set to 0x00010000u */
+  LOffsetTo<VariationStore>
+                varStore;       /* Offset to item variation store table. */
+  LOffsetTo<DeltaSetIndexMap>
+                advMap;         /* Offset to advance var-idx mapping. */
+  LOffsetTo<DeltaSetIndexMap>
+                lsbMap;         /* Offset to lsb/tsb var-idx mapping. */
+  LOffsetTo<DeltaSetIndexMap>
+                rsbMap;         /* Offset to rsb/bsb var-idx mapping. */
+
+  public:
+  DEFINE_SIZE_STATIC (20);
+};
+
+struct HVAR : HVARVVAR {
+  static const hb_tag_t tableTag        = HB_OT_TAG_HVAR;
+};
+struct VVAR : HVARVVAR {
+  static const hb_tag_t tableTag        = HB_OT_TAG_VVAR;
+
+  inline bool sanitize (hb_sanitize_context_t *c) const
+  {
+    TRACE_SANITIZE (this);
+    return_trace (static_cast<const HVARVVAR *> (this)->sanitize (c) &&
+                  vorgMap.sanitize (c, this));
+  }
+
+  protected:
+  LOffsetTo<DeltaSetIndexMap>
+                vorgMap;        /* Offset to vertical-origin var-idx mapping. */
+
+  public:
+  DEFINE_SIZE_STATIC (24);
+};
+
+} /* namespace OT */
+
+
+#endif /* HB_OT_VAR_HVAR_TABLE_HH */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-var-mvar-table.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,114 @@
+/*
+ * Copyright © 2017  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): Behdad Esfahbod
+ */
+
+#ifndef HB_OT_VAR_MVAR_TABLE_HH
+#define HB_OT_VAR_MVAR_TABLE_HH
+
+#include "hb-ot-layout-common-private.hh"
+
+
+namespace OT {
+
+
+struct VariationValueRecord
+{
+  inline bool sanitize (hb_sanitize_context_t *c) const
+  {
+    TRACE_SANITIZE (this);
+    return_trace (c->check_struct (this));
+  }
+
+  public:
+  Tag           valueTag;       /* Four-byte tag identifying a font-wide measure. */
+  ULONG         varIdx;         /* Outer/inner index into VariationStore item. */
+
+  public:
+  DEFINE_SIZE_STATIC (8);
+};
+
+
+/*
+ * MVAR -- Metrics Variations Table
+ */
+
+#define HB_OT_TAG_MVAR HB_TAG('M','V','A','R')
+
+struct MVAR
+{
+  static const hb_tag_t tableTag        = HB_OT_TAG_MVAR;
+
+  inline bool sanitize (hb_sanitize_context_t *c) const
+  {
+    TRACE_SANITIZE (this);
+    return_trace (version.sanitize (c) &&
+                  likely (version.major == 1) &&
+                  c->check_struct (this) &&
+                  valueRecordSize >= VariationValueRecord::static_size &&
+                  varStore.sanitize (c, this) &&
+                  c->check_array (values, valueRecordSize, valueRecordCount));
+  }
+
+  inline float get_var (hb_tag_t tag,
+                        int *coords, unsigned int coord_count) const
+  {
+    const VariationValueRecord *record;
+    record = (VariationValueRecord *) bsearch (&tag, values,
+                                               valueRecordCount, valueRecordSize,
+                                               tag_compare);
+    if (!record)
+      return 0.;
+
+    return (this+varStore).get_delta (record->varIdx, coords, coord_count);
+  }
+
+protected:
+  static inline int tag_compare (const void *pa, const void *pb)
+  {
+    const hb_tag_t *a = (const hb_tag_t *) pa;
+    const Tag *b = (const Tag *) pb;
+    return b->cmp (*a);
+  }
+
+  protected:
+  FixedVersion<>version;        /* Version of the metrics variation table
+                                 * initially set to 0x00010000u */
+  USHORT        reserved;       /* Not used; set to 0. */
+  USHORT        valueRecordSize;/* The size in bytes of each value record —
+                                 * must be greater than zero. */
+  USHORT        valueRecordCount;/* The number of value records — may be zero. */
+  OffsetTo<VariationStore>
+                varStore;       /* Offset to item variation store table. */
+  BYTE          values[VAR];    /* Array of value records. The records must be
+                                 * in binary order of their valueTag field. */
+
+  public:
+  DEFINE_SIZE_ARRAY (12, values);
+};
+
+} /* namespace OT */
+
+
+#endif /* HB_OT_VAR_MVAR_TABLE_HH */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-var.cc	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,159 @@
+/*
+ * Copyright © 2017  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): Behdad Esfahbod
+ */
+
+#include "hb-open-type-private.hh"
+
+#include "hb-ot-layout-private.hh"
+#include "hb-ot-var-avar-table.hh"
+#include "hb-ot-var-fvar-table.hh"
+#include "hb-ot-var-mvar-table.hh"
+#include "hb-ot-var.h"
+
+/*
+ * fvar/avar
+ */
+
+static inline const OT::fvar&
+_get_fvar (hb_face_t *face)
+{
+  if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return OT::Null(OT::fvar);
+  hb_ot_layout_t * layout = hb_ot_layout_from_face (face);
+  return *(layout->fvar.get ());
+}
+static inline const OT::avar&
+_get_avar (hb_face_t *face)
+{
+  if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return OT::Null(OT::avar);
+  hb_ot_layout_t * layout = hb_ot_layout_from_face (face);
+  return *(layout->avar.get ());
+}
+
+/**
+ * hb_ot_var_has_data:
+ * @face: #hb_face_t to test
+ *
+ * This function allows to verify the presence of OpenType variation data on the face.
+ * Alternatively, use hb_ot_var_get_axis_count().
+ *
+ * Return value: true if face has a `fvar' table and false otherwise
+ *
+ * Since: 1.4.2
+ **/
+hb_bool_t
+hb_ot_var_has_data (hb_face_t *face)
+{
+  return &_get_fvar (face) != &OT::Null(OT::fvar);
+}
+
+/**
+ * hb_ot_var_get_axis_count:
+ *
+ * Since: 1.4.2
+ **/
+unsigned int
+hb_ot_var_get_axis_count (hb_face_t *face)
+{
+  const OT::fvar &fvar = _get_fvar (face);
+  return fvar.get_axis_count ();
+}
+
+/**
+ * hb_ot_var_get_axes:
+ *
+ * Since: 1.4.2
+ **/
+unsigned int
+hb_ot_var_get_axes (hb_face_t        *face,
+                    unsigned int      start_offset,
+                    unsigned int     *axes_count /* IN/OUT */,
+                    hb_ot_var_axis_t *axes_array /* OUT */)
+{
+  const OT::fvar &fvar = _get_fvar (face);
+  return fvar.get_axis_infos (start_offset, axes_count, axes_array);
+}
+
+/**
+ * hb_ot_var_find_axis:
+ *
+ * Since: 1.4.2
+ **/
+hb_bool_t
+hb_ot_var_find_axis (hb_face_t        *face,
+                     hb_tag_t          axis_tag,
+                     unsigned int     *axis_index,
+                     hb_ot_var_axis_t *axis_info)
+{
+  const OT::fvar &fvar = _get_fvar (face);
+  return fvar.find_axis (axis_tag, axis_index, axis_info);
+}
+
+
+/**
+ * hb_ot_var_normalize_variations:
+ *
+ * Since: 1.4.2
+ **/
+void
+hb_ot_var_normalize_variations (hb_face_t            *face,
+                                const hb_variation_t *variations, /* IN */
+                                unsigned int          variations_length,
+                                int                  *coords, /* OUT */
+                                unsigned int          coords_length)
+{
+  for (unsigned int i = 0; i < coords_length; i++)
+    coords[i] = 0;
+
+  const OT::fvar &fvar = _get_fvar (face);
+  for (unsigned int i = 0; i < variations_length; i++)
+  {
+    unsigned int axis_index;
+    if (hb_ot_var_find_axis (face, variations[i].tag, &axis_index, nullptr) &&
+        axis_index < coords_length)
+      coords[axis_index] = fvar.normalize_axis_value (axis_index, variations[i].value);
+  }
+
+  const OT::avar &avar = _get_avar (face);
+  avar.map_coords (coords, coords_length);
+}
+
+/**
+ * hb_ot_var_normalize_coords:
+ *
+ * Since: 1.4.2
+ **/
+void
+hb_ot_var_normalize_coords (hb_face_t    *face,
+                            unsigned int coords_length,
+                            const float *design_coords, /* IN */
+                            int *normalized_coords /* OUT */)
+{
+  const OT::fvar &fvar = _get_fvar (face);
+  for (unsigned int i = 0; i < coords_length; i++)
+    normalized_coords[i] = fvar.normalize_axis_value (i, design_coords[i]);
+
+  const OT::avar &avar = _get_avar (face);
+  avar.map_coords (normalized_coords, coords_length);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-var.h	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,105 @@
+/*
+ * Copyright © 2017  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.
+ *
+ * Red Hat Author(s): Behdad Esfahbod
+ */
+
+#ifndef HB_OT_H_IN
+#error "Include <hb-ot.h> instead."
+#endif
+
+#ifndef HB_OT_VAR_H
+#define HB_OT_VAR_H
+
+#include "hb.h"
+
+HB_BEGIN_DECLS
+
+
+#define HB_OT_TAG_VAR_AXIS_ITALIC       HB_TAG('i','t','a','l')
+#define HB_OT_TAG_VAR_AXIS_OPTICAL_SIZE HB_TAG('o','p','s','z')
+#define HB_OT_TAG_VAR_AXIS_SLANT        HB_TAG('s','l','n','t')
+#define HB_OT_TAG_VAR_AXIS_WIDTH        HB_TAG('w','d','t','h')
+#define HB_OT_TAG_VAR_AXIS_WEIGHT       HB_TAG('w','g','h','t')
+
+
+/*
+ * fvar / avar
+ */
+
+/**
+ * hb_ot_var_axis_t:
+ *
+ * Since: 1.4.2
+ */
+typedef struct hb_ot_var_axis_t {
+  hb_tag_t tag;
+  unsigned int name_id;
+  float min_value;
+  float default_value;
+  float max_value;
+} hb_ot_var_axis_t;
+
+HB_EXTERN hb_bool_t
+hb_ot_var_has_data (hb_face_t *face);
+
+/**
+ * HB_OT_VAR_NO_AXIS_INDEX:
+ *
+ * Since: 1.4.2
+ */
+#define HB_OT_VAR_NO_AXIS_INDEX         0xFFFFFFFFu
+
+HB_EXTERN unsigned int
+hb_ot_var_get_axis_count (hb_face_t *face);
+
+HB_EXTERN unsigned int
+hb_ot_var_get_axes (hb_face_t        *face,
+                    unsigned int      start_offset,
+                    unsigned int     *axes_count /* IN/OUT */,
+                    hb_ot_var_axis_t *axes_array /* OUT */);
+
+HB_EXTERN hb_bool_t
+hb_ot_var_find_axis (hb_face_t        *face,
+                     hb_tag_t          axis_tag,
+                     unsigned int     *axis_index,
+                     hb_ot_var_axis_t *axis_info);
+
+
+HB_EXTERN void
+hb_ot_var_normalize_variations (hb_face_t            *face,
+                                const hb_variation_t *variations, /* IN */
+                                unsigned int          variations_length,
+                                int                  *coords, /* OUT */
+                                unsigned int          coords_length);
+
+HB_EXTERN void
+hb_ot_var_normalize_coords (hb_face_t    *face,
+                            unsigned int coords_length,
+                            const float *design_coords, /* IN */
+                            int *normalized_coords /* OUT */);
+
+
+HB_END_DECLS
+
+#endif /* HB_OT_VAR_H */
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot.h	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot.h	Wed Dec 13 10:25:38 2017 -0800
@@ -35,6 +35,7 @@
 #include "hb-ot-math.h"
 #include "hb-ot-tag.h"
 #include "hb-ot-shape.h"
+#include "hb-ot-var.h"
 
 HB_BEGIN_DECLS
 
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-private.hh	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-private.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -44,16 +44,14 @@
 #include <stddef.h>
 #include <string.h>
 #include <assert.h>
-
-/* We only use these two for debug output.  However, the debug code is
- * always seen by the compiler (and optimized out in non-debug builds.
- * If including these becomes a problem, we can start thinking about
- * someway around that. */
+#include <errno.h>
 #include <stdio.h>
-#include <errno.h>
 #include <stdarg.h>
 
 
+#define HB_PASTE1(a,b) a##b
+#define HB_PASTE(a,b) HB_PASTE1(a,b)
+
 /* Compile-time custom allocator support. */
 
 #if defined(hb_malloc_impl) \
@@ -74,10 +72,25 @@
 /* Compiler attributes */
 
 
-#if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__)
-#define _HB_BOOLEAN_EXPR(expr) ((expr) ? 1 : 0)
-#define likely(expr) (__builtin_expect (_HB_BOOLEAN_EXPR(expr), 1))
-#define unlikely(expr) (__builtin_expect (_HB_BOOLEAN_EXPR(expr), 0))
+#if __cplusplus < 201103L
+
+#ifndef nullptr
+#define nullptr NULL
+#endif
+
+// Static assertions
+#ifndef static_assert
+#define static_assert(e, msg) \
+        HB_UNUSED typedef int HB_PASTE(static_assertion_failed_at_line_, __LINE__) [(e) ? 1 : -1]
+#endif // static_assert
+
+#endif // __cplusplus < 201103L
+
+#define _GNU_SOURCE 1
+
+#if (defined(__GNUC__) || defined(__clang__)) && defined(__OPTIMIZE__)
+#define likely(expr) (__builtin_expect (!!(expr), 1))
+#define unlikely(expr) (__builtin_expect (!!(expr), 0))
 #else
 #define likely(expr) (expr)
 #define unlikely(expr) (expr)
@@ -168,21 +181,17 @@
 
 #  if defined(_WIN32_WCE)
      /* Some things not defined on Windows CE. */
-#    define strdup _strdup
 #    define vsnprintf _vsnprintf
-#    define getenv(Name) NULL
+#    define getenv(Name) nullptr
 #    if _WIN32_WCE < 0x800
 #      define setlocale(Category, Locale) "C"
 static int errno = 0; /* Use something better? */
 #    endif
 #  elif defined(WINAPI_FAMILY) && (WINAPI_FAMILY==WINAPI_FAMILY_PC_APP || WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP)
-#    define getenv(Name) NULL
+#    define getenv(Name) nullptr
 #  endif
 #  if defined(_MSC_VER) && _MSC_VER < 1900
 #    define snprintf _snprintf
-#  elif defined(_MSC_VER) && _MSC_VER >= 1900
-#    /* Covers VC++ Error for strdup being a deprecated POSIX name and to instead use _strdup instead */
-#    define strdup _strdup
 #  endif
 #endif
 
@@ -214,11 +223,6 @@
 
 /* Basics */
 
-
-#ifndef NULL
-# define NULL ((void *) 0)
-#endif
-
 #undef MIN
 template <typename Type>
 static inline Type MIN (const Type &a, const Type &b) { return a < b ? a : b; }
@@ -240,32 +244,26 @@
 #define HB_STMT_START do
 #define HB_STMT_END   while (0)
 
-#define _ASSERT_STATIC1(_line, _cond)   HB_UNUSED typedef int _static_assert_on_line_##_line##_failed[(_cond)?1:-1]
-#define _ASSERT_STATIC0(_line, _cond)   _ASSERT_STATIC1 (_line, (_cond))
-#define ASSERT_STATIC(_cond)            _ASSERT_STATIC0 (__LINE__, (_cond))
-
-template <unsigned int cond> class hb_assert_constant_t {};
+template <unsigned int cond> class hb_assert_constant_t;
+template <> class hb_assert_constant_t<1> {};
 
 #define ASSERT_STATIC_EXPR_ZERO(_cond) (0 * (unsigned int) sizeof (hb_assert_constant_t<_cond>))
 
-#define _PASTE1(a,b) a##b
-#define PASTE(a,b) _PASTE1(a,b)
-
 /* Lets assert int types.  Saves trouble down the road. */
 
-ASSERT_STATIC (sizeof (int8_t) == 1);
-ASSERT_STATIC (sizeof (uint8_t) == 1);
-ASSERT_STATIC (sizeof (int16_t) == 2);
-ASSERT_STATIC (sizeof (uint16_t) == 2);
-ASSERT_STATIC (sizeof (int32_t) == 4);
-ASSERT_STATIC (sizeof (uint32_t) == 4);
-ASSERT_STATIC (sizeof (int64_t) == 8);
-ASSERT_STATIC (sizeof (uint64_t) == 8);
+static_assert ((sizeof (int8_t) == 1), "");
+static_assert ((sizeof (uint8_t) == 1), "");
+static_assert ((sizeof (int16_t) == 2), "");
+static_assert ((sizeof (uint16_t) == 2), "");
+static_assert ((sizeof (int32_t) == 4), "");
+static_assert ((sizeof (uint32_t) == 4), "");
+static_assert ((sizeof (int64_t) == 8), "");
+static_assert ((sizeof (uint64_t) == 8), "");
 
-ASSERT_STATIC (sizeof (hb_codepoint_t) == 4);
-ASSERT_STATIC (sizeof (hb_position_t) == 4);
-ASSERT_STATIC (sizeof (hb_mask_t) == 4);
-ASSERT_STATIC (sizeof (hb_var_int_t) == 4);
+static_assert ((sizeof (hb_codepoint_t) == 4), "");
+static_assert ((sizeof (hb_position_t) == 4), "");
+static_assert ((sizeof (hb_mask_t) == 4), "");
+static_assert ((sizeof (hb_var_int_t) == 4), "");
 
 
 /* We like our types POD */
@@ -300,7 +298,7 @@
 /* Void! */
 struct _hb_void_t {};
 typedef const _hb_void_t *hb_void_t;
-#define HB_VOID ((const _hb_void_t *) NULL)
+#define HB_VOID ((const _hb_void_t *) nullptr)
 
 /* Return the number of 1 bits in mask. */
 static inline HB_CONST_FUNC unsigned int
@@ -316,6 +314,18 @@
   return (((y + (y >> 3)) & 030707070707) % 077);
 #endif
 }
+static inline HB_CONST_FUNC unsigned int
+_hb_popcount64 (uint64_t mask)
+{
+#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+  if (sizeof (long) >= sizeof (mask))
+    return __builtin_popcountl (mask);
+#endif
+  return _hb_popcount32 (mask & 0xFFFFFFFF) + _hb_popcount32 (mask >> 32);
+}
+template <typename T> static inline unsigned int _hb_popcount (T mask);
+template <> inline unsigned int _hb_popcount<uint32_t> (uint32_t mask) { return _hb_popcount32 (mask); }
+template <> inline unsigned int _hb_popcount<uint64_t> (uint64_t mask) { return _hb_popcount64 (mask); }
 
 /* Returns the number of bits needed to store number */
 static inline HB_CONST_FUNC unsigned int
@@ -357,16 +367,11 @@
 }
 
 
-/* Type of bsearch() / qsort() compare function */
-typedef int (*hb_compare_func_t) (const void *, const void *);
-
-
-
 
 /* arrays and maps */
 
 
-#define HB_PREALLOCED_ARRAY_INIT {0, 0, NULL}
+#define HB_PREALLOCED_ARRAY_INIT {0, 0, nullptr}
 template <typename Type, unsigned int StaticSize=16>
 struct hb_prealloced_array_t
 {
@@ -375,41 +380,56 @@
   Type *array;
   Type static_array[StaticSize];
 
-  void init (void) { memset (this, 0, sizeof (*this)); }
+  void init (void)
+  {
+    len = 0;
+    allocated = ARRAY_LENGTH (static_array);
+    array = static_array;
+  }
 
   inline Type& operator [] (unsigned int i) { return array[i]; }
   inline const Type& operator [] (unsigned int i) const { return array[i]; }
 
   inline Type *push (void)
   {
-    if (!array) {
-      array = static_array;
-      allocated = ARRAY_LENGTH (static_array);
-    }
-    if (likely (len < allocated))
-      return &array[len++];
+    if (unlikely (!resize (len + 1)))
+      return nullptr;
+
+    return &array[len - 1];
+  }
+
+  inline bool resize (unsigned int size)
+  {
+    if (unlikely (size > allocated))
+    {
+      /* Need to reallocate */
+
+      unsigned int new_allocated = allocated;
+      while (size >= new_allocated)
+        new_allocated += (new_allocated >> 1) + 8;
 
-    /* Need to reallocate */
-    unsigned int new_allocated = allocated + (allocated >> 1) + 8;
-    Type *new_array = NULL;
+      Type *new_array = nullptr;
 
-    if (array == static_array) {
-      new_array = (Type *) calloc (new_allocated, sizeof (Type));
-      if (new_array)
-        memcpy (new_array, array, len * sizeof (Type));
-    } else {
-      bool overflows = (new_allocated < allocated) || _hb_unsigned_int_mul_overflows (new_allocated, sizeof (Type));
-      if (likely (!overflows)) {
-        new_array = (Type *) realloc (array, new_allocated * sizeof (Type));
+      if (array == static_array) {
+        new_array = (Type *) calloc (new_allocated, sizeof (Type));
+        if (new_array)
+          memcpy (new_array, array, len * sizeof (Type));
+      } else {
+        bool overflows = (new_allocated < allocated) || _hb_unsigned_int_mul_overflows (new_allocated, sizeof (Type));
+        if (likely (!overflows)) {
+          new_array = (Type *) realloc (array, new_allocated * sizeof (Type));
+        }
       }
+
+      if (unlikely (!new_array))
+        return false;
+
+      array = new_array;
+      allocated = new_allocated;
     }
 
-    if (unlikely (!new_array))
-      return NULL;
-
-    array = new_array;
-    allocated = new_allocated;
-    return &array[len++];
+    len = size;
+    return true;
   }
 
   inline void pop (void)
@@ -438,42 +458,67 @@
     for (unsigned int i = 0; i < len; i++)
       if (array[i] == v)
         return &array[i];
-    return NULL;
+    return nullptr;
   }
   template <typename T>
   inline const Type *find (T v) const {
     for (unsigned int i = 0; i < len; i++)
       if (array[i] == v)
         return &array[i];
-    return NULL;
+    return nullptr;
   }
 
   inline void qsort (void)
   {
-    ::qsort (array, len, sizeof (Type), (hb_compare_func_t) Type::cmp);
+    ::qsort (array, len, sizeof (Type), Type::cmp);
   }
 
   inline void qsort (unsigned int start, unsigned int end)
   {
-    ::qsort (array + start, end - start, sizeof (Type), (hb_compare_func_t) Type::cmp);
+    ::qsort (array + start, end - start, sizeof (Type), Type::cmp);
   }
 
   template <typename T>
-  inline Type *bsearch (T *key)
+  inline Type *bsearch (T *x)
   {
-    return (Type *) ::bsearch (key, array, len, sizeof (Type), (hb_compare_func_t) Type::cmp);
+    unsigned int i;
+    return bfind (x, &i) ? &array[i] : nullptr;
+  }
+  template <typename T>
+  inline const Type *bsearch (T *x) const
+  {
+    unsigned int i;
+    return bfind (x, &i) ? &array[i] : nullptr;
   }
   template <typename T>
-  inline const Type *bsearch (T *key) const
+  inline bool bfind (T *x, unsigned int *i) const
   {
-    return (const Type *) ::bsearch (key, array, len, sizeof (Type), (hb_compare_func_t) Type::cmp);
+    int min = 0, max = (int) this->len - 1;
+    while (min <= max)
+    {
+      int mid = (min + max) / 2;
+      int c = this->array[mid].cmp (x);
+      if (c < 0)
+        max = mid - 1;
+      else if (c > 0)
+        min = mid + 1;
+      else
+      {
+        *i = mid;
+        return true;
+      }
+    }
+    if (max < 0 || (max < (int) this->len && this->array[max].cmp (x) > 0))
+      max++;
+    *i = max;
+    return false;
   }
 
   inline void finish (void)
   {
     if (array != static_array)
       free (array);
-    array = NULL;
+    array = nullptr;
     allocated = len = 0;
   }
 };
@@ -490,7 +535,7 @@
 template <typename item_t, typename lock_t>
 struct hb_lockable_set_t
 {
-  hb_prealloced_array_t <item_t, 2> items;
+  hb_prealloced_array_t <item_t, 1> items;
 
   inline void init (void) { items.init (); }
 
@@ -507,7 +552,7 @@
         old.finish ();
       }
       else {
-        item = NULL;
+        item = nullptr;
         l.unlock ();
       }
     } else {
@@ -595,22 +640,6 @@
 static inline unsigned char TOLOWER (unsigned char c)
 { return (c >= 'A' && c <= 'Z') ? c - 'A' + 'a' : c; }
 
-#define HB_TAG_CHAR4(s)   (HB_TAG(((const char *) s)[0], \
-                                  ((const char *) s)[1], \
-                                  ((const char *) s)[2], \
-                                  ((const char *) s)[3]))
-
-
-/* C++ helpers */
-
-/* Makes class uncopyable.  Use in private: section. */
-#define NO_COPY(T) \
-  T (const T &o); \
-  T &operator = (const T &o)
-
-
-/* Debug */
-
 
 /* HB_NDEBUG disables some sanity checks that are very safe to disable and
  * should be disabled in production systems.  If NDEBUG is defined, enable
@@ -621,255 +650,6 @@
 #define HB_NDEBUG
 #endif
 
-#ifndef HB_DEBUG
-#define HB_DEBUG 0
-#endif
-
-static inline bool
-_hb_debug (unsigned int level,
-           unsigned int max_level)
-{
-  return level < max_level;
-}
-
-#define DEBUG_LEVEL_ENABLED(WHAT, LEVEL) (_hb_debug ((LEVEL), HB_DEBUG_##WHAT))
-#define DEBUG_ENABLED(WHAT) (DEBUG_LEVEL_ENABLED (WHAT, 0))
-
-static inline void
-_hb_print_func (const char *func)
-{
-  if (func)
-  {
-    unsigned int func_len = strlen (func);
-    /* Skip "static" */
-    if (0 == strncmp (func, "static ", 7))
-      func += 7;
-    /* Skip "typename" */
-    if (0 == strncmp (func, "typename ", 9))
-      func += 9;
-    /* Skip return type */
-    const char *space = strchr (func, ' ');
-    if (space)
-      func = space + 1;
-    /* Skip parameter list */
-    const char *paren = strchr (func, '(');
-    if (paren)
-      func_len = paren - func;
-    fprintf (stderr, "%.*s", func_len, func);
-  }
-}
-
-template <int max_level> static inline void
-_hb_debug_msg_va (const char *what,
-                  const void *obj,
-                  const char *func,
-                  bool indented,
-                  unsigned int level,
-                  int level_dir,
-                  const char *message,
-                  va_list ap) HB_PRINTF_FUNC(7, 0);
-template <int max_level> static inline void
-_hb_debug_msg_va (const char *what,
-                  const void *obj,
-                  const char *func,
-                  bool indented,
-                  unsigned int level,
-                  int level_dir,
-                  const char *message,
-                  va_list ap)
-{
-  if (!_hb_debug (level, max_level))
-    return;
-
-  fprintf (stderr, "%-10s", what ? what : "");
-
-  if (obj)
-    fprintf (stderr, "(%0*lx) ", (unsigned int) (2 * sizeof (void *)), (unsigned long) obj);
-  else
-    fprintf (stderr, " %*s  ", (unsigned int) (2 * sizeof (void *)), "");
-
-  if (indented) {
-#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
-      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) - 1, (unsigned int) (sizeof (VBAR) - 1) * level),
-             level_dir ? (level_dir > 0 ? DLBAR : ULBAR) : LBAR);
-  } else
-    fprintf (stderr, "   " VRBAR LBAR);
-
-  _hb_print_func (func);
-
-  if (message)
-  {
-    fprintf (stderr, ": ");
-    vfprintf (stderr, message, ap);
-  }
-
-  fprintf (stderr, "\n");
-}
-template <> inline void
-_hb_debug_msg_va<0> (const char *what HB_UNUSED,
-                     const void *obj HB_UNUSED,
-                     const char *func HB_UNUSED,
-                     bool indented HB_UNUSED,
-                     unsigned int level HB_UNUSED,
-                     int level_dir HB_UNUSED,
-                     const char *message HB_UNUSED,
-                     va_list ap HB_UNUSED) {}
-
-template <int max_level> static inline void
-_hb_debug_msg (const char *what,
-               const void *obj,
-               const char *func,
-               bool indented,
-               unsigned int level,
-               int level_dir,
-               const char *message,
-               ...) HB_PRINTF_FUNC(7, 8);
-template <int max_level> static inline void
-_hb_debug_msg (const char *what,
-               const void *obj,
-               const char *func,
-               bool indented,
-               unsigned int level,
-               int level_dir,
-               const char *message,
-               ...)
-{
-  va_list ap;
-  va_start (ap, message);
-  _hb_debug_msg_va<max_level> (what, obj, func, indented, level, level_dir, message, ap);
-  va_end (ap);
-}
-template <> inline void
-_hb_debug_msg<0> (const char *what HB_UNUSED,
-                  const void *obj HB_UNUSED,
-                  const char *func HB_UNUSED,
-                  bool indented HB_UNUSED,
-                  unsigned int level HB_UNUSED,
-                  int level_dir HB_UNUSED,
-                  const char *message HB_UNUSED,
-                  ...) HB_PRINTF_FUNC(7, 8);
-template <> inline void
-_hb_debug_msg<0> (const char *what HB_UNUSED,
-                  const void *obj HB_UNUSED,
-                  const char *func HB_UNUSED,
-                  bool indented HB_UNUSED,
-                  unsigned int level HB_UNUSED,
-                  int level_dir HB_UNUSED,
-                  const char *message HB_UNUSED,
-                  ...) {}
-
-#define DEBUG_MSG_LEVEL(WHAT, OBJ, LEVEL, LEVEL_DIR, ...)       _hb_debug_msg<HB_DEBUG_##WHAT> (#WHAT, (OBJ), NULL,    true, (LEVEL), (LEVEL_DIR), __VA_ARGS__)
-#define DEBUG_MSG(WHAT, OBJ, ...)                               _hb_debug_msg<HB_DEBUG_##WHAT> (#WHAT, (OBJ), NULL,    false, 0, 0, __VA_ARGS__)
-#define DEBUG_MSG_FUNC(WHAT, OBJ, ...)                          _hb_debug_msg<HB_DEBUG_##WHAT> (#WHAT, (OBJ), HB_FUNC, false, 0, 0, __VA_ARGS__)
-
-
-/*
- * Printer
- */
-
-template <typename T>
-struct hb_printer_t {
-  const char *print (const T&) { return "something"; }
-};
-
-template <>
-struct hb_printer_t<bool> {
-  const char *print (bool v) { return v ? "true" : "false"; }
-};
-
-template <>
-struct hb_printer_t<hb_void_t> {
-  const char *print (hb_void_t) { return ""; }
-};
-
-
-/*
- * Trace
- */
-
-template <typename T>
-static inline void _hb_warn_no_return (bool returned)
-{
-  if (unlikely (!returned)) {
-    fprintf (stderr, "OUCH, returned with no call to return_trace().  This is a bug, please report.\n");
-  }
-}
-template <>
-/*static*/ inline void _hb_warn_no_return<hb_void_t> (bool returned HB_UNUSED)
-{}
-
-template <int max_level, typename ret_t>
-struct hb_auto_trace_t {
-  explicit inline hb_auto_trace_t (unsigned int *plevel_,
-                                   const char *what_,
-                                   const void *obj_,
-                                   const char *func,
-                                   const char *message,
-                                   ...) : plevel (plevel_), what (what_), obj (obj_), returned (false)
-  {
-    if (plevel) ++*plevel;
-
-    va_list ap;
-    va_start (ap, message);
-    _hb_debug_msg_va<max_level> (what, obj, func, true, plevel ? *plevel : 0, +1, message, ap);
-    va_end (ap);
-  }
-  inline ~hb_auto_trace_t (void)
-  {
-    _hb_warn_no_return<ret_t> (returned);
-    if (!returned) {
-      _hb_debug_msg<max_level> (what, obj, NULL, true, plevel ? *plevel : 1, -1, " ");
-    }
-    if (plevel) --*plevel;
-  }
-
-  inline ret_t ret (ret_t v, unsigned int line = 0)
-  {
-    if (unlikely (returned)) {
-      fprintf (stderr, "OUCH, double calls to return_trace().  This is a bug, please report.\n");
-      return v;
-    }
-
-    _hb_debug_msg<max_level> (what, obj, NULL, true, plevel ? *plevel : 1, -1,
-                              "return %s (line %d)",
-                              hb_printer_t<ret_t>().print (v), line);
-    if (plevel) --*plevel;
-    plevel = NULL;
-    returned = true;
-    return v;
-  }
-
-  private:
-  unsigned int *plevel;
-  const char *what;
-  const void *obj;
-  bool returned;
-};
-template <typename ret_t> /* Optimize when tracing is disabled */
-struct hb_auto_trace_t<0, ret_t> {
-  explicit inline hb_auto_trace_t (unsigned int *plevel_ HB_UNUSED,
-                                   const char *what HB_UNUSED,
-                                   const void *obj HB_UNUSED,
-                                   const char *func HB_UNUSED,
-                                   const char *message HB_UNUSED,
-                                   ...) {}
-
-  inline ret_t ret (ret_t v, unsigned int line HB_UNUSED = 0) { return v; }
-};
-
-#define return_trace(RET) return trace.ret (RET, __LINE__)
 
 /* Misc */
 
@@ -887,7 +667,7 @@
    * one right now.  Declaring a variable won't work as HB_UNUSED
    * is unusable on some platforms and unused types are less likely
    * to generate a warning than unused variables. */
-  ASSERT_STATIC (sizeof (hb_assert_unsigned_t<T>) >= 0);
+  static_assert ((sizeof (hb_assert_unsigned_t<T>) >= 0), "");
 
   /* The casts below are important as if T is smaller than int,
    * the subtract results will become a signed int! */
@@ -932,11 +712,10 @@
 
 /* Useful for set-operations on small enums.
  * For example, for testing "x ∈ {x1, x2, x3}" use:
- * (FLAG_SAFE(x) & (FLAG(x1) | FLAG(x2) | FLAG(x3)))
+ * (FLAG_UNSAFE(x) & (FLAG(x1) | FLAG(x2) | FLAG(x3)))
  */
-#define FLAG(x) (ASSERT_STATIC_EXPR_ZERO ((x) < 32) + (1U << (x)))
-#define FLAG_SAFE(x) (1U << (x))
-#define FLAG_UNSAFE(x) ((x) < 32 ? FLAG_SAFE(x) : 0)
+#define FLAG(x) (ASSERT_STATIC_EXPR_ZERO ((unsigned int)(x) < 32) + (1U << (unsigned int)(x)))
+#define FLAG_UNSAFE(x) ((unsigned int)(x) < 32 ? (1U << (unsigned int)(x)) : 0)
 #define FLAG_RANGE(x,y) (ASSERT_STATIC_EXPR_ZERO ((x) < (y)) + FLAG(y+1) - FLAG(x))
 
 
@@ -968,7 +747,7 @@
 template <typename T> static inline void
 hb_stable_sort (T *array, unsigned int len, int(*compar)(const T *, const T *))
 {
-  hb_stable_sort (array, len, compar, (int *) NULL);
+  hb_stable_sort (array, len, compar, (int *) nullptr);
 }
 
 static inline hb_bool_t
@@ -990,6 +769,73 @@
 }
 
 
+/* Vectorization */
+
+struct HbOpOr
+{
+  static const bool passthru_left = true;
+  static const bool passthru_right = true;
+  template <typename T> static void process (T &o, const T &a, const T &b) { o = a | b; }
+};
+struct HbOpAnd
+{
+  static const bool passthru_left = false;
+  static const bool passthru_right = false;
+  template <typename T> static void process (T &o, const T &a, const T &b) { o = a & b; }
+};
+struct HbOpMinus
+{
+  static const bool passthru_left = true;
+  static const bool passthru_right = false;
+  template <typename T> static void process (T &o, const T &a, const T &b) { o = a & ~b; }
+};
+struct HbOpXor
+{
+  static const bool passthru_left = true;
+  static const bool passthru_right = true;
+  template <typename T> static void process (T &o, const T &a, const T &b) { o = a ^ b; }
+};
+
+/* Type behaving similar to vectorized vars defined using __attribute__((vector_size(...))). */
+template <typename elt_t, unsigned int byte_size>
+struct hb_vector_size_t
+{
+  elt_t& operator [] (unsigned int i) { return v[i]; }
+  const elt_t& operator [] (unsigned int i) const { return v[i]; }
+
+  template <class Op>
+  inline hb_vector_size_t process (const hb_vector_size_t &o) const
+  {
+    hb_vector_size_t r;
+    for (unsigned int i = 0; i < ARRAY_LENGTH (v); i++)
+      Op::process (r.v[i], v[i], o.v[i]);
+    return r;
+  }
+  inline hb_vector_size_t operator | (const hb_vector_size_t &o) const
+  { return process<HbOpOr> (o); }
+  inline hb_vector_size_t operator & (const hb_vector_size_t &o) const
+  { return process<HbOpAnd> (o); }
+  inline hb_vector_size_t operator ^ (const hb_vector_size_t &o) const
+  { return process<HbOpXor> (o); }
+  inline hb_vector_size_t operator ~ () const
+  {
+    hb_vector_size_t r;
+    for (unsigned int i = 0; i < ARRAY_LENGTH (v); i++)
+      r.v[i] = ~v[i];
+    return r;
+  }
+
+  private:
+  static_assert (byte_size / sizeof (elt_t) * sizeof (elt_t) == byte_size, "");
+  elt_t v[byte_size / sizeof (elt_t)];
+};
+
+/* The `vector_size' attribute was introduced in gcc 3.1. */
+#if defined( __GNUC__ ) && ( __GNUC__ >= 4 )
+#define HAVE_VECTOR_SIZE 1
+#endif
+
+
 /* Global runtime options. */
 
 struct hb_options_t
@@ -1002,7 +848,7 @@
   unsigned int i;
   hb_options_t opts;
 };
-ASSERT_STATIC (sizeof (int) == sizeof (hb_options_union_t));
+static_assert ((sizeof (int) == sizeof (hb_options_union_t)), "");
 
 HB_INTERNAL void
 _hb_options_init (void);
@@ -1021,4 +867,31 @@
 /* Size signifying variable-sized array */
 #define VAR 1
 
+
+/* String type. */
+
+struct hb_string_t
+{
+  inline hb_string_t (void) : bytes (nullptr), len (0) {}
+  inline hb_string_t (const char *bytes_, unsigned int len_) : bytes (bytes_), len (len_) {}
+
+  inline int cmp (const hb_string_t &a) const
+  {
+    if (len != a.len)
+      return (int) a.len - (int) len;
+
+    return memcmp (a.bytes, bytes, len);
+  }
+  static inline int cmp (const void *pa, const void *pb)
+  {
+    hb_string_t *a = (hb_string_t *) pa;
+    hb_string_t *b = (hb_string_t *) pb;
+    return b->cmp (*a);
+  }
+
+  const char *bytes;
+  unsigned int len;
+};
+
+
 #endif /* HB_PRIVATE_HH */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-set-digest-private.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,144 @@
+/*
+ * Copyright © 2012  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): Behdad Esfahbod
+ */
+
+#ifndef HB_SET_DIGEST_PRIVATE_HH
+#define HB_SET_DIGEST_PRIVATE_HH
+
+#include "hb-private.hh"
+
+/*
+ * The set digests here implement various "filters" that support
+ * "approximate member query".  Conceptually these are like Bloom
+ * Filter and Quotient Filter, however, much smaller, faster, and
+ * designed to fit the requirements of our uses for glyph coverage
+ * queries.
+ *
+ * Our filters are highly accurate if the lookup covers fairly local
+ * set of glyphs, but fully flooded and ineffective if coverage is
+ * all over the place.
+ *
+ * The frozen-set can be used instead of a digest, to trade more
+ * memory for 100% accuracy, but in practice, that doesn't look like
+ * an attractive trade-off.
+ */
+
+template <typename mask_t, unsigned int shift>
+struct hb_set_digest_lowest_bits_t
+{
+  ASSERT_POD ();
+
+  static const unsigned int mask_bytes = sizeof (mask_t);
+  static const unsigned int mask_bits = sizeof (mask_t) * 8;
+  static const unsigned int num_bits = 0
+                                     + (mask_bytes >= 1 ? 3 : 0)
+                                     + (mask_bytes >= 2 ? 1 : 0)
+                                     + (mask_bytes >= 4 ? 1 : 0)
+                                     + (mask_bytes >= 8 ? 1 : 0)
+                                     + (mask_bytes >= 16? 1 : 0)
+                                     + 0;
+
+  static_assert ((shift < sizeof (hb_codepoint_t) * 8), "");
+  static_assert ((shift + num_bits <= sizeof (hb_codepoint_t) * 8), "");
+
+  inline void init (void) {
+    mask = 0;
+  }
+
+  inline void add (hb_codepoint_t g) {
+    mask |= mask_for (g);
+  }
+
+  inline void add_range (hb_codepoint_t a, hb_codepoint_t b) {
+    if ((b >> shift) - (a >> shift) >= mask_bits - 1)
+      mask = (mask_t) -1;
+    else {
+      mask_t ma = mask_for (a);
+      mask_t mb = mask_for (b);
+      mask |= mb + (mb - ma) - (mb < ma);
+    }
+  }
+
+  inline bool may_have (hb_codepoint_t g) const {
+    return !!(mask & mask_for (g));
+  }
+
+  private:
+
+  static inline mask_t mask_for (hb_codepoint_t g) {
+    return ((mask_t) 1) << ((g >> shift) & (mask_bits - 1));
+  }
+  mask_t mask;
+};
+
+template <typename head_t, typename tail_t>
+struct hb_set_digest_combiner_t
+{
+  ASSERT_POD ();
+
+  inline void init (void) {
+    head.init ();
+    tail.init ();
+  }
+
+  inline void add (hb_codepoint_t g) {
+    head.add (g);
+    tail.add (g);
+  }
+
+  inline void add_range (hb_codepoint_t a, hb_codepoint_t b) {
+    head.add_range (a, b);
+    tail.add_range (a, b);
+  }
+
+  inline bool may_have (hb_codepoint_t g) const {
+    return head.may_have (g) && tail.may_have (g);
+  }
+
+  private:
+  head_t head;
+  tail_t tail;
+};
+
+
+/*
+ * hb_set_digest_t
+ *
+ * This is a combination of digests that performs "best".
+ * There is not much science to this: it's a result of intuition
+ * and testing.
+ */
+typedef hb_set_digest_combiner_t
+<
+  hb_set_digest_lowest_bits_t<unsigned long, 4>,
+  hb_set_digest_combiner_t
+  <
+    hb_set_digest_lowest_bits_t<unsigned long, 0>,
+    hb_set_digest_lowest_bits_t<unsigned long, 9>
+  >
+> hb_set_digest_t;
+
+
+#endif /* HB_SET_DIGEST_PRIVATE_HH */
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-set-private.hh	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-set-private.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2012  Google, Inc.
+ * Copyright © 2012,2017  Google, Inc.
  *
  *  This is part of HarfBuzz, a text shaping library.
  *
@@ -32,157 +32,173 @@
 
 
 /*
- * The set digests here implement various "filters" that support
- * "approximate member query".  Conceptually these are like Bloom
- * Filter and Quotient Filter, however, much smaller, faster, and
- * designed to fit the requirements of our uses for glyph coverage
- * queries.
- *
- * Our filters are highly accurate if the lookup covers fairly local
- * set of glyphs, but fully flooded and ineffective if coverage is
- * all over the place.
- *
- * The frozen-set can be used instead of a digest, to trade more
- * memory for 100% accuracy, but in practice, that doesn't look like
- * an attractive trade-off.
- */
-
-template <typename mask_t, unsigned int shift>
-struct hb_set_digest_lowest_bits_t
-{
-  ASSERT_POD ();
-
-  static const unsigned int mask_bytes = sizeof (mask_t);
-  static const unsigned int mask_bits = sizeof (mask_t) * 8;
-  static const unsigned int num_bits = 0
-                                     + (mask_bytes >= 1 ? 3 : 0)
-                                     + (mask_bytes >= 2 ? 1 : 0)
-                                     + (mask_bytes >= 4 ? 1 : 0)
-                                     + (mask_bytes >= 8 ? 1 : 0)
-                                     + (mask_bytes >= 16? 1 : 0)
-                                     + 0;
-
-  ASSERT_STATIC (shift < sizeof (hb_codepoint_t) * 8);
-  ASSERT_STATIC (shift + num_bits <= sizeof (hb_codepoint_t) * 8);
-
-  inline void init (void) {
-    mask = 0;
-  }
-
-  inline void add (hb_codepoint_t g) {
-    mask |= mask_for (g);
-  }
-
-  inline void add_range (hb_codepoint_t a, hb_codepoint_t b) {
-    if ((b >> shift) - (a >> shift) >= mask_bits - 1)
-      mask = (mask_t) -1;
-    else {
-      mask_t ma = mask_for (a);
-      mask_t mb = mask_for (b);
-      mask |= mb + (mb - ma) - (mb < ma);
-    }
-  }
-
-  inline bool may_have (hb_codepoint_t g) const {
-    return !!(mask & mask_for (g));
-  }
-
-  private:
-
-  static inline mask_t mask_for (hb_codepoint_t g) {
-    return ((mask_t) 1) << ((g >> shift) & (mask_bits - 1));
-  }
-  mask_t mask;
-};
-
-template <typename head_t, typename tail_t>
-struct hb_set_digest_combiner_t
-{
-  ASSERT_POD ();
-
-  inline void init (void) {
-    head.init ();
-    tail.init ();
-  }
-
-  inline void add (hb_codepoint_t g) {
-    head.add (g);
-    tail.add (g);
-  }
-
-  inline void add_range (hb_codepoint_t a, hb_codepoint_t b) {
-    head.add_range (a, b);
-    tail.add_range (a, b);
-  }
-
-  inline bool may_have (hb_codepoint_t g) const {
-    return head.may_have (g) && tail.may_have (g);
-  }
-
-  private:
-  head_t head;
-  tail_t tail;
-};
-
-
-/*
- * hb_set_digest_t
- *
- * This is a combination of digests that performs "best".
- * There is not much science to this: it's a result of intuition
- * and testing.
- */
-typedef hb_set_digest_combiner_t
-<
-  hb_set_digest_lowest_bits_t<unsigned long, 4>,
-  hb_set_digest_combiner_t
-  <
-    hb_set_digest_lowest_bits_t<unsigned long, 0>,
-    hb_set_digest_lowest_bits_t<unsigned long, 9>
-  >
-> hb_set_digest_t;
-
-
-
-/*
  * hb_set_t
  */
 
-
-/* TODO Make this faster and memmory efficient. */
-
 struct hb_set_t
 {
-  friend struct hb_frozen_set_t;
+  struct page_map_t
+  {
+    inline int cmp (const page_map_t *o) const { return (int) o->major - (int) major; }
+
+    uint32_t major;
+    uint32_t index;
+  };
+
+  struct page_t
+  {
+    inline void init (void) {
+      memset (&v, 0, sizeof (v));
+    }
+
+    inline unsigned int len (void) const
+    { return ARRAY_LENGTH_CONST (v); }
+
+    inline bool is_empty (void) const
+    {
+      for (unsigned int i = 0; i < len (); i++)
+        if (v[i])
+          return false;
+      return true;
+    }
+
+    inline void add (hb_codepoint_t g) { elt (g) |= mask (g); }
+    inline void del (hb_codepoint_t g) { elt (g) &= ~mask (g); }
+    inline bool has (hb_codepoint_t g) const { return !!(elt (g) & mask (g)); }
+
+    inline bool is_equal (const page_t *other) const
+    {
+      return 0 == memcmp (&v, &other->v, sizeof (v));
+    }
+
+    inline unsigned int get_population (void) const
+    {
+      unsigned int pop = 0;
+      for (unsigned int i = 0; i < len (); i++)
+        pop += _hb_popcount (v[i]);
+      return pop;
+    }
+
+    inline bool next (hb_codepoint_t *codepoint) const
+    {
+      unsigned int m = (*codepoint + 1) & MASK;
+      if (!m)
+      {
+        *codepoint = INVALID;
+        return false;
+      }
+      unsigned int i = m / ELT_BITS;
+      unsigned int j = m & ELT_MASK;
+
+      for (; j < ELT_BITS; j++)
+        if (v[i] & (elt_t (1) << j))
+          goto found;
+      for (i++; i < len (); i++)
+        if (v[i])
+          for (j = 0; j < ELT_BITS; j++)
+            if (v[i] & (elt_t (1) << j))
+              goto found;
+
+      *codepoint = INVALID;
+      return false;
+
+    found:
+      *codepoint = i * ELT_BITS + j;
+      return true;
+    }
+    inline hb_codepoint_t get_min (void) const
+    {
+      for (unsigned int i = 0; i < len (); i++)
+        if (v[i])
+        {
+          elt_t e = v[i];
+          for (unsigned int j = 0; j < ELT_BITS; j++)
+            if (e & (elt_t (1) << j))
+              return i * ELT_BITS + j;
+        }
+      return INVALID;
+    }
+    inline hb_codepoint_t get_max (void) const
+    {
+      for (int i = len () - 1; i >= 0; i--)
+        if (v[i])
+        {
+          elt_t e = v[i];
+          for (int j = ELT_BITS - 1; j >= 0; j--)
+            if (e & (elt_t (1) << j))
+              return i * ELT_BITS + j;
+        }
+      return 0;
+    }
+
+    static const unsigned int PAGE_BITS = 512; /* Use to tune. */
+    static_assert ((PAGE_BITS & ((PAGE_BITS) - 1)) == 0, "");
+
+    typedef uint64_t elt_t;
+
+#if 0 && HAVE_VECTOR_SIZE
+    /* The vectorized version does not work with clang as non-const
+     * elt() errs "non-const reference cannot bind to vector element". */
+    typedef elt_t vector_t __attribute__((vector_size (PAGE_BITS / 8)));
+#else
+    typedef hb_vector_size_t<elt_t, PAGE_BITS / 8> vector_t;
+#endif
+
+    vector_t v;
+
+    static const unsigned int ELT_BITS = sizeof (elt_t) * 8;
+    static const unsigned int ELT_MASK = ELT_BITS - 1;
+    static const unsigned int BITS = sizeof (vector_t) * 8;
+    static const unsigned int MASK = BITS - 1;
+    static_assert (PAGE_BITS == BITS, "");
+
+    elt_t &elt (hb_codepoint_t g) { return v[(g & MASK) / ELT_BITS]; }
+    elt_t const &elt (hb_codepoint_t g) const { return v[(g & MASK) / ELT_BITS]; }
+    elt_t mask (hb_codepoint_t g) const { return elt_t (1) << (g & ELT_MASK); }
+  };
+  static_assert (page_t::PAGE_BITS == sizeof (page_t) * 8, "");
 
   hb_object_header_t header;
   ASSERT_POD ();
   bool in_error;
+  hb_prealloced_array_t<page_map_t, 8> page_map;
+  hb_prealloced_array_t<page_t, 8> pages;
 
-  inline void init (void) {
-    hb_object_init (this);
-    clear ();
+  inline bool resize (unsigned int count)
+  {
+    if (unlikely (in_error)) return false;
+    if (!pages.resize (count) || !page_map.resize (count))
+    {
+      pages.resize (page_map.len);
+      in_error = true;
+      return false;
+    }
+    return true;
   }
-  inline void fini (void) {
-  }
+
   inline void clear (void) {
     if (unlikely (hb_object_is_inert (this)))
       return;
     in_error = false;
-    memset (elts, 0, sizeof elts);
+    page_map.resize (0);
+    pages.resize (0);
   }
   inline bool is_empty (void) const {
-    for (unsigned int i = 0; i < ARRAY_LENGTH (elts); i++)
-      if (elts[i])
+    unsigned int count = pages.len;
+    for (unsigned int i = 0; i < count; i++)
+      if (!pages[i].is_empty ())
         return false;
     return true;
   }
+
   inline void add (hb_codepoint_t g)
   {
     if (unlikely (in_error)) return;
     if (unlikely (g == INVALID)) return;
-    if (unlikely (g > MAX_G)) return;
-    elt (g) |= mask (g);
+    page_t *page = page_for_insert (g);
+    if (!page)
+      return;
+    page->add (g);
   }
   inline void add_range (hb_codepoint_t a, hb_codepoint_t b)
   {
@@ -194,92 +210,181 @@
   inline void del (hb_codepoint_t g)
   {
     if (unlikely (in_error)) return;
-    if (unlikely (g > MAX_G)) return;
-    elt (g) &= ~mask (g);
+    page_t *p = page_for (g);
+    if (!p)
+      return;
+    p->del (g);
   }
   inline void del_range (hb_codepoint_t a, hb_codepoint_t b)
   {
     if (unlikely (in_error)) return;
-    /* TODO Speedup */
     for (unsigned int i = a; i < b + 1; i++)
       del (i);
   }
   inline bool has (hb_codepoint_t g) const
   {
-    if (unlikely (g > MAX_G)) return false;
-    return !!(elt (g) & mask (g));
+    const page_t *p = page_for (g);
+    if (!p)
+      return false;
+    return p->has (g);
   }
   inline bool intersects (hb_codepoint_t first,
                           hb_codepoint_t last) const
   {
-    if (unlikely (first > MAX_G)) return false;
-    if (unlikely (last  > MAX_G)) last = MAX_G;
-    unsigned int end = last + 1;
-    for (hb_codepoint_t i = first; i < end; i++)
-      if (has (i))
-        return true;
-    return false;
-  }
-  inline bool is_equal (const hb_set_t *other) const
-  {
-    for (unsigned int i = 0; i < ELTS; i++)
-      if (elts[i] != other->elts[i])
-        return false;
-    return true;
+    hb_codepoint_t c = first - 1;
+    return next (&c) && c <= last;
   }
   inline void set (const hb_set_t *other)
   {
     if (unlikely (in_error)) return;
-    for (unsigned int i = 0; i < ELTS; i++)
-      elts[i] = other->elts[i];
+    unsigned int count = other->pages.len;
+    if (!resize (count))
+      return;
+
+    memcpy (pages.array, other->pages.array, count * sizeof (pages.array[0]));
+    memcpy (page_map.array, other->page_map.array, count * sizeof (page_map.array[0]));
+  }
+
+  inline bool is_equal (const hb_set_t *other) const
+  {
+    unsigned int na = pages.len;
+    unsigned int nb = other->pages.len;
+
+    unsigned int a = 0, b = 0;
+    for (; a < na && b < nb; )
+    {
+      if (page_at (a).is_empty ()) { a++; continue; }
+      if (other->page_at (b).is_empty ()) { b++; continue; }
+      if (page_map[a].major != other->page_map[b].major ||
+          !page_at (a).is_equal (&other->page_at (b)))
+        return false;
+      a++;
+      b++;
+    }
+    for (; a < na; a++)
+      if (!page_at (a).is_empty ()) { return false; }
+    for (; b < nb; b++)
+      if (!other->page_at (b).is_empty ()) { return false; }
+
+    return true;
   }
+
+  template <class Op>
+  inline void process (const hb_set_t *other)
+  {
+    if (unlikely (in_error)) return;
+
+    unsigned int na = pages.len;
+    unsigned int nb = other->pages.len;
+
+    unsigned int count = 0;
+    unsigned int a = 0, b = 0;
+    for (; a < na && b < nb; )
+    {
+      if (page_map[a].major == other->page_map[b].major)
+      {
+        count++;
+        a++;
+        b++;
+      }
+      else if (page_map[a].major < other->page_map[b].major)
+      {
+        if (Op::passthru_left)
+          count++;
+        a++;
+      }
+      else
+      {
+        if (Op::passthru_right)
+          count++;
+        b++;
+      }
+    }
+    if (Op::passthru_left)
+      count += na - a;
+    if (Op::passthru_right)
+      count += nb - b;
+
+    if (!resize (count))
+      return;
+
+    /* Process in-place backward. */
+    a = na;
+    b = nb;
+    for (; a && b; )
+    {
+      if (page_map[a - 1].major == other->page_map[b - 1].major)
+      {
+        a--;
+        b--;
+        Op::process (page_at (--count).v, page_at (a).v, other->page_at (b).v);
+      }
+      else if (page_map[a - 1].major > other->page_map[b - 1].major)
+      {
+        a--;
+        if (Op::passthru_left)
+          page_at (--count).v = page_at (a).v;
+      }
+      else
+      {
+        b--;
+        if (Op::passthru_right)
+          page_at (--count).v = other->page_at (b).v;
+      }
+    }
+    if (Op::passthru_left)
+      while (a)
+        page_at (--count).v = page_at (--a).v;
+    if (Op::passthru_right)
+      while (b)
+        page_at (--count).v = other->page_at (--b).v;
+    assert (!count);
+  }
+
   inline void union_ (const hb_set_t *other)
   {
-    if (unlikely (in_error)) return;
-    for (unsigned int i = 0; i < ELTS; i++)
-      elts[i] |= other->elts[i];
+    process<HbOpOr> (other);
   }
   inline void intersect (const hb_set_t *other)
   {
-    if (unlikely (in_error)) return;
-    for (unsigned int i = 0; i < ELTS; i++)
-      elts[i] &= other->elts[i];
+    process<HbOpAnd> (other);
   }
   inline void subtract (const hb_set_t *other)
   {
-    if (unlikely (in_error)) return;
-    for (unsigned int i = 0; i < ELTS; i++)
-      elts[i] &= ~other->elts[i];
+    process<HbOpMinus> (other);
   }
   inline void symmetric_difference (const hb_set_t *other)
   {
-    if (unlikely (in_error)) return;
-    for (unsigned int i = 0; i < ELTS; i++)
-      elts[i] ^= other->elts[i];
-  }
-  inline void invert (void)
-  {
-    if (unlikely (in_error)) return;
-    for (unsigned int i = 0; i < ELTS; i++)
-      elts[i] = ~elts[i];
+    process<HbOpXor> (other);
   }
   inline bool next (hb_codepoint_t *codepoint) const
   {
     if (unlikely (*codepoint == INVALID)) {
-      hb_codepoint_t i = get_min ();
-      if (i != INVALID) {
-        *codepoint = i;
+      *codepoint = get_min ();
+      return *codepoint != INVALID;
+    }
+
+    page_map_t map = {get_major (*codepoint), 0};
+    unsigned int i;
+    page_map.bfind (&map, &i);
+    if (i < page_map.len)
+    {
+      if (pages[page_map[i].index].next (codepoint))
+      {
+        *codepoint += page_map[i].major * page_t::PAGE_BITS;
         return true;
-      } else {
-        *codepoint = INVALID;
-        return false;
+      }
+      i++;
+    }
+    for (; i < page_map.len; i++)
+    {
+      hb_codepoint_t m = pages[page_map[i].index].get_min ();
+      if (m != INVALID)
+      {
+        *codepoint = page_map[i].major * page_t::PAGE_BITS + m;
+        return true;
       }
     }
-    for (hb_codepoint_t i = *codepoint + 1; i < MAX_G + 1; i++)
-      if (has (i)) {
-        *codepoint = i;
-        return true;
-      }
     *codepoint = INVALID;
     return false;
   }
@@ -303,99 +408,65 @@
 
   inline unsigned int get_population (void) const
   {
-    unsigned int count = 0;
-    for (unsigned int i = 0; i < ELTS; i++)
-      count += _hb_popcount32 (elts[i]);
-    return count;
+    unsigned int pop = 0;
+    unsigned int count = pages.len;
+    for (unsigned int i = 0; i < count; i++)
+      pop += pages[i].get_population ();
+    return pop;
   }
   inline hb_codepoint_t get_min (void) const
   {
-    for (unsigned int i = 0; i < ELTS; i++)
-      if (elts[i])
-        for (unsigned int j = 0; j < BITS; j++)
-          if (elts[i] & (1u << j))
-            return i * BITS + j;
+    unsigned int count = pages.len;
+    for (unsigned int i = 0; i < count; i++)
+      if (!page_at (i).is_empty ())
+        return page_map[i].major * page_t::PAGE_BITS + page_at (i).get_min ();
     return INVALID;
   }
   inline hb_codepoint_t get_max (void) const
   {
-    for (unsigned int i = ELTS; i; i--)
-      if (elts[i - 1])
-        for (unsigned int j = BITS; j; j--)
-          if (elts[i - 1] & (1u << (j - 1)))
-            return (i - 1) * BITS + (j - 1);
+    unsigned int count = pages.len;
+    for (int i = count - 1; i >= 0; i++)
+      if (!page_at (i).is_empty ())
+        return page_map[i].major * page_t::PAGE_BITS + page_at (i).get_max ();
     return INVALID;
   }
 
-  typedef uint32_t elt_t;
-  static const unsigned int MAX_G = 65536 - 1; /* XXX Fix this... */
-  static const unsigned int SHIFT = 5;
-  static const unsigned int BITS = (1 << SHIFT);
-  static const unsigned int MASK = BITS - 1;
-  static const unsigned int ELTS = (MAX_G + 1 + (BITS - 1)) / BITS;
   static  const hb_codepoint_t INVALID = HB_SET_VALUE_INVALID;
 
-  elt_t &elt (hb_codepoint_t g) { return elts[g >> SHIFT]; }
-  elt_t const &elt (hb_codepoint_t g) const { return elts[g >> SHIFT]; }
-  elt_t mask (hb_codepoint_t g) const { return elt_t (1) << (g & MASK); }
-
-  elt_t elts[ELTS]; /* XXX 8kb */
-
-  ASSERT_STATIC (sizeof (elt_t) * 8 == BITS);
-  ASSERT_STATIC (sizeof (elt_t) * 8 * ELTS > MAX_G);
-};
-
-struct hb_frozen_set_t
-{
-  static const unsigned int SHIFT = hb_set_t::SHIFT;
-  static const unsigned int BITS = hb_set_t::BITS;
-  static const unsigned int MASK = hb_set_t::MASK;
-  typedef hb_set_t::elt_t elt_t;
-
-  inline void init (const hb_set_t &set)
+  page_t *page_for_insert (hb_codepoint_t g)
   {
-    start = count = 0;
-    elts = NULL;
-
-    unsigned int max = set.get_max ();
-    if (max == set.INVALID)
-      return;
-    unsigned int min = set.get_min ();
-    const elt_t &min_elt = set.elt (min);
+    page_map_t map = {get_major (g), pages.len};
+    unsigned int i;
+    if (!page_map.bfind (&map, &i))
+    {
+      if (!resize (pages.len + 1))
+        return nullptr;
 
-    start = min & ~MASK;
-    count = max - start + 1;
-    unsigned int num_elts = (count + BITS - 1) / BITS;
-    unsigned int elts_size = num_elts * sizeof (elt_t);
-    elts = (elt_t *) malloc (elts_size);
-    if (unlikely (!elts))
-    {
-      start = count = 0;
-      return;
+      pages[map.index].init ();
+      memmove (&page_map[i + 1], &page_map[i], (page_map.len - 1 - i) * sizeof (page_map[0]));
+      page_map[i] = map;
     }
-    memcpy (elts, &min_elt, elts_size);
+    return &pages[page_map[i].index];
   }
-
-  inline void fini (void)
+  page_t *page_for (hb_codepoint_t g)
   {
-    if (elts)
-      free (elts);
+    page_map_t key = {get_major (g)};
+    const page_map_t *found = page_map.bsearch (&key);
+    if (found)
+      return &pages[found->index];
+    return nullptr;
   }
-
-  inline bool has (hb_codepoint_t g) const
+  const page_t *page_for (hb_codepoint_t g) const
   {
-    /* hb_codepoint_t is unsigned. */
-    g -= start;
-    if (unlikely (g > count)) return false;
-    return !!(elt (g) & mask (g));
+    page_map_t key = {get_major (g)};
+    const page_map_t *found = page_map.bsearch (&key);
+    if (found)
+      return &pages[found->index];
+    return nullptr;
   }
-
-  elt_t const &elt (hb_codepoint_t g) const { return elts[g >> SHIFT]; }
-  elt_t mask (hb_codepoint_t g) const { return elt_t (1) << (g & MASK); }
-
-  private:
-  hb_codepoint_t start, count;
-  elt_t *elts;
+  page_t &page_at (unsigned int i) { return pages[page_map[i].index]; }
+  const page_t &page_at (unsigned int i) const { return pages[page_map[i].index]; }
+  unsigned int get_major (hb_codepoint_t g) const { return g / page_t::PAGE_BITS; }
 };
 
 
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-set.cc	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-set.cc	Wed Dec 13 10:25:38 2017 -0800
@@ -45,7 +45,8 @@
   if (!(set = hb_object_create<hb_set_t> ()))
     return hb_set_get_empty ();
 
-  set->clear ();
+  set->page_map.init ();
+  set->pages.init ();
 
   return set;
 }
@@ -95,7 +96,8 @@
 {
   if (!hb_object_destroy (set)) return;
 
-  set->fini ();
+  set->page_map.finish ();
+  set->pages.finish ();
 
   free (set);
 }
@@ -105,7 +107,7 @@
  * @set: a set.
  * @key:
  * @data:
- * @destroy (closure data):
+ * @destroy:
  * @replace:
  *
  * Return value:
@@ -143,9 +145,9 @@
  * hb_set_allocation_successful:
  * @set: a set.
  *
- * 
+ *
  *
- * Return value: 
+ * Return value:
  *
  * Since: 0.9.2
  **/
@@ -159,7 +161,7 @@
  * hb_set_clear:
  * @set: a set.
  *
- * 
+ *
  *
  * Since: 0.9.2
  **/
@@ -173,9 +175,9 @@
  * hb_set_is_empty:
  * @set: a set.
  *
- * 
+ *
  *
- * Return value: 
+ * Return value:
  *
  * Since: 0.9.7
  **/
@@ -188,11 +190,11 @@
 /**
  * hb_set_has:
  * @set: a set.
- * @codepoint: 
+ * @codepoint:
+ *
  *
- * 
  *
- * Return value: 
+ * Return value:
  *
  * Since: 0.9.2
  **/
@@ -206,9 +208,9 @@
 /**
  * hb_set_add:
  * @set: a set.
- * @codepoint: 
+ * @codepoint:
  *
- * 
+ *
  *
  * Since: 0.9.2
  **/
@@ -222,10 +224,10 @@
 /**
  * hb_set_add_range:
  * @set: a set.
- * @first: 
- * @last: 
+ * @first:
+ * @last:
  *
- * 
+ *
  *
  * Since: 0.9.7
  **/
@@ -240,9 +242,9 @@
 /**
  * hb_set_del:
  * @set: a set.
- * @codepoint: 
+ * @codepoint:
  *
- * 
+ *
  *
  * Since: 0.9.2
  **/
@@ -256,10 +258,10 @@
 /**
  * hb_set_del_range:
  * @set: a set.
- * @first: 
- * @last: 
+ * @first:
+ * @last:
  *
- * 
+ *
  *
  * Since: 0.9.7
  **/
@@ -274,11 +276,11 @@
 /**
  * hb_set_is_equal:
  * @set: a set.
- * @other: 
+ * @other:
+ *
  *
- * 
  *
- * Return value: 
+ * Return value:
  *
  * Since: 0.9.7
  **/
@@ -292,9 +294,9 @@
 /**
  * hb_set_set:
  * @set: a set.
- * @other: 
+ * @other:
  *
- * 
+ *
  *
  * Since: 0.9.2
  **/
@@ -308,9 +310,9 @@
 /**
  * hb_set_union:
  * @set: a set.
- * @other: 
+ * @other:
  *
- * 
+ *
  *
  * Since: 0.9.2
  **/
@@ -324,9 +326,9 @@
 /**
  * hb_set_intersect:
  * @set: a set.
- * @other: 
+ * @other:
  *
- * 
+ *
  *
  * Since: 0.9.2
  **/
@@ -340,9 +342,9 @@
 /**
  * hb_set_subtract:
  * @set: a set.
- * @other: 
+ * @other:
  *
- * 
+ *
  *
  * Since: 0.9.2
  **/
@@ -356,9 +358,9 @@
 /**
  * hb_set_symmetric_difference:
  * @set: a set.
- * @other: 
+ * @other:
  *
- * 
+ *
  *
  * Since: 0.9.2
  **/
@@ -373,14 +375,15 @@
  * hb_set_invert:
  * @set: a set.
  *
- * 
+ *
  *
  * Since: 0.9.10
+ *
+ * Deprecated: 1.6.1
  **/
 void
 hb_set_invert (hb_set_t *set)
 {
-  set->invert ();
 }
 
 /**
@@ -436,7 +439,7 @@
  * @set: a set.
  * @codepoint: (inout):
  *
- * 
+ *
  *
  * Return value: whether there was a next value.
  *
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-set.h	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-set.h	Wed Dec 13 10:25:38 2017 -0800
@@ -126,9 +126,6 @@
 hb_set_symmetric_difference (hb_set_t       *set,
                              const hb_set_t *other);
 
-HB_EXTERN void
-hb_set_invert (hb_set_t *set);
-
 HB_EXTERN unsigned int
 hb_set_get_population (const hb_set_t *set);
 
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-shape-plan.cc	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-shape-plan.cc	Wed Dec 13 10:25:38 2017 -0800
@@ -24,24 +24,14 @@
  * Google Author(s): Behdad Esfahbod
  */
 
+#include "hb-private.hh"
+#include "hb-debug.hh"
 #include "hb-shape-plan-private.hh"
 #include "hb-shaper-private.hh"
 #include "hb-font-private.hh"
 #include "hb-buffer-private.hh"
 
 
-#ifndef HB_DEBUG_SHAPE_PLAN
-#define HB_DEBUG_SHAPE_PLAN (HB_DEBUG+0)
-#endif
-
-
-#define HB_SHAPER_IMPLEMENT(shaper) \
-        HB_SHAPER_DATA_ENSURE_DECLARE(shaper, face) \
-        HB_SHAPER_DATA_ENSURE_DECLARE(shaper, font)
-#include "hb-shaper-list.hh"
-#undef HB_SHAPER_IMPLEMENT
-
-
 static void
 hb_shape_plan_plan (hb_shape_plan_t    *shape_plan,
                     const hb_feature_t *user_features,
@@ -101,13 +91,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):
  *
@@ -122,7 +112,7 @@
 {
   return hb_shape_plan_create2 (face, props,
                                 user_features, num_user_features,
-                                NULL, 0,
+                                nullptr, 0,
                                 shaper_list);
 }
 
@@ -135,7 +125,7 @@
                        unsigned int                   num_coords,
                        const char * const            *shaper_list)
 {
-  DEBUG_MSG_FUNC (SHAPE_PLAN, NULL,
+  DEBUG_MSG_FUNC (SHAPE_PLAN, nullptr,
                   "face=%p num_features=%d num_coords=%d shaper_list=%p",
                   face,
                   num_user_features,
@@ -143,8 +133,8 @@
                   shaper_list);
 
   hb_shape_plan_t *shape_plan;
-  hb_feature_t *features = NULL;
-  int *coords = NULL;
+  hb_feature_t *features = nullptr;
+  int *coords = nullptr;
 
   if (unlikely (!face))
     face = hb_face_get_empty ();
@@ -167,7 +157,7 @@
   assert (props->direction != HB_DIRECTION_INVALID);
 
   hb_face_make_immutable (face);
-  shape_plan->default_shaper_list = shaper_list == NULL;
+  shape_plan->default_shaper_list = !shaper_list;
   shape_plan->face_unsafe = face;
   shape_plan->props = *props;
   shape_plan->num_user_features = num_user_features;
@@ -190,7 +180,7 @@
 /**
  * hb_shape_plan_get_empty:
  *
- * 
+ *
  *
  * Return value: (transfer full):
  *
@@ -203,16 +193,16 @@
     HB_OBJECT_HEADER_STATIC,
 
     true, /* default_shaper_list */
-    NULL, /* face */
+    nullptr, /* face */
     HB_SEGMENT_PROPERTIES_DEFAULT, /* props */
 
-    NULL, /* shaper_func */
-    NULL, /* shaper_name */
+    nullptr, /* shaper_func */
+    nullptr, /* shaper_name */
 
-    NULL, /* user_features */
+    nullptr, /* user_features */
     0,    /* num_user_featurs */
 
-    NULL, /* coords */
+    nullptr, /* coords */
     0,    /* num_coords */
 
     {
@@ -229,7 +219,7 @@
  * hb_shape_plan_reference: (skip)
  * @shape_plan: a shape plan.
  *
- * 
+ *
  *
  * Return value: (transfer full):
  *
@@ -245,7 +235,7 @@
  * hb_shape_plan_destroy: (skip)
  * @shape_plan: a shape plan.
  *
- * 
+ *
  *
  * Since: 0.9.7
  **/
@@ -267,14 +257,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
  **/
@@ -291,9 +281,9 @@
 /**
  * hb_shape_plan_get_user_data: (skip)
  * @shape_plan: a shape plan.
- * @key: 
+ * @key:
  *
- * 
+ *
  *
  * Return value: (transfer none):
  *
@@ -313,11 +303,11 @@
  * @font: a font.
  * @buffer: a buffer.
  * @features: (array length=num_features):
- * @num_features: 
+ * @num_features:
+ *
  *
- * 
  *
- * Return value: 
+ * Return value:
  *
  * Since: 0.9.7
  **/
@@ -430,7 +420,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->default_shaper_list && !proposal->shaper_list) ||
           (shape_plan->shaper_func == proposal->shaper_func));
 }
 
@@ -438,11 +428,12 @@
 hb_non_global_user_features_present (const hb_feature_t *user_features,
                                      unsigned int        num_user_features)
 {
-  while (num_user_features)
+  while (num_user_features) {
     if (user_features->start != 0 || user_features->end != (unsigned int) -1)
       return true;
-    else
-      num_user_features--, user_features++;
+    num_user_features--;
+    user_features++;
+  }
   return false;
 }
 
@@ -455,13 +446,13 @@
 
 /**
  * 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):
  *
@@ -476,7 +467,7 @@
 {
   return hb_shape_plan_create_cached2 (face, props,
                                        user_features, num_user_features,
-                                       NULL, 0,
+                                       nullptr, 0,
                                        shaper_list);
 }
 
@@ -489,7 +480,7 @@
                               unsigned int                   num_coords,
                               const char * const            *shaper_list)
 {
-  DEBUG_MSG_FUNC (SHAPE_PLAN, NULL,
+  DEBUG_MSG_FUNC (SHAPE_PLAN, nullptr,
                   "face=%p num_features=%d shaper_list=%p",
                   face,
                   num_user_features,
@@ -500,7 +491,7 @@
     shaper_list,
     user_features,
     num_user_features,
-    NULL
+    nullptr
   };
 
   if (shaper_list) {
@@ -526,15 +517,17 @@
 
 retry:
   hb_face_t::plan_node_t *cached_plan_nodes = (hb_face_t::plan_node_t *) hb_atomic_ptr_get (&face->shape_plans);
-  for (hb_face_t::plan_node_t *node = cached_plan_nodes; node; node = node->next)
-    if (hb_shape_plan_matches (node->shape_plan, &proposal))
-    {
-      DEBUG_MSG_FUNC (SHAPE_PLAN, node->shape_plan, "fulfilled from cache");
-      return hb_shape_plan_reference (node->shape_plan);
-    }
+
+  /* Don't look for plan in the cache if there were variation coordinates XXX Fix me. */
+  if (!hb_coords_present (coords, num_coords))
+    for (hb_face_t::plan_node_t *node = cached_plan_nodes; node; node = node->next)
+      if (hb_shape_plan_matches (node->shape_plan, &proposal))
+      {
+        DEBUG_MSG_FUNC (SHAPE_PLAN, node->shape_plan, "fulfilled from cache");
+        return hb_shape_plan_reference (node->shape_plan);
+      }
 
   /* Not found. */
-
   hb_shape_plan_t *shape_plan = hb_shape_plan_create2 (face, props,
                                                        user_features, num_user_features,
                                                        coords, num_coords,
@@ -572,7 +565,7 @@
  * hb_shape_plan_get_shaper:
  * @shape_plan: a shape plan.
  *
- * 
+ *
  *
  * Return value: (transfer none):
  *
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-shape.cc	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-shape.cc	Wed Dec 13 10:25:38 2017 -0800
@@ -45,254 +45,6 @@
  * contains the output glyphs and their positions.
  **/
 
-static bool
-parse_space (const char **pp, const char *end)
-{
-  while (*pp < end && ISSPACE (**pp))
-    (*pp)++;
-  return true;
-}
-
-static bool
-parse_char (const char **pp, const char *end, char c)
-{
-  parse_space (pp, end);
-
-  if (*pp == end || **pp != c)
-    return false;
-
-  (*pp)++;
-  return true;
-}
-
-static bool
-parse_uint (const char **pp, const char *end, unsigned int *pv)
-{
-  char buf[32];
-  unsigned int len = MIN (ARRAY_LENGTH (buf) - 1, (unsigned int) (end - *pp));
-  strncpy (buf, *pp, len);
-  buf[len] = '\0';
-
-  char *p = buf;
-  char *pend = p;
-  unsigned int v;
-
-  /* Intentionally use strtol instead of strtoul, such that
-   * -1 turns into "big number"... */
-  errno = 0;
-  v = strtol (p, &pend, 0);
-  if (errno || p == pend)
-    return false;
-
-  *pv = v;
-  *pp += pend - p;
-  return true;
-}
-
-static bool
-parse_bool (const char **pp, const char *end, unsigned int *pv)
-{
-  parse_space (pp, end);
-
-  const char *p = *pp;
-  while (*pp < end && ISALPHA(**pp))
-    (*pp)++;
-
-  /* CSS allows on/off as aliases 1/0. */
-  if (*pp - p == 2 || 0 == strncmp (p, "on", 2))
-    *pv = 1;
-  else if (*pp - p == 3 || 0 == strncmp (p, "off", 2))
-    *pv = 0;
-  else
-    return false;
-
-  return true;
-}
-
-static bool
-parse_feature_value_prefix (const char **pp, const char *end, hb_feature_t *feature)
-{
-  if (parse_char (pp, end, '-'))
-    feature->value = 0;
-  else {
-    parse_char (pp, end, '+');
-    feature->value = 1;
-  }
-
-  return true;
-}
-
-static bool
-parse_feature_tag (const char **pp, const char *end, hb_feature_t *feature)
-{
-  parse_space (pp, end);
-
-  char quote = 0;
-
-  if (*pp < end && (**pp == '\'' || **pp == '"'))
-  {
-    quote = **pp;
-    (*pp)++;
-  }
-
-  const char *p = *pp;
-  while (*pp < end && ISALNUM(**pp))
-    (*pp)++;
-
-  if (p == *pp || *pp - p > 4)
-    return false;
-
-  feature->tag = hb_tag_from_string (p, *pp - p);
-
-  if (quote)
-  {
-    /* CSS expects exactly four bytes.  And we only allow quotations for
-     * CSS compatibility.  So, enforce the length. */
-     if (*pp - p != 4)
-       return false;
-    if (*pp == end || **pp != quote)
-      return false;
-    (*pp)++;
-  }
-
-  return true;
-}
-
-static bool
-parse_feature_indices (const char **pp, const char *end, hb_feature_t *feature)
-{
-  parse_space (pp, end);
-
-  bool has_start;
-
-  feature->start = 0;
-  feature->end = (unsigned int) -1;
-
-  if (!parse_char (pp, end, '['))
-    return true;
-
-  has_start = parse_uint (pp, end, &feature->start);
-
-  if (parse_char (pp, end, ':')) {
-    parse_uint (pp, end, &feature->end);
-  } else {
-    if (has_start)
-      feature->end = feature->start + 1;
-  }
-
-  return parse_char (pp, end, ']');
-}
-
-static bool
-parse_feature_value_postfix (const char **pp, const char *end, hb_feature_t *feature)
-{
-  bool had_equal = parse_char (pp, end, '=');
-  bool had_value = parse_uint (pp, end, &feature->value) ||
-                   parse_bool (pp, end, &feature->value);
-  /* CSS doesn't use equal-sign between tag and value.
-   * If there was an equal-sign, then there *must* be a value.
-   * A value without an eqaul-sign is ok, but not required. */
-  return !had_equal || had_value;
-}
-
-
-static bool
-parse_one_feature (const char **pp, const char *end, hb_feature_t *feature)
-{
-  return parse_feature_value_prefix (pp, end, feature) &&
-         parse_feature_tag (pp, end, feature) &&
-         parse_feature_indices (pp, end, feature) &&
-         parse_feature_value_postfix (pp, end, feature) &&
-         parse_space (pp, end) &&
-         *pp == end;
-}
-
-/**
- * hb_feature_from_string:
- * @str: (array length=len) (element-type uint8_t): a string to parse
- * @len: length of @str, or -1 if string is %NULL terminated
- * @feature: (out): the #hb_feature_t to initialize with the parsed values
- *
- * Parses a string into a #hb_feature_t.
- *
- * TODO: document the syntax here.
- *
- * Return value:
- * %true if @str is successfully parsed, %false otherwise.
- *
- * Since: 0.9.5
- **/
-hb_bool_t
-hb_feature_from_string (const char *str, int len,
-                        hb_feature_t *feature)
-{
-  hb_feature_t feat;
-
-  if (len < 0)
-    len = strlen (str);
-
-  if (likely (parse_one_feature (&str, str + len, &feat)))
-  {
-    if (feature)
-      *feature = feat;
-    return true;
-  }
-
-  if (feature)
-    memset (feature, 0, sizeof (*feature));
-  return false;
-}
-
-/**
- * hb_feature_to_string:
- * @feature: an #hb_feature_t to convert
- * @buf: (array length=size) (out): output string
- * @size: the allocated size of @buf
- *
- * Converts a #hb_feature_t into a %NULL-terminated string in the format
- * understood by hb_feature_from_string(). The client in responsible for
- * allocating big enough size for @buf, 128 bytes is more than enough.
- *
- * Since: 0.9.5
- **/
-void
-hb_feature_to_string (hb_feature_t *feature,
-                      char *buf, unsigned int size)
-{
-  if (unlikely (!size)) return;
-
-  char s[128];
-  unsigned int len = 0;
-  if (feature->value == 0)
-    s[len++] = '-';
-  hb_tag_to_string (feature->tag, s + len);
-  len += 4;
-  while (len && s[len - 1] == ' ')
-    len--;
-  if (feature->start != 0 || feature->end != (unsigned int) -1)
-  {
-    s[len++] = '[';
-    if (feature->start)
-      len += MAX (0, snprintf (s + len, ARRAY_LENGTH (s) - len, "%u", feature->start));
-    if (feature->end != feature->start + 1) {
-      s[len++] = ':';
-      if (feature->end != (unsigned int) -1)
-        len += MAX (0, snprintf (s + len, ARRAY_LENGTH (s) - len, "%u", feature->end));
-    }
-    s[len++] = ']';
-  }
-  if (feature->value > 1)
-  {
-    s[len++] = '=';
-    len += MAX (0, snprintf (s + len, ARRAY_LENGTH (s) - len, "%u", feature->value));
-  }
-  assert (len < ARRAY_LENGTH (s));
-  len = MIN (len, size - 1);
-  memcpy (buf, s, len);
-  buf[len] = '\0';
-}
-
-
 static const char **static_shaper_list;
 
 #ifdef HB_USE_ATEXIT
@@ -324,7 +76,7 @@
     /* Not found; allocate one. */
     shaper_list = (const char **) calloc (1 + HB_SHAPERS_COUNT, sizeof (const char *));
     if (unlikely (!shaper_list)) {
-      static const char *nil_shaper_list[] = {NULL};
+      static const char *nil_shaper_list[] = {nullptr};
       return nil_shaper_list;
     }
 
@@ -332,9 +84,9 @@
     unsigned int i;
     for (i = 0; i < HB_SHAPERS_COUNT; i++)
       shaper_list[i] = shapers[i].name;
-    shaper_list[i] = NULL;
+    shaper_list[i] = nullptr;
 
-    if (!hb_atomic_ptr_cmpexch (&static_shaper_list, NULL, shaper_list)) {
+    if (!hb_atomic_ptr_cmpexch (&static_shaper_list, nullptr, shaper_list)) {
       free (shaper_list);
       goto retry;
     }
@@ -362,7 +114,7 @@
  * shapers will be used in the given order, otherwise the default shapers list
  * will be used.
  *
- * Return value: %FALSE if all shapers failed, %TRUE otherwise
+ * Return value: false if all shapers failed, true otherwise
  *
  * Since: 0.9.2
  **/
@@ -405,5 +157,5 @@
           const hb_feature_t  *features,
           unsigned int         num_features)
 {
-  hb_shape_full (font, buffer, features, num_features, NULL);
+  hb_shape_full (font, buffer, features, num_features, nullptr);
 }
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-shape.h	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-shape.h	Wed Dec 13 10:25:38 2017 -0800
@@ -40,22 +40,6 @@
 HB_BEGIN_DECLS
 
 
-typedef struct hb_feature_t {
-  hb_tag_t      tag;
-  uint32_t      value;
-  unsigned int  start;
-  unsigned int  end;
-} hb_feature_t;
-
-HB_EXTERN hb_bool_t
-hb_feature_from_string (const char *str, int len,
-                        hb_feature_t *feature);
-
-HB_EXTERN void
-hb_feature_to_string (hb_feature_t *feature,
-                      char *buf, unsigned int size);
-
-
 HB_EXTERN void
 hb_shape (hb_font_t           *font,
           hb_buffer_t         *buffer,
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-shaper-private.hh	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-shaper-private.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -65,35 +65,51 @@
 #define HB_SHAPER_DATA_INVALID ((void *) -1)
 #define HB_SHAPER_DATA_IS_INVALID(data) ((void *) (data) == HB_SHAPER_DATA_INVALID)
 
-#define HB_SHAPER_DATA_TYPE(shaper, object)             struct hb_##shaper##_shaper_##object##_data_t
+#define HB_SHAPER_DATA_TYPE_NAME(shaper, object)        hb_##shaper##_shaper_##object##_data_t
+#define HB_SHAPER_DATA_TYPE(shaper, object)             struct HB_SHAPER_DATA_TYPE_NAME(shaper, object)
 #define HB_SHAPER_DATA_INSTANCE(shaper, object, instance)       (* (HB_SHAPER_DATA_TYPE(shaper, object) **) &(instance)->shaper_data.shaper)
-#define HB_SHAPER_DATA(shaper, object)                  HB_SHAPER_DATA_INSTANCE (shaper, object, object)
+#define HB_SHAPER_DATA(shaper, object)                  HB_SHAPER_DATA_INSTANCE(shaper, object, object)
 #define HB_SHAPER_DATA_CREATE_FUNC(shaper, object)      _hb_##shaper##_shaper_##object##_data_create
 #define HB_SHAPER_DATA_DESTROY_FUNC(shaper, object)     _hb_##shaper##_shaper_##object##_data_destroy
+#define HB_SHAPER_DATA_ENSURE_FUNC(shaper, object)      hb_##shaper##_shaper_##object##_data_ensure
 
 #define HB_SHAPER_DATA_PROTOTYPE(shaper, object) \
         HB_SHAPER_DATA_TYPE (shaper, object); /* Type forward declaration. */ \
         extern "C" HB_INTERNAL HB_SHAPER_DATA_TYPE (shaper, object) * \
         HB_SHAPER_DATA_CREATE_FUNC (shaper, object) (hb_##object##_t *object HB_SHAPER_DATA_CREATE_FUNC_EXTRA_ARGS); \
         extern "C" HB_INTERNAL void \
-        HB_SHAPER_DATA_DESTROY_FUNC (shaper, object) (HB_SHAPER_DATA_TYPE (shaper, object) *data)
+        HB_SHAPER_DATA_DESTROY_FUNC (shaper, object) (HB_SHAPER_DATA_TYPE (shaper, object) *data); \
+        extern "C" HB_INTERNAL bool \
+        HB_SHAPER_DATA_ENSURE_FUNC (shaper, object) (hb_##object##_t *object)
 
 #define HB_SHAPER_DATA_DESTROY(shaper, object) \
     if (HB_SHAPER_DATA_TYPE (shaper, object) *data = HB_SHAPER_DATA (shaper, object)) \
       if (data != HB_SHAPER_DATA_INVALID && data != HB_SHAPER_DATA_SUCCEEDED) \
         HB_SHAPER_DATA_DESTROY_FUNC (shaper, object) (data);
 
-#define HB_SHAPER_DATA_ENSURE_DECLARE(shaper, object) \
-static inline bool \
-hb_##shaper##_shaper_##object##_data_ensure (hb_##object##_t *object) \
+#define HB_SHAPER_DATA_ENSURE_DEFINE(shaper, object) \
+        HB_SHAPER_DATA_ENSURE_DEFINE_WITH_CONDITION(shaper, object, true)
+
+#define HB_SHAPER_DATA_ENSURE_DEFINE_WITH_CONDITION(shaper, object, condition) \
+bool \
+HB_SHAPER_DATA_ENSURE_FUNC(shaper, object) (hb_##object##_t *object) \
 {\
   retry: \
   HB_SHAPER_DATA_TYPE (shaper, object) *data = (HB_SHAPER_DATA_TYPE (shaper, object) *) hb_atomic_ptr_get (&HB_SHAPER_DATA (shaper, object)); \
+  if (likely (data) && !(condition)) { \
+    /* Drop and recreate. */ \
+    /* If someone dropped it in the mean time, throw it away and don't touch it. \
+     * Otherwise, destruct it. */ \
+    if (hb_atomic_ptr_cmpexch (&HB_SHAPER_DATA (shaper, object), data, nullptr)) { \
+      HB_SHAPER_DATA_DESTROY_FUNC (shaper, object) (data); \
+    } \
+    goto retry; \
+  } \
   if (unlikely (!data)) { \
     data = HB_SHAPER_DATA_CREATE_FUNC (shaper, object) (object); \
     if (unlikely (!data)) \
       data = (HB_SHAPER_DATA_TYPE (shaper, object) *) HB_SHAPER_DATA_INVALID; \
-    if (!hb_atomic_ptr_cmpexch (&HB_SHAPER_DATA (shaper, object), NULL, data)) { \
+    if (!hb_atomic_ptr_cmpexch (&HB_SHAPER_DATA (shaper, object), nullptr, data)) { \
       if (data && \
           data != HB_SHAPER_DATA_INVALID && \
           data != HB_SHAPER_DATA_SUCCEEDED) \
@@ -101,7 +117,7 @@
       goto retry; \
     } \
   } \
-  return data != NULL && !HB_SHAPER_DATA_IS_INVALID (data); \
+  return data != nullptr && !HB_SHAPER_DATA_IS_INVALID (data); \
 }
 
 
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-shaper.cc	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-shaper.cc	Wed Dec 13 10:25:38 2017 -0800
@@ -59,14 +59,14 @@
   {
     char *env = getenv ("HB_SHAPER_LIST");
     if (!env || !*env) {
-      (void) hb_atomic_ptr_cmpexch (&static_shapers, NULL, &all_shapers[0]);
+      (void) hb_atomic_ptr_cmpexch (&static_shapers, nullptr, &all_shapers[0]);
       return (const hb_shaper_pair_t *) all_shapers;
     }
 
     /* Not found; allocate one. */
     shapers = (hb_shaper_pair_t *) calloc (1, sizeof (all_shapers));
     if (unlikely (!shapers)) {
-      (void) hb_atomic_ptr_cmpexch (&static_shapers, NULL, &all_shapers[0]);
+      (void) hb_atomic_ptr_cmpexch (&static_shapers, nullptr, &all_shapers[0]);
       return (const hb_shaper_pair_t *) all_shapers;
     }
 
@@ -97,7 +97,7 @@
         p = end + 1;
     }
 
-    if (!hb_atomic_ptr_cmpexch (&static_shapers, NULL, shapers)) {
+    if (!hb_atomic_ptr_cmpexch (&static_shapers, nullptr, shapers)) {
       free (shapers);
       goto retry;
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-string-array.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,81 @@
+/*
+ * Copyright © 2017  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): Behdad Esfahbod
+ */
+
+#ifndef HB_STRING_ARRAY_HH
+#if 0 /* Make checks happy. */
+#define HB_STRING_ARRAY_HH
+#endif
+
+#include "hb-private.hh"
+
+/* Based on Bruno Haible's code in Appendix B of Ulrich Drepper's dsohowto.pdf:
+ * https://software.intel.com/sites/default/files/m/a/1/e/dsohowto.pdf */
+
+#define HB_STRING_ARRAY_TYPE_NAME       HB_PASTE(HB_STRING_ARRAY_NAME, _msgstr_t)
+#define HB_STRING_ARRAY_POOL_NAME       HB_PASTE(HB_STRING_ARRAY_NAME, _msgstr)
+#define HB_STRING_ARRAY_OFFS_NAME       HB_PASTE(HB_STRING_ARRAY_NAME, _msgidx)
+
+static const union HB_STRING_ARRAY_TYPE_NAME {
+  struct {
+/* I like to avoid storing the nul-termination byte since we don't need it,
+ * but C++ does not allow that.
+ * https://stackoverflow.com/questions/28433862/why-initializer-string-for-array-of-chars-is-too-long-compiles-fine-in-c-not
+ */
+#define _S(s) char HB_PASTE (str, __LINE__)[sizeof (s)];
+#include HB_STRING_ARRAY_LIST
+#undef _S
+  } st;
+  char str[1];
+}
+HB_STRING_ARRAY_POOL_NAME =
+{
+  {
+#define _S(s) s,
+#include HB_STRING_ARRAY_LIST
+#undef _S
+  }
+};
+static const unsigned int HB_STRING_ARRAY_OFFS_NAME[] =
+{
+#define _S(s) offsetof (union HB_STRING_ARRAY_TYPE_NAME, st.HB_PASTE(str, __LINE__)),
+#include HB_STRING_ARRAY_LIST
+#undef _S
+  sizeof (HB_STRING_ARRAY_TYPE_NAME)
+};
+
+static inline hb_string_t
+HB_STRING_ARRAY_NAME (unsigned int i)
+{
+  assert (i < ARRAY_LENGTH (HB_STRING_ARRAY_OFFS_NAME) - 1);
+  return hb_string_t (HB_STRING_ARRAY_POOL_NAME.str + HB_STRING_ARRAY_OFFS_NAME[i],
+                      HB_STRING_ARRAY_OFFS_NAME[i + 1] - HB_STRING_ARRAY_OFFS_NAME[i] - 1);
+}
+
+#undef HB_STRING_ARRAY_TYPE_NAME
+#undef HB_STRING_ARRAY_POOL_NAME
+#undef HB_STRING_ARRAY_OFFS_NAME
+
+#endif /* HB_STRING_ARRAY_HH */
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ucdn.cc	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ucdn.cc	Wed Dec 13 10:25:38 2017 -0800
@@ -160,17 +160,23 @@
     HB_SCRIPT_NEWA,
     HB_SCRIPT_OSAGE,
     HB_SCRIPT_TANGUT,
+    HB_SCRIPT_MASARAM_GONDI,
+    HB_SCRIPT_NUSHU,
+    HB_SCRIPT_SOYOMBO,
+    HB_SCRIPT_ZANABAZAR_SQUARE,
 };
 
 static hb_unicode_combining_class_t
-hb_ucdn_combining_class(hb_unicode_funcs_t *ufuncs, hb_codepoint_t unicode,
+hb_ucdn_combining_class(hb_unicode_funcs_t *ufuncs HB_UNUSED,
+                        hb_codepoint_t unicode,
                         void *user_data HB_UNUSED)
 {
     return (hb_unicode_combining_class_t) ucdn_get_combining_class(unicode);
 }
 
 static unsigned int
-hb_ucdn_eastasian_width(hb_unicode_funcs_t *ufuncs, hb_codepoint_t unicode,
+hb_ucdn_eastasian_width(hb_unicode_funcs_t *ufuncs HB_UNUSED,
+                        hb_codepoint_t unicode,
                         void *user_data HB_UNUSED)
 {
     int w = ucdn_get_east_asian_width(unicode);
@@ -178,28 +184,31 @@
 }
 
 static hb_unicode_general_category_t
-hb_ucdn_general_category(hb_unicode_funcs_t *ufuncs, hb_codepoint_t unicode,
+hb_ucdn_general_category(hb_unicode_funcs_t *ufuncs HB_UNUSED,
+                         hb_codepoint_t unicode,
                          void *user_data HB_UNUSED)
 {
     return (hb_unicode_general_category_t)ucdn_get_general_category(unicode);
 }
 
 static hb_codepoint_t
-hb_ucdn_mirroring(hb_unicode_funcs_t *ufuncs, hb_codepoint_t unicode,
+hb_ucdn_mirroring(hb_unicode_funcs_t *ufuncs HB_UNUSED,
+                  hb_codepoint_t unicode,
                   void *user_data HB_UNUSED)
 {
     return ucdn_mirror(unicode);
 }
 
 static hb_script_t
-hb_ucdn_script(hb_unicode_funcs_t *ufuncs, hb_codepoint_t unicode,
+hb_ucdn_script(hb_unicode_funcs_t *ufuncs HB_UNUSED,
+               hb_codepoint_t unicode,
                void *user_data HB_UNUSED)
 {
     return ucdn_script_translate[ucdn_get_script(unicode)];
 }
 
 static hb_bool_t
-hb_ucdn_compose(hb_unicode_funcs_t *ufuncs,
+hb_ucdn_compose(hb_unicode_funcs_t *ufuncs HB_UNUSED,
                 hb_codepoint_t a, hb_codepoint_t b, hb_codepoint_t *ab,
                 void *user_data HB_UNUSED)
 {
@@ -207,7 +216,7 @@
 }
 
 static hb_bool_t
-hb_ucdn_decompose(hb_unicode_funcs_t *ufuncs,
+hb_ucdn_decompose(hb_unicode_funcs_t *ufuncs HB_UNUSED,
                   hb_codepoint_t ab, hb_codepoint_t *a, hb_codepoint_t *b,
                   void *user_data HB_UNUSED)
 {
@@ -215,29 +224,50 @@
 }
 
 static unsigned int
-hb_ucdn_decompose_compatibility(hb_unicode_funcs_t *ufuncs,
+hb_ucdn_decompose_compatibility(hb_unicode_funcs_t *ufuncs HB_UNUSED,
                                 hb_codepoint_t u, hb_codepoint_t *decomposed,
                                 void *user_data HB_UNUSED)
 {
     return ucdn_compat_decompose(u, decomposed);
 }
 
+static hb_unicode_funcs_t *static_ucdn_funcs = nullptr;
+
+#ifdef HB_USE_ATEXIT
+static
+void free_static_ucdn_funcs (void)
+{
+  hb_unicode_funcs_destroy (static_ucdn_funcs);
+}
+#endif
+
 extern "C" HB_INTERNAL
 hb_unicode_funcs_t *
 hb_ucdn_get_unicode_funcs (void)
 {
-  static const hb_unicode_funcs_t _hb_ucdn_unicode_funcs = {
-    HB_OBJECT_HEADER_STATIC,
+retry:
+  hb_unicode_funcs_t *funcs = (hb_unicode_funcs_t *) hb_atomic_ptr_get (&static_ucdn_funcs);
 
-    NULL, /* parent */
-    true, /* immutable */
-    {
-#define HB_UNICODE_FUNC_IMPLEMENT(name) hb_ucdn_##name,
+  if (unlikely (!funcs))
+  {
+    funcs = hb_unicode_funcs_create (nullptr);
+
+#define HB_UNICODE_FUNC_IMPLEMENT(name) \
+    hb_unicode_funcs_set_##name##_func (funcs, hb_ucdn_##name, nullptr, nullptr);
       HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS
 #undef HB_UNICODE_FUNC_IMPLEMENT
+
+    hb_unicode_funcs_make_immutable (funcs);
+
+    if (!hb_atomic_ptr_cmpexch (&static_ucdn_funcs, nullptr, funcs)) {
+      hb_unicode_funcs_destroy (funcs);
+      goto retry;
     }
+
+#ifdef HB_USE_ATEXIT
+    atexit (free_static_ucdn_funcs); /* First person registers atexit() callback. */
+#endif
   };
 
-  return const_cast<hb_unicode_funcs_t *> (&_hb_ucdn_unicode_funcs);
+  return hb_unicode_funcs_reference (funcs);
 }
-
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ucdn/ucdn.c	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ucdn/ucdn.c	Wed Dec 13 10:25:38 2017 -0800
@@ -23,7 +23,6 @@
     unsigned char category;
     unsigned char combining;
     unsigned char bidi_class;
-    unsigned char mirrored;
     unsigned char east_asian_width;
     unsigned char script;
     unsigned char linebreak_class;
@@ -43,7 +42,7 @@
     short count, index;
 } Reindex;
 
-#include "unicodedata_db.h"
+#include "ucdn_db.h"
 
 /* constants required for Hangul (de)composition */
 #define SBASE 0xAC00
@@ -91,20 +90,30 @@
     return &decomp_data[index];
 }
 
-static int get_comp_index(uint32_t code, const Reindex *idx)
+static int compare_reindex(const void *a, const void *b)
 {
-    int i;
+    Reindex *ra = (Reindex *)a;
+    Reindex *rb = (Reindex *)b;
 
-    for (i = 0; idx[i].start; i++) {
-        const Reindex *cur = &idx[i];
-        if (code < cur->start)
-            return -1;
-        if (code <= cur->start + cur->count) {
-            return cur->index + (code - cur->start);
-        }
-    }
+    if (ra->start < rb->start)
+        return -1;
+    else if (ra->start > (rb->start + rb->count))
+        return 1;
+    else
+        return 0;
+}
 
-    return -1;
+static int get_comp_index(uint32_t code, const Reindex *idx, size_t len)
+{
+    Reindex *res;
+    Reindex r = {0, 0, 0};
+    r.start = code;
+    res = (Reindex *) bsearch(&r, idx, len, sizeof(Reindex), compare_reindex);
+
+    if (res != NULL)
+        return res->index + (code - res->start);
+    else
+        return -1;
 }
 
 static int compare_mp(const void *a, const void *b)
@@ -127,8 +136,8 @@
     BracketPair *res;
 
     bp.from = code;
-    res = bsearch(&bp, bracket_pairs, BIDI_BRACKET_LEN, sizeof(BracketPair),
-            compare_bp);
+    res = (BracketPair *) bsearch(&bp, bracket_pairs, BIDI_BRACKET_LEN,
+                                 sizeof(BracketPair), compare_bp);
     return res;
 }
 
@@ -154,23 +163,18 @@
 
 static int hangul_pair_compose(uint32_t *code, uint32_t a, uint32_t b)
 {
-    if (b < VBASE || b >= (TBASE + TCOUNT))
-        return 0;
-
-    if ((a < LBASE || a >= (LBASE + LCOUNT))
-            && (a < SBASE || a >= (SBASE + SCOUNT)))
-        return 0;
-
-    if (a >= SBASE) {
+    if (a >= SBASE && a < (SBASE + SCOUNT) && b >= TBASE && b < (TBASE + TCOUNT)) {
         /* LV,T */
         *code = a + (b - TBASE);
         return 3;
-    } else {
+    } else if (a >= LBASE && a < (LBASE + LCOUNT) && b >= VBASE && b < (VBASE + VCOUNT)) {
         /* L,V */
         int li = a - LBASE;
         int vi = b - VBASE;
         *code = SBASE + li * NCOUNT + vi * TCOUNT;
         return 2;
+    } else {
+        return 0;
     }
 }
 
@@ -178,7 +182,7 @@
 {
     const unsigned short *code = *code_ptr;
 
-    if ((code[0] & 0xd800) != 0xd800) {
+    if (code[0] < 0xd800 || code[0] > 0xdc00) {
         *code_ptr += 1;
         return (uint32_t)code[0];
     } else {
@@ -215,7 +219,7 @@
 
 int ucdn_get_mirrored(uint32_t code)
 {
-    return get_ucd_record(code)->mirrored;
+    return ucdn_mirror(code) != code;
 }
 
 int ucdn_get_script(uint32_t code)
@@ -264,12 +268,9 @@
     MirrorPair mp = {0};
     MirrorPair *res;
 
-    if (get_ucd_record(code)->mirrored == 0)
-        return code;
-
     mp.from = code;
-    res = bsearch(&mp, mirror_pairs, BIDI_MIRROR_LEN, sizeof(MirrorPair),
-            compare_mp);
+    res = (MirrorPair *) bsearch(&mp, mirror_pairs, BIDI_MIRROR_LEN,
+                                sizeof(MirrorPair), compare_mp);
 
     if (res == NULL)
         return code;
@@ -326,8 +327,8 @@
     if (hangul_pair_compose(code, a, b))
         return 1;
 
-    l = get_comp_index(a, nfc_first);
-    r = get_comp_index(b, nfc_last);
+    l = get_comp_index(a, nfc_first, sizeof(nfc_first) / sizeof(Reindex));
+    r = get_comp_index(b, nfc_last, sizeof(nfc_last) / sizeof(Reindex));
 
     if (l < 0 || r < 0)
         return 0;
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ucdn/ucdn.h	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ucdn/ucdn.h	Wed Dec 13 10:25:38 2017 -0800
@@ -36,30 +36,16 @@
 
 HB_BEGIN_HEADER
 
-#if !defined (HB_DONT_DEFINE_STDINT)
-
 #if defined (_SVR4) || defined (SVR4) || defined (__OpenBSD__) || \
     defined (_sgi) || defined (__sun) || defined (sun) || \
     defined (__digital__) || defined (__HP_cc)
 #  include <inttypes.h>
 #elif defined (_AIX)
 #  include <sys/inttypes.h>
-/* VS 2010 (_MSC_VER 1600) has stdint.h */
-#elif defined (_MSC_VER) && _MSC_VER < 1600
-typedef __int8 int8_t;
-typedef unsigned __int8 uint8_t;
-typedef __int16 int16_t;
-typedef unsigned __int16 uint16_t;
-typedef __int32 int32_t;
-typedef unsigned __int32 uint32_t;
-typedef __int64 int64_t;
-typedef unsigned __int64 uint64_t;
 #else
 #  include <stdint.h>
 #endif
 
-#endif
-
 
 #define UCDN_EAST_ASIAN_F 0
 #define UCDN_EAST_ASIAN_H 1
@@ -206,6 +192,10 @@
 #define UCDN_SCRIPT_NEWA 135
 #define UCDN_SCRIPT_OSAGE 136
 #define UCDN_SCRIPT_TANGUT 137
+#define UCDN_SCRIPT_MASARAM_GONDI 138
+#define UCDN_SCRIPT_NUSHU 139
+#define UCDN_SCRIPT_SOYOMBO 140
+#define UCDN_SCRIPT_ZANABAZAR_SQUARE 141
 
 #define UCDN_LINEBREAK_CLASS_OP 0
 #define UCDN_LINEBREAK_CLASS_CL 1
@@ -247,6 +237,9 @@
 #define UCDN_LINEBREAK_CLASS_SG 37
 #define UCDN_LINEBREAK_CLASS_SP 38
 #define UCDN_LINEBREAK_CLASS_XX 39
+#define UCDN_LINEBREAK_CLASS_ZWJ 40
+#define UCDN_LINEBREAK_CLASS_EB 41
+#define UCDN_LINEBREAK_CLASS_EM 42
 
 #define UCDN_GENERAL_CATEGORY_CC 0
 #define UCDN_GENERAL_CATEGORY_CF 1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ucdn/ucdn_db.h	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,5540 @@
+/* this file was generated by makeunicodedata.py 3.2 */
+
+#define UNIDATA_VERSION "10.0.0"
+/* a list of unique database records */
+static const UCDRecord ucd_records[] = {
+    {2, 0, 18, 5, 102, 39},
+    {0, 0, 14, 5, 0, 21},
+    {0, 0, 16, 5, 0, 17},
+    {0, 0, 15, 5, 0, 34},
+    {0, 0, 16, 5, 0, 30},
+    {0, 0, 17, 5, 0, 30},
+    {0, 0, 15, 5, 0, 33},
+    {0, 0, 15, 5, 0, 21},
+    {0, 0, 16, 5, 0, 21},
+    {29, 0, 17, 3, 0, 38},
+    {21, 0, 18, 3, 0, 6},
+    {21, 0, 18, 3, 0, 3},
+    {21, 0, 10, 3, 0, 12},
+    {23, 0, 10, 3, 0, 9},
+    {21, 0, 10, 3, 0, 10},
+    {21, 0, 18, 3, 0, 12},
+    {22, 0, 18, 3, 0, 0},
+    {18, 0, 18, 3, 0, 2},
+    {25, 0, 9, 3, 0, 9},
+    {21, 0, 12, 3, 0, 8},
+    {17, 0, 9, 3, 0, 16},
+    {21, 0, 12, 3, 0, 7},
+    {13, 0, 8, 3, 0, 11},
+    {21, 0, 18, 3, 0, 8},
+    {25, 0, 18, 3, 0, 12},
+    {9, 0, 0, 3, 1, 12},
+    {21, 0, 18, 3, 0, 9},
+    {24, 0, 18, 3, 0, 12},
+    {16, 0, 18, 3, 0, 12},
+    {5, 0, 0, 3, 1, 12},
+    {25, 0, 18, 3, 0, 17},
+    {18, 0, 18, 3, 0, 1},
+    {0, 0, 15, 5, 0, 35},
+    {29, 0, 12, 5, 0, 4},
+    {21, 0, 18, 4, 0, 0},
+    {23, 0, 10, 3, 0, 10},
+    {23, 0, 10, 4, 0, 9},
+    {26, 0, 18, 3, 0, 12},
+    {21, 0, 18, 4, 0, 29},
+    {24, 0, 18, 4, 0, 29},
+    {26, 0, 18, 5, 0, 12},
+    {7, 0, 0, 4, 1, 29},
+    {20, 0, 18, 5, 0, 3},
+    {1, 0, 14, 4, 0, 17},
+    {26, 0, 18, 4, 0, 12},
+    {26, 0, 10, 4, 0, 10},
+    {25, 0, 10, 4, 0, 9},
+    {15, 0, 8, 4, 0, 29},
+    {24, 0, 18, 4, 0, 18},
+    {5, 0, 0, 5, 0, 12},
+    {19, 0, 18, 5, 0, 3},
+    {15, 0, 18, 4, 0, 29},
+    {9, 0, 0, 5, 1, 12},
+    {9, 0, 0, 4, 1, 12},
+    {25, 0, 18, 4, 0, 29},
+    {5, 0, 0, 4, 1, 12},
+    {5, 0, 0, 5, 1, 12},
+    {7, 0, 0, 5, 1, 12},
+    {8, 0, 0, 5, 1, 12},
+    {6, 0, 0, 5, 1, 12},
+    {6, 0, 18, 5, 0, 12},
+    {6, 0, 0, 5, 0, 12},
+    {24, 0, 18, 5, 0, 12},
+    {24, 0, 18, 4, 0, 12},
+    {6, 0, 18, 4, 0, 29},
+    {6, 0, 18, 5, 0, 18},
+    {6, 0, 0, 4, 0, 29},
+    {24, 0, 18, 5, 34, 12},
+    {12, 230, 13, 4, 40, 21},
+    {12, 232, 13, 4, 40, 21},
+    {12, 220, 13, 4, 40, 21},
+    {12, 216, 13, 4, 40, 21},
+    {12, 202, 13, 4, 40, 21},
+    {12, 1, 13, 4, 40, 21},
+    {12, 240, 13, 4, 40, 21},
+    {12, 0, 13, 4, 40, 4},
+    {12, 233, 13, 4, 40, 4},
+    {12, 234, 13, 4, 40, 4},
+    {9, 0, 0, 5, 2, 12},
+    {5, 0, 0, 5, 2, 12},
+    {24, 0, 18, 5, 2, 12},
+    {2, 0, 18, 5, 102, 39},
+    {6, 0, 0, 5, 2, 12},
+    {21, 0, 18, 5, 0, 8},
+    {21, 0, 18, 5, 0, 12},
+    {9, 0, 0, 4, 2, 12},
+    {5, 0, 0, 4, 2, 12},
+    {9, 0, 0, 5, 54, 12},
+    {5, 0, 0, 5, 54, 12},
+    {25, 0, 18, 5, 2, 12},
+    {9, 0, 0, 5, 3, 12},
+    {9, 0, 0, 4, 3, 12},
+    {5, 0, 0, 4, 3, 12},
+    {5, 0, 0, 5, 3, 12},
+    {26, 0, 0, 5, 3, 12},
+    {12, 230, 13, 5, 3, 21},
+    {12, 230, 13, 5, 40, 21},
+    {11, 0, 13, 5, 3, 21},
+    {9, 0, 0, 5, 4, 12},
+    {6, 0, 0, 5, 4, 12},
+    {21, 0, 0, 5, 4, 12},
+    {5, 0, 0, 5, 4, 12},
+    {21, 0, 0, 5, 0, 8},
+    {17, 0, 18, 5, 4, 17},
+    {26, 0, 18, 5, 4, 12},
+    {23, 0, 10, 5, 4, 9},
+    {12, 220, 13, 5, 5, 21},
+    {12, 230, 13, 5, 5, 21},
+    {12, 222, 13, 5, 5, 21},
+    {12, 228, 13, 5, 5, 21},
+    {12, 10, 13, 5, 5, 21},
+    {12, 11, 13, 5, 5, 21},
+    {12, 12, 13, 5, 5, 21},
+    {12, 13, 13, 5, 5, 21},
+    {12, 14, 13, 5, 5, 21},
+    {12, 15, 13, 5, 5, 21},
+    {12, 16, 13, 5, 5, 21},
+    {12, 17, 13, 5, 5, 21},
+    {12, 18, 13, 5, 5, 21},
+    {12, 19, 13, 5, 5, 21},
+    {12, 20, 13, 5, 5, 21},
+    {12, 21, 13, 5, 5, 21},
+    {12, 22, 13, 5, 5, 21},
+    {17, 0, 3, 5, 5, 17},
+    {12, 23, 13, 5, 5, 21},
+    {21, 0, 3, 5, 5, 12},
+    {12, 24, 13, 5, 5, 21},
+    {12, 25, 13, 5, 5, 21},
+    {21, 0, 3, 5, 5, 6},
+    {7, 0, 3, 5, 5, 13},
+    {1, 0, 11, 5, 6, 12},
+    {1, 0, 11, 5, 0, 12},
+    {25, 0, 18, 5, 6, 12},
+    {25, 0, 4, 5, 6, 12},
+    {21, 0, 10, 5, 6, 10},
+    {23, 0, 4, 5, 6, 10},
+    {21, 0, 12, 5, 0, 8},
+    {21, 0, 4, 5, 6, 8},
+    {26, 0, 18, 5, 6, 12},
+    {12, 230, 13, 5, 6, 21},
+    {12, 30, 13, 5, 6, 21},
+    {12, 31, 13, 5, 6, 21},
+    {12, 32, 13, 5, 6, 21},
+    {21, 0, 4, 5, 0, 6},
+    {1, 0, 4, 5, 6, 21},
+    {21, 0, 4, 5, 6, 6},
+    {7, 0, 4, 5, 6, 12},
+    {6, 0, 4, 5, 0, 12},
+    {12, 27, 13, 5, 40, 21},
+    {12, 28, 13, 5, 40, 21},
+    {12, 29, 13, 5, 40, 21},
+    {12, 30, 13, 5, 40, 21},
+    {12, 31, 13, 5, 40, 21},
+    {12, 32, 13, 5, 40, 21},
+    {12, 33, 13, 5, 40, 21},
+    {12, 34, 13, 5, 40, 21},
+    {12, 220, 13, 5, 40, 21},
+    {12, 220, 13, 5, 6, 21},
+    {13, 0, 11, 5, 6, 11},
+    {21, 0, 11, 5, 6, 11},
+    {21, 0, 4, 5, 6, 12},
+    {12, 35, 13, 5, 40, 21},
+    {6, 0, 4, 5, 6, 12},
+    {13, 0, 8, 5, 6, 11},
+    {26, 0, 4, 5, 6, 12},
+    {21, 0, 4, 5, 7, 12},
+    {1, 0, 4, 5, 7, 12},
+    {7, 0, 4, 5, 7, 12},
+    {12, 36, 13, 5, 7, 21},
+    {12, 230, 13, 5, 7, 21},
+    {12, 220, 13, 5, 7, 21},
+    {7, 0, 4, 5, 8, 12},
+    {12, 0, 13, 5, 8, 21},
+    {13, 0, 3, 5, 65, 11},
+    {7, 0, 3, 5, 65, 12},
+    {12, 230, 13, 5, 65, 21},
+    {12, 220, 13, 5, 65, 21},
+    {6, 0, 3, 5, 65, 12},
+    {26, 0, 18, 5, 65, 12},
+    {21, 0, 18, 5, 65, 12},
+    {21, 0, 18, 5, 65, 8},
+    {21, 0, 18, 5, 65, 6},
+    {7, 0, 3, 5, 81, 12},
+    {12, 230, 13, 5, 81, 21},
+    {6, 0, 3, 5, 81, 12},
+    {21, 0, 3, 5, 81, 12},
+    {7, 0, 3, 5, 94, 12},
+    {12, 220, 13, 5, 94, 21},
+    {21, 0, 3, 5, 94, 12},
+    {12, 27, 13, 5, 6, 21},
+    {12, 28, 13, 5, 6, 21},
+    {12, 29, 13, 5, 6, 21},
+    {12, 0, 13, 5, 9, 21},
+    {10, 0, 0, 5, 9, 21},
+    {7, 0, 0, 5, 9, 12},
+    {12, 7, 13, 5, 9, 21},
+    {12, 9, 13, 5, 9, 21},
+    {12, 230, 13, 5, 9, 21},
+    {21, 0, 0, 5, 0, 17},
+    {13, 0, 0, 5, 9, 11},
+    {21, 0, 0, 5, 9, 12},
+    {6, 0, 0, 5, 9, 12},
+    {7, 0, 0, 5, 10, 12},
+    {12, 0, 13, 5, 10, 21},
+    {10, 0, 0, 5, 10, 21},
+    {12, 7, 13, 5, 10, 21},
+    {12, 9, 13, 5, 10, 21},
+    {13, 0, 0, 5, 10, 11},
+    {23, 0, 10, 5, 10, 10},
+    {15, 0, 0, 5, 10, 12},
+    {15, 0, 0, 5, 10, 10},
+    {26, 0, 0, 5, 10, 12},
+    {23, 0, 10, 5, 10, 9},
+    {21, 0, 0, 5, 10, 12},
+    {12, 0, 13, 5, 11, 21},
+    {10, 0, 0, 5, 11, 21},
+    {7, 0, 0, 5, 11, 12},
+    {12, 7, 13, 5, 11, 21},
+    {12, 9, 13, 5, 11, 21},
+    {13, 0, 0, 5, 11, 11},
+    {12, 0, 13, 5, 12, 21},
+    {10, 0, 0, 5, 12, 21},
+    {7, 0, 0, 5, 12, 12},
+    {12, 7, 13, 5, 12, 21},
+    {12, 9, 13, 5, 12, 21},
+    {13, 0, 0, 5, 12, 11},
+    {21, 0, 0, 5, 12, 12},
+    {23, 0, 10, 5, 12, 9},
+    {12, 0, 13, 5, 13, 21},
+    {10, 0, 0, 5, 13, 21},
+    {7, 0, 0, 5, 13, 12},
+    {12, 7, 13, 5, 13, 21},
+    {12, 9, 13, 5, 13, 21},
+    {13, 0, 0, 5, 13, 11},
+    {26, 0, 0, 5, 13, 12},
+    {15, 0, 0, 5, 13, 12},
+    {12, 0, 13, 5, 14, 21},
+    {7, 0, 0, 5, 14, 12},
+    {10, 0, 0, 5, 14, 21},
+    {12, 9, 13, 5, 14, 21},
+    {13, 0, 0, 5, 14, 11},
+    {15, 0, 0, 5, 14, 12},
+    {26, 0, 18, 5, 14, 12},
+    {23, 0, 10, 5, 14, 9},
+    {12, 0, 13, 5, 15, 21},
+    {10, 0, 0, 5, 15, 21},
+    {7, 0, 0, 5, 15, 12},
+    {12, 9, 13, 5, 15, 21},
+    {12, 84, 13, 5, 15, 21},
+    {12, 91, 13, 5, 15, 21},
+    {13, 0, 0, 5, 15, 11},
+    {15, 0, 18, 5, 15, 12},
+    {26, 0, 0, 5, 15, 12},
+    {7, 0, 0, 5, 16, 12},
+    {12, 0, 13, 5, 16, 21},
+    {10, 0, 0, 5, 16, 21},
+    {12, 7, 13, 5, 16, 21},
+    {12, 0, 0, 5, 16, 21},
+    {12, 9, 13, 5, 16, 21},
+    {13, 0, 0, 5, 16, 11},
+    {12, 0, 13, 5, 17, 21},
+    {10, 0, 0, 5, 17, 21},
+    {7, 0, 0, 5, 17, 12},
+    {12, 9, 13, 5, 17, 21},
+    {26, 0, 0, 5, 17, 12},
+    {15, 0, 0, 5, 17, 12},
+    {13, 0, 0, 5, 17, 11},
+    {26, 0, 0, 5, 17, 10},
+    {10, 0, 0, 5, 18, 21},
+    {7, 0, 0, 5, 18, 12},
+    {12, 9, 13, 5, 18, 21},
+    {12, 0, 13, 5, 18, 21},
+    {13, 0, 0, 5, 18, 11},
+    {21, 0, 0, 5, 18, 12},
+    {7, 0, 0, 5, 19, 36},
+    {12, 0, 13, 5, 19, 36},
+    {12, 103, 13, 5, 19, 36},
+    {12, 9, 13, 5, 19, 36},
+    {23, 0, 10, 5, 0, 9},
+    {6, 0, 0, 5, 19, 36},
+    {12, 107, 13, 5, 19, 36},
+    {21, 0, 0, 5, 19, 12},
+    {13, 0, 0, 5, 19, 11},
+    {21, 0, 0, 5, 19, 17},
+    {7, 0, 0, 5, 20, 36},
+    {12, 0, 13, 5, 20, 36},
+    {12, 118, 13, 5, 20, 36},
+    {6, 0, 0, 5, 20, 36},
+    {12, 122, 13, 5, 20, 36},
+    {13, 0, 0, 5, 20, 11},
+    {7, 0, 0, 5, 21, 12},
+    {26, 0, 0, 5, 21, 18},
+    {21, 0, 0, 5, 21, 18},
+    {21, 0, 0, 5, 21, 12},
+    {21, 0, 0, 5, 21, 4},
+    {21, 0, 0, 5, 21, 17},
+    {21, 0, 0, 5, 21, 6},
+    {26, 0, 0, 5, 21, 12},
+    {12, 220, 13, 5, 21, 21},
+    {13, 0, 0, 5, 21, 11},
+    {15, 0, 0, 5, 21, 12},
+    {26, 0, 0, 5, 21, 17},
+    {12, 216, 13, 5, 21, 21},
+    {22, 0, 18, 5, 21, 0},
+    {18, 0, 18, 5, 21, 1},
+    {10, 0, 0, 5, 21, 21},
+    {12, 129, 13, 5, 21, 21},
+    {12, 130, 13, 5, 21, 21},
+    {12, 0, 13, 5, 21, 21},
+    {12, 132, 13, 5, 21, 21},
+    {10, 0, 0, 5, 21, 17},
+    {12, 230, 13, 5, 21, 21},
+    {12, 9, 13, 5, 21, 21},
+    {26, 0, 0, 5, 0, 12},
+    {7, 0, 0, 5, 22, 36},
+    {10, 0, 0, 5, 22, 36},
+    {12, 0, 13, 5, 22, 36},
+    {12, 7, 13, 5, 22, 36},
+    {12, 9, 13, 5, 22, 36},
+    {13, 0, 0, 5, 22, 11},
+    {21, 0, 0, 5, 22, 17},
+    {21, 0, 0, 5, 22, 12},
+    {12, 220, 13, 5, 22, 36},
+    {26, 0, 0, 5, 22, 36},
+    {9, 0, 0, 5, 23, 12},
+    {7, 0, 0, 5, 23, 12},
+    {21, 0, 0, 5, 0, 12},
+    {6, 0, 0, 5, 23, 12},
+    {7, 0, 0, 2, 24, 25},
+    {7, 0, 0, 5, 24, 26},
+    {7, 0, 0, 5, 24, 27},
+    {7, 0, 0, 5, 25, 12},
+    {12, 230, 13, 5, 25, 21},
+    {21, 0, 0, 5, 25, 12},
+    {21, 0, 0, 5, 25, 17},
+    {15, 0, 0, 5, 25, 12},
+    {26, 0, 18, 5, 25, 12},
+    {9, 0, 0, 5, 26, 12},
+    {5, 0, 0, 5, 26, 12},
+    {17, 0, 18, 5, 27, 17},
+    {7, 0, 0, 5, 27, 12},
+    {21, 0, 0, 5, 27, 12},
+    {29, 0, 17, 5, 28, 17},
+    {7, 0, 0, 5, 28, 12},
+    {22, 0, 18, 5, 28, 0},
+    {18, 0, 18, 5, 28, 1},
+    {7, 0, 0, 5, 29, 12},
+    {14, 0, 0, 5, 29, 12},
+    {7, 0, 0, 5, 41, 12},
+    {12, 0, 13, 5, 41, 21},
+    {12, 9, 13, 5, 41, 21},
+    {7, 0, 0, 5, 42, 12},
+    {12, 0, 13, 5, 42, 21},
+    {12, 9, 13, 5, 42, 21},
+    {7, 0, 0, 5, 43, 12},
+    {12, 0, 13, 5, 43, 21},
+    {7, 0, 0, 5, 44, 12},
+    {12, 0, 13, 5, 44, 21},
+    {7, 0, 0, 5, 30, 36},
+    {12, 0, 13, 5, 30, 36},
+    {10, 0, 0, 5, 30, 36},
+    {12, 9, 13, 5, 30, 36},
+    {21, 0, 0, 5, 30, 17},
+    {21, 0, 0, 5, 30, 5},
+    {6, 0, 0, 5, 30, 36},
+    {21, 0, 0, 5, 30, 12},
+    {23, 0, 10, 5, 30, 9},
+    {12, 230, 13, 5, 30, 36},
+    {13, 0, 0, 5, 30, 11},
+    {15, 0, 18, 5, 30, 12},
+    {21, 0, 18, 5, 31, 12},
+    {21, 0, 18, 5, 0, 6},
+    {21, 0, 18, 5, 31, 17},
+    {21, 0, 18, 5, 0, 17},
+    {17, 0, 18, 5, 31, 18},
+    {21, 0, 18, 5, 31, 6},
+    {12, 0, 13, 5, 31, 21},
+    {1, 0, 14, 5, 31, 4},
+    {13, 0, 0, 5, 31, 11},
+    {7, 0, 0, 5, 31, 12},
+    {6, 0, 0, 5, 31, 12},
+    {12, 228, 13, 5, 31, 21},
+    {7, 0, 0, 5, 45, 12},
+    {12, 0, 13, 5, 45, 21},
+    {10, 0, 0, 5, 45, 21},
+    {12, 222, 13, 5, 45, 21},
+    {12, 230, 13, 5, 45, 21},
+    {12, 220, 13, 5, 45, 21},
+    {26, 0, 18, 5, 45, 12},
+    {21, 0, 18, 5, 45, 6},
+    {13, 0, 0, 5, 45, 11},
+    {7, 0, 0, 5, 46, 36},
+    {7, 0, 0, 5, 55, 36},
+    {13, 0, 0, 5, 55, 11},
+    {15, 0, 0, 5, 55, 36},
+    {26, 0, 18, 5, 55, 36},
+    {26, 0, 18, 5, 30, 12},
+    {7, 0, 0, 5, 53, 12},
+    {12, 230, 13, 5, 53, 21},
+    {12, 220, 13, 5, 53, 21},
+    {10, 0, 0, 5, 53, 21},
+    {12, 0, 13, 5, 53, 21},
+    {21, 0, 0, 5, 53, 12},
+    {7, 0, 0, 5, 77, 36},
+    {10, 0, 0, 5, 77, 36},
+    {12, 0, 13, 5, 77, 36},
+    {12, 9, 13, 5, 77, 36},
+    {12, 230, 13, 5, 77, 36},
+    {12, 220, 13, 5, 77, 21},
+    {13, 0, 0, 5, 77, 11},
+    {21, 0, 0, 5, 77, 36},
+    {6, 0, 0, 5, 77, 36},
+    {11, 0, 13, 5, 40, 21},
+    {12, 0, 13, 5, 61, 21},
+    {10, 0, 0, 5, 61, 21},
+    {7, 0, 0, 5, 61, 12},
+    {12, 7, 13, 5, 61, 21},
+    {10, 9, 0, 5, 61, 21},
+    {13, 0, 0, 5, 61, 11},
+    {21, 0, 0, 5, 61, 17},
+    {21, 0, 0, 5, 61, 12},
+    {26, 0, 0, 5, 61, 12},
+    {12, 230, 13, 5, 61, 21},
+    {12, 220, 13, 5, 61, 21},
+    {12, 0, 13, 5, 66, 21},
+    {10, 0, 0, 5, 66, 21},
+    {7, 0, 0, 5, 66, 12},
+    {10, 9, 0, 5, 66, 21},
+    {12, 9, 13, 5, 66, 21},
+    {13, 0, 0, 5, 66, 11},
+    {7, 0, 0, 5, 92, 12},
+    {12, 7, 13, 5, 92, 21},
+    {10, 0, 0, 5, 92, 21},
+    {12, 0, 13, 5, 92, 21},
+    {10, 9, 0, 5, 92, 21},
+    {21, 0, 0, 5, 92, 12},
+    {7, 0, 0, 5, 67, 12},
+    {10, 0, 0, 5, 67, 21},
+    {12, 0, 13, 5, 67, 21},
+    {12, 7, 13, 5, 67, 21},
+    {21, 0, 0, 5, 67, 17},
+    {13, 0, 0, 5, 67, 11},
+    {13, 0, 0, 5, 68, 11},
+    {7, 0, 0, 5, 68, 12},
+    {6, 0, 0, 5, 68, 12},
+    {21, 0, 0, 5, 68, 17},
+    {21, 0, 0, 5, 66, 12},
+    {12, 1, 13, 5, 40, 21},
+    {10, 0, 0, 5, 0, 21},
+    {7, 0, 0, 5, 0, 12},
+    {6, 0, 0, 5, 3, 12},
+    {12, 234, 13, 5, 40, 21},
+    {12, 214, 13, 5, 40, 21},
+    {12, 202, 13, 5, 40, 21},
+    {12, 232, 13, 5, 40, 21},
+    {12, 228, 13, 5, 40, 21},
+    {12, 233, 13, 5, 40, 21},
+    {8, 0, 0, 5, 2, 12},
+    {24, 0, 18, 5, 2, 18},
+    {29, 0, 17, 5, 0, 17},
+    {29, 0, 17, 5, 0, 4},
+    {1, 0, 14, 5, 0, 20},
+    {1, 0, 14, 5, 40, 21},
+    {1, 0, 14, 5, 40, 40},
+    {1, 0, 0, 5, 0, 21},
+    {1, 0, 3, 5, 0, 21},
+    {17, 0, 18, 4, 0, 17},
+    {17, 0, 18, 5, 0, 4},
+    {17, 0, 18, 5, 0, 17},
+    {17, 0, 18, 4, 0, 19},
+    {17, 0, 18, 4, 0, 29},
+    {20, 0, 18, 4, 0, 3},
+    {19, 0, 18, 4, 0, 3},
+    {22, 0, 18, 5, 0, 0},
+    {21, 0, 18, 4, 0, 12},
+    {21, 0, 18, 4, 0, 15},
+    {21, 0, 18, 4, 0, 17},
+    {27, 0, 17, 5, 0, 30},
+    {28, 0, 15, 5, 0, 30},
+    {1, 0, 1, 5, 0, 21},
+    {1, 0, 5, 5, 0, 21},
+    {1, 0, 7, 5, 0, 21},
+    {1, 0, 2, 5, 0, 21},
+    {1, 0, 6, 5, 0, 21},
+    {21, 0, 10, 4, 0, 10},
+    {21, 0, 10, 5, 0, 10},
+    {21, 0, 18, 4, 0, 10},
+    {21, 0, 18, 5, 0, 10},
+    {21, 0, 18, 5, 0, 5},
+    {16, 0, 18, 5, 0, 12},
+    {25, 0, 12, 5, 0, 8},
+    {18, 0, 18, 5, 0, 1},
+    {25, 0, 18, 5, 0, 12},
+    {1, 0, 14, 5, 0, 22},
+    {1, 0, 14, 5, 0, 12},
+    {1, 0, 19, 5, 0, 21},
+    {1, 0, 20, 5, 0, 21},
+    {1, 0, 21, 5, 0, 21},
+    {1, 0, 22, 5, 0, 21},
+    {1, 0, 14, 5, 0, 21},
+    {15, 0, 8, 5, 0, 12},
+    {25, 0, 9, 5, 0, 12},
+    {6, 0, 0, 4, 1, 29},
+    {23, 0, 10, 5, 0, 10},
+    {23, 0, 10, 1, 0, 9},
+    {2, 0, 18, 5, 102, 9},
+    {9, 0, 0, 5, 0, 12},
+    {26, 0, 18, 4, 0, 10},
+    {26, 0, 18, 4, 0, 29},
+    {5, 0, 0, 4, 0, 29},
+    {26, 0, 18, 4, 0, 9},
+    {9, 0, 0, 4, 1, 29},
+    {26, 0, 10, 5, 0, 12},
+    {15, 0, 18, 5, 0, 12},
+    {15, 0, 18, 4, 0, 12},
+    {15, 0, 18, 5, 0, 29},
+    {14, 0, 0, 4, 1, 29},
+    {14, 0, 0, 5, 1, 12},
+    {25, 0, 9, 5, 0, 9},
+    {25, 0, 10, 5, 0, 9},
+    {25, 0, 18, 5, 0, 15},
+    {26, 0, 18, 2, 0, 14},
+    {22, 0, 18, 2, 0, 0},
+    {18, 0, 18, 2, 0, 1},
+    {26, 0, 18, 2, 0, 12},
+    {26, 0, 18, 5, 0, 14},
+    {26, 0, 0, 4, 0, 29},
+    {26, 0, 18, 5, 0, 29},
+    {25, 0, 18, 2, 0, 12},
+    {26, 0, 18, 4, 0, 14},
+    {26, 0, 18, 5, 0, 41},
+    {26, 0, 18, 4, 0, 41},
+    {26, 0, 18, 2, 0, 41},
+    {26, 0, 18, 2, 0, 29},
+    {26, 0, 18, 5, 0, 3},
+    {26, 0, 18, 5, 0, 6},
+    {26, 0, 0, 5, 52, 12},
+    {9, 0, 0, 5, 56, 12},
+    {5, 0, 0, 5, 56, 12},
+    {26, 0, 18, 5, 54, 12},
+    {12, 230, 13, 5, 54, 21},
+    {21, 0, 18, 5, 54, 6},
+    {21, 0, 18, 5, 54, 17},
+    {15, 0, 18, 5, 54, 12},
+    {5, 0, 0, 5, 23, 12},
+    {7, 0, 0, 5, 57, 12},
+    {6, 0, 0, 5, 57, 12},
+    {21, 0, 0, 5, 57, 17},
+    {12, 9, 13, 5, 57, 21},
+    {21, 0, 18, 5, 0, 3},
+    {21, 0, 18, 5, 0, 0},
+    {17, 0, 18, 5, 0, 12},
+    {17, 0, 18, 5, 0, 19},
+    {26, 0, 18, 2, 35, 14},
+    {29, 0, 17, 0, 0, 17},
+    {21, 0, 18, 2, 0, 1},
+    {21, 0, 18, 2, 0, 14},
+    {6, 0, 0, 2, 35, 5},
+    {7, 0, 0, 2, 0, 14},
+    {14, 0, 0, 2, 35, 14},
+    {17, 0, 18, 2, 0, 5},
+    {12, 218, 13, 2, 40, 21},
+    {12, 228, 13, 2, 40, 21},
+    {12, 232, 13, 2, 40, 21},
+    {12, 222, 13, 2, 40, 21},
+    {10, 224, 0, 2, 24, 21},
+    {17, 0, 18, 2, 0, 14},
+    {6, 0, 0, 2, 0, 14},
+    {6, 0, 0, 2, 0, 21},
+    {7, 0, 0, 2, 0, 5},
+    {7, 0, 0, 2, 32, 32},
+    {7, 0, 0, 2, 32, 14},
+    {12, 8, 13, 2, 40, 21},
+    {24, 0, 18, 2, 0, 5},
+    {6, 0, 0, 2, 32, 5},
+    {7, 0, 0, 2, 33, 32},
+    {7, 0, 0, 2, 33, 14},
+    {21, 0, 18, 2, 0, 5},
+    {6, 0, 0, 2, 0, 32},
+    {6, 0, 0, 2, 33, 5},
+    {7, 0, 0, 2, 34, 14},
+    {7, 0, 0, 2, 24, 14},
+    {26, 0, 0, 2, 0, 14},
+    {15, 0, 0, 2, 0, 14},
+    {26, 0, 0, 2, 24, 14},
+    {26, 0, 18, 2, 24, 14},
+    {15, 0, 0, 4, 0, 29},
+    {15, 0, 18, 2, 0, 14},
+    {26, 0, 0, 2, 33, 14},
+    {7, 0, 0, 2, 35, 14},
+    {2, 0, 18, 2, 102, 14},
+    {7, 0, 0, 2, 36, 14},
+    {6, 0, 0, 2, 36, 5},
+    {26, 0, 18, 2, 36, 14},
+    {7, 0, 0, 5, 82, 12},
+    {6, 0, 0, 5, 82, 12},
+    {21, 0, 0, 5, 82, 17},
+    {7, 0, 0, 5, 69, 12},
+    {6, 0, 0, 5, 69, 12},
+    {21, 0, 18, 5, 69, 17},
+    {21, 0, 18, 5, 69, 6},
+    {13, 0, 0, 5, 69, 11},
+    {7, 0, 0, 5, 3, 12},
+    {21, 0, 18, 5, 3, 12},
+    {6, 0, 18, 5, 3, 12},
+    {7, 0, 0, 5, 83, 12},
+    {14, 0, 0, 5, 83, 12},
+    {12, 230, 13, 5, 83, 21},
+    {21, 0, 0, 5, 83, 12},
+    {21, 0, 0, 5, 83, 17},
+    {24, 0, 0, 5, 0, 12},
+    {7, 0, 0, 5, 58, 12},
+    {12, 0, 13, 5, 58, 21},
+    {12, 9, 13, 5, 58, 21},
+    {10, 0, 0, 5, 58, 21},
+    {26, 0, 18, 5, 58, 12},
+    {15, 0, 0, 5, 0, 12},
+    {7, 0, 0, 5, 64, 12},
+    {21, 0, 18, 5, 64, 18},
+    {21, 0, 18, 5, 64, 6},
+    {10, 0, 0, 5, 70, 21},
+    {7, 0, 0, 5, 70, 12},
+    {12, 9, 13, 5, 70, 21},
+    {12, 0, 13, 5, 70, 21},
+    {21, 0, 0, 5, 70, 17},
+    {13, 0, 0, 5, 70, 11},
+    {21, 0, 0, 5, 9, 18},
+    {13, 0, 0, 5, 71, 11},
+    {7, 0, 0, 5, 71, 12},
+    {12, 0, 13, 5, 71, 21},
+    {12, 220, 13, 5, 71, 21},
+    {21, 0, 0, 5, 71, 17},
+    {7, 0, 0, 5, 72, 12},
+    {12, 0, 13, 5, 72, 21},
+    {10, 0, 0, 5, 72, 21},
+    {10, 9, 0, 5, 72, 21},
+    {21, 0, 0, 5, 72, 12},
+    {12, 0, 13, 5, 84, 21},
+    {10, 0, 0, 5, 84, 21},
+    {7, 0, 0, 5, 84, 12},
+    {12, 7, 13, 5, 84, 21},
+    {10, 9, 0, 5, 84, 21},
+    {21, 0, 0, 5, 84, 12},
+    {21, 0, 0, 5, 84, 17},
+    {13, 0, 0, 5, 84, 11},
+    {6, 0, 0, 5, 22, 36},
+    {7, 0, 0, 5, 76, 12},
+    {12, 0, 13, 5, 76, 21},
+    {10, 0, 0, 5, 76, 21},
+    {13, 0, 0, 5, 76, 11},
+    {21, 0, 0, 5, 76, 12},
+    {21, 0, 0, 5, 76, 17},
+    {7, 0, 0, 5, 78, 36},
+    {12, 230, 13, 5, 78, 36},
+    {12, 220, 13, 5, 78, 36},
+    {6, 0, 0, 5, 78, 36},
+    {21, 0, 0, 5, 78, 36},
+    {7, 0, 0, 5, 85, 12},
+    {10, 0, 0, 5, 85, 21},
+    {12, 0, 13, 5, 85, 21},
+    {21, 0, 0, 5, 85, 17},
+    {6, 0, 0, 5, 85, 12},
+    {12, 9, 13, 5, 85, 21},
+    {13, 0, 0, 5, 85, 11},
+    {7, 0, 0, 2, 24, 23},
+    {7, 0, 0, 2, 24, 24},
+    {4, 0, 0, 5, 102, 37},
+    {3, 0, 0, 4, 102, 39},
+    {12, 26, 13, 5, 5, 21},
+    {25, 0, 9, 5, 5, 12},
+    {24, 0, 4, 5, 6, 12},
+    {12, 0, 13, 4, 40, 21},
+    {21, 0, 18, 2, 0, 8},
+    {21, 0, 18, 2, 0, 6},
+    {21, 0, 18, 2, 0, 15},
+    {16, 0, 18, 2, 0, 14},
+    {21, 0, 12, 2, 0, 1},
+    {21, 0, 12, 2, 0, 5},
+    {21, 0, 10, 2, 0, 14},
+    {25, 0, 9, 2, 0, 14},
+    {17, 0, 9, 2, 0, 14},
+    {25, 0, 18, 2, 0, 14},
+    {23, 0, 10, 2, 0, 9},
+    {21, 0, 10, 2, 0, 10},
+    {21, 0, 18, 0, 0, 6},
+    {21, 0, 18, 0, 0, 14},
+    {21, 0, 10, 0, 0, 14},
+    {23, 0, 10, 0, 0, 9},
+    {21, 0, 10, 0, 0, 10},
+    {22, 0, 18, 0, 0, 0},
+    {18, 0, 18, 0, 0, 1},
+    {25, 0, 9, 0, 0, 14},
+    {21, 0, 12, 0, 0, 1},
+    {17, 0, 9, 0, 0, 14},
+    {21, 0, 12, 0, 0, 14},
+    {13, 0, 8, 0, 0, 14},
+    {21, 0, 12, 0, 0, 5},
+    {21, 0, 18, 0, 0, 5},
+    {25, 0, 18, 0, 0, 14},
+    {9, 0, 0, 0, 1, 14},
+    {24, 0, 18, 0, 0, 14},
+    {16, 0, 18, 0, 0, 14},
+    {5, 0, 0, 0, 1, 14},
+    {21, 0, 18, 1, 0, 1},
+    {22, 0, 18, 1, 0, 0},
+    {18, 0, 18, 1, 0, 1},
+    {21, 0, 18, 1, 0, 5},
+    {7, 0, 0, 1, 33, 14},
+    {7, 0, 0, 1, 33, 32},
+    {6, 0, 0, 1, 0, 32},
+    {6, 0, 0, 1, 0, 5},
+    {7, 0, 0, 1, 24, 14},
+    {23, 0, 10, 0, 0, 10},
+    {26, 0, 18, 0, 0, 14},
+    {26, 0, 18, 1, 0, 12},
+    {25, 0, 18, 1, 0, 12},
+    {1, 0, 18, 5, 0, 21},
+    {26, 0, 18, 5, 0, 31},
+    {7, 0, 0, 5, 47, 12},
+    {14, 0, 18, 5, 2, 12},
+    {15, 0, 18, 5, 2, 12},
+    {26, 0, 18, 5, 2, 12},
+    {26, 0, 0, 5, 2, 12},
+    {7, 0, 0, 5, 73, 12},
+    {7, 0, 0, 5, 74, 12},
+    {7, 0, 0, 5, 37, 12},
+    {15, 0, 0, 5, 37, 12},
+    {7, 0, 0, 5, 38, 12},
+    {14, 0, 0, 5, 38, 12},
+    {7, 0, 0, 5, 118, 12},
+    {12, 230, 13, 5, 118, 21},
+    {7, 0, 0, 5, 48, 12},
+    {21, 0, 0, 5, 48, 17},
+    {7, 0, 0, 5, 59, 12},
+    {21, 0, 0, 5, 59, 17},
+    {14, 0, 0, 5, 59, 12},
+    {9, 0, 0, 5, 39, 12},
+    {5, 0, 0, 5, 39, 12},
+    {7, 0, 0, 5, 49, 12},
+    {7, 0, 0, 5, 50, 12},
+    {13, 0, 0, 5, 50, 11},
+    {9, 0, 0, 5, 136, 12},
+    {5, 0, 0, 5, 136, 12},
+    {7, 0, 0, 5, 106, 12},
+    {7, 0, 0, 5, 104, 12},
+    {21, 0, 0, 5, 104, 12},
+    {7, 0, 0, 5, 110, 12},
+    {7, 0, 3, 5, 51, 12},
+    {7, 0, 3, 5, 86, 12},
+    {21, 0, 3, 5, 86, 17},
+    {15, 0, 3, 5, 86, 12},
+    {7, 0, 3, 5, 120, 12},
+    {26, 0, 3, 5, 120, 12},
+    {15, 0, 3, 5, 120, 12},
+    {7, 0, 3, 5, 116, 12},
+    {15, 0, 3, 5, 116, 12},
+    {7, 0, 3, 5, 128, 12},
+    {15, 0, 3, 5, 128, 12},
+    {7, 0, 3, 5, 63, 12},
+    {15, 0, 3, 5, 63, 12},
+    {21, 0, 18, 5, 63, 17},
+    {7, 0, 3, 5, 75, 12},
+    {21, 0, 3, 5, 75, 12},
+    {7, 0, 3, 5, 97, 12},
+    {7, 0, 3, 5, 96, 12},
+    {15, 0, 3, 5, 96, 12},
+    {7, 0, 3, 5, 60, 12},
+    {12, 0, 13, 5, 60, 21},
+    {12, 220, 13, 5, 60, 21},
+    {12, 230, 13, 5, 60, 21},
+    {12, 1, 13, 5, 60, 21},
+    {12, 9, 13, 5, 60, 21},
+    {15, 0, 3, 5, 60, 12},
+    {21, 0, 3, 5, 60, 17},
+    {21, 0, 3, 5, 60, 12},
+    {7, 0, 3, 5, 87, 12},
+    {15, 0, 3, 5, 87, 12},
+    {21, 0, 3, 5, 87, 12},
+    {7, 0, 3, 5, 117, 12},
+    {15, 0, 3, 5, 117, 12},
+    {7, 0, 3, 5, 112, 12},
+    {26, 0, 3, 5, 112, 12},
+    {12, 230, 13, 5, 112, 21},
+    {12, 220, 13, 5, 112, 21},
+    {15, 0, 3, 5, 112, 12},
+    {21, 0, 3, 5, 112, 17},
+    {21, 0, 3, 5, 112, 15},
+    {7, 0, 3, 5, 79, 12},
+    {21, 0, 18, 5, 79, 17},
+    {7, 0, 3, 5, 88, 12},
+    {15, 0, 3, 5, 88, 12},
+    {7, 0, 3, 5, 89, 12},
+    {15, 0, 3, 5, 89, 12},
+    {7, 0, 3, 5, 122, 12},
+    {21, 0, 3, 5, 122, 12},
+    {15, 0, 3, 5, 122, 12},
+    {7, 0, 3, 5, 90, 12},
+    {9, 0, 3, 5, 130, 12},
+    {5, 0, 3, 5, 130, 12},
+    {15, 0, 3, 5, 130, 12},
+    {15, 0, 11, 5, 6, 12},
+    {10, 0, 0, 5, 93, 21},
+    {12, 0, 13, 5, 93, 21},
+    {7, 0, 0, 5, 93, 12},
+    {12, 9, 13, 5, 93, 21},
+    {21, 0, 0, 5, 93, 17},
+    {21, 0, 0, 5, 93, 12},
+    {15, 0, 18, 5, 93, 12},
+    {13, 0, 0, 5, 93, 11},
+    {12, 0, 13, 5, 91, 21},
+    {10, 0, 0, 5, 91, 21},
+    {7, 0, 0, 5, 91, 12},
+    {12, 9, 13, 5, 91, 21},
+    {12, 7, 13, 5, 91, 21},
+    {21, 0, 0, 5, 91, 12},
+    {1, 0, 0, 5, 91, 12},
+    {21, 0, 0, 5, 91, 17},
+    {7, 0, 0, 5, 100, 12},
+    {13, 0, 0, 5, 100, 11},
+    {12, 230, 13, 5, 95, 21},
+    {7, 0, 0, 5, 95, 12},
+    {12, 0, 13, 5, 95, 21},
+    {10, 0, 0, 5, 95, 21},
+    {12, 9, 13, 5, 95, 21},
+    {13, 0, 0, 5, 95, 11},
+    {21, 0, 0, 5, 95, 17},
+    {7, 0, 0, 5, 111, 12},
+    {12, 7, 13, 5, 111, 21},
+    {21, 0, 0, 5, 111, 12},
+    {21, 0, 0, 5, 111, 18},
+    {12, 0, 13, 5, 99, 21},
+    {10, 0, 0, 5, 99, 21},
+    {7, 0, 0, 5, 99, 12},
+    {10, 9, 0, 5, 99, 21},
+    {21, 0, 0, 5, 99, 17},
+    {21, 0, 0, 5, 99, 12},
+    {12, 7, 13, 5, 99, 21},
+    {13, 0, 0, 5, 99, 11},
+    {21, 0, 0, 5, 99, 18},
+    {15, 0, 0, 5, 18, 12},
+    {7, 0, 0, 5, 108, 12},
+    {10, 0, 0, 5, 108, 21},
+    {12, 0, 13, 5, 108, 21},
+    {10, 9, 0, 5, 108, 21},
+    {12, 7, 13, 5, 108, 21},
+    {21, 0, 0, 5, 108, 17},
+    {21, 0, 0, 5, 108, 12},
+    {7, 0, 0, 5, 129, 12},
+    {21, 0, 0, 5, 129, 17},
+    {7, 0, 0, 5, 109, 12},
+    {12, 0, 13, 5, 109, 21},
+    {10, 0, 0, 5, 109, 21},
+    {12, 7, 13, 5, 109, 21},
+    {12, 9, 13, 5, 109, 21},
+    {13, 0, 0, 5, 109, 11},
+    {12, 0, 13, 5, 107, 21},
+    {10, 0, 0, 5, 107, 21},
+    {7, 0, 0, 5, 107, 12},
+    {12, 7, 13, 5, 107, 21},
+    {10, 9, 0, 5, 107, 21},
+    {12, 230, 13, 5, 107, 21},
+    {7, 0, 0, 5, 135, 12},
+    {10, 0, 0, 5, 135, 21},
+    {12, 0, 13, 5, 135, 21},
+    {12, 9, 13, 5, 135, 21},
+    {12, 7, 13, 5, 135, 21},
+    {21, 0, 0, 5, 135, 17},
+    {21, 0, 0, 5, 135, 12},
+    {13, 0, 0, 5, 135, 11},
+    {7, 0, 0, 5, 124, 12},
+    {10, 0, 0, 5, 124, 21},
+    {12, 0, 13, 5, 124, 21},
+    {12, 9, 13, 5, 124, 21},
+    {12, 7, 13, 5, 124, 21},
+    {21, 0, 0, 5, 124, 12},
+    {13, 0, 0, 5, 124, 11},
+    {7, 0, 0, 5, 123, 12},
+    {10, 0, 0, 5, 123, 21},
+    {12, 0, 13, 5, 123, 21},
+    {12, 9, 13, 5, 123, 21},
+    {12, 7, 13, 5, 123, 21},
+    {21, 0, 0, 5, 123, 18},
+    {21, 0, 0, 5, 123, 17},
+    {21, 0, 0, 5, 123, 6},
+    {21, 0, 0, 5, 123, 12},
+    {7, 0, 0, 5, 114, 12},
+    {10, 0, 0, 5, 114, 21},
+    {12, 0, 13, 5, 114, 21},
+    {12, 9, 13, 5, 114, 21},
+    {21, 0, 0, 5, 114, 17},
+    {21, 0, 0, 5, 114, 12},
+    {13, 0, 0, 5, 114, 11},
+    {21, 0, 18, 5, 31, 18},
+    {7, 0, 0, 5, 101, 12},
+    {12, 0, 13, 5, 101, 21},
+    {10, 0, 0, 5, 101, 21},
+    {10, 9, 0, 5, 101, 21},
+    {12, 7, 13, 5, 101, 21},
+    {13, 0, 0, 5, 101, 11},
+    {7, 0, 0, 5, 126, 36},
+    {12, 0, 13, 5, 126, 36},
+    {10, 0, 0, 5, 126, 36},
+    {12, 9, 13, 5, 126, 36},
+    {13, 0, 0, 5, 126, 11},
+    {15, 0, 0, 5, 126, 36},
+    {21, 0, 0, 5, 126, 17},
+    {26, 0, 0, 5, 126, 36},
+    {9, 0, 0, 5, 125, 12},
+    {5, 0, 0, 5, 125, 12},
+    {13, 0, 0, 5, 125, 11},
+    {15, 0, 0, 5, 125, 12},
+    {7, 0, 0, 5, 125, 12},
+    {7, 0, 0, 5, 141, 12},
+    {12, 0, 13, 5, 141, 21},
+    {10, 0, 0, 5, 141, 21},
+    {12, 9, 13, 5, 141, 21},
+    {21, 0, 0, 5, 141, 18},
+    {21, 0, 0, 5, 141, 12},
+    {21, 0, 0, 5, 141, 17},
+    {7, 0, 0, 5, 140, 12},
+    {12, 0, 13, 5, 140, 21},
+    {10, 0, 0, 5, 140, 21},
+    {12, 9, 13, 5, 140, 21},
+    {21, 0, 0, 5, 140, 17},
+    {21, 0, 0, 5, 140, 18},
+    {7, 0, 0, 5, 121, 12},
+    {7, 0, 0, 5, 133, 12},
+    {10, 0, 0, 5, 133, 21},
+    {12, 0, 13, 5, 133, 21},
+    {12, 9, 0, 5, 133, 21},
+    {21, 0, 0, 5, 133, 17},
+    {13, 0, 0, 5, 133, 11},
+    {15, 0, 0, 5, 133, 12},
+    {21, 0, 0, 5, 134, 18},
+    {21, 0, 0, 5, 134, 6},
+    {7, 0, 0, 5, 134, 12},
+    {12, 0, 13, 5, 134, 21},
+    {10, 0, 0, 5, 134, 21},
+    {7, 0, 0, 5, 138, 12},
+    {12, 0, 13, 5, 138, 21},
+    {12, 7, 13, 5, 138, 21},
+    {12, 9, 13, 5, 138, 21},
+    {13, 0, 0, 5, 138, 11},
+    {7, 0, 0, 5, 62, 12},
+    {14, 0, 0, 5, 62, 12},
+    {21, 0, 0, 5, 62, 17},
+    {7, 0, 0, 5, 80, 12},
+    {7, 0, 0, 5, 80, 0},
+    {7, 0, 0, 5, 80, 1},
+    {7, 0, 0, 5, 127, 12},
+    {7, 0, 0, 5, 127, 0},
+    {7, 0, 0, 5, 127, 1},
+    {7, 0, 0, 5, 115, 12},
+    {13, 0, 0, 5, 115, 11},
+    {21, 0, 0, 5, 115, 17},
+    {7, 0, 0, 5, 103, 12},
+    {12, 1, 13, 5, 103, 21},
+    {21, 0, 0, 5, 103, 17},
+    {7, 0, 0, 5, 119, 12},
+    {12, 230, 13, 5, 119, 21},
+    {21, 0, 0, 5, 119, 17},
+    {21, 0, 0, 5, 119, 12},
+    {26, 0, 0, 5, 119, 12},
+    {6, 0, 0, 5, 119, 12},
+    {13, 0, 0, 5, 119, 11},
+    {15, 0, 0, 5, 119, 12},
+    {7, 0, 0, 5, 98, 12},
+    {10, 0, 0, 5, 98, 21},
+    {12, 0, 13, 5, 98, 21},
+    {6, 0, 0, 5, 98, 12},
+    {6, 0, 0, 2, 137, 5},
+    {6, 0, 0, 2, 139, 5},
+    {7, 0, 0, 2, 137, 14},
+    {7, 0, 0, 2, 139, 14},
+    {7, 0, 0, 5, 105, 12},
+    {26, 0, 0, 5, 105, 12},
+    {12, 0, 13, 5, 105, 21},
+    {12, 1, 13, 5, 105, 21},
+    {21, 0, 0, 5, 105, 17},
+    {10, 216, 0, 5, 0, 21},
+    {10, 226, 0, 5, 0, 21},
+    {12, 230, 13, 5, 2, 21},
+    {25, 0, 0, 5, 0, 12},
+    {13, 0, 8, 5, 0, 11},
+    {26, 0, 0, 5, 131, 12},
+    {12, 0, 13, 5, 131, 21},
+    {21, 0, 0, 5, 131, 17},
+    {21, 0, 0, 5, 131, 12},
+    {12, 230, 13, 5, 56, 21},
+    {7, 0, 3, 5, 113, 12},
+    {15, 0, 3, 5, 113, 12},
+    {12, 220, 13, 5, 113, 21},
+    {9, 0, 3, 5, 132, 12},
+    {5, 0, 3, 5, 132, 12},
+    {12, 230, 13, 5, 132, 21},
+    {12, 7, 13, 5, 132, 21},
+    {13, 0, 3, 5, 132, 11},
+    {21, 0, 3, 5, 132, 0},
+    {2, 0, 18, 5, 102, 14},
+    {26, 0, 0, 2, 0, 29},
+    {26, 0, 0, 5, 0, 28},
+    {26, 0, 0, 2, 32, 14},
+    {24, 0, 18, 2, 0, 42},
+    {26, 0, 18, 5, 0, 5},
+};
+
+#define BIDI_MIRROR_LEN 364
+static const MirrorPair mirror_pairs[] = {
+    {40, 41},
+    {41, 40},
+    {60, 62},
+    {62, 60},
+    {91, 93},
+    {93, 91},
+    {123, 125},
+    {125, 123},
+    {171, 187},
+    {187, 171},
+    {3898, 3899},
+    {3899, 3898},
+    {3900, 3901},
+    {3901, 3900},
+    {5787, 5788},
+    {5788, 5787},
+    {8249, 8250},
+    {8250, 8249},
+    {8261, 8262},
+    {8262, 8261},
+    {8317, 8318},
+    {8318, 8317},
+    {8333, 8334},
+    {8334, 8333},
+    {8712, 8715},
+    {8713, 8716},
+    {8714, 8717},
+    {8715, 8712},
+    {8716, 8713},
+    {8717, 8714},
+    {8725, 10741},
+    {8764, 8765},
+    {8765, 8764},
+    {8771, 8909},
+    {8786, 8787},
+    {8787, 8786},
+    {8788, 8789},
+    {8789, 8788},
+    {8804, 8805},
+    {8805, 8804},
+    {8806, 8807},
+    {8807, 8806},
+    {8808, 8809},
+    {8809, 8808},
+    {8810, 8811},
+    {8811, 8810},
+    {8814, 8815},
+    {8815, 8814},
+    {8816, 8817},
+    {8817, 8816},
+    {8818, 8819},
+    {8819, 8818},
+    {8820, 8821},
+    {8821, 8820},
+    {8822, 8823},
+    {8823, 8822},
+    {8824, 8825},
+    {8825, 8824},
+    {8826, 8827},
+    {8827, 8826},
+    {8828, 8829},
+    {8829, 8828},
+    {8830, 8831},
+    {8831, 8830},
+    {8832, 8833},
+    {8833, 8832},
+    {8834, 8835},
+    {8835, 8834},
+    {8836, 8837},
+    {8837, 8836},
+    {8838, 8839},
+    {8839, 8838},
+    {8840, 8841},
+    {8841, 8840},
+    {8842, 8843},
+    {8843, 8842},
+    {8847, 8848},
+    {8848, 8847},
+    {8849, 8850},
+    {8850, 8849},
+    {8856, 10680},
+    {8866, 8867},
+    {8867, 8866},
+    {8870, 10974},
+    {8872, 10980},
+    {8873, 10979},
+    {8875, 10981},
+    {8880, 8881},
+    {8881, 8880},
+    {8882, 8883},
+    {8883, 8882},
+    {8884, 8885},
+    {8885, 8884},
+    {8886, 8887},
+    {8887, 8886},
+    {8905, 8906},
+    {8906, 8905},
+    {8907, 8908},
+    {8908, 8907},
+    {8909, 8771},
+    {8912, 8913},
+    {8913, 8912},
+    {8918, 8919},
+    {8919, 8918},
+    {8920, 8921},
+    {8921, 8920},
+    {8922, 8923},
+    {8923, 8922},
+    {8924, 8925},
+    {8925, 8924},
+    {8926, 8927},
+    {8927, 8926},
+    {8928, 8929},
+    {8929, 8928},
+    {8930, 8931},
+    {8931, 8930},
+    {8932, 8933},
+    {8933, 8932},
+    {8934, 8935},
+    {8935, 8934},
+    {8936, 8937},
+    {8937, 8936},
+    {8938, 8939},
+    {8939, 8938},
+    {8940, 8941},
+    {8941, 8940},
+    {8944, 8945},
+    {8945, 8944},
+    {8946, 8954},
+    {8947, 8955},
+    {8948, 8956},
+    {8950, 8957},
+    {8951, 8958},
+    {8954, 8946},
+    {8955, 8947},
+    {8956, 8948},
+    {8957, 8950},
+    {8958, 8951},
+    {8968, 8969},
+    {8969, 8968},
+    {8970, 8971},
+    {8971, 8970},
+    {9001, 9002},
+    {9002, 9001},
+    {10088, 10089},
+    {10089, 10088},
+    {10090, 10091},
+    {10091, 10090},
+    {10092, 10093},
+    {10093, 10092},
+    {10094, 10095},
+    {10095, 10094},
+    {10096, 10097},
+    {10097, 10096},
+    {10098, 10099},
+    {10099, 10098},
+    {10100, 10101},
+    {10101, 10100},
+    {10179, 10180},
+    {10180, 10179},
+    {10181, 10182},
+    {10182, 10181},
+    {10184, 10185},
+    {10185, 10184},
+    {10187, 10189},
+    {10189, 10187},
+    {10197, 10198},
+    {10198, 10197},
+    {10205, 10206},
+    {10206, 10205},
+    {10210, 10211},
+    {10211, 10210},
+    {10212, 10213},
+    {10213, 10212},
+    {10214, 10215},
+    {10215, 10214},
+    {10216, 10217},
+    {10217, 10216},
+    {10218, 10219},
+    {10219, 10218},
+    {10220, 10221},
+    {10221, 10220},
+    {10222, 10223},
+    {10223, 10222},
+    {10627, 10628},
+    {10628, 10627},
+    {10629, 10630},
+    {10630, 10629},
+    {10631, 10632},
+    {10632, 10631},
+    {10633, 10634},
+    {10634, 10633},
+    {10635, 10636},
+    {10636, 10635},
+    {10637, 10640},
+    {10638, 10639},
+    {10639, 10638},
+    {10640, 10637},
+    {10641, 10642},
+    {10642, 10641},
+    {10643, 10644},
+    {10644, 10643},
+    {10645, 10646},
+    {10646, 10645},
+    {10647, 10648},
+    {10648, 10647},
+    {10680, 8856},
+    {10688, 10689},
+    {10689, 10688},
+    {10692, 10693},
+    {10693, 10692},
+    {10703, 10704},
+    {10704, 10703},
+    {10705, 10706},
+    {10706, 10705},
+    {10708, 10709},
+    {10709, 10708},
+    {10712, 10713},
+    {10713, 10712},
+    {10714, 10715},
+    {10715, 10714},
+    {10741, 8725},
+    {10744, 10745},
+    {10745, 10744},
+    {10748, 10749},
+    {10749, 10748},
+    {10795, 10796},
+    {10796, 10795},
+    {10797, 10798},
+    {10798, 10797},
+    {10804, 10805},
+    {10805, 10804},
+    {10812, 10813},
+    {10813, 10812},
+    {10852, 10853},
+    {10853, 10852},
+    {10873, 10874},
+    {10874, 10873},
+    {10877, 10878},
+    {10878, 10877},
+    {10879, 10880},
+    {10880, 10879},
+    {10881, 10882},
+    {10882, 10881},
+    {10883, 10884},
+    {10884, 10883},
+    {10891, 10892},
+    {10892, 10891},
+    {10897, 10898},
+    {10898, 10897},
+    {10899, 10900},
+    {10900, 10899},
+    {10901, 10902},
+    {10902, 10901},
+    {10903, 10904},
+    {10904, 10903},
+    {10905, 10906},
+    {10906, 10905},
+    {10907, 10908},
+    {10908, 10907},
+    {10913, 10914},
+    {10914, 10913},
+    {10918, 10919},
+    {10919, 10918},
+    {10920, 10921},
+    {10921, 10920},
+    {10922, 10923},
+    {10923, 10922},
+    {10924, 10925},
+    {10925, 10924},
+    {10927, 10928},
+    {10928, 10927},
+    {10931, 10932},
+    {10932, 10931},
+    {10939, 10940},
+    {10940, 10939},
+    {10941, 10942},
+    {10942, 10941},
+    {10943, 10944},
+    {10944, 10943},
+    {10945, 10946},
+    {10946, 10945},
+    {10947, 10948},
+    {10948, 10947},
+    {10949, 10950},
+    {10950, 10949},
+    {10957, 10958},
+    {10958, 10957},
+    {10959, 10960},
+    {10960, 10959},
+    {10961, 10962},
+    {10962, 10961},
+    {10963, 10964},
+    {10964, 10963},
+    {10965, 10966},
+    {10966, 10965},
+    {10974, 8870},
+    {10979, 8873},
+    {10980, 8872},
+    {10981, 8875},
+    {10988, 10989},
+    {10989, 10988},
+    {10999, 11000},
+    {11000, 10999},
+    {11001, 11002},
+    {11002, 11001},
+    {11778, 11779},
+    {11779, 11778},
+    {11780, 11781},
+    {11781, 11780},
+    {11785, 11786},
+    {11786, 11785},
+    {11788, 11789},
+    {11789, 11788},
+    {11804, 11805},
+    {11805, 11804},
+    {11808, 11809},
+    {11809, 11808},
+    {11810, 11811},
+    {11811, 11810},
+    {11812, 11813},
+    {11813, 11812},
+    {11814, 11815},
+    {11815, 11814},
+    {11816, 11817},
+    {11817, 11816},
+    {12296, 12297},
+    {12297, 12296},
+    {12298, 12299},
+    {12299, 12298},
+    {12300, 12301},
+    {12301, 12300},
+    {12302, 12303},
+    {12303, 12302},
+    {12304, 12305},
+    {12305, 12304},
+    {12308, 12309},
+    {12309, 12308},
+    {12310, 12311},
+    {12311, 12310},
+    {12312, 12313},
+    {12313, 12312},
+    {12314, 12315},
+    {12315, 12314},
+    {65113, 65114},
+    {65114, 65113},
+    {65115, 65116},
+    {65116, 65115},
+    {65117, 65118},
+    {65118, 65117},
+    {65124, 65125},
+    {65125, 65124},
+    {65288, 65289},
+    {65289, 65288},
+    {65308, 65310},
+    {65310, 65308},
+    {65339, 65341},
+    {65341, 65339},
+    {65371, 65373},
+    {65373, 65371},
+    {65375, 65376},
+    {65376, 65375},
+    {65378, 65379},
+    {65379, 65378},
+};
+
+#define BIDI_BRACKET_LEN 120
+static const BracketPair bracket_pairs[] = {
+    {40, 41, 0},
+    {41, 40, 1},
+    {91, 93, 0},
+    {93, 91, 1},
+    {123, 125, 0},
+    {125, 123, 1},
+    {3898, 3899, 0},
+    {3899, 3898, 1},
+    {3900, 3901, 0},
+    {3901, 3900, 1},
+    {5787, 5788, 0},
+    {5788, 5787, 1},
+    {8261, 8262, 0},
+    {8262, 8261, 1},
+    {8317, 8318, 0},
+    {8318, 8317, 1},
+    {8333, 8334, 0},
+    {8334, 8333, 1},
+    {8968, 8969, 0},
+    {8969, 8968, 1},
+    {8970, 8971, 0},
+    {8971, 8970, 1},
+    {9001, 9002, 0},
+    {9002, 9001, 1},
+    {10088, 10089, 0},
+    {10089, 10088, 1},
+    {10090, 10091, 0},
+    {10091, 10090, 1},
+    {10092, 10093, 0},
+    {10093, 10092, 1},
+    {10094, 10095, 0},
+    {10095, 10094, 1},
+    {10096, 10097, 0},
+    {10097, 10096, 1},
+    {10098, 10099, 0},
+    {10099, 10098, 1},
+    {10100, 10101, 0},
+    {10101, 10100, 1},
+    {10181, 10182, 0},
+    {10182, 10181, 1},
+    {10214, 10215, 0},
+    {10215, 10214, 1},
+    {10216, 10217, 0},
+    {10217, 10216, 1},
+    {10218, 10219, 0},
+    {10219, 10218, 1},
+    {10220, 10221, 0},
+    {10221, 10220, 1},
+    {10222, 10223, 0},
+    {10223, 10222, 1},
+    {10627, 10628, 0},
+    {10628, 10627, 1},
+    {10629, 10630, 0},
+    {10630, 10629, 1},
+    {10631, 10632, 0},
+    {10632, 10631, 1},
+    {10633, 10634, 0},
+    {10634, 10633, 1},
+    {10635, 10636, 0},
+    {10636, 10635, 1},
+    {10637, 10640, 0},
+    {10638, 10639, 1},
+    {10639, 10638, 0},
+    {10640, 10637, 1},
+    {10641, 10642, 0},
+    {10642, 10641, 1},
+    {10643, 10644, 0},
+    {10644, 10643, 1},
+    {10645, 10646, 0},
+    {10646, 10645, 1},
+    {10647, 10648, 0},
+    {10648, 10647, 1},
+    {10712, 10713, 0},
+    {10713, 10712, 1},
+    {10714, 10715, 0},
+    {10715, 10714, 1},
+    {10748, 10749, 0},
+    {10749, 10748, 1},
+    {11810, 11811, 0},
+    {11811, 11810, 1},
+    {11812, 11813, 0},
+    {11813, 11812, 1},
+    {11814, 11815, 0},
+    {11815, 11814, 1},
+    {11816, 11817, 0},
+    {11817, 11816, 1},
+    {12296, 12297, 0},
+    {12297, 12296, 1},
+    {12298, 12299, 0},
+    {12299, 12298, 1},
+    {12300, 12301, 0},
+    {12301, 12300, 1},
+    {12302, 12303, 0},
+    {12303, 12302, 1},
+    {12304, 12305, 0},
+    {12305, 12304, 1},
+    {12308, 12309, 0},
+    {12309, 12308, 1},
+    {12310, 12311, 0},
+    {12311, 12310, 1},
+    {12312, 12313, 0},
+    {12313, 12312, 1},
+    {12314, 12315, 0},
+    {12315, 12314, 1},
+    {65113, 65114, 0},
+    {65114, 65113, 1},
+    {65115, 65116, 0},
+    {65116, 65115, 1},
+    {65117, 65118, 0},
+    {65118, 65117, 1},
+    {65288, 65289, 0},
+    {65289, 65288, 1},
+    {65339, 65341, 0},
+    {65341, 65339, 1},
+    {65371, 65373, 0},
+    {65373, 65371, 1},
+    {65375, 65376, 0},
+    {65376, 65375, 1},
+    {65378, 65379, 0},
+    {65379, 65378, 1},
+};
+
+/* Reindexing of NFC first characters. */
+#define TOTAL_FIRST 376
+#define TOTAL_LAST 62
+static const Reindex nfc_first[] = {
+  { 60, 2, 0},
+  { 65, 15, 3},
+  { 82, 8, 19},
+  { 97, 15, 28},
+  { 114, 8, 44},
+  { 168, 0, 53},
+  { 194, 0, 54},
+  { 196, 3, 55},
+  { 202, 0, 59},
+  { 207, 0, 60},
+  { 212, 2, 61},
+  { 216, 0, 64},
+  { 220, 0, 65},
+  { 226, 0, 66},
+  { 228, 3, 67},
+  { 234, 0, 71},
+  { 239, 0, 72},
+  { 244, 2, 73},
+  { 248, 0, 76},
+  { 252, 0, 77},
+  { 258, 1, 78},
+  { 274, 1, 80},
+  { 332, 1, 82},
+  { 346, 1, 84},
+  { 352, 1, 86},
+  { 360, 3, 88},
+  { 383, 0, 92},
+  { 416, 1, 93},
+  { 431, 1, 95},
+  { 439, 0, 97},
+  { 490, 1, 98},
+  { 550, 3, 100},
+  { 558, 1, 104},
+  { 658, 0, 106},
+  { 913, 0, 107},
+  { 917, 0, 108},
+  { 919, 0, 109},
+  { 921, 0, 110},
+  { 927, 0, 111},
+  { 929, 0, 112},
+  { 933, 0, 113},
+  { 937, 0, 114},
+  { 940, 0, 115},
+  { 942, 0, 116},
+  { 945, 0, 117},
+  { 949, 0, 118},
+  { 951, 0, 119},
+  { 953, 0, 120},
+  { 959, 0, 121},
+  { 961, 0, 122},
+  { 965, 0, 123},
+  { 969, 2, 124},
+  { 974, 0, 127},
+  { 978, 0, 128},
+  { 1030, 0, 129},
+  { 1040, 0, 130},
+  { 1043, 0, 131},
+  { 1045, 3, 132},
+  { 1050, 0, 136},
+  { 1054, 0, 137},
+  { 1059, 0, 138},
+  { 1063, 0, 139},
+  { 1067, 0, 140},
+  { 1069, 0, 141},
+  { 1072, 0, 142},
+  { 1075, 0, 143},
+  { 1077, 3, 144},
+  { 1082, 0, 148},
+  { 1086, 0, 149},
+  { 1091, 0, 150},
+  { 1095, 0, 151},
+  { 1099, 0, 152},
+  { 1101, 0, 153},
+  { 1110, 0, 154},
+  { 1140, 1, 155},
+  { 1240, 1, 157},
+  { 1256, 1, 159},
+  { 1575, 0, 161},
+  { 1608, 0, 162},
+  { 1610, 0, 163},
+  { 1729, 0, 164},
+  { 1746, 0, 165},
+  { 1749, 0, 166},
+  { 2344, 0, 167},
+  { 2352, 0, 168},
+  { 2355, 0, 169},
+  { 2503, 0, 170},
+  { 2887, 0, 171},
+  { 2962, 0, 172},
+  { 3014, 1, 173},
+  { 3142, 0, 175},
+  { 3263, 0, 176},
+  { 3270, 0, 177},
+  { 3274, 0, 178},
+  { 3398, 1, 179},
+  { 3545, 0, 181},
+  { 3548, 0, 182},
+  { 4133, 0, 183},
+  { 6917, 0, 184},
+  { 6919, 0, 185},
+  { 6921, 0, 186},
+  { 6923, 0, 187},
+  { 6925, 0, 188},
+  { 6929, 0, 189},
+  { 6970, 0, 190},
+  { 6972, 0, 191},
+  { 6974, 1, 192},
+  { 6978, 0, 194},
+  { 7734, 1, 195},
+  { 7770, 1, 197},
+  { 7778, 1, 199},
+  { 7840, 1, 201},
+  { 7864, 1, 203},
+  { 7884, 1, 205},
+  { 7936, 17, 207},
+  { 7960, 1, 225},
+  { 7968, 17, 227},
+  { 7992, 1, 245},
+  { 8000, 1, 247},
+  { 8008, 1, 249},
+  { 8016, 1, 251},
+  { 8025, 0, 253},
+  { 8032, 16, 254},
+  { 8052, 0, 271},
+  { 8060, 0, 272},
+  { 8118, 0, 273},
+  { 8127, 0, 274},
+  { 8134, 0, 275},
+  { 8182, 0, 276},
+  { 8190, 0, 277},
+  { 8592, 0, 278},
+  { 8594, 0, 279},
+  { 8596, 0, 280},
+  { 8656, 0, 281},
+  { 8658, 0, 282},
+  { 8660, 0, 283},
+  { 8707, 0, 284},
+  { 8712, 0, 285},
+  { 8715, 0, 286},
+  { 8739, 0, 287},
+  { 8741, 0, 288},
+  { 8764, 0, 289},
+  { 8771, 0, 290},
+  { 8773, 0, 291},
+  { 8776, 0, 292},
+  { 8781, 0, 293},
+  { 8801, 0, 294},
+  { 8804, 1, 295},
+  { 8818, 1, 297},
+  { 8822, 1, 299},
+  { 8826, 3, 301},
+  { 8834, 1, 305},
+  { 8838, 1, 307},
+  { 8849, 1, 309},
+  { 8866, 0, 311},
+  { 8872, 1, 312},
+  { 8875, 0, 314},
+  { 8882, 3, 315},
+  { 12358, 0, 319},
+  { 12363, 0, 320},
+  { 12365, 0, 321},
+  { 12367, 0, 322},
+  { 12369, 0, 323},
+  { 12371, 0, 324},
+  { 12373, 0, 325},
+  { 12375, 0, 326},
+  { 12377, 0, 327},
+  { 12379, 0, 328},
+  { 12381, 0, 329},
+  { 12383, 0, 330},
+  { 12385, 0, 331},
+  { 12388, 0, 332},
+  { 12390, 0, 333},
+  { 12392, 0, 334},
+  { 12399, 0, 335},
+  { 12402, 0, 336},
+  { 12405, 0, 337},
+  { 12408, 0, 338},
+  { 12411, 0, 339},
+  { 12445, 0, 340},
+  { 12454, 0, 341},
+  { 12459, 0, 342},
+  { 12461, 0, 343},
+  { 12463, 0, 344},
+  { 12465, 0, 345},
+  { 12467, 0, 346},
+  { 12469, 0, 347},
+  { 12471, 0, 348},
+  { 12473, 0, 349},
+  { 12475, 0, 350},
+  { 12477, 0, 351},
+  { 12479, 0, 352},
+  { 12481, 0, 353},
+  { 12484, 0, 354},
+  { 12486, 0, 355},
+  { 12488, 0, 356},
+  { 12495, 0, 357},
+  { 12498, 0, 358},
+  { 12501, 0, 359},
+  { 12504, 0, 360},
+  { 12507, 0, 361},
+  { 12527, 3, 362},
+  { 12541, 0, 366},
+  { 69785, 0, 367},
+  { 69787, 0, 368},
+  { 69797, 0, 369},
+  { 69937, 1, 370},
+  { 70471, 0, 372},
+  { 70841, 0, 373},
+  { 71096, 1, 374},
+  {0,0,0}
+};
+
+static const Reindex nfc_last[] = {
+  { 768, 4, 0},
+  { 774, 6, 5},
+  { 783, 0, 12},
+  { 785, 0, 13},
+  { 787, 1, 14},
+  { 795, 0, 16},
+  { 803, 5, 17},
+  { 813, 1, 23},
+  { 816, 1, 25},
+  { 824, 0, 27},
+  { 834, 0, 28},
+  { 837, 0, 29},
+  { 1619, 2, 30},
+  { 2364, 0, 33},
+  { 2494, 0, 34},
+  { 2519, 0, 35},
+  { 2878, 0, 36},
+  { 2902, 1, 37},
+  { 3006, 0, 39},
+  { 3031, 0, 40},
+  { 3158, 0, 41},
+  { 3266, 0, 42},
+  { 3285, 1, 43},
+  { 3390, 0, 45},
+  { 3415, 0, 46},
+  { 3530, 0, 47},
+  { 3535, 0, 48},
+  { 3551, 0, 49},
+  { 4142, 0, 50},
+  { 6965, 0, 51},
+  { 12441, 1, 52},
+  { 69818, 0, 54},
+  { 69927, 0, 55},
+  { 70462, 0, 56},
+  { 70487, 0, 57},
+  { 70832, 0, 58},
+  { 70842, 0, 59},
+  { 70845, 0, 60},
+  { 71087, 0, 61},
+  {0,0,0}
+};
+
+#define UCDN_EAST_ASIAN_F 0
+#define UCDN_EAST_ASIAN_H 1
+#define UCDN_EAST_ASIAN_W 2
+#define UCDN_EAST_ASIAN_NA 3
+#define UCDN_EAST_ASIAN_A 4
+#define UCDN_EAST_ASIAN_N 5
+
+#define UCDN_SCRIPT_COMMON 0
+#define UCDN_SCRIPT_LATIN 1
+#define UCDN_SCRIPT_GREEK 2
+#define UCDN_SCRIPT_CYRILLIC 3
+#define UCDN_SCRIPT_ARMENIAN 4
+#define UCDN_SCRIPT_HEBREW 5
+#define UCDN_SCRIPT_ARABIC 6
+#define UCDN_SCRIPT_SYRIAC 7
+#define UCDN_SCRIPT_THAANA 8
+#define UCDN_SCRIPT_DEVANAGARI 9
+#define UCDN_SCRIPT_BENGALI 10
+#define UCDN_SCRIPT_GURMUKHI 11
+#define UCDN_SCRIPT_GUJARATI 12
+#define UCDN_SCRIPT_ORIYA 13
+#define UCDN_SCRIPT_TAMIL 14
+#define UCDN_SCRIPT_TELUGU 15
+#define UCDN_SCRIPT_KANNADA 16
+#define UCDN_SCRIPT_MALAYALAM 17
+#define UCDN_SCRIPT_SINHALA 18
+#define UCDN_SCRIPT_THAI 19
+#define UCDN_SCRIPT_LAO 20
+#define UCDN_SCRIPT_TIBETAN 21
+#define UCDN_SCRIPT_MYANMAR 22
+#define UCDN_SCRIPT_GEORGIAN 23
+#define UCDN_SCRIPT_HANGUL 24
+#define UCDN_SCRIPT_ETHIOPIC 25
+#define UCDN_SCRIPT_CHEROKEE 26
+#define UCDN_SCRIPT_CANADIAN_ABORIGINAL 27
+#define UCDN_SCRIPT_OGHAM 28
+#define UCDN_SCRIPT_RUNIC 29
+#define UCDN_SCRIPT_KHMER 30
+#define UCDN_SCRIPT_MONGOLIAN 31
+#define UCDN_SCRIPT_HIRAGANA 32
+#define UCDN_SCRIPT_KATAKANA 33
+#define UCDN_SCRIPT_BOPOMOFO 34
+#define UCDN_SCRIPT_HAN 35
+#define UCDN_SCRIPT_YI 36
+#define UCDN_SCRIPT_OLD_ITALIC 37
+#define UCDN_SCRIPT_GOTHIC 38
+#define UCDN_SCRIPT_DESERET 39
+#define UCDN_SCRIPT_INHERITED 40
+#define UCDN_SCRIPT_TAGALOG 41
+#define UCDN_SCRIPT_HANUNOO 42
+#define UCDN_SCRIPT_BUHID 43
+#define UCDN_SCRIPT_TAGBANWA 44
+#define UCDN_SCRIPT_LIMBU 45
+#define UCDN_SCRIPT_TAI_LE 46
+#define UCDN_SCRIPT_LINEAR_B 47
+#define UCDN_SCRIPT_UGARITIC 48
+#define UCDN_SCRIPT_SHAVIAN 49
+#define UCDN_SCRIPT_OSMANYA 50
+#define UCDN_SCRIPT_CYPRIOT 51
+#define UCDN_SCRIPT_BRAILLE 52
+#define UCDN_SCRIPT_BUGINESE 53
+#define UCDN_SCRIPT_COPTIC 54
+#define UCDN_SCRIPT_NEW_TAI_LUE 55
+#define UCDN_SCRIPT_GLAGOLITIC 56
+#define UCDN_SCRIPT_TIFINAGH 57
+#define UCDN_SCRIPT_SYLOTI_NAGRI 58
+#define UCDN_SCRIPT_OLD_PERSIAN 59
+#define UCDN_SCRIPT_KHAROSHTHI 60
+#define UCDN_SCRIPT_BALINESE 61
+#define UCDN_SCRIPT_CUNEIFORM 62
+#define UCDN_SCRIPT_PHOENICIAN 63
+#define UCDN_SCRIPT_PHAGS_PA 64
+#define UCDN_SCRIPT_NKO 65
+#define UCDN_SCRIPT_SUNDANESE 66
+#define UCDN_SCRIPT_LEPCHA 67
+#define UCDN_SCRIPT_OL_CHIKI 68
+#define UCDN_SCRIPT_VAI 69
+#define UCDN_SCRIPT_SAURASHTRA 70
+#define UCDN_SCRIPT_KAYAH_LI 71
+#define UCDN_SCRIPT_REJANG 72
+#define UCDN_SCRIPT_LYCIAN 73
+#define UCDN_SCRIPT_CARIAN 74
+#define UCDN_SCRIPT_LYDIAN 75
+#define UCDN_SCRIPT_CHAM 76
+#define UCDN_SCRIPT_TAI_THAM 77
+#define UCDN_SCRIPT_TAI_VIET 78
+#define UCDN_SCRIPT_AVESTAN 79
+#define UCDN_SCRIPT_EGYPTIAN_HIEROGLYPHS 80
+#define UCDN_SCRIPT_SAMARITAN 81
+#define UCDN_SCRIPT_LISU 82
+#define UCDN_SCRIPT_BAMUM 83
+#define UCDN_SCRIPT_JAVANESE 84
+#define UCDN_SCRIPT_MEETEI_MAYEK 85
+#define UCDN_SCRIPT_IMPERIAL_ARAMAIC 86
+#define UCDN_SCRIPT_OLD_SOUTH_ARABIAN 87
+#define UCDN_SCRIPT_INSCRIPTIONAL_PARTHIAN 88
+#define UCDN_SCRIPT_INSCRIPTIONAL_PAHLAVI 89
+#define UCDN_SCRIPT_OLD_TURKIC 90
+#define UCDN_SCRIPT_KAITHI 91
+#define UCDN_SCRIPT_BATAK 92
+#define UCDN_SCRIPT_BRAHMI 93
+#define UCDN_SCRIPT_MANDAIC 94
+#define UCDN_SCRIPT_CHAKMA 95
+#define UCDN_SCRIPT_MEROITIC_CURSIVE 96
+#define UCDN_SCRIPT_MEROITIC_HIEROGLYPHS 97
+#define UCDN_SCRIPT_MIAO 98
+#define UCDN_SCRIPT_SHARADA 99
+#define UCDN_SCRIPT_SORA_SOMPENG 100
+#define UCDN_SCRIPT_TAKRI 101
+#define UCDN_SCRIPT_UNKNOWN 102
+#define UCDN_SCRIPT_BASSA_VAH 103
+#define UCDN_SCRIPT_CAUCASIAN_ALBANIAN 104
+#define UCDN_SCRIPT_DUPLOYAN 105
+#define UCDN_SCRIPT_ELBASAN 106
+#define UCDN_SCRIPT_GRANTHA 107
+#define UCDN_SCRIPT_KHOJKI 108
+#define UCDN_SCRIPT_KHUDAWADI 109
+#define UCDN_SCRIPT_LINEAR_A 110
+#define UCDN_SCRIPT_MAHAJANI 111
+#define UCDN_SCRIPT_MANICHAEAN 112
+#define UCDN_SCRIPT_MENDE_KIKAKUI 113
+#define UCDN_SCRIPT_MODI 114
+#define UCDN_SCRIPT_MRO 115
+#define UCDN_SCRIPT_NABATAEAN 116
+#define UCDN_SCRIPT_OLD_NORTH_ARABIAN 117
+#define UCDN_SCRIPT_OLD_PERMIC 118
+#define UCDN_SCRIPT_PAHAWH_HMONG 119
+#define UCDN_SCRIPT_PALMYRENE 120
+#define UCDN_SCRIPT_PAU_CIN_HAU 121
+#define UCDN_SCRIPT_PSALTER_PAHLAVI 122
+#define UCDN_SCRIPT_SIDDHAM 123
+#define UCDN_SCRIPT_TIRHUTA 124
+#define UCDN_SCRIPT_WARANG_CITI 125
+#define UCDN_SCRIPT_AHOM 126
+#define UCDN_SCRIPT_ANATOLIAN_HIEROGLYPHS 127
+#define UCDN_SCRIPT_HATRAN 128
+#define UCDN_SCRIPT_MULTANI 129
+#define UCDN_SCRIPT_OLD_HUNGARIAN 130
+#define UCDN_SCRIPT_SIGNWRITING 131
+#define UCDN_SCRIPT_ADLAM 132
+#define UCDN_SCRIPT_BHAIKSUKI 133
+#define UCDN_SCRIPT_MARCHEN 134
+#define UCDN_SCRIPT_NEWA 135
+#define UCDN_SCRIPT_OSAGE 136
+#define UCDN_SCRIPT_TANGUT 137
+#define UCDN_SCRIPT_MASARAM_GONDI 138
+#define UCDN_SCRIPT_NUSHU 139
+#define UCDN_SCRIPT_SOYOMBO 140
+#define UCDN_SCRIPT_ZANABAZAR_SQUARE 141
+
+#define UCDN_GENERAL_CATEGORY_CC 0
+#define UCDN_GENERAL_CATEGORY_CF 1
+#define UCDN_GENERAL_CATEGORY_CN 2
+#define UCDN_GENERAL_CATEGORY_CO 3
+#define UCDN_GENERAL_CATEGORY_CS 4
+#define UCDN_GENERAL_CATEGORY_LL 5
+#define UCDN_GENERAL_CATEGORY_LM 6
+#define UCDN_GENERAL_CATEGORY_LO 7
+#define UCDN_GENERAL_CATEGORY_LT 8
+#define UCDN_GENERAL_CATEGORY_LU 9
+#define UCDN_GENERAL_CATEGORY_MC 10
+#define UCDN_GENERAL_CATEGORY_ME 11
+#define UCDN_GENERAL_CATEGORY_MN 12
+#define UCDN_GENERAL_CATEGORY_ND 13
+#define UCDN_GENERAL_CATEGORY_NL 14
+#define UCDN_GENERAL_CATEGORY_NO 15
+#define UCDN_GENERAL_CATEGORY_PC 16
+#define UCDN_GENERAL_CATEGORY_PD 17
+#define UCDN_GENERAL_CATEGORY_PE 18
+#define UCDN_GENERAL_CATEGORY_PF 19
+#define UCDN_GENERAL_CATEGORY_PI 20
+#define UCDN_GENERAL_CATEGORY_PO 21
+#define UCDN_GENERAL_CATEGORY_PS 22
+#define UCDN_GENERAL_CATEGORY_SC 23
+#define UCDN_GENERAL_CATEGORY_SK 24
+#define UCDN_GENERAL_CATEGORY_SM 25
+#define UCDN_GENERAL_CATEGORY_SO 26
+#define UCDN_GENERAL_CATEGORY_ZL 27
+#define UCDN_GENERAL_CATEGORY_ZP 28
+#define UCDN_GENERAL_CATEGORY_ZS 29
+
+#define UCDN_BIDI_CLASS_L 0
+#define UCDN_BIDI_CLASS_LRE 1
+#define UCDN_BIDI_CLASS_LRO 2
+#define UCDN_BIDI_CLASS_R 3
+#define UCDN_BIDI_CLASS_AL 4
+#define UCDN_BIDI_CLASS_RLE 5
+#define UCDN_BIDI_CLASS_RLO 6
+#define UCDN_BIDI_CLASS_PDF 7
+#define UCDN_BIDI_CLASS_EN 8
+#define UCDN_BIDI_CLASS_ES 9
+#define UCDN_BIDI_CLASS_ET 10
+#define UCDN_BIDI_CLASS_AN 11
+#define UCDN_BIDI_CLASS_CS 12
+#define UCDN_BIDI_CLASS_NSM 13
+#define UCDN_BIDI_CLASS_BN 14
+#define UCDN_BIDI_CLASS_B 15
+#define UCDN_BIDI_CLASS_S 16
+#define UCDN_BIDI_CLASS_WS 17
+#define UCDN_BIDI_CLASS_ON 18
+#define UCDN_BIDI_CLASS_LRI 19
+#define UCDN_BIDI_CLASS_RLI 20
+#define UCDN_BIDI_CLASS_FSI 21
+#define UCDN_BIDI_CLASS_PDI 22
+
+/* index tables for the database records */
+#define SHIFT1 5
+#define SHIFT2 3
+static const unsigned char index0[] = {
+    0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
+    21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
+    39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 52, 52, 52, 52,
+    52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
+    52, 52, 53, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
+    52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
+    52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
+    52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
+    52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 54, 55, 56, 56, 56, 57,
+    58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 65, 66, 67, 68,
+    69, 70, 71, 65, 66, 67, 68, 69, 70, 71, 65, 66, 67, 68, 69, 70, 71, 65,
+    66, 67, 68, 69, 70, 71, 65, 66, 67, 68, 69, 70, 71, 65, 72, 73, 73, 73,
+    73, 73, 73, 73, 73, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 52, 75, 76, 77, 78, 79,
+    80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 94, 96,
+    97, 98, 99, 100, 101, 102, 103, 104, 94, 105, 94, 106, 107, 94, 94, 108,
+    108, 108, 109, 110, 111, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 112,
+    112, 113, 114, 115, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 116, 117, 118, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 119, 119, 120, 121, 94, 94, 94, 122, 123, 123, 123, 123, 123,
+    123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123,
+    123, 123, 123, 123, 124, 123, 123, 125, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 126, 127, 128, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 129, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 130, 131, 132, 133, 134, 135, 136, 137,
+    138, 138, 139, 94, 94, 94, 94, 94, 140, 94, 94, 94, 94, 94, 94, 94, 141,
+    142, 94, 94, 94, 94, 143, 94, 144, 145, 146, 147, 148, 149, 150, 151,
+    152, 153, 154, 154, 154, 154, 154, 155, 52, 52, 52, 52, 52, 52, 52, 52,
+    52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
+    52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
+    52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
+    52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
+    52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
+    52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
+    52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
+    52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
+    52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 156, 52, 52, 52,
+    52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 157, 158, 52, 52, 52,
+    52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
+    159, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
+    52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 160, 161, 161, 161, 161, 161,
+    161, 161, 161, 161, 161, 161, 161, 52, 52, 162, 161, 161, 161, 161, 163,
+    161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161,
+    161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161,
+    161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161,
+    161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161,
+    161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161,
+    161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161,
+    161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161,
+    161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161,
+    161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161,
+    161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161,
+    161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161,
+    161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161,
+    161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161,
+    161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161,
+    161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161,
+    161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161,
+    161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161,
+    161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161,
+    161, 161, 161, 163, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 164, 165, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 74, 74, 74, 74, 74,
+    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 166, 74,
+    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+    74, 74, 166,
+};
+
+static const unsigned short index1[] = {
+    0, 1, 0, 2, 3, 4, 5, 6, 7, 8, 8, 9, 10, 11, 11, 12, 13, 0, 0, 0, 14, 15,
+    16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 29, 31, 32,
+    33, 34, 35, 27, 30, 29, 27, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
+    47, 48, 27, 27, 49, 27, 27, 27, 27, 27, 27, 27, 50, 51, 52, 27, 53, 54,
+    53, 54, 54, 54, 54, 54, 55, 54, 54, 54, 56, 57, 58, 59, 60, 61, 62, 63,
+    64, 64, 65, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 65, 77, 78,
+    79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
+    97, 97, 97, 97, 98, 98, 98, 98, 99, 100, 101, 101, 101, 101, 102, 103,
+    101, 101, 101, 101, 101, 101, 104, 105, 101, 101, 101, 101, 101, 101,
+    101, 101, 101, 101, 101, 101, 106, 107, 107, 107, 108, 109, 110, 111,
+    111, 111, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 121,
+    121, 122, 123, 120, 124, 125, 126, 127, 128, 128, 128, 128, 129, 130,
+    131, 132, 133, 134, 135, 128, 128, 128, 128, 128, 128, 128, 128, 128,
+    128, 128, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 145, 145,
+    146, 147, 148, 149, 128, 128, 128, 128, 128, 128, 150, 150, 150, 150,
+    151, 152, 153, 120, 154, 155, 156, 156, 156, 157, 158, 159, 160, 160,
+    161, 162, 163, 164, 165, 166, 167, 167, 167, 168, 145, 169, 120, 120,
+    120, 120, 120, 120, 128, 128, 170, 171, 120, 120, 172, 126, 173, 174,
+    175, 176, 177, 178, 178, 178, 178, 178, 178, 179, 180, 181, 182, 178,
+    183, 184, 185, 178, 186, 187, 188, 189, 189, 190, 191, 192, 193, 194,
+    195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 204, 205, 206, 207,
+    208, 209, 210, 211, 212, 213, 214, 120, 215, 216, 217, 218, 218, 219,
+    220, 221, 222, 223, 224, 120, 225, 226, 227, 228, 229, 230, 231, 232,
+    232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 120, 243, 244,
+    245, 246, 247, 244, 248, 249, 250, 251, 252, 120, 253, 254, 255, 256,
+    257, 258, 259, 260, 260, 259, 260, 261, 262, 263, 264, 265, 266, 267,
+    120, 268, 269, 270, 271, 272, 272, 271, 273, 274, 275, 276, 277, 278,
+    279, 280, 281, 120, 282, 283, 284, 285, 285, 285, 285, 286, 287, 288,
+    289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 296, 296, 299, 300,
+    297, 301, 302, 303, 304, 305, 306, 120, 307, 308, 308, 308, 308, 308,
+    309, 310, 311, 312, 313, 314, 120, 120, 120, 120, 315, 316, 317, 318,
+    319, 320, 321, 322, 323, 324, 325, 326, 120, 120, 120, 120, 327, 328,
+    329, 330, 331, 332, 333, 334, 335, 336, 335, 335, 335, 337, 338, 339,
+    340, 341, 342, 343, 342, 342, 342, 344, 345, 346, 347, 348, 120, 120,
+    120, 120, 349, 349, 349, 349, 349, 350, 351, 352, 353, 354, 355, 356,
+    357, 358, 359, 349, 360, 361, 353, 362, 363, 363, 363, 363, 364, 365,
+    366, 366, 366, 366, 366, 367, 368, 368, 368, 368, 368, 368, 368, 368,
+    368, 368, 368, 368, 369, 369, 369, 369, 369, 369, 369, 369, 369, 370,
+    370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 371, 371, 371, 371,
+    371, 371, 371, 371, 371, 372, 373, 372, 371, 371, 371, 371, 371, 372,
+    371, 371, 371, 371, 372, 373, 372, 371, 373, 371, 371, 371, 371, 371,
+    371, 371, 372, 371, 371, 371, 371, 371, 371, 371, 371, 374, 375, 376,
+    377, 378, 371, 371, 379, 380, 381, 381, 381, 381, 381, 381, 381, 381,
+    381, 381, 382, 383, 384, 385, 385, 385, 385, 385, 385, 385, 385, 385,
+    385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385,
+    385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385,
+    385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385,
+    385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385,
+    385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 386, 385, 385,
+    387, 388, 388, 389, 390, 390, 390, 390, 390, 390, 390, 390, 390, 391,
+    392, 393, 394, 395, 396, 120, 397, 397, 398, 120, 399, 399, 400, 120,
+    401, 402, 403, 120, 404, 404, 404, 404, 404, 404, 405, 406, 407, 408,
+    409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 419, 419, 419,
+    420, 419, 419, 419, 419, 419, 419, 120, 421, 419, 419, 419, 419, 422,
+    385, 385, 385, 385, 385, 385, 385, 385, 423, 120, 424, 424, 424, 425,
+    426, 427, 428, 429, 430, 431, 432, 432, 432, 433, 434, 120, 435, 435,
+    435, 435, 435, 436, 435, 435, 435, 437, 438, 439, 440, 440, 440, 440,
+    441, 441, 442, 443, 444, 444, 444, 444, 444, 444, 445, 446, 447, 448,
+    449, 450, 451, 452, 451, 452, 453, 454, 455, 456, 120, 120, 120, 120,
+    120, 120, 120, 120, 457, 458, 458, 458, 458, 458, 459, 460, 461, 462,
+    463, 464, 465, 466, 467, 468, 469, 470, 470, 470, 471, 472, 473, 474,
+    475, 475, 475, 475, 476, 477, 478, 479, 480, 480, 480, 480, 481, 482,
+    483, 484, 485, 486, 487, 488, 489, 489, 489, 490, 100, 491, 120, 120,
+    120, 120, 120, 120, 492, 120, 493, 494, 495, 496, 497, 498, 54, 54, 54,
+    54, 499, 500, 56, 56, 56, 56, 56, 501, 502, 503, 54, 504, 54, 54, 54,
+    505, 56, 56, 56, 506, 507, 508, 509, 510, 510, 510, 511, 512, 27, 27, 27,
+    27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 513, 514, 27,
+    27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 515, 516, 517, 518, 515, 516,
+    515, 516, 517, 518, 515, 519, 515, 516, 515, 517, 515, 520, 515, 520,
+    515, 520, 521, 522, 523, 524, 525, 526, 515, 527, 528, 529, 530, 531,
+    532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545,
+    546, 547, 56, 548, 549, 550, 551, 552, 553, 553, 554, 555, 556, 557, 558,
+    120, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571,
+    572, 571, 573, 574, 575, 576, 577, 578, 579, 580, 581, 580, 582, 583,
+    580, 584, 580, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 586,
+    595, 596, 586, 597, 598, 586, 586, 598, 586, 599, 600, 599, 586, 586,
+    601, 586, 586, 586, 586, 586, 602, 586, 586, 580, 603, 604, 605, 606,
+    607, 608, 609, 609, 609, 609, 609, 609, 609, 609, 610, 580, 580, 611,
+    612, 586, 586, 613, 580, 580, 580, 580, 585, 606, 614, 615, 580, 580,
+    580, 580, 580, 616, 120, 120, 120, 580, 617, 120, 120, 618, 618, 618,
+    618, 618, 619, 619, 620, 621, 621, 621, 621, 621, 621, 621, 621, 621,
+    622, 618, 623, 624, 624, 624, 624, 624, 624, 624, 624, 624, 625, 624,
+    624, 624, 624, 626, 580, 624, 624, 627, 580, 628, 629, 630, 631, 632,
+    633, 629, 580, 627, 634, 580, 635, 636, 637, 638, 639, 580, 580, 580,
+    640, 641, 642, 643, 580, 644, 645, 580, 646, 580, 580, 647, 648, 649,
+    650, 580, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 580,
+    580, 580, 662, 580, 663, 580, 664, 665, 666, 667, 668, 669, 618, 670,
+    670, 671, 580, 580, 580, 662, 672, 673, 586, 586, 586, 674, 675, 586,
+    586, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676,
+    676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676,
+    676, 676, 676, 676, 676, 586, 586, 586, 586, 586, 586, 586, 586, 586,
+    586, 586, 586, 586, 586, 586, 586, 677, 678, 678, 679, 586, 586, 586,
+    586, 586, 586, 586, 680, 586, 586, 586, 681, 586, 586, 586, 586, 586,
+    586, 586, 586, 586, 586, 586, 586, 586, 586, 586, 586, 586, 586, 586,
+    586, 586, 586, 586, 586, 586, 586, 586, 586, 586, 586, 586, 586, 580,
+    580, 580, 682, 580, 580, 586, 586, 683, 684, 685, 629, 580, 580, 686,
+    580, 580, 580, 687, 580, 580, 580, 580, 688, 580, 689, 617, 120, 120,
+    690, 120, 120, 691, 691, 691, 691, 691, 692, 693, 693, 693, 693, 693,
+    694, 695, 696, 697, 698, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
+    699, 700, 701, 702, 703, 703, 703, 703, 704, 705, 706, 706, 706, 706,
+    706, 706, 706, 707, 708, 709, 371, 371, 373, 120, 373, 373, 373, 373,
+    373, 373, 373, 373, 710, 710, 710, 710, 711, 712, 713, 714, 715, 716,
+    717, 718, 719, 720, 120, 120, 120, 120, 120, 120, 721, 721, 721, 722,
+    721, 721, 721, 721, 721, 721, 721, 721, 721, 721, 723, 120, 721, 721,
+    721, 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, 721,
+    721, 721, 721, 721, 721, 721, 721, 721, 721, 721, 724, 120, 120, 120,
+    725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 737,
+    738, 737, 737, 737, 739, 740, 741, 742, 743, 744, 745, 745, 746, 745,
+    745, 745, 747, 748, 749, 750, 751, 752, 752, 752, 752, 753, 754, 755,
+    755, 755, 755, 755, 755, 755, 755, 755, 755, 756, 757, 758, 752, 752,
+    752, 759, 725, 725, 725, 725, 726, 120, 760, 760, 761, 761, 761, 762,
+    763, 764, 758, 758, 758, 765, 766, 767, 761, 761, 761, 768, 763, 764,
+    758, 758, 758, 758, 769, 767, 758, 770, 771, 771, 771, 771, 771, 772,
+    771, 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, 758, 758, 758,
+    773, 774, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 775,
+    758, 758, 758, 773, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776,
+    776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776,
+    776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776,
+    776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776,
+    776, 776, 777, 778, 580, 580, 580, 580, 580, 580, 580, 580, 776, 776,
+    776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776,
+    776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 779,
+    778, 778, 780, 780, 781, 780, 780, 780, 780, 780, 780, 780, 780, 780,
+    780, 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, 780,
+    780, 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, 780,
+    780, 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, 780,
+    780, 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, 780,
+    780, 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, 782,
+    783, 783, 783, 783, 783, 783, 784, 120, 785, 785, 785, 785, 785, 786,
+    787, 787, 787, 787, 787, 787, 787, 787, 787, 787, 787, 787, 787, 787,
+    787, 787, 787, 787, 787, 787, 787, 787, 787, 787, 787, 787, 787, 787,
+    787, 787, 787, 787, 787, 788, 787, 787, 789, 790, 120, 120, 101, 101,
+    101, 101, 101, 791, 792, 793, 101, 101, 101, 794, 795, 795, 795, 795,
+    795, 795, 795, 795, 796, 797, 798, 120, 64, 64, 799, 800, 801, 27, 802,
+    27, 27, 27, 27, 27, 27, 27, 803, 804, 27, 805, 806, 27, 27, 807, 808,
+    120, 120, 120, 120, 120, 120, 120, 809, 810, 811, 812, 813, 813, 814,
+    815, 816, 817, 818, 818, 818, 818, 818, 818, 819, 120, 820, 821, 821,
+    821, 821, 821, 822, 823, 824, 825, 826, 827, 828, 828, 829, 830, 831,
+    832, 833, 833, 834, 835, 836, 836, 837, 838, 839, 840, 368, 368, 368,
+    841, 842, 843, 843, 843, 843, 843, 844, 845, 846, 847, 848, 849, 850,
+    349, 353, 851, 852, 852, 852, 852, 852, 853, 854, 120, 855, 856, 857,
+    858, 349, 349, 859, 860, 861, 861, 861, 861, 861, 861, 862, 863, 864,
+    120, 120, 865, 866, 867, 868, 120, 869, 869, 869, 120, 373, 373, 54, 54,
+    54, 54, 54, 870, 871, 120, 872, 872, 872, 872, 872, 872, 872, 872, 872,
+    872, 866, 866, 866, 866, 873, 874, 875, 876, 877, 878, 878, 879, 878,
+    878, 878, 877, 878, 878, 879, 878, 878, 878, 877, 878, 878, 879, 878,
+    878, 878, 877, 878, 878, 879, 878, 878, 878, 877, 878, 878, 879, 878,
+    878, 878, 877, 878, 878, 879, 878, 878, 878, 877, 878, 878, 879, 878,
+    878, 878, 877, 878, 878, 879, 878, 878, 878, 877, 878, 878, 879, 878,
+    878, 878, 877, 878, 878, 879, 878, 878, 878, 877, 878, 878, 879, 878,
+    878, 878, 877, 878, 878, 879, 878, 878, 878, 877, 878, 878, 879, 878,
+    878, 878, 877, 878, 878, 879, 878, 878, 878, 877, 878, 878, 879, 878,
+    878, 878, 877, 878, 878, 879, 878, 878, 878, 877, 878, 878, 879, 878,
+    878, 878, 877, 878, 878, 879, 878, 878, 878, 877, 878, 878, 879, 878,
+    878, 878, 877, 878, 878, 879, 878, 878, 878, 877, 878, 878, 879, 878,
+    878, 878, 877, 878, 878, 879, 878, 878, 878, 877, 878, 878, 879, 878,
+    878, 878, 877, 878, 878, 879, 878, 878, 878, 877, 878, 878, 879, 878,
+    878, 878, 877, 878, 878, 879, 878, 878, 878, 877, 878, 878, 879, 878,
+    878, 878, 877, 878, 878, 879, 878, 878, 878, 877, 878, 878, 879, 878,
+    878, 878, 877, 878, 878, 879, 878, 878, 878, 877, 878, 878, 879, 878,
+    878, 878, 877, 878, 878, 879, 878, 878, 878, 878, 878, 878, 877, 878,
+    878, 879, 878, 878, 878, 877, 878, 878, 879, 878, 878, 878, 877, 878,
+    878, 880, 120, 369, 369, 881, 882, 370, 370, 370, 370, 370, 883, 884,
+    884, 884, 884, 884, 884, 884, 884, 884, 884, 884, 884, 884, 884, 884,
+    884, 884, 884, 884, 884, 884, 884, 884, 884, 884, 884, 884, 884, 884,
+    884, 884, 884, 885, 885, 885, 885, 885, 885, 885, 885, 885, 885, 885,
+    885, 885, 885, 885, 885, 885, 885, 885, 885, 885, 885, 885, 885, 885,
+    885, 885, 885, 885, 885, 885, 885, 776, 776, 776, 776, 776, 776, 776,
+    776, 776, 776, 776, 776, 776, 777, 776, 776, 776, 776, 776, 776, 776,
+    776, 776, 776, 776, 776, 776, 886, 778, 778, 778, 778, 887, 120, 888,
+    889, 121, 890, 891, 892, 893, 121, 128, 128, 128, 128, 128, 128, 128,
+    128, 128, 128, 128, 128, 894, 895, 896, 120, 897, 128, 128, 128, 128,
+    128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
+    128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
+    128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 898, 120,
+    120, 128, 128, 128, 128, 128, 128, 128, 128, 899, 128, 128, 128, 128,
+    128, 128, 120, 120, 120, 120, 120, 128, 900, 901, 901, 902, 903, 904,
+    905, 906, 907, 908, 909, 910, 911, 912, 913, 170, 128, 128, 128, 128,
+    128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 914, 915,
+    916, 917, 918, 919, 920, 920, 921, 922, 923, 923, 924, 925, 926, 927,
+    928, 928, 928, 928, 929, 930, 930, 930, 931, 932, 932, 932, 933, 934,
+    935, 120, 936, 937, 938, 937, 937, 939, 937, 937, 940, 937, 941, 937,
+    941, 120, 120, 120, 120, 937, 937, 937, 937, 937, 937, 937, 937, 937,
+    937, 937, 937, 937, 937, 937, 942, 943, 944, 944, 944, 944, 944, 945,
+    609, 946, 946, 946, 946, 946, 946, 947, 948, 949, 950, 580, 951, 952,
+    120, 120, 120, 120, 120, 609, 609, 609, 609, 609, 953, 120, 120, 120,
+    120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 954,
+    954, 954, 955, 956, 956, 956, 956, 956, 956, 957, 120, 958, 959, 959,
+    960, 961, 961, 961, 961, 962, 963, 964, 964, 965, 966, 967, 967, 967,
+    967, 968, 969, 970, 970, 970, 971, 972, 972, 972, 972, 973, 972, 974,
+    120, 120, 120, 120, 120, 975, 975, 975, 975, 975, 976, 976, 976, 976,
+    976, 977, 977, 977, 977, 977, 977, 978, 978, 978, 979, 980, 981, 982,
+    982, 982, 982, 983, 984, 984, 984, 984, 985, 986, 986, 986, 986, 986,
+    120, 987, 987, 987, 987, 987, 987, 988, 989, 120, 120, 120, 120, 120,
+    120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 990,
+    990, 990, 990, 990, 990, 990, 990, 990, 990, 990, 990, 990, 990, 990,
+    990, 990, 990, 990, 990, 990, 990, 990, 990, 990, 990, 990, 990, 990,
+    990, 990, 990, 990, 990, 990, 990, 990, 990, 991, 120, 990, 990, 992,
+    120, 990, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+    120, 120, 120, 120, 120, 120, 120, 993, 994, 995, 995, 995, 995, 996,
+    997, 998, 998, 999, 1000, 1001, 1001, 1002, 1003, 1004, 1004, 1004, 1005,
+    1006, 1007, 120, 120, 120, 120, 120, 120, 1008, 1008, 1009, 1010, 1011,
+    1011, 1012, 1013, 1014, 1014, 1014, 1015, 120, 120, 120, 120, 120, 120,
+    120, 120, 1016, 1016, 1016, 1016, 1017, 1017, 1017, 1018, 1019, 1019,
+    1020, 1019, 1019, 1019, 1019, 1019, 1021, 1022, 1023, 1024, 1025, 1025,
+    1026, 1027, 1028, 120, 1029, 1030, 1031, 1031, 1031, 1032, 1033, 1033,
+    1033, 1034, 120, 120, 120, 120, 1035, 1036, 1035, 1035, 1037, 1038, 1039,
+    120, 1040, 1040, 1040, 1040, 1040, 1040, 1041, 1042, 1043, 1043, 1044,
+    1045, 1046, 1046, 1047, 1048, 1049, 1049, 1050, 1051, 120, 1052, 120,
+    120, 120, 120, 120, 120, 120, 120, 120, 120, 1053, 1053, 1053, 1053,
+    1053, 1053, 1053, 1053, 1053, 1054, 120, 120, 120, 120, 120, 120, 1055,
+    1055, 1055, 1055, 1055, 1055, 1056, 120, 1057, 1057, 1057, 1057, 1057,
+    1057, 1058, 1059, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+    120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+    120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+    120, 120, 120, 120, 120, 1060, 1060, 1060, 1061, 120, 120, 120, 120, 120,
+    120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 1062, 1063, 1063,
+    1063, 1063, 1063, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 120,
+    1071, 1072, 1073, 1073, 1073, 1073, 1073, 1074, 1075, 1076, 120, 1077,
+    1077, 1077, 1078, 1079, 1080, 1081, 1082, 1082, 1082, 1083, 1084, 1085,
+    1086, 1087, 120, 1088, 1088, 1088, 1088, 1089, 120, 1090, 1091, 1091,
+    1091, 1091, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100,
+    120, 1101, 1101, 1102, 1101, 1101, 1103, 1104, 1105, 120, 120, 120, 120,
+    120, 120, 120, 120, 1106, 1107, 1108, 1109, 1108, 1110, 1111, 1111, 1111,
+    1111, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1120,
+    1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1129, 120, 120,
+    120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+    120, 1130, 1130, 1130, 1130, 1130, 1130, 1131, 1132, 1133, 1134, 1135,
+    1136, 120, 120, 120, 120, 1137, 1137, 1137, 1137, 1137, 1137, 1138, 1139,
+    1140, 120, 1141, 1142, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+    120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 1143, 1143, 1143, 1143,
+    1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, 120, 120, 120, 120, 1151,
+    1151, 1151, 1151, 1151, 1151, 1152, 1153, 1154, 120, 1155, 1156, 1157,
+    1158, 120, 120, 1159, 1159, 1159, 1159, 1159, 1160, 1161, 120, 1162,
+    1163, 120, 120, 120, 120, 120, 120, 1164, 1164, 1164, 1165, 1166, 1167,
+    1168, 1169, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+    120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+    120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+    120, 120, 120, 120, 1170, 1170, 1170, 1170, 1171, 1171, 1171, 1171, 1172,
+    1173, 1174, 1175, 1176, 1177, 1178, 1178, 1178, 1178, 1179, 1180, 1181,
+    120, 1182, 1183, 1184, 1184, 1184, 1184, 1185, 1186, 1187, 1188, 1189,
+    120, 120, 120, 1190, 1190, 1190, 1190, 1190, 1190, 1190, 1191, 1192,
+    1193, 1192, 1192, 1192, 1194, 1195, 1196, 1197, 120, 1198, 1199, 1200,
+    1201, 1202, 1203, 1203, 1203, 1204, 1205, 1205, 1206, 1207, 120, 120,
+    120, 120, 120, 120, 120, 120, 120, 1208, 1209, 1210, 1210, 1210, 1210,
+    1211, 1212, 1213, 120, 1214, 1215, 120, 120, 120, 120, 120, 120, 120,
+    120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 1216,
+    1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216,
+    1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216,
+    1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216,
+    1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216,
+    1216, 1216, 1217, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+    120, 1218, 1218, 1218, 1218, 1218, 1218, 1218, 1218, 1218, 1218, 1218,
+    1218, 1218, 1219, 1220, 120, 1216, 1216, 1216, 1216, 1216, 1216, 1216,
+    1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216,
+    1216, 1216, 1216, 1216, 1216, 1221, 120, 120, 120, 120, 120, 120, 120,
+    120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+    120, 120, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222,
+    1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222,
+    1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222,
+    1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1223, 1222, 1222,
+    1222, 1222, 1224, 1225, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222,
+    1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222,
+    1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1226, 1222, 1222,
+    1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222,
+    1222, 1222, 1222, 1222, 1222, 1222, 1222, 1227, 120, 120, 120, 120, 120,
+    120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+    120, 120, 120, 120, 120, 120, 120, 1228, 1228, 1228, 1228, 1228, 1228,
+    1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228,
+    1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228,
+    1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228,
+    1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228,
+    1228, 1228, 1228, 1229, 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228,
+    1228, 1228, 1228, 1228, 1228, 1228, 1230, 120, 120, 120, 120, 120, 120,
+    120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+    120, 120, 120, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795,
+    795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795,
+    795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795,
+    1231, 1232, 1232, 1232, 1233, 1234, 1235, 120, 120, 120, 120, 120, 120,
+    120, 120, 120, 120, 120, 120, 1236, 1236, 1236, 1237, 1238, 120, 1239,
+    1239, 1239, 1239, 1239, 1239, 1240, 1241, 1242, 120, 1243, 1244, 1245,
+    1239, 1239, 1246, 1239, 1239, 120, 120, 120, 120, 120, 120, 120, 120,
+    120, 120, 120, 120, 120, 120, 1247, 1247, 1247, 1247, 1247, 1247, 1247,
+    1247, 1248, 120, 1249, 1250, 1250, 1250, 1250, 1251, 120, 1252, 1253,
+    1254, 120, 120, 120, 120, 120, 120, 120, 120, 1255, 120, 120, 120, 1256,
+    1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256,
+    1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256,
+    1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256,
+    1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256,
+    1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256,
+    1257, 120, 120, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256,
+    1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256,
+    1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1258, 120, 1259,
+    737, 737, 737, 737, 737, 737, 737, 737, 737, 737, 737, 737, 737, 737,
+    737, 737, 737, 737, 737, 737, 737, 737, 737, 737, 737, 737, 737, 737,
+    737, 737, 737, 737, 737, 737, 1260, 120, 120, 120, 120, 120, 120, 120,
+    120, 120, 120, 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261,
+    1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261,
+    1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261,
+    1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261,
+    1261, 1261, 1261, 1261, 1262, 1263, 1263, 1263, 1263, 1263, 1263, 1263,
+    1263, 1263, 1263, 1263, 1263, 1263, 1264, 1263, 1265, 1263, 1266, 1263,
+    1267, 1268, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 609,
+    609, 609, 609, 609, 609, 609, 609, 609, 609, 609, 609, 609, 609, 609,
+    609, 609, 609, 609, 609, 609, 609, 609, 609, 609, 609, 609, 609, 609,
+    609, 1269, 120, 609, 609, 609, 609, 1270, 1271, 609, 609, 609, 609, 609,
+    609, 1272, 1273, 1274, 1275, 1276, 1277, 609, 609, 609, 1278, 609, 609,
+    609, 609, 609, 609, 609, 1279, 120, 120, 949, 949, 949, 949, 949, 949,
+    949, 949, 1280, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+    120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 580, 580,
+    580, 580, 580, 580, 580, 580, 580, 580, 616, 120, 944, 944, 1281, 120,
+    120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+    120, 120, 1282, 1282, 1282, 1283, 1284, 1284, 1285, 1282, 1282, 1286,
+    1287, 1284, 1284, 1282, 1282, 1282, 1283, 1284, 1284, 1288, 1289, 1290,
+    1286, 1291, 1292, 1284, 1282, 1282, 1282, 1283, 1284, 1284, 1293, 1294,
+    1295, 1296, 1284, 1284, 1284, 1297, 1298, 1299, 1300, 1284, 1284, 1285,
+    1282, 1282, 1286, 1284, 1284, 1284, 1282, 1282, 1282, 1283, 1284, 1284,
+    1285, 1282, 1282, 1286, 1284, 1284, 1284, 1282, 1282, 1282, 1283, 1284,
+    1284, 1285, 1282, 1282, 1286, 1284, 1284, 1284, 1282, 1282, 1282, 1283,
+    1284, 1284, 1301, 1282, 1282, 1282, 1302, 1284, 1284, 1303, 1304, 1282,
+    1282, 1305, 1284, 1284, 1306, 1285, 1282, 1282, 1307, 1284, 1284, 1308,
+    1309, 1282, 1282, 1310, 1284, 1284, 1284, 1311, 1282, 1282, 1282, 1302,
+    1284, 1284, 1303, 1312, 1313, 1313, 1313, 1313, 1313, 1313, 1314, 1314,
+    1314, 1314, 1314, 1314, 1314, 1314, 1314, 1314, 1314, 1314, 1314, 1314,
+    1314, 1314, 1314, 1314, 1314, 1314, 1314, 1314, 1314, 1314, 1314, 1314,
+    1314, 1314, 1314, 1314, 1314, 1314, 1315, 1315, 1315, 1315, 1315, 1315,
+    1316, 1317, 1315, 1315, 1315, 1315, 1315, 1318, 1319, 1314, 1320, 1321,
+    120, 1322, 1323, 1315, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+    1324, 1325, 1325, 1326, 1327, 1328, 120, 120, 120, 120, 120, 120, 120,
+    120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+    120, 120, 120, 120, 120, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329,
+    1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329,
+    1329, 1329, 1329, 1329, 1330, 1331, 1332, 120, 120, 120, 120, 120, 1333,
+    1333, 1333, 1333, 1334, 1335, 1335, 1335, 1336, 1337, 1338, 1339, 120,
+    120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+    120, 120, 120, 120, 120, 1340, 128, 128, 128, 1341, 1342, 1343, 1344,
+    1345, 1346, 1341, 1347, 1341, 1343, 1343, 1348, 128, 1349, 128, 1350,
+    1351, 1349, 128, 1350, 120, 120, 120, 120, 120, 120, 1352, 120, 1353,
+    1354, 1354, 1354, 1354, 1355, 1354, 1354, 1354, 1354, 1354, 1354, 1354,
+    1354, 1354, 1354, 1354, 1354, 1355, 1356, 1354, 1357, 1358, 1354, 1358,
+    1359, 1358, 1354, 1354, 1354, 1360, 1356, 619, 1361, 621, 621, 621, 1362,
+    621, 621, 621, 621, 621, 621, 621, 1363, 621, 621, 621, 1364, 1365, 1366,
+    621, 1367, 1356, 1356, 1356, 1356, 1356, 1356, 1368, 1369, 1369, 1369,
+    1370, 1356, 758, 758, 758, 758, 758, 1371, 758, 1372, 1373, 1356, 1374,
+    1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356,
+    1356, 1356, 1356, 1356, 1356, 1356, 1356, 725, 725, 725, 725, 1375, 1376,
+    1377, 725, 725, 725, 725, 725, 725, 725, 725, 1378, 1379, 725, 1380,
+    1381, 725, 725, 1382, 1383, 1384, 1385, 1380, 1354, 725, 725, 1386, 1387,
+    725, 725, 725, 725, 725, 725, 725, 1388, 1389, 1390, 1391, 725, 1392,
+    1393, 1390, 1394, 1395, 725, 725, 725, 1396, 1397, 1398, 725, 725, 725,
+    725, 725, 725, 725, 725, 1399, 1400, 725, 1401, 642, 1402, 725, 1403,
+    1404, 580, 1405, 725, 725, 725, 1354, 1406, 1407, 1354, 1354, 1408, 1354,
+    1353, 1354, 1354, 1354, 1354, 1354, 1409, 1410, 1354, 1354, 1409, 1411,
+    725, 725, 725, 725, 725, 725, 725, 725, 1412, 1413, 580, 580, 580, 580,
+    1414, 1415, 725, 725, 725, 725, 1416, 725, 1417, 725, 1418, 1419, 1420,
+    1356, 1354, 1421, 1422, 1423, 580, 580, 580, 580, 580, 580, 580, 580,
+    580, 580, 580, 580, 580, 580, 1424, 1356, 580, 580, 580, 580, 580, 580,
+    580, 580, 580, 580, 1425, 1356, 1356, 1356, 1356, 1356, 580, 1424, 580,
+    580, 580, 580, 580, 580, 580, 1356, 580, 1426, 580, 580, 580, 580, 580,
+    1356, 580, 580, 580, 1427, 1356, 1356, 1356, 1356, 1356, 1356, 1356,
+    1356, 1356, 1356, 580, 1424, 725, 1428, 1429, 725, 1390, 1430, 725, 1431,
+    725, 725, 725, 1432, 1356, 1356, 725, 725, 725, 1356, 1356, 1356, 1356,
+    1356, 1423, 1356, 1433, 1434, 1435, 1356, 1356, 1356, 1356, 1356, 1356,
+    1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356,
+    1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356,
+    1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356,
+    1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356,
+    1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356,
+    1436, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776,
+    776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 1437,
+    778, 778, 778, 778, 778, 776, 776, 776, 776, 776, 776, 1438, 778, 776,
+    776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776,
+    776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 777, 776,
+    776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776,
+    776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776,
+    776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776,
+    776, 776, 776, 776, 776, 886, 778, 776, 776, 776, 776, 776, 776, 776,
+    776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776,
+    776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776,
+    776, 776, 776, 1439, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778,
+    778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778,
+    778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 776, 776, 776,
+    777, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778,
+    778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778,
+    778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778,
+    778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778,
+    778, 778, 778, 778, 1440, 1441, 120, 120, 120, 1442, 1442, 1442, 1442,
+    1442, 1442, 1442, 1442, 1442, 1442, 1442, 1442, 120, 120, 120, 120, 120,
+    120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 901, 901, 901,
+    901, 901, 901, 901, 901, 901, 901, 901, 901, 901, 901, 901, 901, 901,
+    901, 901, 901, 901, 901, 901, 901, 901, 901, 901, 901, 901, 901, 120,
+    120, 885, 885, 885, 885, 885, 885, 885, 885, 885, 885, 885, 885, 885,
+    885, 885, 885, 885, 885, 885, 885, 885, 885, 885, 885, 885, 885, 885,
+    885, 885, 885, 885, 1443,
+};
+
+static const unsigned short index2[] = {
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 5, 6, 1, 1, 1, 1, 1, 1, 7, 7, 7, 8,
+    9, 10, 11, 12, 13, 14, 15, 11, 16, 17, 15, 18, 19, 20, 19, 21, 22, 22,
+    22, 22, 22, 22, 22, 22, 22, 22, 19, 23, 24, 24, 24, 10, 15, 25, 25, 25,
+    25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 16, 26, 17,
+    27, 28, 27, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
+    29, 29, 29, 16, 30, 31, 24, 1, 1, 1, 1, 1, 1, 32, 1, 1, 33, 34, 35, 13,
+    36, 13, 37, 38, 39, 40, 41, 42, 24, 43, 44, 27, 45, 46, 47, 47, 48, 49,
+    38, 38, 39, 47, 41, 50, 51, 51, 51, 34, 52, 52, 52, 52, 52, 52, 53, 52,
+    52, 52, 52, 52, 52, 52, 52, 52, 53, 52, 52, 52, 52, 52, 52, 54, 53, 52,
+    52, 52, 52, 52, 53, 55, 55, 55, 56, 56, 56, 56, 55, 56, 55, 55, 55, 56,
+    55, 55, 56, 56, 55, 56, 55, 55, 56, 56, 56, 54, 55, 55, 55, 56, 55, 56,
+    55, 56, 52, 55, 52, 56, 52, 56, 52, 56, 52, 56, 52, 56, 52, 56, 52, 56,
+    52, 55, 52, 55, 52, 56, 52, 56, 52, 56, 52, 55, 52, 56, 52, 56, 52, 56,
+    52, 56, 52, 56, 53, 55, 52, 55, 53, 55, 52, 56, 52, 56, 55, 52, 56, 52,
+    56, 52, 56, 53, 55, 53, 55, 52, 55, 52, 56, 52, 55, 55, 53, 55, 52, 55,
+    52, 56, 52, 56, 53, 55, 52, 56, 52, 56, 52, 52, 56, 52, 56, 52, 56, 56,
+    56, 52, 52, 56, 52, 56, 52, 52, 56, 52, 52, 52, 56, 56, 52, 52, 52, 52,
+    56, 52, 52, 56, 52, 52, 52, 56, 56, 56, 52, 52, 56, 52, 52, 56, 52, 56,
+    52, 56, 52, 52, 56, 52, 56, 56, 52, 56, 52, 52, 56, 52, 52, 52, 56, 52,
+    56, 52, 52, 56, 56, 57, 52, 56, 56, 56, 57, 57, 57, 57, 52, 58, 56, 52,
+    58, 56, 52, 58, 56, 52, 55, 52, 55, 52, 55, 52, 55, 52, 55, 52, 55, 52,
+    55, 52, 55, 56, 52, 56, 56, 52, 58, 56, 52, 56, 52, 52, 52, 56, 52, 56,
+    56, 56, 56, 56, 56, 56, 52, 52, 56, 52, 52, 56, 56, 52, 56, 52, 52, 52,
+    52, 56, 56, 55, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
+    56, 56, 56, 56, 57, 56, 56, 56, 59, 59, 59, 59, 59, 59, 59, 59, 59, 60,
+    60, 61, 61, 61, 61, 61, 61, 61, 62, 62, 63, 62, 60, 64, 65, 64, 64, 64,
+    65, 64, 60, 60, 66, 61, 62, 62, 62, 62, 62, 62, 39, 39, 39, 39, 62, 39,
+    62, 48, 59, 59, 59, 59, 59, 62, 62, 62, 62, 62, 67, 67, 60, 62, 61, 62,
+    62, 62, 62, 62, 62, 62, 62, 62, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
+    68, 68, 68, 69, 70, 70, 70, 70, 69, 71, 70, 70, 70, 70, 70, 72, 72, 70,
+    70, 70, 70, 72, 72, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 73, 73,
+    73, 73, 73, 70, 70, 70, 70, 68, 68, 68, 68, 68, 68, 68, 68, 74, 68, 70,
+    70, 70, 68, 68, 68, 70, 70, 75, 68, 68, 68, 70, 70, 70, 70, 68, 69, 70,
+    70, 68, 76, 77, 77, 76, 77, 77, 76, 68, 68, 68, 68, 68, 78, 79, 78, 79,
+    60, 80, 78, 79, 81, 81, 82, 79, 79, 79, 83, 78, 81, 81, 81, 81, 80, 62,
+    78, 84, 78, 78, 78, 81, 78, 81, 78, 78, 79, 85, 85, 85, 85, 85, 85, 85,
+    85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 81, 85, 85, 85, 85, 85, 85, 85,
+    78, 78, 79, 79, 79, 79, 79, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
+    86, 86, 86, 86, 86, 86, 79, 86, 86, 86, 86, 86, 86, 86, 79, 79, 79, 79,
+    79, 78, 79, 79, 78, 78, 78, 79, 79, 79, 78, 79, 78, 79, 78, 79, 78, 79,
+    78, 79, 87, 88, 87, 88, 87, 88, 87, 88, 87, 88, 87, 88, 87, 88, 79, 79,
+    79, 79, 78, 79, 89, 78, 79, 78, 78, 79, 79, 78, 78, 78, 90, 91, 90, 90,
+    90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 91, 91, 91, 91, 91, 91,
+    91, 91, 92, 92, 92, 92, 92, 92, 92, 92, 93, 92, 93, 93, 93, 93, 93, 93,
+    93, 93, 93, 93, 93, 93, 93, 93, 90, 93, 90, 93, 90, 93, 90, 93, 90, 93,
+    94, 95, 95, 96, 96, 95, 97, 97, 90, 93, 90, 93, 90, 93, 90, 90, 93, 90,
+    93, 90, 93, 90, 93, 90, 93, 90, 93, 90, 93, 93, 81, 98, 98, 98, 98, 98,
+    98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 81,
+    81, 99, 100, 100, 100, 100, 100, 100, 81, 101, 101, 101, 101, 101, 101,
+    101, 101, 101, 101, 101, 101, 101, 101, 101, 81, 102, 103, 81, 81, 104,
+    104, 105, 81, 106, 107, 107, 107, 107, 106, 107, 107, 107, 108, 106, 107,
+    107, 107, 107, 107, 107, 106, 106, 106, 106, 106, 106, 107, 107, 106,
+    107, 107, 108, 109, 107, 110, 111, 112, 113, 114, 115, 116, 117, 118,
+    119, 119, 120, 121, 122, 123, 124, 125, 126, 127, 125, 107, 106, 128,
+    118, 81, 81, 81, 81, 81, 81, 81, 81, 129, 129, 129, 129, 129, 129, 129,
+    129, 129, 129, 129, 81, 81, 81, 81, 81, 129, 129, 129, 125, 125, 81, 81,
+    81, 130, 130, 130, 130, 130, 131, 132, 132, 133, 134, 134, 135, 136, 137,
+    138, 138, 139, 139, 139, 139, 139, 139, 139, 139, 140, 141, 142, 143,
+    144, 81, 145, 143, 146, 146, 146, 146, 146, 146, 146, 146, 147, 146, 146,
+    146, 146, 146, 146, 146, 146, 146, 146, 148, 149, 150, 151, 152, 153,
+    154, 155, 96, 96, 156, 157, 139, 139, 139, 139, 139, 157, 139, 139, 157,
+    158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 134, 159, 159, 160,
+    146, 146, 161, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
+    145, 146, 139, 139, 139, 139, 139, 139, 139, 131, 138, 139, 139, 139,
+    139, 157, 139, 162, 162, 139, 139, 138, 157, 139, 139, 157, 146, 146,
+    163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 146, 146, 146, 164,
+    164, 146, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
+    165, 165, 81, 166, 167, 168, 167, 167, 167, 167, 167, 167, 167, 167, 167,
+    167, 167, 167, 167, 167, 169, 170, 169, 169, 170, 169, 169, 170, 170,
+    170, 169, 170, 170, 169, 170, 169, 169, 169, 170, 169, 170, 169, 170,
+    169, 170, 169, 169, 81, 81, 167, 167, 167, 171, 171, 171, 171, 171, 171,
+    171, 171, 171, 171, 171, 171, 171, 171, 172, 172, 172, 172, 172, 172,
+    172, 172, 172, 172, 172, 171, 81, 81, 81, 81, 81, 81, 173, 173, 173, 173,
+    173, 173, 173, 173, 173, 173, 174, 174, 174, 174, 174, 174, 174, 174,
+    174, 174, 174, 174, 174, 174, 174, 174, 174, 175, 175, 175, 175, 175,
+    175, 175, 176, 175, 177, 177, 178, 179, 180, 181, 177, 81, 81, 81, 81,
+    81, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182,
+    183, 183, 183, 183, 184, 183, 183, 183, 183, 183, 183, 183, 183, 183,
+    184, 183, 183, 183, 184, 183, 183, 183, 183, 183, 81, 81, 185, 185, 185,
+    185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 81, 186, 186,
+    186, 186, 186, 186, 186, 186, 186, 187, 187, 187, 81, 81, 188, 81, 167,
+    167, 167, 81, 81, 81, 81, 81, 146, 146, 146, 146, 146, 81, 146, 146, 146,
+    146, 146, 146, 146, 146, 81, 81, 81, 81, 81, 81, 139, 139, 139, 139, 139,
+    139, 131, 157, 139, 139, 157, 139, 139, 157, 139, 139, 139, 157, 157,
+    157, 189, 190, 191, 139, 139, 139, 157, 139, 139, 157, 157, 139, 139,
+    139, 139, 139, 192, 192, 192, 193, 194, 194, 194, 194, 194, 194, 194,
+    194, 194, 194, 194, 194, 194, 194, 192, 193, 195, 194, 193, 193, 193,
+    192, 192, 192, 192, 192, 192, 192, 192, 193, 193, 193, 193, 196, 193,
+    193, 194, 96, 156, 197, 197, 192, 192, 192, 194, 194, 192, 192, 198, 198,
+    199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 200, 201, 194, 194,
+    194, 194, 194, 194, 202, 203, 204, 204, 81, 202, 202, 202, 202, 202, 202,
+    202, 202, 81, 81, 202, 202, 81, 81, 202, 202, 202, 202, 202, 202, 202,
+    202, 202, 202, 202, 202, 202, 202, 81, 202, 202, 202, 202, 202, 202, 202,
+    81, 202, 81, 81, 81, 202, 202, 202, 202, 81, 81, 205, 202, 204, 204, 204,
+    203, 203, 203, 203, 81, 81, 204, 204, 81, 81, 204, 204, 206, 202, 81, 81,
+    81, 81, 81, 81, 81, 81, 204, 81, 81, 81, 81, 202, 202, 81, 202, 202, 202,
+    203, 203, 81, 81, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 202,
+    202, 208, 208, 209, 209, 209, 209, 209, 210, 211, 212, 202, 213, 81, 81,
+    81, 214, 214, 215, 81, 216, 216, 216, 216, 216, 216, 81, 81, 81, 81, 216,
+    216, 81, 81, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216,
+    216, 216, 81, 216, 216, 216, 216, 216, 216, 216, 81, 216, 216, 81, 216,
+    216, 81, 216, 216, 81, 81, 217, 81, 215, 215, 215, 214, 214, 81, 81, 81,
+    81, 214, 214, 81, 81, 214, 214, 218, 81, 81, 81, 214, 81, 81, 81, 81, 81,
+    81, 81, 216, 216, 216, 216, 81, 216, 81, 81, 81, 81, 81, 81, 81, 219,
+    219, 219, 219, 219, 219, 219, 219, 219, 219, 214, 214, 216, 216, 216,
+    214, 81, 81, 81, 220, 220, 221, 81, 222, 222, 222, 222, 222, 222, 222,
+    222, 222, 81, 222, 222, 222, 81, 222, 222, 222, 222, 222, 222, 222, 222,
+    222, 222, 222, 222, 222, 222, 81, 222, 222, 222, 222, 222, 222, 222, 81,
+    222, 222, 81, 222, 222, 222, 222, 222, 81, 81, 223, 222, 221, 221, 221,
+    220, 220, 220, 220, 220, 81, 220, 220, 221, 81, 221, 221, 224, 81, 81,
+    222, 81, 81, 81, 81, 81, 81, 81, 222, 222, 220, 220, 81, 81, 225, 225,
+    225, 225, 225, 225, 225, 225, 225, 225, 226, 227, 81, 81, 81, 81, 81, 81,
+    81, 222, 220, 220, 220, 220, 220, 220, 81, 228, 229, 229, 81, 230, 230,
+    230, 230, 230, 230, 230, 230, 81, 81, 230, 230, 81, 81, 230, 230, 230,
+    230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 81, 230, 230, 230,
+    230, 230, 230, 230, 81, 230, 230, 81, 230, 230, 230, 230, 230, 81, 81,
+    231, 230, 229, 228, 229, 228, 228, 228, 228, 81, 81, 229, 229, 81, 81,
+    229, 229, 232, 81, 81, 81, 81, 81, 81, 81, 81, 228, 229, 81, 81, 81, 81,
+    230, 230, 81, 230, 230, 230, 228, 228, 81, 81, 233, 233, 233, 233, 233,
+    233, 233, 233, 233, 233, 234, 230, 235, 235, 235, 235, 235, 235, 81, 81,
+    236, 237, 81, 237, 237, 237, 237, 237, 237, 81, 81, 81, 237, 237, 237,
+    81, 237, 237, 237, 237, 81, 81, 81, 237, 237, 81, 237, 81, 237, 237, 81,
+    81, 81, 237, 237, 81, 81, 81, 237, 237, 237, 237, 237, 237, 237, 237,
+    237, 237, 81, 81, 81, 81, 238, 238, 236, 238, 238, 81, 81, 81, 238, 238,
+    238, 81, 238, 238, 238, 239, 81, 81, 237, 81, 81, 81, 81, 81, 81, 238,
+    81, 81, 81, 81, 81, 81, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240,
+    241, 241, 241, 242, 242, 242, 242, 242, 242, 243, 242, 81, 81, 81, 81,
+    81, 244, 245, 245, 245, 81, 246, 246, 246, 246, 246, 246, 246, 246, 81,
+    246, 246, 246, 81, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246,
+    246, 246, 246, 246, 246, 81, 81, 81, 246, 244, 244, 244, 245, 245, 245,
+    245, 81, 244, 244, 244, 81, 244, 244, 244, 247, 81, 81, 81, 81, 81, 81,
+    81, 248, 249, 81, 246, 246, 246, 81, 81, 81, 81, 81, 246, 246, 244, 244,
+    81, 81, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 251, 251, 251,
+    251, 251, 251, 251, 252, 253, 254, 255, 255, 81, 253, 253, 253, 253, 253,
+    253, 253, 253, 81, 253, 253, 253, 81, 253, 253, 253, 253, 253, 253, 253,
+    253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 81, 253, 253, 253,
+    253, 253, 81, 81, 256, 253, 255, 257, 255, 255, 255, 255, 255, 81, 257,
+    255, 255, 81, 255, 255, 254, 258, 81, 81, 81, 81, 81, 81, 81, 255, 255,
+    81, 81, 81, 81, 81, 81, 81, 253, 81, 253, 253, 254, 254, 81, 81, 259,
+    259, 259, 259, 259, 259, 259, 259, 259, 259, 81, 253, 253, 81, 81, 81,
+    81, 81, 260, 260, 261, 261, 81, 262, 262, 262, 262, 262, 262, 262, 262,
+    81, 262, 262, 262, 81, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
+    262, 262, 262, 262, 262, 262, 262, 263, 263, 262, 261, 261, 261, 260,
+    260, 260, 260, 81, 261, 261, 261, 81, 261, 261, 261, 263, 262, 264, 81,
+    81, 81, 81, 262, 262, 262, 261, 265, 265, 265, 265, 265, 265, 265, 262,
+    262, 262, 260, 260, 81, 81, 266, 266, 266, 266, 266, 266, 266, 266, 266,
+    266, 265, 265, 265, 265, 265, 265, 265, 265, 265, 267, 262, 262, 262,
+    262, 262, 262, 81, 81, 268, 268, 81, 269, 269, 269, 269, 269, 269, 269,
+    269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 81, 81, 81, 269,
+    269, 269, 269, 269, 269, 269, 269, 81, 269, 269, 269, 269, 269, 269, 269,
+    269, 269, 81, 269, 81, 81, 81, 81, 270, 81, 81, 81, 81, 268, 268, 268,
+    271, 271, 271, 81, 271, 81, 268, 268, 268, 268, 268, 268, 268, 268, 81,
+    81, 81, 81, 81, 81, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 81,
+    81, 268, 268, 273, 81, 81, 81, 81, 274, 274, 274, 274, 274, 274, 274,
+    274, 274, 274, 274, 274, 274, 274, 274, 274, 275, 274, 274, 275, 275,
+    275, 275, 276, 276, 277, 81, 81, 81, 81, 278, 274, 274, 274, 274, 274,
+    274, 279, 275, 280, 280, 280, 280, 275, 275, 275, 281, 282, 282, 282,
+    282, 282, 282, 282, 282, 282, 282, 283, 283, 81, 81, 81, 81, 81, 284,
+    284, 81, 284, 81, 81, 284, 284, 81, 284, 81, 81, 284, 81, 81, 81, 81, 81,
+    81, 284, 284, 284, 284, 81, 284, 284, 284, 284, 284, 284, 284, 81, 284,
+    284, 284, 81, 284, 81, 284, 81, 81, 284, 284, 81, 284, 284, 284, 284,
+    285, 284, 284, 285, 285, 285, 285, 286, 286, 81, 285, 285, 284, 81, 81,
+    284, 284, 284, 284, 284, 81, 287, 81, 288, 288, 288, 288, 285, 285, 81,
+    81, 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, 81, 81, 284, 284,
+    284, 284, 290, 291, 291, 291, 292, 293, 292, 292, 294, 292, 292, 295,
+    294, 296, 296, 296, 296, 296, 294, 297, 296, 297, 297, 297, 298, 298,
+    297, 297, 297, 297, 297, 297, 299, 299, 299, 299, 299, 299, 299, 299,
+    299, 299, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 301, 298,
+    297, 298, 297, 302, 303, 304, 303, 304, 305, 305, 290, 290, 290, 290,
+    290, 290, 290, 290, 81, 290, 290, 290, 290, 290, 290, 290, 290, 290, 290,
+    290, 290, 81, 81, 81, 81, 306, 307, 308, 309, 308, 308, 308, 308, 308,
+    307, 307, 307, 307, 308, 310, 307, 308, 311, 311, 312, 295, 311, 311,
+    290, 290, 290, 290, 290, 308, 308, 308, 308, 308, 308, 308, 308, 308,
+    308, 308, 81, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308,
+    81, 301, 301, 297, 297, 297, 297, 297, 297, 298, 297, 297, 297, 297, 297,
+    297, 81, 297, 297, 292, 292, 295, 292, 293, 313, 313, 313, 313, 294, 294,
+    81, 81, 81, 81, 81, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314,
+    314, 315, 315, 316, 316, 316, 316, 315, 316, 316, 316, 316, 316, 317,
+    315, 318, 318, 315, 315, 316, 316, 314, 319, 319, 319, 319, 319, 319,
+    319, 319, 319, 319, 320, 320, 321, 321, 321, 321, 314, 314, 314, 314,
+    314, 314, 315, 315, 316, 316, 314, 314, 314, 314, 316, 316, 316, 314,
+    315, 315, 315, 314, 314, 315, 315, 315, 315, 315, 315, 315, 314, 314,
+    314, 316, 316, 316, 316, 314, 314, 314, 314, 314, 316, 315, 315, 316,
+    316, 315, 315, 315, 315, 315, 315, 322, 314, 315, 319, 319, 315, 315,
+    315, 316, 323, 323, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324,
+    324, 324, 324, 324, 81, 324, 81, 81, 81, 81, 81, 324, 81, 81, 325, 325,
+    325, 325, 325, 325, 325, 325, 325, 325, 325, 326, 327, 325, 325, 325,
+    328, 328, 328, 328, 328, 328, 328, 328, 329, 329, 329, 329, 329, 329,
+    329, 329, 330, 330, 330, 330, 330, 330, 330, 330, 331, 331, 331, 331,
+    331, 331, 331, 331, 331, 81, 331, 331, 331, 331, 81, 81, 331, 331, 331,
+    331, 331, 331, 331, 81, 331, 331, 331, 81, 81, 332, 332, 332, 333, 334,
+    333, 333, 333, 333, 333, 333, 333, 335, 335, 335, 335, 335, 335, 335,
+    335, 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, 81, 81,
+    81, 336, 336, 336, 336, 336, 336, 336, 336, 336, 336, 81, 81, 81, 81, 81,
+    81, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337,
+    81, 81, 338, 338, 338, 338, 338, 338, 81, 81, 339, 340, 340, 340, 340,
+    340, 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, 340,
+    340, 340, 341, 341, 340, 342, 343, 343, 343, 343, 343, 343, 343, 343,
+    343, 343, 343, 343, 343, 343, 343, 343, 343, 343, 344, 345, 81, 81, 81,
+    346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 198, 198, 198,
+    347, 347, 347, 346, 346, 346, 346, 346, 346, 346, 346, 81, 81, 81, 81,
+    81, 81, 81, 348, 348, 348, 348, 348, 348, 348, 348, 348, 348, 348, 348,
+    348, 81, 348, 348, 348, 348, 349, 349, 350, 81, 81, 81, 351, 351, 351,
+    351, 351, 351, 351, 351, 351, 351, 352, 352, 353, 198, 198, 81, 354, 354,
+    354, 354, 354, 354, 354, 354, 354, 354, 355, 355, 81, 81, 81, 81, 356,
+    356, 356, 356, 356, 356, 356, 356, 356, 356, 356, 356, 356, 81, 356, 356,
+    356, 81, 357, 357, 81, 81, 81, 81, 358, 358, 358, 358, 358, 358, 358,
+    358, 358, 358, 358, 358, 359, 359, 360, 359, 359, 359, 359, 359, 359,
+    359, 360, 360, 360, 360, 360, 360, 360, 360, 359, 360, 360, 359, 359,
+    359, 359, 359, 359, 359, 359, 359, 361, 359, 362, 362, 363, 364, 362,
+    365, 362, 366, 358, 367, 81, 81, 368, 368, 368, 368, 368, 368, 368, 368,
+    368, 368, 81, 81, 81, 81, 81, 81, 369, 369, 369, 369, 369, 369, 369, 369,
+    369, 369, 81, 81, 81, 81, 81, 81, 370, 370, 371, 371, 372, 373, 374, 370,
+    375, 375, 370, 376, 376, 376, 377, 81, 378, 378, 378, 378, 378, 378, 378,
+    378, 378, 378, 81, 81, 81, 81, 81, 81, 379, 379, 379, 379, 379, 379, 379,
+    379, 379, 379, 379, 380, 379, 379, 379, 379, 379, 379, 379, 379, 379,
+    376, 376, 379, 379, 381, 379, 81, 81, 81, 81, 81, 340, 340, 340, 340,
+    340, 340, 81, 81, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382,
+    382, 382, 382, 382, 81, 383, 383, 383, 384, 384, 384, 384, 383, 383, 384,
+    384, 384, 81, 81, 81, 81, 384, 384, 383, 384, 384, 384, 384, 384, 384,
+    385, 386, 387, 81, 81, 81, 81, 388, 81, 81, 81, 389, 389, 390, 390, 390,
+    390, 390, 390, 390, 390, 390, 390, 391, 391, 391, 391, 391, 391, 391,
+    391, 391, 391, 391, 391, 391, 391, 81, 81, 391, 391, 391, 391, 391, 81,
+    81, 81, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 81,
+    81, 81, 81, 392, 392, 81, 81, 81, 81, 81, 81, 393, 393, 393, 393, 393,
+    393, 393, 393, 393, 393, 394, 81, 81, 81, 395, 395, 396, 396, 396, 396,
+    396, 396, 396, 396, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
+    397, 397, 397, 397, 397, 398, 399, 400, 400, 401, 81, 81, 402, 402, 403,
+    403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 404, 405,
+    404, 405, 405, 405, 405, 405, 405, 405, 81, 406, 404, 405, 404, 404, 405,
+    405, 405, 405, 405, 405, 405, 405, 404, 404, 404, 404, 404, 404, 405,
+    405, 407, 407, 407, 407, 407, 407, 407, 407, 81, 81, 408, 409, 409, 409,
+    409, 409, 409, 409, 409, 409, 409, 81, 81, 81, 81, 81, 81, 410, 410, 410,
+    410, 410, 410, 410, 411, 410, 410, 410, 410, 410, 410, 81, 81, 96, 96,
+    96, 96, 96, 156, 156, 156, 156, 156, 156, 96, 96, 156, 412, 81, 413, 413,
+    413, 413, 414, 415, 415, 415, 415, 415, 415, 415, 415, 415, 415, 415,
+    415, 415, 415, 415, 416, 414, 413, 413, 413, 413, 413, 414, 413, 414,
+    414, 414, 414, 414, 413, 414, 417, 415, 415, 415, 415, 415, 415, 415, 81,
+    81, 81, 81, 418, 418, 418, 418, 418, 418, 418, 418, 418, 418, 419, 419,
+    420, 419, 419, 419, 419, 421, 421, 421, 421, 421, 421, 421, 421, 421,
+    421, 422, 423, 422, 422, 422, 422, 422, 422, 422, 421, 421, 421, 421,
+    421, 421, 421, 421, 421, 81, 81, 81, 424, 424, 425, 426, 426, 426, 426,
+    426, 426, 426, 426, 426, 426, 426, 426, 426, 426, 425, 424, 424, 424,
+    424, 425, 425, 424, 424, 427, 428, 424, 424, 426, 426, 429, 429, 429,
+    429, 429, 429, 429, 429, 429, 429, 426, 426, 426, 426, 426, 426, 430,
+    430, 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, 431,
+    432, 433, 433, 432, 432, 432, 433, 432, 433, 433, 433, 434, 434, 81, 81,
+    81, 81, 81, 81, 81, 81, 435, 435, 435, 435, 436, 436, 436, 436, 436, 436,
+    436, 436, 436, 436, 436, 436, 437, 437, 437, 437, 437, 437, 437, 437,
+    438, 438, 438, 438, 438, 438, 438, 438, 437, 437, 438, 439, 81, 81, 81,
+    440, 440, 440, 440, 440, 441, 441, 441, 441, 441, 441, 441, 441, 441,
+    441, 81, 81, 81, 436, 436, 436, 442, 442, 442, 442, 442, 442, 442, 442,
+    442, 442, 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 443,
+    443, 443, 444, 444, 444, 444, 444, 444, 445, 445, 93, 81, 81, 81, 81, 81,
+    81, 81, 446, 446, 446, 446, 446, 446, 446, 446, 96, 96, 96, 326, 447,
+    156, 156, 156, 156, 156, 96, 96, 156, 156, 156, 156, 96, 448, 447, 447,
+    447, 447, 447, 447, 447, 449, 449, 449, 449, 156, 449, 449, 449, 449,
+    448, 448, 96, 449, 449, 448, 96, 96, 81, 81, 81, 81, 81, 81, 56, 56, 56,
+    56, 56, 56, 79, 79, 79, 79, 79, 93, 59, 59, 59, 59, 59, 59, 59, 59, 59,
+    82, 82, 82, 82, 82, 59, 59, 59, 59, 82, 82, 82, 82, 82, 56, 56, 56, 56,
+    56, 450, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 59, 59, 59, 59, 59, 59,
+    59, 59, 59, 59, 59, 59, 82, 96, 96, 156, 96, 96, 96, 96, 96, 96, 96, 156,
+    96, 96, 451, 452, 156, 453, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
+    96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 454, 455, 455, 156, 81, 96, 456,
+    156, 96, 156, 52, 56, 52, 56, 52, 56, 56, 56, 56, 56, 56, 56, 56, 56, 52,
+    56, 79, 79, 79, 79, 79, 79, 79, 79, 78, 78, 78, 78, 78, 78, 78, 78, 79,
+    79, 79, 79, 79, 79, 81, 81, 78, 78, 78, 78, 78, 78, 81, 81, 81, 78, 81,
+    78, 81, 78, 81, 78, 457, 457, 457, 457, 457, 457, 457, 457, 79, 79, 79,
+    79, 79, 81, 79, 79, 78, 78, 78, 78, 457, 80, 79, 80, 80, 80, 79, 79, 79,
+    81, 79, 79, 78, 78, 78, 78, 457, 80, 80, 80, 79, 79, 79, 79, 81, 81, 79,
+    79, 78, 78, 78, 78, 81, 80, 80, 80, 78, 78, 78, 78, 78, 80, 80, 80, 81,
+    81, 79, 79, 79, 81, 79, 79, 78, 78, 78, 78, 457, 458, 80, 81, 459, 459,
+    459, 459, 459, 459, 459, 460, 459, 459, 459, 461, 462, 463, 464, 465,
+    466, 467, 468, 466, 469, 470, 38, 84, 471, 472, 473, 42, 471, 472, 473,
+    42, 38, 38, 474, 84, 475, 475, 475, 476, 477, 478, 479, 480, 481, 482,
+    483, 33, 484, 485, 484, 484, 485, 486, 487, 487, 84, 42, 50, 38, 488,
+    488, 474, 489, 489, 84, 84, 84, 490, 473, 491, 488, 488, 488, 84, 84, 84,
+    84, 84, 84, 84, 84, 492, 84, 489, 84, 373, 84, 373, 373, 373, 373, 84,
+    373, 373, 459, 493, 494, 494, 494, 494, 81, 495, 496, 497, 498, 499, 499,
+    499, 499, 499, 499, 500, 59, 81, 81, 47, 500, 500, 500, 500, 500, 501,
+    501, 492, 473, 491, 502, 500, 47, 47, 47, 47, 500, 500, 500, 500, 500,
+    501, 501, 492, 473, 491, 81, 59, 59, 59, 59, 59, 81, 81, 81, 278, 278,
+    278, 278, 278, 278, 278, 503, 278, 504, 278, 278, 36, 278, 278, 278, 278,
+    278, 278, 278, 278, 278, 503, 278, 278, 278, 278, 503, 278, 278, 503,
+    278, 505, 505, 505, 505, 505, 505, 505, 505, 96, 96, 447, 447, 96, 96,
+    96, 96, 447, 447, 447, 96, 96, 412, 412, 412, 412, 96, 412, 412, 412,
+    447, 447, 96, 156, 96, 447, 447, 156, 156, 156, 156, 96, 81, 81, 81, 81,
+    81, 81, 81, 40, 40, 506, 507, 40, 508, 40, 506, 40, 507, 49, 506, 506,
+    506, 49, 49, 506, 506, 506, 509, 40, 506, 510, 40, 492, 506, 506, 506,
+    506, 506, 40, 40, 40, 508, 508, 40, 506, 40, 85, 40, 506, 40, 52, 511,
+    506, 506, 512, 49, 506, 506, 52, 506, 49, 449, 449, 449, 449, 49, 40, 40,
+    49, 49, 506, 506, 492, 492, 492, 492, 492, 506, 49, 49, 49, 49, 40, 492,
+    40, 40, 56, 313, 513, 513, 513, 514, 51, 515, 513, 513, 513, 513, 513,
+    51, 514, 514, 51, 513, 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
+    516, 516, 517, 517, 517, 517, 516, 516, 517, 517, 517, 517, 517, 517,
+    517, 517, 517, 52, 56, 517, 517, 517, 517, 51, 40, 40, 81, 81, 81, 81,
+    54, 54, 54, 54, 54, 508, 508, 508, 508, 508, 492, 492, 40, 40, 40, 40,
+    492, 40, 40, 492, 40, 40, 492, 40, 40, 40, 40, 40, 40, 40, 492, 40, 40,
+    40, 40, 40, 40, 40, 40, 40, 44, 44, 40, 40, 40, 40, 40, 40, 40, 40, 40,
+    40, 40, 40, 492, 492, 40, 40, 54, 40, 54, 40, 40, 40, 40, 40, 40, 40, 40,
+    40, 40, 44, 40, 40, 40, 40, 492, 492, 492, 492, 492, 492, 492, 492, 492,
+    492, 492, 492, 54, 492, 54, 54, 492, 492, 492, 54, 54, 492, 492, 54, 492,
+    492, 492, 54, 492, 54, 518, 519, 492, 54, 492, 492, 492, 492, 54, 492,
+    492, 54, 54, 54, 54, 492, 492, 54, 492, 54, 492, 54, 54, 54, 54, 54, 54,
+    492, 54, 492, 492, 492, 492, 492, 54, 54, 54, 54, 492, 492, 492, 492, 54,
+    54, 492, 492, 54, 492, 492, 492, 54, 492, 492, 492, 492, 492, 54, 492,
+    492, 492, 492, 492, 54, 54, 492, 492, 54, 54, 54, 54, 492, 492, 54, 54,
+    492, 492, 54, 54, 492, 492, 492, 492, 492, 54, 492, 492, 492, 54, 492,
+    492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 54, 492, 492,
+    492, 492, 492, 492, 492, 520, 473, 491, 473, 491, 40, 40, 40, 40, 40, 40,
+    508, 40, 40, 40, 40, 40, 40, 40, 521, 521, 40, 40, 40, 40, 492, 492, 40,
+    40, 40, 40, 40, 40, 40, 522, 523, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
+    40, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 40,
+    492, 40, 40, 40, 40, 40, 40, 40, 40, 313, 40, 40, 40, 40, 40, 492, 492,
+    492, 492, 492, 492, 492, 492, 492, 40, 40, 40, 40, 40, 524, 524, 524,
+    524, 40, 40, 40, 521, 525, 525, 521, 40, 40, 40, 40, 40, 40, 40, 40, 40,
+    40, 40, 81, 40, 40, 40, 81, 81, 81, 81, 81, 51, 51, 51, 51, 51, 51, 51,
+    51, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 526, 526, 526, 526,
+    526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 515, 51, 51, 51, 51,
+    51, 51, 51, 51, 51, 51, 51, 51, 514, 508, 508, 508, 508, 508, 508, 508,
+    508, 508, 508, 508, 508, 40, 40, 40, 40, 508, 508, 508, 508, 527, 40, 40,
+    40, 40, 40, 508, 508, 508, 508, 40, 40, 508, 508, 40, 508, 508, 508, 508,
+    508, 508, 508, 40, 40, 40, 40, 40, 40, 40, 40, 508, 508, 40, 40, 508, 54,
+    40, 40, 40, 40, 508, 508, 40, 40, 508, 54, 40, 40, 40, 40, 508, 508, 508,
+    40, 40, 508, 40, 40, 508, 508, 40, 40, 40, 40, 40, 40, 40, 508, 492, 492,
+    492, 492, 492, 528, 528, 492, 525, 525, 525, 525, 40, 508, 508, 40, 40,
+    508, 40, 40, 40, 40, 508, 508, 40, 40, 40, 40, 521, 521, 527, 527, 525,
+    40, 525, 525, 529, 530, 529, 525, 40, 525, 525, 525, 40, 40, 40, 40, 508,
+    40, 508, 40, 40, 40, 40, 40, 524, 524, 524, 524, 524, 524, 524, 524, 524,
+    524, 524, 524, 40, 40, 40, 40, 508, 508, 40, 508, 508, 508, 40, 508, 529,
+    508, 508, 40, 508, 508, 40, 54, 40, 40, 40, 40, 40, 40, 40, 521, 40, 40,
+    40, 524, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 508, 508, 40, 524, 40,
+    40, 40, 40, 40, 40, 40, 40, 524, 524, 313, 40, 40, 40, 40, 40, 40, 40,
+    40, 521, 521, 529, 525, 525, 525, 525, 521, 521, 529, 529, 529, 508, 508,
+    508, 508, 529, 524, 529, 529, 529, 508, 529, 521, 508, 508, 508, 529,
+    529, 508, 508, 529, 508, 508, 529, 529, 529, 40, 508, 40, 40, 40, 40,
+    508, 508, 521, 508, 508, 508, 508, 508, 508, 529, 521, 521, 529, 521,
+    508, 529, 529, 531, 521, 508, 508, 521, 529, 529, 525, 525, 525, 525,
+    525, 524, 40, 40, 525, 525, 532, 532, 530, 530, 40, 40, 524, 40, 40, 40,
+    40, 40, 40, 40, 40, 40, 40, 40, 40, 44, 40, 40, 40, 40, 40, 40, 524, 40,
+    524, 40, 40, 40, 40, 524, 524, 524, 40, 533, 40, 40, 40, 534, 534, 534,
+    534, 534, 534, 40, 535, 535, 525, 40, 40, 40, 473, 491, 473, 491, 473,
+    491, 473, 491, 473, 491, 473, 491, 473, 491, 51, 51, 515, 515, 515, 515,
+    515, 515, 515, 515, 515, 515, 515, 515, 40, 524, 524, 524, 40, 40, 40,
+    40, 40, 40, 40, 524, 492, 492, 492, 492, 492, 473, 491, 492, 492, 492,
+    492, 492, 492, 492, 16, 31, 16, 31, 16, 31, 16, 31, 473, 491, 536, 536,
+    536, 536, 536, 536, 536, 536, 492, 492, 492, 473, 491, 16, 31, 473, 491,
+    473, 491, 473, 491, 473, 491, 473, 491, 492, 492, 492, 492, 492, 492,
+    492, 473, 491, 473, 491, 492, 492, 492, 492, 492, 492, 492, 492, 473,
+    491, 492, 492, 40, 40, 40, 524, 524, 40, 40, 40, 492, 492, 492, 492, 492,
+    40, 40, 492, 492, 492, 492, 492, 492, 40, 40, 40, 524, 40, 40, 40, 40,
+    533, 508, 508, 40, 40, 40, 40, 81, 81, 40, 40, 40, 40, 40, 40, 40, 40,
+    81, 81, 40, 40, 81, 81, 81, 40, 40, 40, 40, 81, 40, 40, 40, 40, 40, 40,
+    81, 81, 81, 81, 40, 40, 40, 40, 537, 537, 537, 537, 537, 537, 537, 537,
+    537, 537, 537, 537, 537, 537, 537, 81, 538, 538, 538, 538, 538, 538, 538,
+    538, 538, 538, 538, 538, 538, 538, 538, 81, 52, 56, 52, 52, 52, 56, 56,
+    52, 56, 52, 56, 52, 56, 52, 52, 52, 52, 56, 52, 56, 56, 52, 56, 56, 56,
+    56, 56, 56, 59, 59, 52, 52, 87, 88, 87, 88, 88, 539, 539, 539, 539, 539,
+    539, 87, 88, 87, 88, 540, 540, 540, 87, 88, 81, 81, 81, 81, 81, 541, 542,
+    542, 542, 543, 541, 542, 544, 544, 544, 544, 544, 544, 544, 544, 544,
+    544, 544, 544, 544, 544, 81, 544, 81, 81, 81, 81, 81, 544, 81, 81, 545,
+    545, 545, 545, 545, 545, 545, 545, 81, 81, 81, 81, 81, 81, 81, 546, 547,
+    81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 548, 95, 95, 95,
+    95, 95, 95, 95, 95, 549, 549, 42, 50, 42, 50, 549, 549, 549, 42, 50, 549,
+    42, 50, 373, 373, 373, 373, 373, 373, 373, 373, 84, 468, 550, 373, 551,
+    84, 42, 50, 84, 84, 42, 50, 473, 491, 473, 491, 473, 491, 473, 491, 373,
+    373, 373, 373, 371, 60, 373, 373, 84, 373, 373, 84, 84, 84, 84, 84, 552,
+    552, 373, 373, 373, 84, 468, 373, 473, 373, 373, 373, 373, 373, 373, 373,
+    81, 81, 81, 81, 81, 81, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553,
+    81, 553, 553, 553, 553, 553, 553, 553, 553, 553, 81, 81, 81, 81, 553,
+    553, 553, 553, 553, 553, 81, 81, 521, 521, 521, 521, 521, 521, 521, 521,
+    521, 521, 521, 521, 81, 81, 81, 81, 554, 555, 555, 556, 521, 557, 558,
+    559, 522, 523, 522, 523, 522, 523, 522, 523, 522, 523, 521, 521, 522,
+    523, 522, 523, 522, 523, 522, 523, 560, 522, 523, 523, 521, 559, 559,
+    559, 559, 559, 559, 559, 559, 559, 561, 562, 563, 564, 565, 565, 566,
+    567, 567, 567, 567, 568, 521, 521, 559, 559, 559, 557, 569, 556, 521,
+    525, 81, 570, 571, 570, 571, 570, 571, 570, 571, 570, 571, 571, 571, 571,
+    571, 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, 570,
+    571, 571, 571, 571, 571, 571, 571, 570, 571, 570, 571, 570, 571, 571,
+    571, 571, 571, 571, 570, 571, 571, 571, 571, 571, 571, 570, 570, 81, 81,
+    572, 572, 573, 573, 574, 574, 571, 560, 575, 576, 575, 576, 575, 576,
+    575, 576, 575, 576, 576, 576, 576, 576, 576, 576, 576, 576, 576, 576,
+    576, 576, 576, 576, 576, 576, 575, 576, 576, 576, 576, 576, 576, 576,
+    575, 576, 575, 576, 575, 576, 576, 576, 576, 576, 576, 575, 576, 576,
+    576, 576, 576, 576, 575, 575, 576, 576, 576, 576, 577, 578, 579, 579,
+    576, 81, 81, 81, 81, 81, 580, 580, 580, 580, 580, 580, 580, 580, 580,
+    580, 580, 580, 580, 580, 580, 580, 580, 580, 81, 81, 581, 581, 581, 581,
+    581, 581, 581, 581, 581, 581, 581, 581, 581, 581, 581, 581, 581, 581,
+    581, 581, 581, 581, 81, 582, 582, 583, 583, 583, 583, 582, 582, 582, 582,
+    582, 582, 582, 582, 582, 582, 580, 580, 580, 81, 81, 81, 81, 81, 575,
+    575, 575, 575, 575, 575, 575, 575, 584, 584, 584, 584, 584, 584, 584,
+    584, 584, 584, 584, 584, 584, 585, 585, 81, 583, 583, 583, 583, 583, 583,
+    583, 583, 583, 583, 582, 582, 582, 582, 582, 582, 586, 586, 586, 586,
+    586, 586, 586, 586, 521, 587, 587, 587, 587, 587, 587, 587, 587, 587,
+    587, 587, 587, 587, 587, 587, 584, 584, 584, 584, 585, 585, 585, 582,
+    582, 587, 587, 587, 587, 587, 587, 587, 582, 582, 582, 582, 521, 521,
+    521, 521, 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, 588,
+    588, 588, 588, 81, 582, 582, 582, 582, 582, 582, 582, 521, 521, 521, 521,
+    582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 521, 521, 589,
+    589, 589, 589, 589, 589, 589, 589, 589, 589, 589, 589, 589, 589, 590,
+    590, 590, 590, 590, 590, 590, 590, 590, 590, 589, 589, 589, 590, 590,
+    590, 590, 590, 591, 591, 591, 591, 591, 591, 591, 591, 591, 591, 591,
+    591, 591, 592, 591, 591, 591, 591, 591, 591, 591, 81, 81, 81, 593, 593,
+    593, 593, 593, 593, 593, 593, 593, 593, 593, 593, 593, 593, 593, 81, 594,
+    594, 594, 594, 594, 594, 594, 594, 595, 595, 595, 595, 595, 595, 596,
+    596, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 598,
+    599, 600, 599, 601, 601, 601, 601, 601, 601, 601, 601, 601, 601, 597,
+    597, 81, 81, 81, 81, 90, 93, 90, 93, 90, 93, 602, 95, 97, 97, 97, 603,
+    95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 603, 604, 90, 93, 90, 93, 450,
+    450, 95, 95, 605, 605, 605, 605, 605, 605, 605, 605, 605, 605, 605, 605,
+    605, 605, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 607, 607,
+    608, 609, 609, 609, 609, 609, 62, 62, 62, 62, 62, 62, 62, 60, 60, 60, 60,
+    60, 60, 60, 60, 60, 62, 62, 52, 56, 52, 56, 52, 56, 56, 56, 52, 56, 52,
+    56, 52, 56, 59, 56, 56, 56, 56, 56, 56, 56, 56, 52, 56, 52, 56, 52, 52,
+    56, 60, 610, 610, 52, 56, 52, 56, 57, 52, 56, 52, 56, 56, 56, 52, 56, 52,
+    56, 52, 52, 52, 52, 52, 81, 52, 52, 52, 52, 52, 56, 52, 56, 81, 81, 81,
+    81, 81, 81, 81, 57, 59, 59, 56, 57, 57, 57, 57, 57, 611, 611, 612, 611,
+    611, 611, 613, 611, 611, 611, 611, 612, 611, 611, 611, 611, 611, 611,
+    611, 611, 611, 611, 611, 611, 611, 611, 611, 614, 614, 612, 612, 614,
+    615, 615, 615, 615, 81, 81, 81, 81, 616, 616, 616, 616, 616, 616, 313,
+    313, 503, 512, 81, 81, 81, 81, 81, 81, 617, 617, 617, 617, 617, 617, 617,
+    617, 617, 617, 617, 617, 618, 618, 619, 619, 620, 620, 621, 621, 621,
+    621, 621, 621, 621, 621, 621, 621, 621, 621, 621, 621, 621, 621, 621,
+    621, 620, 620, 620, 620, 620, 620, 620, 620, 620, 620, 620, 620, 620,
+    620, 620, 620, 622, 623, 81, 81, 81, 81, 81, 81, 81, 81, 624, 624, 625,
+    625, 625, 625, 625, 625, 625, 625, 625, 625, 81, 81, 81, 81, 81, 81, 197,
+    197, 197, 197, 197, 197, 197, 197, 197, 197, 194, 194, 194, 194, 194,
+    194, 200, 200, 200, 194, 626, 194, 81, 81, 627, 627, 627, 627, 627, 627,
+    627, 627, 627, 627, 628, 628, 628, 628, 628, 628, 628, 628, 628, 628,
+    628, 628, 628, 628, 628, 628, 628, 628, 628, 628, 629, 629, 629, 629,
+    629, 630, 630, 630, 198, 631, 632, 632, 632, 632, 632, 632, 632, 632,
+    632, 632, 632, 632, 632, 632, 632, 633, 633, 633, 633, 633, 633, 633,
+    633, 633, 633, 633, 634, 635, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+    636, 328, 328, 328, 328, 328, 81, 81, 81, 637, 637, 637, 638, 639, 639,
+    639, 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, 640,
+    638, 638, 637, 637, 637, 637, 638, 638, 637, 638, 638, 638, 641, 642,
+    642, 642, 642, 642, 642, 643, 643, 643, 642, 642, 642, 642, 81, 61, 644,
+    644, 644, 644, 644, 644, 644, 644, 644, 644, 81, 81, 81, 81, 642, 642,
+    314, 314, 314, 314, 314, 316, 645, 314, 319, 319, 314, 314, 314, 314,
+    314, 81, 646, 646, 646, 646, 646, 646, 646, 646, 646, 647, 647, 647, 647,
+    647, 647, 648, 648, 647, 647, 648, 648, 647, 647, 81, 646, 646, 646, 647,
+    646, 646, 646, 646, 646, 646, 646, 646, 647, 648, 81, 81, 649, 649, 649,
+    649, 649, 649, 649, 649, 649, 649, 81, 81, 650, 651, 651, 651, 645, 314,
+    314, 314, 314, 314, 314, 323, 323, 323, 314, 315, 316, 315, 314, 314,
+    652, 652, 652, 652, 652, 652, 652, 652, 653, 652, 653, 653, 654, 652,
+    652, 653, 653, 652, 652, 652, 652, 652, 653, 653, 652, 653, 652, 81, 81,
+    81, 81, 81, 81, 81, 81, 652, 652, 655, 656, 656, 657, 657, 657, 657, 657,
+    657, 657, 657, 657, 657, 657, 658, 659, 659, 658, 658, 660, 660, 657,
+    661, 661, 658, 662, 81, 81, 331, 331, 331, 331, 331, 331, 81, 56, 56, 56,
+    610, 59, 59, 59, 59, 56, 56, 56, 56, 56, 79, 81, 81, 338, 338, 338, 338,
+    338, 338, 338, 338, 657, 657, 657, 658, 658, 659, 658, 658, 659, 658,
+    658, 660, 658, 662, 81, 81, 663, 663, 663, 663, 663, 663, 663, 663, 663,
+    663, 81, 81, 81, 81, 81, 81, 664, 665, 665, 665, 665, 665, 665, 665, 665,
+    665, 665, 665, 665, 665, 665, 665, 665, 665, 665, 665, 664, 665, 665,
+    665, 665, 665, 665, 665, 81, 81, 81, 81, 329, 329, 329, 329, 329, 329,
+    329, 81, 81, 81, 81, 330, 330, 330, 330, 330, 330, 330, 330, 330, 81, 81,
+    81, 81, 666, 666, 666, 666, 666, 666, 666, 666, 667, 667, 667, 667, 667,
+    667, 667, 667, 589, 589, 590, 590, 590, 590, 590, 590, 56, 56, 56, 56,
+    56, 56, 56, 81, 81, 81, 81, 101, 101, 101, 101, 101, 81, 81, 81, 81, 81,
+    129, 668, 129, 129, 669, 129, 129, 129, 129, 129, 129, 129, 129, 129,
+    129, 129, 129, 129, 81, 129, 129, 129, 129, 129, 81, 129, 81, 129, 129,
+    81, 129, 129, 81, 129, 129, 146, 146, 670, 670, 670, 670, 670, 670, 670,
+    670, 670, 670, 670, 670, 670, 670, 670, 670, 81, 81, 81, 81, 81, 81, 81,
+    81, 81, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 491, 473,
+    81, 81, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 135, 138, 81,
+    81, 671, 671, 671, 671, 671, 671, 671, 671, 672, 555, 555, 672, 672, 673,
+    673, 522, 523, 674, 81, 81, 81, 81, 81, 81, 96, 96, 96, 96, 96, 96, 96,
+    156, 156, 156, 156, 156, 156, 156, 95, 95, 556, 566, 566, 675, 675, 522,
+    523, 522, 523, 522, 523, 522, 523, 522, 523, 522, 523, 522, 523, 522,
+    523, 556, 556, 522, 523, 556, 556, 556, 556, 675, 675, 675, 676, 556,
+    676, 81, 577, 677, 673, 673, 566, 522, 523, 522, 523, 522, 523, 678, 556,
+    556, 679, 680, 681, 681, 681, 81, 556, 682, 683, 556, 81, 81, 81, 81,
+    146, 146, 146, 146, 146, 81, 81, 493, 81, 684, 685, 686, 687, 688, 685,
+    685, 689, 690, 685, 691, 692, 693, 692, 694, 695, 695, 695, 695, 695,
+    695, 695, 695, 695, 695, 696, 697, 698, 698, 698, 684, 685, 699, 699,
+    699, 699, 699, 699, 699, 699, 699, 699, 699, 699, 699, 699, 699, 699,
+    699, 699, 689, 685, 690, 700, 701, 700, 702, 702, 702, 702, 702, 702,
+    702, 702, 702, 702, 702, 702, 702, 702, 702, 702, 702, 702, 689, 698,
+    690, 698, 689, 690, 703, 704, 705, 703, 706, 707, 708, 708, 708, 708,
+    708, 708, 708, 708, 708, 709, 707, 707, 707, 707, 707, 707, 707, 707,
+    707, 707, 707, 707, 707, 707, 707, 707, 707, 707, 707, 707, 707, 710,
+    710, 711, 711, 711, 711, 711, 711, 711, 711, 711, 711, 711, 711, 711,
+    711, 711, 81, 81, 81, 711, 711, 711, 711, 711, 711, 81, 81, 711, 711,
+    711, 81, 81, 81, 712, 687, 698, 700, 713, 687, 687, 81, 714, 715, 715,
+    715, 715, 714, 714, 81, 81, 716, 716, 716, 717, 508, 81, 81, 718, 718,
+    718, 718, 718, 718, 718, 718, 718, 718, 718, 718, 81, 718, 718, 718, 718,
+    718, 718, 718, 718, 718, 718, 81, 718, 718, 718, 81, 718, 718, 81, 718,
+    718, 718, 718, 718, 718, 718, 81, 81, 718, 718, 718, 81, 81, 81, 81, 81,
+    198, 373, 198, 81, 81, 81, 81, 616, 616, 616, 616, 616, 616, 616, 616,
+    616, 616, 616, 616, 616, 81, 81, 81, 313, 719, 719, 719, 719, 719, 719,
+    719, 719, 719, 719, 719, 719, 719, 720, 720, 720, 720, 721, 721, 721,
+    721, 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, 721,
+    720, 720, 721, 722, 722, 81, 40, 40, 40, 40, 81, 81, 81, 81, 721, 81, 81,
+    81, 81, 81, 81, 81, 313, 313, 313, 313, 313, 156, 81, 81, 723, 723, 723,
+    723, 723, 723, 723, 723, 723, 723, 723, 723, 723, 81, 81, 81, 724, 724,
+    724, 724, 724, 724, 724, 724, 724, 81, 81, 81, 81, 81, 81, 81, 156, 500,
+    500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500,
+    500, 500, 500, 500, 81, 81, 81, 81, 725, 725, 725, 725, 725, 725, 725,
+    725, 726, 726, 726, 726, 81, 81, 81, 81, 81, 81, 81, 81, 81, 725, 725,
+    725, 727, 727, 727, 727, 727, 727, 727, 727, 727, 728, 727, 727, 727,
+    727, 727, 727, 727, 727, 728, 81, 81, 81, 81, 81, 729, 729, 729, 729,
+    729, 729, 729, 729, 729, 729, 729, 729, 729, 729, 730, 730, 730, 730,
+    730, 81, 81, 81, 81, 81, 731, 731, 731, 731, 731, 731, 731, 731, 731,
+    731, 731, 731, 731, 731, 81, 732, 733, 733, 733, 733, 733, 733, 733, 733,
+    733, 733, 733, 733, 81, 81, 81, 81, 734, 735, 735, 735, 735, 735, 81, 81,
+    736, 736, 736, 736, 736, 736, 736, 736, 737, 737, 737, 737, 737, 737,
+    737, 737, 738, 738, 738, 738, 738, 738, 738, 738, 739, 739, 739, 739,
+    739, 739, 739, 739, 739, 739, 739, 739, 739, 739, 81, 81, 740, 740, 740,
+    740, 740, 740, 740, 740, 740, 740, 81, 81, 81, 81, 81, 81, 741, 741, 741,
+    741, 741, 741, 741, 741, 741, 741, 741, 741, 81, 81, 81, 81, 742, 742,
+    742, 742, 742, 742, 742, 742, 742, 742, 742, 742, 81, 81, 81, 81, 743,
+    743, 743, 743, 743, 743, 743, 743, 744, 744, 744, 744, 744, 744, 744,
+    744, 744, 744, 744, 744, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 745,
+    746, 746, 746, 746, 746, 746, 746, 746, 746, 746, 746, 746, 746, 746,
+    746, 81, 746, 746, 746, 746, 746, 746, 81, 81, 747, 747, 747, 747, 747,
+    747, 81, 81, 747, 81, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747,
+    747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 81, 747, 747, 81, 81,
+    81, 747, 81, 81, 747, 748, 748, 748, 748, 748, 748, 748, 748, 748, 748,
+    748, 748, 748, 748, 81, 749, 750, 750, 750, 750, 750, 750, 750, 750, 751,
+    751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751,
+    752, 752, 753, 753, 753, 753, 753, 753, 753, 754, 754, 754, 754, 754,
+    754, 754, 754, 754, 754, 754, 754, 754, 754, 754, 81, 81, 81, 81, 81, 81,
+    81, 81, 755, 755, 755, 755, 755, 755, 755, 755, 755, 756, 756, 756, 756,
+    756, 756, 756, 756, 756, 756, 756, 81, 756, 756, 81, 81, 81, 81, 81, 757,
+    757, 757, 757, 757, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758,
+    758, 758, 758, 758, 759, 759, 759, 759, 759, 759, 81, 81, 81, 760, 761,
+    761, 761, 761, 761, 761, 761, 761, 761, 761, 81, 81, 81, 81, 81, 762,
+    763, 763, 763, 763, 763, 763, 763, 763, 764, 764, 764, 764, 764, 764,
+    764, 764, 81, 81, 81, 81, 765, 765, 764, 764, 765, 765, 765, 765, 765,
+    765, 765, 765, 81, 81, 765, 765, 765, 765, 765, 765, 766, 767, 767, 767,
+    81, 767, 767, 81, 81, 81, 81, 81, 767, 768, 767, 769, 766, 766, 766, 766,
+    81, 766, 766, 766, 81, 766, 766, 766, 766, 766, 766, 766, 766, 766, 766,
+    766, 766, 766, 766, 766, 766, 766, 766, 766, 81, 81, 81, 81, 769, 770,
+    768, 81, 81, 81, 81, 771, 772, 772, 772, 772, 772, 772, 772, 772, 773,
+    773, 773, 773, 773, 773, 773, 773, 774, 81, 81, 81, 81, 81, 81, 81, 775,
+    775, 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, 776, 776,
+    777, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778,
+    779, 779, 779, 780, 780, 780, 780, 780, 780, 780, 780, 781, 780, 780,
+    780, 780, 780, 780, 780, 780, 780, 780, 780, 780, 782, 783, 81, 81, 81,
+    81, 784, 784, 784, 784, 784, 785, 785, 785, 785, 785, 785, 786, 81, 787,
+    787, 787, 787, 787, 787, 787, 787, 787, 787, 787, 787, 787, 787, 81, 81,
+    81, 788, 788, 788, 788, 788, 788, 788, 789, 789, 789, 789, 789, 789, 789,
+    789, 789, 789, 789, 789, 789, 789, 81, 81, 790, 790, 790, 790, 790, 790,
+    790, 790, 791, 791, 791, 791, 791, 791, 791, 791, 791, 791, 791, 81, 81,
+    81, 81, 81, 792, 792, 792, 792, 792, 792, 792, 792, 793, 793, 793, 793,
+    793, 793, 793, 793, 793, 793, 81, 81, 81, 81, 81, 81, 81, 794, 794, 794,
+    794, 81, 81, 81, 81, 795, 795, 795, 795, 795, 795, 795, 796, 796, 796,
+    796, 796, 796, 796, 796, 796, 81, 81, 81, 81, 81, 81, 81, 797, 797, 797,
+    797, 797, 797, 797, 797, 797, 797, 797, 81, 81, 81, 81, 81, 798, 798,
+    798, 798, 798, 798, 798, 798, 798, 798, 798, 81, 81, 81, 81, 81, 81, 81,
+    799, 799, 799, 799, 799, 799, 800, 800, 800, 800, 800, 800, 800, 800,
+    800, 800, 800, 800, 800, 800, 800, 81, 801, 802, 801, 803, 803, 803, 803,
+    803, 803, 803, 803, 803, 803, 803, 803, 803, 802, 802, 802, 802, 802,
+    802, 802, 802, 802, 802, 802, 802, 802, 802, 804, 805, 805, 806, 806,
+    806, 806, 806, 81, 81, 81, 81, 807, 807, 807, 807, 807, 807, 807, 807,
+    807, 807, 807, 807, 807, 807, 807, 807, 807, 807, 807, 807, 808, 808,
+    808, 808, 808, 808, 808, 808, 808, 808, 81, 81, 81, 81, 81, 81, 81, 804,
+    809, 809, 810, 811, 811, 811, 811, 811, 811, 811, 811, 811, 811, 811,
+    811, 811, 810, 810, 810, 809, 809, 809, 809, 810, 810, 812, 813, 814,
+    814, 815, 816, 816, 816, 816, 81, 81, 81, 81, 81, 81, 817, 817, 817, 817,
+    817, 817, 817, 817, 817, 81, 81, 81, 81, 81, 81, 81, 818, 818, 818, 818,
+    818, 818, 818, 818, 818, 818, 81, 81, 81, 81, 81, 81, 819, 819, 819, 820,
+    820, 820, 820, 820, 820, 820, 820, 820, 820, 820, 820, 820, 820, 820,
+    820, 820, 820, 820, 820, 821, 821, 821, 821, 821, 822, 821, 821, 821,
+    821, 821, 821, 823, 823, 81, 824, 824, 824, 824, 824, 824, 824, 824, 824,
+    824, 825, 825, 825, 825, 81, 81, 81, 81, 826, 826, 826, 826, 826, 826,
+    826, 826, 826, 826, 826, 827, 828, 829, 826, 81, 830, 830, 831, 832, 832,
+    832, 832, 832, 832, 832, 832, 832, 832, 832, 832, 832, 832, 832, 832,
+    831, 831, 831, 830, 830, 830, 830, 830, 830, 830, 830, 830, 831, 833,
+    832, 832, 832, 832, 834, 834, 835, 834, 835, 836, 830, 830, 835, 81, 81,
+    837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 832, 838, 832, 834,
+    834, 834, 81, 839, 839, 839, 839, 839, 839, 839, 839, 839, 839, 839, 839,
+    839, 839, 839, 839, 839, 839, 839, 839, 81, 81, 81, 840, 840, 840, 840,
+    840, 840, 840, 840, 840, 840, 81, 840, 840, 840, 840, 840, 840, 840, 840,
+    840, 841, 841, 841, 842, 842, 842, 841, 841, 842, 843, 844, 842, 845,
+    845, 846, 845, 845, 846, 842, 81, 847, 847, 847, 847, 847, 847, 847, 81,
+    847, 81, 847, 847, 847, 847, 81, 847, 847, 847, 847, 847, 847, 847, 847,
+    847, 847, 847, 847, 847, 847, 847, 81, 847, 847, 848, 81, 81, 81, 81, 81,
+    81, 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, 849,
+    849, 850, 851, 851, 851, 850, 850, 850, 850, 850, 850, 852, 853, 81, 81,
+    81, 81, 81, 854, 854, 854, 854, 854, 854, 854, 854, 854, 854, 81, 81, 81,
+    81, 81, 81, 855, 855, 856, 856, 81, 857, 857, 857, 857, 857, 857, 857,
+    857, 81, 81, 857, 857, 81, 81, 857, 857, 857, 857, 857, 857, 857, 857,
+    857, 857, 857, 857, 857, 857, 81, 857, 857, 857, 857, 857, 857, 857, 81,
+    857, 857, 81, 857, 857, 857, 857, 857, 81, 81, 858, 857, 856, 856, 855,
+    856, 856, 856, 856, 81, 81, 856, 856, 81, 81, 856, 856, 859, 81, 81, 857,
+    81, 81, 81, 81, 81, 81, 856, 81, 81, 81, 81, 81, 857, 857, 857, 857, 857,
+    856, 856, 81, 81, 860, 860, 860, 860, 860, 860, 860, 81, 81, 81, 861,
+    861, 861, 861, 861, 861, 861, 861, 861, 861, 861, 861, 861, 862, 862,
+    862, 863, 863, 863, 863, 863, 863, 863, 863, 862, 862, 864, 863, 863,
+    862, 865, 861, 861, 861, 861, 866, 866, 866, 866, 867, 868, 868, 868,
+    868, 868, 868, 868, 868, 868, 868, 81, 866, 81, 867, 81, 81, 869, 869,
+    869, 869, 869, 869, 869, 869, 870, 870, 870, 871, 871, 871, 871, 871,
+    871, 870, 871, 870, 870, 870, 870, 871, 871, 870, 872, 873, 869, 869,
+    874, 869, 875, 875, 875, 875, 875, 875, 875, 875, 875, 875, 81, 81, 81,
+    81, 81, 81, 876, 876, 876, 876, 876, 876, 876, 876, 876, 876, 876, 876,
+    876, 876, 876, 877, 877, 877, 878, 878, 878, 878, 81, 81, 877, 877, 877,
+    877, 878, 878, 877, 879, 880, 881, 882, 882, 883, 883, 884, 884, 884,
+    882, 882, 882, 882, 882, 882, 882, 882, 882, 882, 882, 882, 882, 882,
+    882, 876, 876, 876, 876, 878, 878, 81, 81, 885, 885, 885, 885, 885, 885,
+    885, 885, 886, 886, 886, 887, 887, 887, 887, 887, 887, 887, 887, 886,
+    886, 887, 886, 888, 887, 889, 889, 890, 885, 81, 81, 81, 891, 891, 891,
+    891, 891, 891, 891, 891, 891, 891, 81, 81, 81, 81, 81, 81, 892, 892, 892,
+    892, 892, 892, 892, 892, 892, 892, 892, 892, 892, 81, 81, 81, 893, 893,
+    893, 893, 893, 893, 893, 893, 893, 893, 893, 894, 895, 894, 895, 895,
+    894, 894, 894, 894, 894, 894, 896, 897, 898, 898, 898, 898, 898, 898,
+    898, 898, 898, 898, 81, 81, 81, 81, 81, 81, 899, 899, 899, 899, 899, 899,
+    899, 899, 899, 899, 81, 81, 81, 900, 900, 900, 901, 901, 900, 900, 900,
+    900, 901, 900, 900, 900, 900, 902, 81, 81, 81, 81, 903, 903, 903, 903,
+    903, 903, 903, 903, 903, 903, 904, 904, 905, 905, 905, 906, 907, 907,
+    907, 907, 907, 907, 907, 907, 908, 908, 908, 908, 908, 908, 908, 908,
+    909, 909, 909, 909, 909, 909, 909, 909, 909, 909, 910, 910, 910, 910,
+    910, 910, 910, 910, 910, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+    911, 912, 913, 913, 913, 913, 913, 913, 914, 914, 913, 913, 912, 912,
+    912, 912, 912, 912, 912, 912, 912, 912, 912, 912, 912, 912, 912, 912,
+    913, 915, 913, 913, 913, 913, 914, 912, 913, 913, 913, 913, 916, 917,
+    918, 918, 918, 918, 916, 917, 915, 919, 920, 920, 920, 920, 920, 920,
+    921, 921, 920, 920, 920, 919, 919, 919, 919, 919, 919, 919, 919, 919,
+    919, 919, 919, 919, 919, 919, 919, 81, 81, 919, 919, 919, 919, 920, 920,
+    920, 920, 920, 920, 920, 920, 920, 920, 920, 920, 920, 921, 920, 922,
+    923, 923, 923, 81, 924, 924, 924, 923, 923, 81, 81, 81, 81, 81, 925, 925,
+    925, 925, 925, 925, 925, 925, 925, 81, 81, 81, 81, 81, 81, 81, 926, 926,
+    926, 926, 926, 926, 926, 926, 926, 81, 926, 926, 926, 926, 926, 926, 926,
+    926, 926, 926, 926, 926, 926, 927, 928, 928, 928, 928, 928, 928, 928, 81,
+    928, 928, 928, 928, 928, 928, 927, 929, 926, 930, 930, 930, 930, 930, 81,
+    81, 931, 931, 931, 931, 931, 931, 931, 931, 931, 931, 932, 932, 932, 932,
+    932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932,
+    932, 81, 81, 81, 933, 934, 935, 935, 935, 935, 935, 935, 935, 935, 935,
+    935, 935, 935, 935, 935, 81, 81, 936, 936, 936, 936, 936, 936, 936, 936,
+    936, 936, 936, 936, 936, 936, 81, 937, 936, 936, 936, 936, 936, 936, 936,
+    937, 936, 936, 937, 936, 936, 81, 938, 938, 938, 938, 938, 938, 938, 81,
+    938, 938, 81, 938, 938, 938, 938, 938, 938, 938, 938, 938, 938, 938, 938,
+    938, 938, 939, 939, 939, 939, 939, 939, 81, 81, 81, 939, 81, 939, 939,
+    81, 939, 939, 939, 940, 939, 941, 941, 938, 939, 942, 942, 942, 942, 942,
+    942, 942, 942, 942, 942, 81, 81, 81, 81, 81, 81, 943, 943, 943, 943, 943,
+    943, 943, 943, 943, 943, 81, 81, 81, 81, 81, 81, 944, 944, 944, 944, 944,
+    944, 944, 944, 944, 944, 944, 944, 944, 944, 944, 81, 945, 945, 945, 945,
+    945, 81, 81, 81, 943, 943, 943, 943, 81, 81, 81, 81, 946, 946, 946, 946,
+    946, 946, 946, 946, 947, 947, 947, 948, 948, 948, 946, 946, 946, 946,
+    948, 946, 946, 946, 947, 948, 947, 948, 946, 946, 946, 946, 946, 946,
+    946, 947, 948, 948, 946, 946, 946, 946, 946, 946, 946, 946, 946, 946,
+    946, 81, 949, 949, 949, 949, 949, 949, 949, 949, 949, 949, 949, 949, 949,
+    949, 950, 951, 949, 949, 949, 949, 949, 949, 949, 81, 605, 81, 81, 81,
+    81, 81, 81, 81, 952, 952, 952, 952, 952, 952, 952, 952, 952, 952, 952,
+    952, 952, 952, 952, 81, 953, 953, 953, 953, 953, 953, 953, 953, 953, 953,
+    81, 81, 81, 81, 954, 954, 955, 955, 955, 955, 955, 955, 955, 955, 955,
+    955, 955, 955, 955, 955, 81, 81, 956, 956, 956, 956, 956, 957, 81, 81,
+    958, 958, 958, 958, 958, 958, 958, 958, 959, 959, 959, 959, 959, 959,
+    959, 960, 960, 960, 961, 961, 962, 962, 962, 962, 963, 963, 963, 963,
+    960, 962, 81, 81, 964, 964, 964, 964, 964, 964, 964, 964, 964, 964, 81,
+    965, 965, 965, 965, 965, 965, 965, 81, 958, 958, 958, 958, 958, 81, 81,
+    81, 81, 81, 958, 958, 958, 966, 966, 966, 966, 966, 966, 966, 966, 966,
+    966, 966, 966, 966, 81, 81, 81, 966, 967, 967, 967, 967, 967, 967, 967,
+    967, 967, 967, 967, 967, 967, 967, 967, 967, 967, 967, 967, 967, 967,
+    967, 81, 81, 81, 81, 81, 81, 81, 81, 968, 968, 968, 968, 969, 969, 969,
+    969, 969, 969, 969, 969, 969, 969, 969, 969, 969, 970, 971, 81, 81, 81,
+    81, 81, 81, 972, 972, 972, 972, 972, 972, 972, 972, 972, 972, 972, 972,
+    972, 81, 81, 81, 972, 972, 972, 81, 81, 81, 81, 81, 576, 571, 571, 571,
+    571, 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, 81, 973, 973, 973,
+    973, 973, 973, 973, 973, 973, 973, 973, 973, 81, 81, 81, 81, 974, 974,
+    974, 974, 974, 974, 974, 974, 974, 974, 974, 81, 81, 81, 81, 81, 974,
+    974, 974, 974, 974, 81, 81, 81, 974, 81, 81, 81, 81, 81, 81, 81, 974,
+    974, 81, 81, 975, 976, 977, 978, 499, 499, 499, 499, 81, 81, 81, 81, 313,
+    313, 313, 313, 313, 313, 81, 81, 313, 313, 313, 313, 313, 313, 313, 81,
+    81, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 979, 979,
+    447, 447, 447, 313, 313, 313, 980, 979, 979, 979, 979, 979, 499, 499,
+    499, 499, 499, 499, 499, 499, 156, 156, 156, 156, 156, 156, 156, 156,
+    313, 313, 96, 96, 96, 96, 96, 156, 156, 313, 313, 313, 313, 313, 313, 96,
+    96, 96, 96, 313, 313, 313, 81, 81, 81, 81, 81, 81, 81, 721, 721, 981,
+    981, 981, 721, 81, 81, 616, 616, 81, 81, 81, 81, 81, 81, 506, 506, 506,
+    506, 506, 506, 506, 506, 506, 506, 49, 49, 49, 49, 49, 49, 49, 49, 49,
+    49, 49, 49, 49, 49, 49, 49, 49, 49, 506, 506, 506, 506, 506, 506, 506,
+    506, 506, 506, 49, 49, 49, 49, 49, 49, 49, 81, 49, 49, 49, 49, 49, 49,
+    506, 81, 506, 506, 81, 81, 506, 81, 81, 506, 506, 81, 81, 506, 506, 506,
+    506, 81, 506, 506, 49, 49, 81, 49, 81, 49, 49, 49, 49, 49, 49, 49, 81,
+    49, 49, 49, 49, 49, 49, 49, 506, 506, 81, 506, 506, 506, 506, 81, 81,
+    506, 506, 506, 506, 506, 506, 506, 506, 81, 506, 506, 506, 506, 506, 506,
+    506, 81, 49, 49, 506, 506, 81, 506, 506, 506, 506, 81, 506, 506, 506,
+    506, 506, 81, 506, 81, 81, 81, 506, 506, 506, 506, 506, 506, 506, 81, 49,
+    49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 81, 81, 506, 982, 49, 49, 49,
+    49, 49, 49, 49, 49, 49, 492, 49, 49, 49, 49, 49, 49, 506, 506, 506, 506,
+    506, 506, 506, 506, 506, 982, 49, 49, 49, 49, 49, 49, 49, 49, 49, 492,
+    49, 49, 506, 506, 506, 506, 506, 982, 49, 49, 49, 49, 49, 49, 49, 49, 49,
+    492, 49, 49, 49, 49, 49, 49, 506, 506, 506, 506, 506, 506, 506, 506, 506,
+    982, 49, 492, 49, 49, 49, 49, 49, 49, 49, 49, 506, 49, 81, 81, 983, 983,
+    983, 983, 983, 983, 983, 983, 983, 983, 984, 984, 984, 984, 984, 984,
+    984, 984, 985, 985, 985, 985, 985, 985, 985, 985, 985, 985, 985, 985,
+    985, 985, 985, 984, 984, 984, 984, 985, 985, 985, 985, 985, 985, 985,
+    985, 985, 985, 984, 984, 984, 984, 984, 984, 984, 984, 985, 984, 984,
+    984, 984, 984, 984, 985, 984, 984, 986, 986, 986, 986, 987, 81, 81, 81,
+    81, 81, 81, 81, 985, 985, 985, 985, 985, 81, 985, 985, 985, 985, 985,
+    985, 985, 988, 988, 988, 988, 988, 988, 988, 81, 988, 988, 988, 988, 988,
+    988, 988, 988, 988, 81, 81, 988, 988, 988, 988, 988, 988, 988, 81, 988,
+    988, 81, 988, 988, 988, 988, 988, 81, 81, 81, 81, 81, 989, 989, 989, 989,
+    989, 989, 989, 989, 989, 989, 989, 989, 989, 81, 81, 990, 990, 990, 990,
+    990, 990, 990, 990, 990, 991, 991, 991, 991, 991, 991, 991, 81, 992, 992,
+    992, 992, 992, 992, 992, 992, 992, 992, 993, 993, 993, 993, 993, 993,
+    993, 993, 993, 993, 993, 993, 993, 993, 993, 993, 993, 993, 994, 994,
+    994, 994, 994, 994, 995, 81, 81, 81, 81, 81, 996, 996, 996, 996, 996,
+    996, 996, 996, 996, 996, 81, 81, 81, 81, 997, 997, 146, 146, 146, 146,
+    81, 146, 146, 146, 81, 146, 146, 81, 146, 81, 81, 146, 81, 146, 146, 146,
+    146, 146, 146, 146, 146, 146, 146, 81, 146, 146, 146, 146, 81, 146, 81,
+    146, 81, 81, 81, 81, 81, 81, 146, 81, 81, 81, 81, 146, 81, 146, 81, 146,
+    81, 146, 146, 146, 81, 146, 81, 146, 81, 146, 81, 146, 81, 146, 146, 146,
+    146, 81, 146, 81, 146, 146, 81, 146, 146, 146, 146, 146, 146, 146, 146,
+    146, 81, 81, 81, 81, 81, 146, 146, 146, 81, 146, 146, 146, 132, 132, 81,
+    81, 81, 81, 81, 81, 525, 525, 525, 525, 521, 525, 525, 525, 525, 525,
+    525, 525, 525, 525, 525, 525, 525, 525, 525, 525, 998, 998, 998, 998,
+    998, 998, 998, 998, 998, 998, 998, 998, 525, 525, 525, 525, 525, 525,
+    525, 998, 998, 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
+    525, 525, 525, 521, 525, 525, 525, 525, 525, 525, 998, 998, 47, 47, 47,
+    515, 515, 998, 998, 998, 526, 526, 526, 526, 526, 526, 313, 998, 526,
+    526, 40, 40, 998, 998, 998, 998, 526, 526, 526, 526, 526, 526, 999, 526,
+    526, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 526, 526, 526,
+    526, 526, 526, 526, 526, 526, 526, 998, 998, 998, 998, 998, 998, 998,
+    998, 998, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000,
+    1001, 582, 582, 998, 998, 998, 998, 998, 582, 582, 582, 582, 998, 998,
+    998, 998, 582, 998, 998, 998, 998, 998, 998, 998, 582, 582, 998, 998,
+    998, 998, 998, 998, 521, 521, 521, 521, 521, 521, 998, 998, 521, 525,
+    525, 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, 521, 521, 521,
+    521, 521, 521, 521, 521, 521, 525, 521, 521, 521, 521, 521, 521, 525,
+    521, 521, 521, 521, 521, 521, 521, 532, 521, 521, 521, 521, 521, 521,
+    525, 525, 525, 525, 525, 525, 525, 525, 40, 40, 525, 525, 521, 521, 521,
+    521, 521, 524, 524, 521, 521, 521, 521, 521, 524, 521, 521, 521, 521,
+    521, 532, 532, 532, 521, 521, 532, 521, 521, 532, 530, 530, 525, 525,
+    521, 521, 525, 525, 525, 521, 525, 525, 525, 521, 521, 521, 1002, 1002,
+    1002, 1002, 1002, 521, 521, 521, 521, 521, 521, 521, 525, 521, 525, 532,
+    532, 521, 521, 532, 532, 532, 532, 532, 532, 532, 532, 532, 532, 532,
+    521, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, 532,
+    532, 532, 532, 521, 521, 521, 521, 532, 521, 532, 521, 521, 521, 532,
+    521, 521, 521, 521, 532, 532, 532, 521, 532, 532, 532, 524, 521, 524,
+    521, 524, 521, 521, 521, 521, 521, 532, 521, 521, 521, 521, 524, 521,
+    524, 524, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, 525, 525,
+    521, 524, 524, 524, 524, 524, 524, 524, 521, 521, 521, 521, 521, 521,
+    521, 521, 524, 524, 524, 524, 524, 524, 521, 521, 521, 521, 521, 524,
+    524, 524, 524, 524, 524, 524, 524, 524, 524, 524, 524, 40, 40, 40, 40,
+    525, 521, 521, 521, 521, 525, 525, 525, 525, 525, 530, 530, 525, 525,
+    525, 525, 532, 525, 525, 525, 525, 525, 530, 525, 525, 525, 525, 532,
+    532, 525, 525, 525, 525, 525, 40, 40, 40, 40, 40, 40, 40, 40, 525, 525,
+    525, 525, 40, 40, 525, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521,
+    532, 532, 532, 521, 521, 521, 532, 532, 532, 532, 532, 40, 40, 40, 40,
+    40, 40, 534, 534, 534, 1003, 1003, 1003, 40, 40, 40, 40, 521, 521, 521,
+    532, 521, 521, 521, 521, 521, 521, 521, 521, 532, 532, 532, 521, 532,
+    521, 521, 521, 521, 521, 525, 525, 525, 525, 525, 525, 532, 525, 525,
+    525, 521, 521, 521, 525, 525, 998, 998, 998, 525, 525, 525, 521, 521,
+    998, 998, 998, 525, 525, 525, 525, 521, 521, 521, 521, 521, 998, 998,
+    998, 998, 998, 998, 998, 40, 40, 40, 40, 998, 998, 998, 998, 40, 40, 40,
+    40, 40, 998, 998, 998, 40, 40, 998, 998, 998, 998, 998, 998, 40, 40, 40,
+    40, 40, 40, 998, 998, 532, 532, 532, 532, 532, 521, 532, 532, 521, 521,
+    521, 521, 521, 521, 532, 521, 532, 532, 521, 521, 521, 532, 532, 998,
+    521, 521, 521, 521, 521, 998, 998, 998, 521, 521, 521, 521, 998, 998,
+    998, 998, 521, 532, 532, 532, 532, 532, 532, 532, 532, 532, 532, 532,
+    532, 532, 521, 521, 521, 521, 521, 521, 521, 521, 521, 998, 998, 998,
+    998, 998, 998, 998, 81, 81, 589, 589, 589, 589, 589, 589, 589, 590, 589,
+    589, 589, 589, 589, 590, 590, 590, 589, 590, 590, 590, 590, 590, 590,
+    590, 590, 590, 590, 590, 590, 590, 81, 81, 81, 499, 81, 81, 81, 81, 81,
+    81, 499, 499, 499, 499, 499, 499, 499, 499, 667, 667, 667, 667, 667, 667,
+    81, 81,
+};
+
+/* decomposition data */
+static const unsigned short decomp_data[] = {
+    0, 257, 32, 514, 32, 776, 259, 97, 514, 32, 772, 259, 50, 259, 51, 514,
+    32, 769, 258, 956, 514, 32, 807, 259, 49, 259, 111, 772, 49, 8260, 52,
+    772, 49, 8260, 50, 772, 51, 8260, 52, 512, 65, 768, 512, 65, 769, 512,
+    65, 770, 512, 65, 771, 512, 65, 776, 512, 65, 778, 512, 67, 807, 512, 69,
+    768, 512, 69, 769, 512, 69, 770, 512, 69, 776, 512, 73, 768, 512, 73,
+    769, 512, 73, 770, 512, 73, 776, 512, 78, 771, 512, 79, 768, 512, 79,
+    769, 512, 79, 770, 512, 79, 771, 512, 79, 776, 512, 85, 768, 512, 85,
+    769, 512, 85, 770, 512, 85, 776, 512, 89, 769, 512, 97, 768, 512, 97,
+    769, 512, 97, 770, 512, 97, 771, 512, 97, 776, 512, 97, 778, 512, 99,
+    807, 512, 101, 768, 512, 101, 769, 512, 101, 770, 512, 101, 776, 512,
+    105, 768, 512, 105, 769, 512, 105, 770, 512, 105, 776, 512, 110, 771,
+    512, 111, 768, 512, 111, 769, 512, 111, 770, 512, 111, 771, 512, 111,
+    776, 512, 117, 768, 512, 117, 769, 512, 117, 770, 512, 117, 776, 512,
+    121, 769, 512, 121, 776, 512, 65, 772, 512, 97, 772, 512, 65, 774, 512,
+    97, 774, 512, 65, 808, 512, 97, 808, 512, 67, 769, 512, 99, 769, 512, 67,
+    770, 512, 99, 770, 512, 67, 775, 512, 99, 775, 512, 67, 780, 512, 99,
+    780, 512, 68, 780, 512, 100, 780, 512, 69, 772, 512, 101, 772, 512, 69,
+    774, 512, 101, 774, 512, 69, 775, 512, 101, 775, 512, 69, 808, 512, 101,
+    808, 512, 69, 780, 512, 101, 780, 512, 71, 770, 512, 103, 770, 512, 71,
+    774, 512, 103, 774, 512, 71, 775, 512, 103, 775, 512, 71, 807, 512, 103,
+    807, 512, 72, 770, 512, 104, 770, 512, 73, 771, 512, 105, 771, 512, 73,
+    772, 512, 105, 772, 512, 73, 774, 512, 105, 774, 512, 73, 808, 512, 105,
+    808, 512, 73, 775, 514, 73, 74, 514, 105, 106, 512, 74, 770, 512, 106,
+    770, 512, 75, 807, 512, 107, 807, 512, 76, 769, 512, 108, 769, 512, 76,
+    807, 512, 108, 807, 512, 76, 780, 512, 108, 780, 514, 76, 183, 514, 108,
+    183, 512, 78, 769, 512, 110, 769, 512, 78, 807, 512, 110, 807, 512, 78,
+    780, 512, 110, 780, 514, 700, 110, 512, 79, 772, 512, 111, 772, 512, 79,
+    774, 512, 111, 774, 512, 79, 779, 512, 111, 779, 512, 82, 769, 512, 114,
+    769, 512, 82, 807, 512, 114, 807, 512, 82, 780, 512, 114, 780, 512, 83,
+    769, 512, 115, 769, 512, 83, 770, 512, 115, 770, 512, 83, 807, 512, 115,
+    807, 512, 83, 780, 512, 115, 780, 512, 84, 807, 512, 116, 807, 512, 84,
+    780, 512, 116, 780, 512, 85, 771, 512, 117, 771, 512, 85, 772, 512, 117,
+    772, 512, 85, 774, 512, 117, 774, 512, 85, 778, 512, 117, 778, 512, 85,
+    779, 512, 117, 779, 512, 85, 808, 512, 117, 808, 512, 87, 770, 512, 119,
+    770, 512, 89, 770, 512, 121, 770, 512, 89, 776, 512, 90, 769, 512, 122,
+    769, 512, 90, 775, 512, 122, 775, 512, 90, 780, 512, 122, 780, 258, 115,
+    512, 79, 795, 512, 111, 795, 512, 85, 795, 512, 117, 795, 514, 68, 381,
+    514, 68, 382, 514, 100, 382, 514, 76, 74, 514, 76, 106, 514, 108, 106,
+    514, 78, 74, 514, 78, 106, 514, 110, 106, 512, 65, 780, 512, 97, 780,
+    512, 73, 780, 512, 105, 780, 512, 79, 780, 512, 111, 780, 512, 85, 780,
+    512, 117, 780, 512, 220, 772, 512, 252, 772, 512, 220, 769, 512, 252,
+    769, 512, 220, 780, 512, 252, 780, 512, 220, 768, 512, 252, 768, 512,
+    196, 772, 512, 228, 772, 512, 550, 772, 512, 551, 772, 512, 198, 772,
+    512, 230, 772, 512, 71, 780, 512, 103, 780, 512, 75, 780, 512, 107, 780,
+    512, 79, 808, 512, 111, 808, 512, 490, 772, 512, 491, 772, 512, 439, 780,
+    512, 658, 780, 512, 106, 780, 514, 68, 90, 514, 68, 122, 514, 100, 122,
+    512, 71, 769, 512, 103, 769, 512, 78, 768, 512, 110, 768, 512, 197, 769,
+    512, 229, 769, 512, 198, 769, 512, 230, 769, 512, 216, 769, 512, 248,
+    769, 512, 65, 783, 512, 97, 783, 512, 65, 785, 512, 97, 785, 512, 69,
+    783, 512, 101, 783, 512, 69, 785, 512, 101, 785, 512, 73, 783, 512, 105,
+    783, 512, 73, 785, 512, 105, 785, 512, 79, 783, 512, 111, 783, 512, 79,
+    785, 512, 111, 785, 512, 82, 783, 512, 114, 783, 512, 82, 785, 512, 114,
+    785, 512, 85, 783, 512, 117, 783, 512, 85, 785, 512, 117, 785, 512, 83,
+    806, 512, 115, 806, 512, 84, 806, 512, 116, 806, 512, 72, 780, 512, 104,
+    780, 512, 65, 775, 512, 97, 775, 512, 69, 807, 512, 101, 807, 512, 214,
+    772, 512, 246, 772, 512, 213, 772, 512, 245, 772, 512, 79, 775, 512, 111,
+    775, 512, 558, 772, 512, 559, 772, 512, 89, 772, 512, 121, 772, 259, 104,
+    259, 614, 259, 106, 259, 114, 259, 633, 259, 635, 259, 641, 259, 119,
+    259, 121, 514, 32, 774, 514, 32, 775, 514, 32, 778, 514, 32, 808, 514,
+    32, 771, 514, 32, 779, 259, 611, 259, 108, 259, 115, 259, 120, 259, 661,
+    256, 768, 256, 769, 256, 787, 512, 776, 769, 256, 697, 514, 32, 837, 256,
+    59, 514, 32, 769, 512, 168, 769, 512, 913, 769, 256, 183, 512, 917, 769,
+    512, 919, 769, 512, 921, 769, 512, 927, 769, 512, 933, 769, 512, 937,
+    769, 512, 970, 769, 512, 921, 776, 512, 933, 776, 512, 945, 769, 512,
+    949, 769, 512, 951, 769, 512, 953, 769, 512, 971, 769, 512, 953, 776,
+    512, 965, 776, 512, 959, 769, 512, 965, 769, 512, 969, 769, 258, 946,
+    258, 952, 258, 933, 512, 978, 769, 512, 978, 776, 258, 966, 258, 960,
+    258, 954, 258, 961, 258, 962, 258, 920, 258, 949, 258, 931, 512, 1045,
+    768, 512, 1045, 776, 512, 1043, 769, 512, 1030, 776, 512, 1050, 769, 512,
+    1048, 768, 512, 1059, 774, 512, 1048, 774, 512, 1080, 774, 512, 1077,
+    768, 512, 1077, 776, 512, 1075, 769, 512, 1110, 776, 512, 1082, 769, 512,
+    1080, 768, 512, 1091, 774, 512, 1140, 783, 512, 1141, 783, 512, 1046,
+    774, 512, 1078, 774, 512, 1040, 774, 512, 1072, 774, 512, 1040, 776, 512,
+    1072, 776, 512, 1045, 774, 512, 1077, 774, 512, 1240, 776, 512, 1241,
+    776, 512, 1046, 776, 512, 1078, 776, 512, 1047, 776, 512, 1079, 776, 512,
+    1048, 772, 512, 1080, 772, 512, 1048, 776, 512, 1080, 776, 512, 1054,
+    776, 512, 1086, 776, 512, 1256, 776, 512, 1257, 776, 512, 1069, 776, 512,
+    1101, 776, 512, 1059, 772, 512, 1091, 772, 512, 1059, 776, 512, 1091,
+    776, 512, 1059, 779, 512, 1091, 779, 512, 1063, 776, 512, 1095, 776, 512,
+    1067, 776, 512, 1099, 776, 514, 1381, 1410, 512, 1575, 1619, 512, 1575,
+    1620, 512, 1608, 1620, 512, 1575, 1621, 512, 1610, 1620, 514, 1575, 1652,
+    514, 1608, 1652, 514, 1735, 1652, 514, 1610, 1652, 512, 1749, 1620, 512,
+    1729, 1620, 512, 1746, 1620, 512, 2344, 2364, 512, 2352, 2364, 512, 2355,
+    2364, 512, 2325, 2364, 512, 2326, 2364, 512, 2327, 2364, 512, 2332, 2364,
+    512, 2337, 2364, 512, 2338, 2364, 512, 2347, 2364, 512, 2351, 2364, 512,
+    2503, 2494, 512, 2503, 2519, 512, 2465, 2492, 512, 2466, 2492, 512, 2479,
+    2492, 512, 2610, 2620, 512, 2616, 2620, 512, 2582, 2620, 512, 2583, 2620,
+    512, 2588, 2620, 512, 2603, 2620, 512, 2887, 2902, 512, 2887, 2878, 512,
+    2887, 2903, 512, 2849, 2876, 512, 2850, 2876, 512, 2962, 3031, 512, 3014,
+    3006, 512, 3015, 3006, 512, 3014, 3031, 512, 3142, 3158, 512, 3263, 3285,
+    512, 3270, 3285, 512, 3270, 3286, 512, 3270, 3266, 512, 3274, 3285, 512,
+    3398, 3390, 512, 3399, 3390, 512, 3398, 3415, 512, 3545, 3530, 512, 3545,
+    3535, 512, 3548, 3530, 512, 3545, 3551, 514, 3661, 3634, 514, 3789, 3762,
+    514, 3755, 3737, 514, 3755, 3745, 257, 3851, 512, 3906, 4023, 512, 3916,
+    4023, 512, 3921, 4023, 512, 3926, 4023, 512, 3931, 4023, 512, 3904, 4021,
+    512, 3953, 3954, 512, 3953, 3956, 512, 4018, 3968, 514, 4018, 3969, 512,
+    4019, 3968, 514, 4019, 3969, 512, 3953, 3968, 512, 3986, 4023, 512, 3996,
+    4023, 512, 4001, 4023, 512, 4006, 4023, 512, 4011, 4023, 512, 3984, 4021,
+    512, 4133, 4142, 259, 4316, 512, 6917, 6965, 512, 6919, 6965, 512, 6921,
+    6965, 512, 6923, 6965, 512, 6925, 6965, 512, 6929, 6965, 512, 6970, 6965,
+    512, 6972, 6965, 512, 6974, 6965, 512, 6975, 6965, 512, 6978, 6965, 259,
+    65, 259, 198, 259, 66, 259, 68, 259, 69, 259, 398, 259, 71, 259, 72, 259,
+    73, 259, 74, 259, 75, 259, 76, 259, 77, 259, 78, 259, 79, 259, 546, 259,
+    80, 259, 82, 259, 84, 259, 85, 259, 87, 259, 97, 259, 592, 259, 593, 259,
+    7426, 259, 98, 259, 100, 259, 101, 259, 601, 259, 603, 259, 604, 259,
+    103, 259, 107, 259, 109, 259, 331, 259, 111, 259, 596, 259, 7446, 259,
+    7447, 259, 112, 259, 116, 259, 117, 259, 7453, 259, 623, 259, 118, 259,
+    7461, 259, 946, 259, 947, 259, 948, 259, 966, 259, 967, 261, 105, 261,
+    114, 261, 117, 261, 118, 261, 946, 261, 947, 261, 961, 261, 966, 261,
+    967, 259, 1085, 259, 594, 259, 99, 259, 597, 259, 240, 259, 604, 259,
+    102, 259, 607, 259, 609, 259, 613, 259, 616, 259, 617, 259, 618, 259,
+    7547, 259, 669, 259, 621, 259, 7557, 259, 671, 259, 625, 259, 624, 259,
+    626, 259, 627, 259, 628, 259, 629, 259, 632, 259, 642, 259, 643, 259,
+    427, 259, 649, 259, 650, 259, 7452, 259, 651, 259, 652, 259, 122, 259,
+    656, 259, 657, 259, 658, 259, 952, 512, 65, 805, 512, 97, 805, 512, 66,
+    775, 512, 98, 775, 512, 66, 803, 512, 98, 803, 512, 66, 817, 512, 98,
+    817, 512, 199, 769, 512, 231, 769, 512, 68, 775, 512, 100, 775, 512, 68,
+    803, 512, 100, 803, 512, 68, 817, 512, 100, 817, 512, 68, 807, 512, 100,
+    807, 512, 68, 813, 512, 100, 813, 512, 274, 768, 512, 275, 768, 512, 274,
+    769, 512, 275, 769, 512, 69, 813, 512, 101, 813, 512, 69, 816, 512, 101,
+    816, 512, 552, 774, 512, 553, 774, 512, 70, 775, 512, 102, 775, 512, 71,
+    772, 512, 103, 772, 512, 72, 775, 512, 104, 775, 512, 72, 803, 512, 104,
+    803, 512, 72, 776, 512, 104, 776, 512, 72, 807, 512, 104, 807, 512, 72,
+    814, 512, 104, 814, 512, 73, 816, 512, 105, 816, 512, 207, 769, 512, 239,
+    769, 512, 75, 769, 512, 107, 769, 512, 75, 803, 512, 107, 803, 512, 75,
+    817, 512, 107, 817, 512, 76, 803, 512, 108, 803, 512, 7734, 772, 512,
+    7735, 772, 512, 76, 817, 512, 108, 817, 512, 76, 813, 512, 108, 813, 512,
+    77, 769, 512, 109, 769, 512, 77, 775, 512, 109, 775, 512, 77, 803, 512,
+    109, 803, 512, 78, 775, 512, 110, 775, 512, 78, 803, 512, 110, 803, 512,
+    78, 817, 512, 110, 817, 512, 78, 813, 512, 110, 813, 512, 213, 769, 512,
+    245, 769, 512, 213, 776, 512, 245, 776, 512, 332, 768, 512, 333, 768,
+    512, 332, 769, 512, 333, 769, 512, 80, 769, 512, 112, 769, 512, 80, 775,
+    512, 112, 775, 512, 82, 775, 512, 114, 775, 512, 82, 803, 512, 114, 803,
+    512, 7770, 772, 512, 7771, 772, 512, 82, 817, 512, 114, 817, 512, 83,
+    775, 512, 115, 775, 512, 83, 803, 512, 115, 803, 512, 346, 775, 512, 347,
+    775, 512, 352, 775, 512, 353, 775, 512, 7778, 775, 512, 7779, 775, 512,
+    84, 775, 512, 116, 775, 512, 84, 803, 512, 116, 803, 512, 84, 817, 512,
+    116, 817, 512, 84, 813, 512, 116, 813, 512, 85, 804, 512, 117, 804, 512,
+    85, 816, 512, 117, 816, 512, 85, 813, 512, 117, 813, 512, 360, 769, 512,
+    361, 769, 512, 362, 776, 512, 363, 776, 512, 86, 771, 512, 118, 771, 512,
+    86, 803, 512, 118, 803, 512, 87, 768, 512, 119, 768, 512, 87, 769, 512,
+    119, 769, 512, 87, 776, 512, 119, 776, 512, 87, 775, 512, 119, 775, 512,
+    87, 803, 512, 119, 803, 512, 88, 775, 512, 120, 775, 512, 88, 776, 512,
+    120, 776, 512, 89, 775, 512, 121, 775, 512, 90, 770, 512, 122, 770, 512,
+    90, 803, 512, 122, 803, 512, 90, 817, 512, 122, 817, 512, 104, 817, 512,
+    116, 776, 512, 119, 778, 512, 121, 778, 514, 97, 702, 512, 383, 775, 512,
+    65, 803, 512, 97, 803, 512, 65, 777, 512, 97, 777, 512, 194, 769, 512,
+    226, 769, 512, 194, 768, 512, 226, 768, 512, 194, 777, 512, 226, 777,
+    512, 194, 771, 512, 226, 771, 512, 7840, 770, 512, 7841, 770, 512, 258,
+    769, 512, 259, 769, 512, 258, 768, 512, 259, 768, 512, 258, 777, 512,
+    259, 777, 512, 258, 771, 512, 259, 771, 512, 7840, 774, 512, 7841, 774,
+    512, 69, 803, 512, 101, 803, 512, 69, 777, 512, 101, 777, 512, 69, 771,
+    512, 101, 771, 512, 202, 769, 512, 234, 769, 512, 202, 768, 512, 234,
+    768, 512, 202, 777, 512, 234, 777, 512, 202, 771, 512, 234, 771, 512,
+    7864, 770, 512, 7865, 770, 512, 73, 777, 512, 105, 777, 512, 73, 803,
+    512, 105, 803, 512, 79, 803, 512, 111, 803, 512, 79, 777, 512, 111, 777,
+    512, 212, 769, 512, 244, 769, 512, 212, 768, 512, 244, 768, 512, 212,
+    777, 512, 244, 777, 512, 212, 771, 512, 244, 771, 512, 7884, 770, 512,
+    7885, 770, 512, 416, 769, 512, 417, 769, 512, 416, 768, 512, 417, 768,
+    512, 416, 777, 512, 417, 777, 512, 416, 771, 512, 417, 771, 512, 416,
+    803, 512, 417, 803, 512, 85, 803, 512, 117, 803, 512, 85, 777, 512, 117,
+    777, 512, 431, 769, 512, 432, 769, 512, 431, 768, 512, 432, 768, 512,
+    431, 777, 512, 432, 777, 512, 431, 771, 512, 432, 771, 512, 431, 803,
+    512, 432, 803, 512, 89, 768, 512, 121, 768, 512, 89, 803, 512, 121, 803,
+    512, 89, 777, 512, 121, 777, 512, 89, 771, 512, 121, 771, 512, 945, 787,
+    512, 945, 788, 512, 7936, 768, 512, 7937, 768, 512, 7936, 769, 512, 7937,
+    769, 512, 7936, 834, 512, 7937, 834, 512, 913, 787, 512, 913, 788, 512,
+    7944, 768, 512, 7945, 768, 512, 7944, 769, 512, 7945, 769, 512, 7944,
+    834, 512, 7945, 834, 512, 949, 787, 512, 949, 788, 512, 7952, 768, 512,
+    7953, 768, 512, 7952, 769, 512, 7953, 769, 512, 917, 787, 512, 917, 788,
+    512, 7960, 768, 512, 7961, 768, 512, 7960, 769, 512, 7961, 769, 512, 951,
+    787, 512, 951, 788, 512, 7968, 768, 512, 7969, 768, 512, 7968, 769, 512,
+    7969, 769, 512, 7968, 834, 512, 7969, 834, 512, 919, 787, 512, 919, 788,
+    512, 7976, 768, 512, 7977, 768, 512, 7976, 769, 512, 7977, 769, 512,
+    7976, 834, 512, 7977, 834, 512, 953, 787, 512, 953, 788, 512, 7984, 768,
+    512, 7985, 768, 512, 7984, 769, 512, 7985, 769, 512, 7984, 834, 512,
+    7985, 834, 512, 921, 787, 512, 921, 788, 512, 7992, 768, 512, 7993, 768,
+    512, 7992, 769, 512, 7993, 769, 512, 7992, 834, 512, 7993, 834, 512, 959,
+    787, 512, 959, 788, 512, 8000, 768, 512, 8001, 768, 512, 8000, 769, 512,
+    8001, 769, 512, 927, 787, 512, 927, 788, 512, 8008, 768, 512, 8009, 768,
+    512, 8008, 769, 512, 8009, 769, 512, 965, 787, 512, 965, 788, 512, 8016,
+    768, 512, 8017, 768, 512, 8016, 769, 512, 8017, 769, 512, 8016, 834, 512,
+    8017, 834, 512, 933, 788, 512, 8025, 768, 512, 8025, 769, 512, 8025, 834,
+    512, 969, 787, 512, 969, 788, 512, 8032, 768, 512, 8033, 768, 512, 8032,
+    769, 512, 8033, 769, 512, 8032, 834, 512, 8033, 834, 512, 937, 787, 512,
+    937, 788, 512, 8040, 768, 512, 8041, 768, 512, 8040, 769, 512, 8041, 769,
+    512, 8040, 834, 512, 8041, 834, 512, 945, 768, 256, 940, 512, 949, 768,
+    256, 941, 512, 951, 768, 256, 942, 512, 953, 768, 256, 943, 512, 959,
+    768, 256, 972, 512, 965, 768, 256, 973, 512, 969, 768, 256, 974, 512,
+    7936, 837, 512, 7937, 837, 512, 7938, 837, 512, 7939, 837, 512, 7940,
+    837, 512, 7941, 837, 512, 7942, 837, 512, 7943, 837, 512, 7944, 837, 512,
+    7945, 837, 512, 7946, 837, 512, 7947, 837, 512, 7948, 837, 512, 7949,
+    837, 512, 7950, 837, 512, 7951, 837, 512, 7968, 837, 512, 7969, 837, 512,
+    7970, 837, 512, 7971, 837, 512, 7972, 837, 512, 7973, 837, 512, 7974,
+    837, 512, 7975, 837, 512, 7976, 837, 512, 7977, 837, 512, 7978, 837, 512,
+    7979, 837, 512, 7980, 837, 512, 7981, 837, 512, 7982, 837, 512, 7983,
+    837, 512, 8032, 837, 512, 8033, 837, 512, 8034, 837, 512, 8035, 837, 512,
+    8036, 837, 512, 8037, 837, 512, 8038, 837, 512, 8039, 837, 512, 8040,
+    837, 512, 8041, 837, 512, 8042, 837, 512, 8043, 837, 512, 8044, 837, 512,
+    8045, 837, 512, 8046, 837, 512, 8047, 837, 512, 945, 774, 512, 945, 772,
+    512, 8048, 837, 512, 945, 837, 512, 940, 837, 512, 945, 834, 512, 8118,
+    837, 512, 913, 774, 512, 913, 772, 512, 913, 768, 256, 902, 512, 913,
+    837, 514, 32, 787, 256, 953, 514, 32, 787, 514, 32, 834, 512, 168, 834,
+    512, 8052, 837, 512, 951, 837, 512, 942, 837, 512, 951, 834, 512, 8134,
+    837, 512, 917, 768, 256, 904, 512, 919, 768, 256, 905, 512, 919, 837,
+    512, 8127, 768, 512, 8127, 769, 512, 8127, 834, 512, 953, 774, 512, 953,
+    772, 512, 970, 768, 256, 912, 512, 953, 834, 512, 970, 834, 512, 921,
+    774, 512, 921, 772, 512, 921, 768, 256, 906, 512, 8190, 768, 512, 8190,
+    769, 512, 8190, 834, 512, 965, 774, 512, 965, 772, 512, 971, 768, 256,
+    944, 512, 961, 787, 512, 961, 788, 512, 965, 834, 512, 971, 834, 512,
+    933, 774, 512, 933, 772, 512, 933, 768, 256, 910, 512, 929, 788, 512,
+    168, 768, 256, 901, 256, 96, 512, 8060, 837, 512, 969, 837, 512, 974,
+    837, 512, 969, 834, 512, 8182, 837, 512, 927, 768, 256, 908, 512, 937,
+    768, 256, 911, 512, 937, 837, 256, 180, 514, 32, 788, 256, 8194, 256,
+    8195, 258, 32, 258, 32, 258, 32, 258, 32, 258, 32, 257, 32, 258, 32, 258,
+    32, 258, 32, 257, 8208, 514, 32, 819, 258, 46, 514, 46, 46, 770, 46, 46,
+    46, 257, 32, 514, 8242, 8242, 770, 8242, 8242, 8242, 514, 8245, 8245,
+    770, 8245, 8245, 8245, 514, 33, 33, 514, 32, 773, 514, 63, 63, 514, 63,
+    33, 514, 33, 63, 1026, 8242, 8242, 8242, 8242, 258, 32, 259, 48, 259,
+    105, 259, 52, 259, 53, 259, 54, 259, 55, 259, 56, 259, 57, 259, 43, 259,
+    8722, 259, 61, 259, 40, 259, 41, 259, 110, 261, 48, 261, 49, 261, 50,
+    261, 51, 261, 52, 261, 53, 261, 54, 261, 55, 261, 56, 261, 57, 261, 43,
+    261, 8722, 261, 61, 261, 40, 261, 41, 261, 97, 261, 101, 261, 111, 261,
+    120, 261, 601, 261, 104, 261, 107, 261, 108, 261, 109, 261, 110, 261,
+    112, 261, 115, 261, 116, 514, 82, 115, 770, 97, 47, 99, 770, 97, 47, 115,
+    262, 67, 514, 176, 67, 770, 99, 47, 111, 770, 99, 47, 117, 258, 400, 514,
+    176, 70, 262, 103, 262, 72, 262, 72, 262, 72, 262, 104, 262, 295, 262,
+    73, 262, 73, 262, 76, 262, 108, 262, 78, 514, 78, 111, 262, 80, 262, 81,
+    262, 82, 262, 82, 262, 82, 515, 83, 77, 770, 84, 69, 76, 515, 84, 77,
+    262, 90, 256, 937, 262, 90, 256, 75, 256, 197, 262, 66, 262, 67, 262,
+    101, 262, 69, 262, 70, 262, 77, 262, 111, 258, 1488, 258, 1489, 258,
+    1490, 258, 1491, 262, 105, 770, 70, 65, 88, 262, 960, 262, 947, 262, 915,
+    262, 928, 262, 8721, 262, 68, 262, 100, 262, 101, 262, 105, 262, 106,
+    772, 49, 8260, 55, 772, 49, 8260, 57, 1028, 49, 8260, 49, 48, 772, 49,
+    8260, 51, 772, 50, 8260, 51, 772, 49, 8260, 53, 772, 50, 8260, 53, 772,
+    51, 8260, 53, 772, 52, 8260, 53, 772, 49, 8260, 54, 772, 53, 8260, 54,
+    772, 49, 8260, 56, 772, 51, 8260, 56, 772, 53, 8260, 56, 772, 55, 8260,
+    56, 516, 49, 8260, 258, 73, 514, 73, 73, 770, 73, 73, 73, 514, 73, 86,
+    258, 86, 514, 86, 73, 770, 86, 73, 73, 1026, 86, 73, 73, 73, 514, 73, 88,
+    258, 88, 514, 88, 73, 770, 88, 73, 73, 258, 76, 258, 67, 258, 68, 258,
+    77, 258, 105, 514, 105, 105, 770, 105, 105, 105, 514, 105, 118, 258, 118,
+    514, 118, 105, 770, 118, 105, 105, 1026, 118, 105, 105, 105, 514, 105,
+    120, 258, 120, 514, 120, 105, 770, 120, 105, 105, 258, 108, 258, 99, 258,
+    100, 258, 109, 772, 48, 8260, 51, 512, 8592, 824, 512, 8594, 824, 512,
+    8596, 824, 512, 8656, 824, 512, 8660, 824, 512, 8658, 824, 512, 8707,
+    824, 512, 8712, 824, 512, 8715, 824, 512, 8739, 824, 512, 8741, 824, 514,
+    8747, 8747, 770, 8747, 8747, 8747, 514, 8750, 8750, 770, 8750, 8750,
+    8750, 512, 8764, 824, 512, 8771, 824, 512, 8773, 824, 512, 8776, 824,
+    512, 61, 824, 512, 8801, 824, 512, 8781, 824, 512, 60, 824, 512, 62, 824,
+    512, 8804, 824, 512, 8805, 824, 512, 8818, 824, 512, 8819, 824, 512,
+    8822, 824, 512, 8823, 824, 512, 8826, 824, 512, 8827, 824, 512, 8834,
+    824, 512, 8835, 824, 512, 8838, 824, 512, 8839, 824, 512, 8866, 824, 512,
+    8872, 824, 512, 8873, 824, 512, 8875, 824, 512, 8828, 824, 512, 8829,
+    824, 512, 8849, 824, 512, 8850, 824, 512, 8882, 824, 512, 8883, 824, 512,
+    8884, 824, 512, 8885, 824, 256, 12296, 256, 12297, 263, 49, 263, 50, 263,
+    51, 263, 52, 263, 53, 263, 54, 263, 55, 263, 56, 263, 57, 519, 49, 48,
+    519, 49, 49, 519, 49, 50, 519, 49, 51, 519, 49, 52, 519, 49, 53, 519, 49,
+    54, 519, 49, 55, 519, 49, 56, 519, 49, 57, 519, 50, 48, 770, 40, 49, 41,
+    770, 40, 50, 41, 770, 40, 51, 41, 770, 40, 52, 41, 770, 40, 53, 41, 770,
+    40, 54, 41, 770, 40, 55, 41, 770, 40, 56, 41, 770, 40, 57, 41, 1026, 40,
+    49, 48, 41, 1026, 40, 49, 49, 41, 1026, 40, 49, 50, 41, 1026, 40, 49, 51,
+    41, 1026, 40, 49, 52, 41, 1026, 40, 49, 53, 41, 1026, 40, 49, 54, 41,
+    1026, 40, 49, 55, 41, 1026, 40, 49, 56, 41, 1026, 40, 49, 57, 41, 1026,
+    40, 50, 48, 41, 514, 49, 46, 514, 50, 46, 514, 51, 46, 514, 52, 46, 514,
+    53, 46, 514, 54, 46, 514, 55, 46, 514, 56, 46, 514, 57, 46, 770, 49, 48,
+    46, 770, 49, 49, 46, 770, 49, 50, 46, 770, 49, 51, 46, 770, 49, 52, 46,
+    770, 49, 53, 46, 770, 49, 54, 46, 770, 49, 55, 46, 770, 49, 56, 46, 770,
+    49, 57, 46, 770, 50, 48, 46, 770, 40, 97, 41, 770, 40, 98, 41, 770, 40,
+    99, 41, 770, 40, 100, 41, 770, 40, 101, 41, 770, 40, 102, 41, 770, 40,
+    103, 41, 770, 40, 104, 41, 770, 40, 105, 41, 770, 40, 106, 41, 770, 40,
+    107, 41, 770, 40, 108, 41, 770, 40, 109, 41, 770, 40, 110, 41, 770, 40,
+    111, 41, 770, 40, 112, 41, 770, 40, 113, 41, 770, 40, 114, 41, 770, 40,
+    115, 41, 770, 40, 116, 41, 770, 40, 117, 41, 770, 40, 118, 41, 770, 40,
+    119, 41, 770, 40, 120, 41, 770, 40, 121, 41, 770, 40, 122, 41, 263, 65,
+    263, 66, 263, 67, 263, 68, 263, 69, 263, 70, 263, 71, 263, 72, 263, 73,
+    263, 74, 263, 75, 263, 76, 263, 77, 263, 78, 263, 79, 263, 80, 263, 81,
+    263, 82, 263, 83, 263, 84, 263, 85, 263, 86, 263, 87, 263, 88, 263, 89,
+    263, 90, 263, 97, 263, 98, 263, 99, 263, 100, 263, 101, 263, 102, 263,
+    103, 263, 104, 263, 105, 263, 106, 263, 107, 263, 108, 263, 109, 263,
+    110, 263, 111, 263, 112, 263, 113, 263, 114, 263, 115, 263, 116, 263,
+    117, 263, 118, 263, 119, 263, 120, 263, 121, 263, 122, 263, 48, 1026,
+    8747, 8747, 8747, 8747, 770, 58, 58, 61, 514, 61, 61, 770, 61, 61, 61,
+    512, 10973, 824, 261, 106, 259, 86, 259, 11617, 258, 27597, 258, 40863,
+    258, 19968, 258, 20008, 258, 20022, 258, 20031, 258, 20057, 258, 20101,
+    258, 20108, 258, 20128, 258, 20154, 258, 20799, 258, 20837, 258, 20843,
+    258, 20866, 258, 20886, 258, 20907, 258, 20960, 258, 20981, 258, 20992,
+    258, 21147, 258, 21241, 258, 21269, 258, 21274, 258, 21304, 258, 21313,
+    258, 21340, 258, 21353, 258, 21378, 258, 21430, 258, 21448, 258, 21475,
+    258, 22231, 258, 22303, 258, 22763, 258, 22786, 258, 22794, 258, 22805,
+    258, 22823, 258, 22899, 258, 23376, 258, 23424, 258, 23544, 258, 23567,
+    258, 23586, 258, 23608, 258, 23662, 258, 23665, 258, 24027, 258, 24037,
+    258, 24049, 258, 24062, 258, 24178, 258, 24186, 258, 24191, 258, 24308,
+    258, 24318, 258, 24331, 258, 24339, 258, 24400, 258, 24417, 258, 24435,
+    258, 24515, 258, 25096, 258, 25142, 258, 25163, 258, 25903, 258, 25908,
+    258, 25991, 258, 26007, 258, 26020, 258, 26041, 258, 26080, 258, 26085,
+    258, 26352, 258, 26376, 258, 26408, 258, 27424, 258, 27490, 258, 27513,
+    258, 27571, 258, 27595, 258, 27604, 258, 27611, 258, 27663, 258, 27668,
+    258, 27700, 258, 28779, 258, 29226, 258, 29238, 258, 29243, 258, 29247,
+    258, 29255, 258, 29273, 258, 29275, 258, 29356, 258, 29572, 258, 29577,
+    258, 29916, 258, 29926, 258, 29976, 258, 29983, 258, 29992, 258, 30000,
+    258, 30091, 258, 30098, 258, 30326, 258, 30333, 258, 30382, 258, 30399,
+    258, 30446, 258, 30683, 258, 30690, 258, 30707, 258, 31034, 258, 31160,
+    258, 31166, 258, 31348, 258, 31435, 258, 31481, 258, 31859, 258, 31992,
+    258, 32566, 258, 32593, 258, 32650, 258, 32701, 258, 32769, 258, 32780,
+    258, 32786, 258, 32819, 258, 32895, 258, 32905, 258, 33251, 258, 33258,
+    258, 33267, 258, 33276, 258, 33292, 258, 33307, 258, 33311, 258, 33390,
+    258, 33394, 258, 33400, 258, 34381, 258, 34411, 258, 34880, 258, 34892,
+    258, 34915, 258, 35198, 258, 35211, 258, 35282, 258, 35328, 258, 35895,
+    258, 35910, 258, 35925, 258, 35960, 258, 35997, 258, 36196, 258, 36208,
+    258, 36275, 258, 36523, 258, 36554, 258, 36763, 258, 36784, 258, 36789,
+    258, 37009, 258, 37193, 258, 37318, 258, 37324, 258, 37329, 258, 38263,
+    258, 38272, 258, 38428, 258, 38582, 258, 38585, 258, 38632, 258, 38737,
+    258, 38750, 258, 38754, 258, 38761, 258, 38859, 258, 38893, 258, 38899,
+    258, 38913, 258, 39080, 258, 39131, 258, 39135, 258, 39318, 258, 39321,
+    258, 39340, 258, 39592, 258, 39640, 258, 39647, 258, 39717, 258, 39727,
+    258, 39730, 258, 39740, 258, 39770, 258, 40165, 258, 40565, 258, 40575,
+    258, 40613, 258, 40635, 258, 40643, 258, 40653, 258, 40657, 258, 40697,
+    258, 40701, 258, 40718, 258, 40723, 258, 40736, 258, 40763, 258, 40778,
+    258, 40786, 258, 40845, 258, 40860, 258, 40864, 264, 32, 258, 12306, 258,
+    21313, 258, 21316, 258, 21317, 512, 12363, 12441, 512, 12365, 12441, 512,
+    12367, 12441, 512, 12369, 12441, 512, 12371, 12441, 512, 12373, 12441,
+    512, 12375, 12441, 512, 12377, 12441, 512, 12379, 12441, 512, 12381,
+    12441, 512, 12383, 12441, 512, 12385, 12441, 512, 12388, 12441, 512,
+    12390, 12441, 512, 12392, 12441, 512, 12399, 12441, 512, 12399, 12442,
+    512, 12402, 12441, 512, 12402, 12442, 512, 12405, 12441, 512, 12405,
+    12442, 512, 12408, 12441, 512, 12408, 12442, 512, 12411, 12441, 512,
+    12411, 12442, 512, 12358, 12441, 514, 32, 12441, 514, 32, 12442, 512,
+    12445, 12441, 521, 12424, 12426, 512, 12459, 12441, 512, 12461, 12441,
+    512, 12463, 12441, 512, 12465, 12441, 512, 12467, 12441, 512, 12469,
+    12441, 512, 12471, 12441, 512, 12473, 12441, 512, 12475, 12441, 512,
+    12477, 12441, 512, 12479, 12441, 512, 12481, 12441, 512, 12484, 12441,
+    512, 12486, 12441, 512, 12488, 12441, 512, 12495, 12441, 512, 12495,
+    12442, 512, 12498, 12441, 512, 12498, 12442, 512, 12501, 12441, 512,
+    12501, 12442, 512, 12504, 12441, 512, 12504, 12442, 512, 12507, 12441,
+    512, 12507, 12442, 512, 12454, 12441, 512, 12527, 12441, 512, 12528,
+    12441, 512, 12529, 12441, 512, 12530, 12441, 512, 12541, 12441, 521,
+    12467, 12488, 258, 4352, 258, 4353, 258, 4522, 258, 4354, 258, 4524, 258,
+    4525, 258, 4355, 258, 4356, 258, 4357, 258, 4528, 258, 4529, 258, 4530,
+    258, 4531, 258, 4532, 258, 4533, 258, 4378, 258, 4358, 258, 4359, 258,
+    4360, 258, 4385, 258, 4361, 258, 4362, 258, 4363, 258, 4364, 258, 4365,
+    258, 4366, 258, 4367, 258, 4368, 258, 4369, 258, 4370, 258, 4449, 258,
+    4450, 258, 4451, 258, 4452, 258, 4453, 258, 4454, 258, 4455, 258, 4456,
+    258, 4457, 258, 4458, 258, 4459, 258, 4460, 258, 4461, 258, 4462, 258,
+    4463, 258, 4464, 258, 4465, 258, 4466, 258, 4467, 258, 4468, 258, 4469,
+    258, 4448, 258, 4372, 258, 4373, 258, 4551, 258, 4552, 258, 4556, 258,
+    4558, 258, 4563, 258, 4567, 258, 4569, 258, 4380, 258, 4573, 258, 4575,
+    258, 4381, 258, 4382, 258, 4384, 258, 4386, 258, 4387, 258, 4391, 258,
+    4393, 258, 4395, 258, 4396, 258, 4397, 258, 4398, 258, 4399, 258, 4402,
+    258, 4406, 258, 4416, 258, 4423, 258, 4428, 258, 4593, 258, 4594, 258,
+    4439, 258, 4440, 258, 4441, 258, 4484, 258, 4485, 258, 4488, 258, 4497,
+    258, 4498, 258, 4500, 258, 4510, 258, 4513, 259, 19968, 259, 20108, 259,
+    19977, 259, 22235, 259, 19978, 259, 20013, 259, 19979, 259, 30002, 259,
+    20057, 259, 19993, 259, 19969, 259, 22825, 259, 22320, 259, 20154, 770,
+    40, 4352, 41, 770, 40, 4354, 41, 770, 40, 4355, 41, 770, 40, 4357, 41,
+    770, 40, 4358, 41, 770, 40, 4359, 41, 770, 40, 4361, 41, 770, 40, 4363,
+    41, 770, 40, 4364, 41, 770, 40, 4366, 41, 770, 40, 4367, 41, 770, 40,
+    4368, 41, 770, 40, 4369, 41, 770, 40, 4370, 41, 1026, 40, 4352, 4449, 41,
+    1026, 40, 4354, 4449, 41, 1026, 40, 4355, 4449, 41, 1026, 40, 4357, 4449,
+    41, 1026, 40, 4358, 4449, 41, 1026, 40, 4359, 4449, 41, 1026, 40, 4361,
+    4449, 41, 1026, 40, 4363, 4449, 41, 1026, 40, 4364, 4449, 41, 1026, 40,
+    4366, 4449, 41, 1026, 40, 4367, 4449, 41, 1026, 40, 4368, 4449, 41, 1026,
+    40, 4369, 4449, 41, 1026, 40, 4370, 4449, 41, 1026, 40, 4364, 4462, 41,
+    1794, 40, 4363, 4457, 4364, 4453, 4523, 41, 1538, 40, 4363, 4457, 4370,
+    4462, 41, 770, 40, 19968, 41, 770, 40, 20108, 41, 770, 40, 19977, 41,
+    770, 40, 22235, 41, 770, 40, 20116, 41, 770, 40, 20845, 41, 770, 40,
+    19971, 41, 770, 40, 20843, 41, 770, 40, 20061, 41, 770, 40, 21313, 41,
+    770, 40, 26376, 41, 770, 40, 28779, 41, 770, 40, 27700, 41, 770, 40,
+    26408, 41, 770, 40, 37329, 41, 770, 40, 22303, 41, 770, 40, 26085, 41,
+    770, 40, 26666, 41, 770, 40, 26377, 41, 770, 40, 31038, 41, 770, 40,
+    21517, 41, 770, 40, 29305, 41, 770, 40, 36001, 41, 770, 40, 31069, 41,
+    770, 40, 21172, 41, 770, 40, 20195, 41, 770, 40, 21628, 41, 770, 40,
+    23398, 41, 770, 40, 30435, 41, 770, 40, 20225, 41, 770, 40, 36039, 41,
+    770, 40, 21332, 41, 770, 40, 31085, 41, 770, 40, 20241, 41, 770, 40,
+    33258, 41, 770, 40, 33267, 41, 263, 21839, 263, 24188, 263, 25991, 263,
+    31631, 778, 80, 84, 69, 519, 50, 49, 519, 50, 50, 519, 50, 51, 519, 50,
+    52, 519, 50, 53, 519, 50, 54, 519, 50, 55, 519, 50, 56, 519, 50, 57, 519,
+    51, 48, 519, 51, 49, 519, 51, 50, 519, 51, 51, 519, 51, 52, 519, 51, 53,
+    263, 4352, 263, 4354, 263, 4355, 263, 4357, 263, 4358, 263, 4359, 263,
+    4361, 263, 4363, 263, 4364, 263, 4366, 263, 4367, 263, 4368, 263, 4369,
+    263, 4370, 519, 4352, 4449, 519, 4354, 4449, 519, 4355, 4449, 519, 4357,
+    4449, 519, 4358, 4449, 519, 4359, 4449, 519, 4361, 4449, 519, 4363, 4449,
+    519, 4364, 4449, 519, 4366, 4449, 519, 4367, 4449, 519, 4368, 4449, 519,
+    4369, 4449, 519, 4370, 4449, 1287, 4366, 4449, 4535, 4352, 4457, 1031,
+    4364, 4462, 4363, 4468, 519, 4363, 4462, 263, 19968, 263, 20108, 263,
+    19977, 263, 22235, 263, 20116, 263, 20845, 263, 19971, 263, 20843, 263,
+    20061, 263, 21313, 263, 26376, 263, 28779, 263, 27700, 263, 26408, 263,
+    37329, 263, 22303, 263, 26085, 263, 26666, 263, 26377, 263, 31038, 263,
+    21517, 263, 29305, 263, 36001, 263, 31069, 263, 21172, 263, 31192, 263,
+    30007, 263, 22899, 263, 36969, 263, 20778, 263, 21360, 263, 27880, 263,
+    38917, 263, 20241, 263, 20889, 263, 27491, 263, 19978, 263, 20013, 263,
+    19979, 263, 24038, 263, 21491, 263, 21307, 263, 23447, 263, 23398, 263,
+    30435, 263, 20225, 263, 36039, 263, 21332, 263, 22812, 519, 51, 54, 519,
+    51, 55, 519, 51, 56, 519, 51, 57, 519, 52, 48, 519, 52, 49, 519, 52, 50,
+    519, 52, 51, 519, 52, 52, 519, 52, 53, 519, 52, 54, 519, 52, 55, 519, 52,
+    56, 519, 52, 57, 519, 53, 48, 514, 49, 26376, 514, 50, 26376, 514, 51,
+    26376, 514, 52, 26376, 514, 53, 26376, 514, 54, 26376, 514, 55, 26376,
+    514, 56, 26376, 514, 57, 26376, 770, 49, 48, 26376, 770, 49, 49, 26376,
+    770, 49, 50, 26376, 522, 72, 103, 778, 101, 114, 103, 522, 101, 86, 778,
+    76, 84, 68, 263, 12450, 263, 12452, 263, 12454, 263, 12456, 263, 12458,
+    263, 12459, 263, 12461, 263, 12463, 263, 12465, 263, 12467, 263, 12469,
+    263, 12471, 263, 12473, 263, 12475, 263, 12477, 263, 12479, 263, 12481,
+    263, 12484, 263, 12486, 263, 12488, 263, 12490, 263, 12491, 263, 12492,
+    263, 12493, 263, 12494, 263, 12495, 263, 12498, 263, 12501, 263, 12504,
+    263, 12507, 263, 12510, 263, 12511, 263, 12512, 263, 12513, 263, 12514,
+    263, 12516, 263, 12518, 263, 12520, 263, 12521, 263, 12522, 263, 12523,
+    263, 12524, 263, 12525, 263, 12527, 263, 12528, 263, 12529, 263, 12530,
+    1034, 12450, 12497, 12540, 12488, 1034, 12450, 12523, 12501, 12449, 1034,
+    12450, 12531, 12506, 12450, 778, 12450, 12540, 12523, 1034, 12452, 12491,
+    12531, 12464, 778, 12452, 12531, 12481, 778, 12454, 12457, 12531, 1290,
+    12456, 12473, 12463, 12540, 12489, 1034, 12456, 12540, 12459, 12540, 778,
+    12458, 12531, 12473, 778, 12458, 12540, 12512, 778, 12459, 12452, 12522,
+    1034, 12459, 12521, 12483, 12488, 1034, 12459, 12525, 12522, 12540, 778,
+    12460, 12525, 12531, 778, 12460, 12531, 12510, 522, 12462, 12460, 778,
+    12462, 12491, 12540, 1034, 12461, 12517, 12522, 12540, 1034, 12462,
+    12523, 12480, 12540, 522, 12461, 12525, 1290, 12461, 12525, 12464, 12521,
+    12512, 1546, 12461, 12525, 12513, 12540, 12488, 12523, 1290, 12461,
+    12525, 12527, 12483, 12488, 778, 12464, 12521, 12512, 1290, 12464, 12521,
+    12512, 12488, 12531, 1290, 12463, 12523, 12476, 12452, 12525, 1034,
+    12463, 12525, 12540, 12493, 778, 12465, 12540, 12473, 778, 12467, 12523,
+    12490, 778, 12467, 12540, 12509, 1034, 12469, 12452, 12463, 12523, 1290,
+    12469, 12531, 12481, 12540, 12512, 1034, 12471, 12522, 12531, 12464, 778,
+    12475, 12531, 12481, 778, 12475, 12531, 12488, 778, 12480, 12540, 12473,
+    522, 12487, 12471, 522, 12489, 12523, 522, 12488, 12531, 522, 12490,
+    12494, 778, 12494, 12483, 12488, 778, 12495, 12452, 12484, 1290, 12497,
+    12540, 12475, 12531, 12488, 778, 12497, 12540, 12484, 1034, 12496, 12540,
+    12524, 12523, 1290, 12500, 12450, 12473, 12488, 12523, 778, 12500, 12463,
+    12523, 522, 12500, 12467, 522, 12499, 12523, 1290, 12501, 12449, 12521,
+    12483, 12489, 1034, 12501, 12451, 12540, 12488, 1290, 12502, 12483,
+    12471, 12455, 12523, 778, 12501, 12521, 12531, 1290, 12504, 12463, 12479,
+    12540, 12523, 522, 12506, 12477, 778, 12506, 12491, 12498, 778, 12504,
+    12523, 12484, 778, 12506, 12531, 12473, 778, 12506, 12540, 12472, 778,
+    12505, 12540, 12479, 1034, 12509, 12452, 12531, 12488, 778, 12508, 12523,
+    12488, 522, 12507, 12531, 778, 12509, 12531, 12489, 778, 12507, 12540,
+    12523, 778, 12507, 12540, 12531, 1034, 12510, 12452, 12463, 12525, 778,
+    12510, 12452, 12523, 778, 12510, 12483, 12495, 778, 12510, 12523, 12463,
+    1290, 12510, 12531, 12471, 12519, 12531, 1034, 12511, 12463, 12525,
+    12531, 522, 12511, 12522, 1290, 12511, 12522, 12496, 12540, 12523, 522,
+    12513, 12460, 1034, 12513, 12460, 12488, 12531, 1034, 12513, 12540,
+    12488, 12523, 778, 12516, 12540, 12489, 778, 12516, 12540, 12523, 778,
+    12518, 12450, 12531, 1034, 12522, 12483, 12488, 12523, 522, 12522, 12521,
+    778, 12523, 12500, 12540, 1034, 12523, 12540, 12502, 12523, 522, 12524,
+    12512, 1290, 12524, 12531, 12488, 12466, 12531, 778, 12527, 12483, 12488,
+    514, 48, 28857, 514, 49, 28857, 514, 50, 28857, 514, 51, 28857, 514, 52,
+    28857, 514, 53, 28857, 514, 54, 28857, 514, 55, 28857, 514, 56, 28857,
+    514, 57, 28857, 770, 49, 48, 28857, 770, 49, 49, 28857, 770, 49, 50,
+    28857, 770, 49, 51, 28857, 770, 49, 52, 28857, 770, 49, 53, 28857, 770,
+    49, 54, 28857, 770, 49, 55, 28857, 770, 49, 56, 28857, 770, 49, 57,
+    28857, 770, 50, 48, 28857, 770, 50, 49, 28857, 770, 50, 50, 28857, 770,
+    50, 51, 28857, 770, 50, 52, 28857, 778, 104, 80, 97, 522, 100, 97, 522,
+    65, 85, 778, 98, 97, 114, 522, 111, 86, 522, 112, 99, 522, 100, 109, 778,
+    100, 109, 178, 778, 100, 109, 179, 522, 73, 85, 522, 24179, 25104, 522,
+    26157, 21644, 522, 22823, 27491, 522, 26126, 27835, 1034, 26666, 24335,
+    20250, 31038, 522, 112, 65, 522, 110, 65, 522, 956, 65, 522, 109, 65,
+    522, 107, 65, 522, 75, 66, 522, 77, 66, 522, 71, 66, 778, 99, 97, 108,
+    1034, 107, 99, 97, 108, 522, 112, 70, 522, 110, 70, 522, 956, 70, 522,
+    956, 103, 522, 109, 103, 522, 107, 103, 522, 72, 122, 778, 107, 72, 122,
+    778, 77, 72, 122, 778, 71, 72, 122, 778, 84, 72, 122, 522, 956, 8467,
+    522, 109, 8467, 522, 100, 8467, 522, 107, 8467, 522, 102, 109, 522, 110,
+    109, 522, 956, 109, 522, 109, 109, 522, 99, 109, 522, 107, 109, 778, 109,
+    109, 178, 778, 99, 109, 178, 522, 109, 178, 778, 107, 109, 178, 778, 109,
+    109, 179, 778, 99, 109, 179, 522, 109, 179, 778, 107, 109, 179, 778, 109,
+    8725, 115, 1034, 109, 8725, 115, 178, 522, 80, 97, 778, 107, 80, 97, 778,
+    77, 80, 97, 778, 71, 80, 97, 778, 114, 97, 100, 1290, 114, 97, 100, 8725,
+    115, 1546, 114, 97, 100, 8725, 115, 178, 522, 112, 115, 522, 110, 115,
+    522, 956, 115, 522, 109, 115, 522, 112, 86, 522, 110, 86, 522, 956, 86,
+    522, 109, 86, 522, 107, 86, 522, 77, 86, 522, 112, 87, 522, 110, 87, 522,
+    956, 87, 522, 109, 87, 522, 107, 87, 522, 77, 87, 522, 107, 937, 522, 77,
+    937, 1034, 97, 46, 109, 46, 522, 66, 113, 522, 99, 99, 522, 99, 100,
+    1034, 67, 8725, 107, 103, 778, 67, 111, 46, 522, 100, 66, 522, 71, 121,
+    522, 104, 97, 522, 72, 80, 522, 105, 110, 522, 75, 75, 522, 75, 77, 522,
+    107, 116, 522, 108, 109, 522, 108, 110, 778, 108, 111, 103, 522, 108,
+    120, 522, 109, 98, 778, 109, 105, 108, 778, 109, 111, 108, 522, 80, 72,
+    1034, 112, 46, 109, 46, 778, 80, 80, 77, 522, 80, 82, 522, 115, 114, 522,
+    83, 118, 522, 87, 98, 778, 86, 8725, 109, 778, 65, 8725, 109, 514, 49,
+    26085, 514, 50, 26085, 514, 51, 26085, 514, 52, 26085, 514, 53, 26085,
+    514, 54, 26085, 514, 55, 26085, 514, 56, 26085, 514, 57, 26085, 770, 49,
+    48, 26085, 770, 49, 49, 26085, 770, 49, 50, 26085, 770, 49, 51, 26085,
+    770, 49, 52, 26085, 770, 49, 53, 26085, 770, 49, 54, 26085, 770, 49, 55,
+    26085, 770, 49, 56, 26085, 770, 49, 57, 26085, 770, 50, 48, 26085, 770,
+    50, 49, 26085, 770, 50, 50, 26085, 770, 50, 51, 26085, 770, 50, 52,
+    26085, 770, 50, 53, 26085, 770, 50, 54, 26085, 770, 50, 55, 26085, 770,
+    50, 56, 26085, 770, 50, 57, 26085, 770, 51, 48, 26085, 770, 51, 49,
+    26085, 778, 103, 97, 108, 259, 1098, 259, 1100, 259, 42863, 259, 294,
+    259, 339, 259, 42791, 259, 43831, 259, 619, 259, 43858, 256, 35912, 256,
+    26356, 256, 36554, 256, 36040, 256, 28369, 256, 20018, 256, 21477, 256,
+    40860, 256, 40860, 256, 22865, 256, 37329, 256, 21895, 256, 22856, 256,
+    25078, 256, 30313, 256, 32645, 256, 34367, 256, 34746, 256, 35064, 256,
+    37007, 256, 27138, 256, 27931, 256, 28889, 256, 29662, 256, 33853, 256,
+    37226, 256, 39409, 256, 20098, 256, 21365, 256, 27396, 256, 29211, 256,
+    34349, 256, 40478, 256, 23888, 256, 28651, 256, 34253, 256, 35172, 256,
+    25289, 256, 33240, 256, 34847, 256, 24266, 256, 26391, 256, 28010, 256,
+    29436, 256, 37070, 256, 20358, 256, 20919, 256, 21214, 256, 25796, 256,
+    27347, 256, 29200, 256, 30439, 256, 32769, 256, 34310, 256, 34396, 256,
+    36335, 256, 38706, 256, 39791, 256, 40442, 256, 30860, 256, 31103, 256,
+    32160, 256, 33737, 256, 37636, 256, 40575, 256, 35542, 256, 22751, 256,
+    24324, 256, 31840, 256, 32894, 256, 29282, 256, 30922, 256, 36034, 256,
+    38647, 256, 22744, 256, 23650, 256, 27155, 256, 28122, 256, 28431, 256,
+    32047, 256, 32311, 256, 38475, 256, 21202, 256, 32907, 256, 20956, 256,
+    20940, 256, 31260, 256, 32190, 256, 33777, 256, 38517, 256, 35712, 256,
+    25295, 256, 27138, 256, 35582, 256, 20025, 256, 23527, 256, 24594, 256,
+    29575, 256, 30064, 256, 21271, 256, 30971, 256, 20415, 256, 24489, 256,
+    19981, 256, 27852, 256, 25976, 256, 32034, 256, 21443, 256, 22622, 256,
+    30465, 256, 33865, 256, 35498, 256, 27578, 256, 36784, 256, 27784, 256,
+    25342, 256, 33509, 256, 25504, 256, 30053, 256, 20142, 256, 20841, 256,
+    20937, 256, 26753, 256, 31975, 256, 33391, 256, 35538, 256, 37327, 256,
+    21237, 256, 21570, 256, 22899, 256, 24300, 256, 26053, 256, 28670, 256,
+    31018, 256, 38317, 256, 39530, 256, 40599, 256, 40654, 256, 21147, 256,
+    26310, 256, 27511, 256, 36706, 256, 24180, 256, 24976, 256, 25088, 256,
+    25754, 256, 28451, 256, 29001, 256, 29833, 256, 31178, 256, 32244, 256,
+    32879, 256, 36646, 256, 34030, 256, 36899, 256, 37706, 256, 21015, 256,
+    21155, 256, 21693, 256, 28872, 256, 35010, 256, 35498, 256, 24265, 256,
+    24565, 256, 25467, 256, 27566, 256, 31806, 256, 29557, 256, 20196, 256,
+    22265, 256, 23527, 256, 23994, 256, 24604, 256, 29618, 256, 29801, 256,
+    32666, 256, 32838, 256, 37428, 256, 38646, 256, 38728, 256, 38936, 256,
+    20363, 256, 31150, 256, 37300, 256, 38584, 256, 24801, 256, 20102, 256,
+    20698, 256, 23534, 256, 23615, 256, 26009, 256, 27138, 256, 29134, 256,
+    30274, 256, 34044, 256, 36988, 256, 40845, 256, 26248, 256, 38446, 256,
+    21129, 256, 26491, 256, 26611, 256, 27969, 256, 28316, 256, 29705, 256,
+    30041, 256, 30827, 256, 32016, 256, 39006, 256, 20845, 256, 25134, 256,
+    38520, 256, 20523, 256, 23833, 256, 28138, 256, 36650, 256, 24459, 256,
+    24900, 256, 26647, 256, 29575, 256, 38534, 256, 21033, 256, 21519, 256,
+    23653, 256, 26131, 256, 26446, 256, 26792, 256, 27877, 256, 29702, 256,
+    30178, 256, 32633, 256, 35023, 256, 35041, 256, 37324, 256, 38626, 256,
+    21311, 256, 28346, 256, 21533, 256, 29136, 256, 29848, 256, 34298, 256,
+    38563, 256, 40023, 256, 40607, 256, 26519, 256, 28107, 256, 33256, 256,
+    31435, 256, 31520, 256, 31890, 256, 29376, 256, 28825, 256, 35672, 256,
+    20160, 256, 33590, 256, 21050, 256, 20999, 256, 24230, 256, 25299, 256,
+    31958, 256, 23429, 256, 27934, 256, 26292, 256, 36667, 256, 34892, 256,
+    38477, 256, 35211, 256, 24275, 256, 20800, 256, 21952, 256, 22618, 256,
+    26228, 256, 20958, 256, 29482, 256, 30410, 256, 31036, 256, 31070, 256,
+    31077, 256, 31119, 256, 38742, 256, 31934, 256, 32701, 256, 34322, 256,
+    35576, 256, 36920, 256, 37117, 256, 39151, 256, 39164, 256, 39208, 256,
+    40372, 256, 37086, 256, 38583, 256, 20398, 256, 20711, 256, 20813, 256,
+    21193, 256, 21220, 256, 21329, 256, 21917, 256, 22022, 256, 22120, 256,
+    22592, 256, 22696, 256, 23652, 256, 23662, 256, 24724, 256, 24936, 256,
+    24974, 256, 25074, 256, 25935, 256, 26082, 256, 26257, 256, 26757, 256,
+    28023, 256, 28186, 256, 28450, 256, 29038, 256, 29227, 256, 29730, 256,
+    30865, 256, 31038, 256, 31049, 256, 31048, 256, 31056, 256, 31062, 256,
+    31069, 256, 31117, 256, 31118, 256, 31296, 256, 31361, 256, 31680, 256,
+    32244, 256, 32265, 256, 32321, 256, 32626, 256, 32773, 256, 33261, 256,
+    33401, 256, 33401, 256, 33879, 256, 35088, 256, 35222, 256, 35585, 256,
+    35641, 256, 36051, 256, 36104, 256, 36790, 256, 36920, 256, 38627, 256,
+    38911, 256, 38971, 256, 24693, 256, 55376, 57070, 256, 33304, 256, 20006,
+    256, 20917, 256, 20840, 256, 20352, 256, 20805, 256, 20864, 256, 21191,
+    256, 21242, 256, 21917, 256, 21845, 256, 21913, 256, 21986, 256, 22618,
+    256, 22707, 256, 22852, 256, 22868, 256, 23138, 256, 23336, 256, 24274,
+    256, 24281, 256, 24425, 256, 24493, 256, 24792, 256, 24910, 256, 24840,
+    256, 24974, 256, 24928, 256, 25074, 256, 25140, 256, 25540, 256, 25628,
+    256, 25682, 256, 25942, 256, 26228, 256, 26391, 256, 26395, 256, 26454,
+    256, 27513, 256, 27578, 256, 27969, 256, 28379, 256, 28363, 256, 28450,
+    256, 28702, 256, 29038, 256, 30631, 256, 29237, 256, 29359, 256, 29482,
+    256, 29809, 256, 29958, 256, 30011, 256, 30237, 256, 30239, 256, 30410,
+    256, 30427, 256, 30452, 256, 30538, 256, 30528, 256, 30924, 256, 31409,
+    256, 31680, 256, 31867, 256, 32091, 256, 32244, 256, 32574, 256, 32773,
+    256, 33618, 256, 33775, 256, 34681, 256, 35137, 256, 35206, 256, 35222,
+    256, 35519, 256, 35576, 256, 35531, 256, 35585, 256, 35582, 256, 35565,
+    256, 35641, 256, 35722, 256, 36104, 256, 36664, 256, 36978, 256, 37273,
+    256, 37494, 256, 38524, 256, 38627, 256, 38742, 256, 38875, 256, 38911,
+    256, 38923, 256, 38971, 256, 39698, 256, 40860, 256, 55370, 56394, 256,
+    55370, 56388, 256, 55372, 57301, 256, 15261, 256, 16408, 256, 16441, 256,
+    55380, 56905, 256, 55383, 56528, 256, 55391, 57043, 256, 40771, 256,
+    40846, 514, 102, 102, 514, 102, 105, 514, 102, 108, 770, 102, 102, 105,
+    770, 102, 102, 108, 514, 383, 116, 514, 115, 116, 514, 1396, 1398, 514,
+    1396, 1381, 514, 1396, 1387, 514, 1406, 1398, 514, 1396, 1389, 512, 1497,
+    1460, 512, 1522, 1463, 262, 1506, 262, 1488, 262, 1491, 262, 1492, 262,
+    1499, 262, 1500, 262, 1501, 262, 1512, 262, 1514, 262, 43, 512, 1513,
+    1473, 512, 1513, 1474, 512, 64329, 1473, 512, 64329, 1474, 512, 1488,
+    1463, 512, 1488, 1464, 512, 1488, 1468, 512, 1489, 1468, 512, 1490, 1468,
+    512, 1491, 1468, 512, 1492, 1468, 512, 1493, 1468, 512, 1494, 1468, 512,
+    1496, 1468, 512, 1497, 1468, 512, 1498, 1468, 512, 1499, 1468, 512, 1500,
+    1468, 512, 1502, 1468, 512, 1504, 1468, 512, 1505, 1468, 512, 1507, 1468,
+    512, 1508, 1468, 512, 1510, 1468, 512, 1511, 1468, 512, 1512, 1468, 512,
+    1513, 1468, 512, 1514, 1468, 512, 1493, 1465, 512, 1489, 1471, 512, 1499,
+    1471, 512, 1508, 1471, 514, 1488, 1500, 267, 1649, 268, 1649, 267, 1659,
+    268, 1659, 269, 1659, 270, 1659, 267, 1662, 268, 1662, 269, 1662, 270,
+    1662, 267, 1664, 268, 1664, 269, 1664, 270, 1664, 267, 1658, 268, 1658,
+    269, 1658, 270, 1658, 267, 1663, 268, 1663, 269, 1663, 270, 1663, 267,
+    1657, 268, 1657, 269, 1657, 270, 1657, 267, 1700, 268, 1700, 269, 1700,
+    270, 1700, 267, 1702, 268, 1702, 269, 1702, 270, 1702, 267, 1668, 268,
+    1668, 269, 1668, 270, 1668, 267, 1667, 268, 1667, 269, 1667, 270, 1667,
+    267, 1670, 268, 1670, 269, 1670, 270, 1670, 267, 1671, 268, 1671, 269,
+    1671, 270, 1671, 267, 1677, 268, 1677, 267, 1676, 268, 1676, 267, 1678,
+    268, 1678, 267, 1672, 268, 1672, 267, 1688, 268, 1688, 267, 1681, 268,
+    1681, 267, 1705, 268, 1705, 269, 1705, 270, 1705, 267, 1711, 268, 1711,
+    269, 1711, 270, 1711, 267, 1715, 268, 1715, 269, 1715, 270, 1715, 267,
+    1713, 268, 1713, 269, 1713, 270, 1713, 267, 1722, 268, 1722, 267, 1723,
+    268, 1723, 269, 1723, 270, 1723, 267, 1728, 268, 1728, 267, 1729, 268,
+    1729, 269, 1729, 270, 1729, 267, 1726, 268, 1726, 269, 1726, 270, 1726,
+    267, 1746, 268, 1746, 267, 1747, 268, 1747, 267, 1709, 268, 1709, 269,
+    1709, 270, 1709, 267, 1735, 268, 1735, 267, 1734, 268, 1734, 267, 1736,
+    268, 1736, 267, 1655, 267, 1739, 268, 1739, 267, 1733, 268, 1733, 267,
+    1737, 268, 1737, 267, 1744, 268, 1744, 269, 1744, 270, 1744, 269, 1609,
+    270, 1609, 523, 1574, 1575, 524, 1574, 1575, 523, 1574, 1749, 524, 1574,
+    1749, 523, 1574, 1608, 524, 1574, 1608, 523, 1574, 1735, 524, 1574, 1735,
+    523, 1574, 1734, 524, 1574, 1734, 523, 1574, 1736, 524, 1574, 1736, 523,
+    1574, 1744, 524, 1574, 1744, 525, 1574, 1744, 523, 1574, 1609, 524, 1574,
+    1609, 525, 1574, 1609, 267, 1740, 268, 1740, 269, 1740, 270, 1740, 523,
+    1574, 1580, 523, 1574, 1581, 523, 1574, 1605, 523, 1574, 1609, 523, 1574,
+    1610, 523, 1576, 1580, 523, 1576, 1581, 523, 1576, 1582, 523, 1576, 1605,
+    523, 1576, 1609, 523, 1576, 1610, 523, 1578, 1580, 523, 1578, 1581, 523,
+    1578, 1582, 523, 1578, 1605, 523, 1578, 1609, 523, 1578, 1610, 523, 1579,
+    1580, 523, 1579, 1605, 523, 1579, 1609, 523, 1579, 1610, 523, 1580, 1581,
+    523, 1580, 1605, 523, 1581, 1580, 523, 1581, 1605, 523, 1582, 1580, 523,
+    1582, 1581, 523, 1582, 1605, 523, 1587, 1580, 523, 1587, 1581, 523, 1587,
+    1582, 523, 1587, 1605, 523, 1589, 1581, 523, 1589, 1605, 523, 1590, 1580,
+    523, 1590, 1581, 523, 1590, 1582, 523, 1590, 1605, 523, 1591, 1581, 523,
+    1591, 1605, 523, 1592, 1605, 523, 1593, 1580, 523, 1593, 1605, 523, 1594,
+    1580, 523, 1594, 1605, 523, 1601, 1580, 523, 1601, 1581, 523, 1601, 1582,
+    523, 1601, 1605, 523, 1601, 1609, 523, 1601, 1610, 523, 1602, 1581, 523,
+    1602, 1605, 523, 1602, 1609, 523, 1602, 1610, 523, 1603, 1575, 523, 1603,
+    1580, 523, 1603, 1581, 523, 1603, 1582, 523, 1603, 1604, 523, 1603, 1605,
+    523, 1603, 1609, 523, 1603, 1610, 523, 1604, 1580, 523, 1604, 1581, 523,
+    1604, 1582, 523, 1604, 1605, 523, 1604, 1609, 523, 1604, 1610, 523, 1605,
+    1580, 523, 1605, 1581, 523, 1605, 1582, 523, 1605, 1605, 523, 1605, 1609,
+    523, 1605, 1610, 523, 1606, 1580, 523, 1606, 1581, 523, 1606, 1582, 523,
+    1606, 1605, 523, 1606, 1609, 523, 1606, 1610, 523, 1607, 1580, 523, 1607,
+    1605, 523, 1607, 1609, 523, 1607, 1610, 523, 1610, 1580, 523, 1610, 1581,
+    523, 1610, 1582, 523, 1610, 1605, 523, 1610, 1609, 523, 1610, 1610, 523,
+    1584, 1648, 523, 1585, 1648, 523, 1609, 1648, 779, 32, 1612, 1617, 779,
+    32, 1613, 1617, 779, 32, 1614, 1617, 779, 32, 1615, 1617, 779, 32, 1616,
+    1617, 779, 32, 1617, 1648, 524, 1574, 1585, 524, 1574, 1586, 524, 1574,
+    1605, 524, 1574, 1606, 524, 1574, 1609, 524, 1574, 1610, 524, 1576, 1585,
+    524, 1576, 1586, 524, 1576, 1605, 524, 1576, 1606, 524, 1576, 1609, 524,
+    1576, 1610, 524, 1578, 1585, 524, 1578, 1586, 524, 1578, 1605, 524, 1578,
+    1606, 524, 1578, 1609, 524, 1578, 1610, 524, 1579, 1585, 524, 1579, 1586,
+    524, 1579, 1605, 524, 1579, 1606, 524, 1579, 1609, 524, 1579, 1610, 524,
+    1601, 1609, 524, 1601, 1610, 524, 1602, 1609, 524, 1602, 1610, 524, 1603,
+    1575, 524, 1603, 1604, 524, 1603, 1605, 524, 1603, 1609, 524, 1603, 1610,
+    524, 1604, 1605, 524, 1604, 1609, 524, 1604, 1610, 524, 1605, 1575, 524,
+    1605, 1605, 524, 1606, 1585, 524, 1606, 1586, 524, 1606, 1605, 524, 1606,
+    1606, 524, 1606, 1609, 524, 1606, 1610, 524, 1609, 1648, 524, 1610, 1585,
+    524, 1610, 1586, 524, 1610, 1605, 524, 1610, 1606, 524, 1610, 1609, 524,
+    1610, 1610, 525, 1574, 1580, 525, 1574, 1581, 525, 1574, 1582, 525, 1574,
+    1605, 525, 1574, 1607, 525, 1576, 1580, 525, 1576, 1581, 525, 1576, 1582,
+    525, 1576, 1605, 525, 1576, 1607, 525, 1578, 1580, 525, 1578, 1581, 525,
+    1578, 1582, 525, 1578, 1605, 525, 1578, 1607, 525, 1579, 1605, 525, 1580,
+    1581, 525, 1580, 1605, 525, 1581, 1580, 525, 1581, 1605, 525, 1582, 1580,
+    525, 1582, 1605, 525, 1587, 1580, 525, 1587, 1581, 525, 1587, 1582, 525,
+    1587, 1605, 525, 1589, 1581, 525, 1589, 1582, 525, 1589, 1605, 525, 1590,
+    1580, 525, 1590, 1581, 525, 1590, 1582, 525, 1590, 1605, 525, 1591, 1581,
+    525, 1592, 1605, 525, 1593, 1580, 525, 1593, 1605, 525, 1594, 1580, 525,
+    1594, 1605, 525, 1601, 1580, 525, 1601, 1581, 525, 1601, 1582, 525, 1601,
+    1605, 525, 1602, 1581, 525, 1602, 1605, 525, 1603, 1580, 525, 1603, 1581,
+    525, 1603, 1582, 525, 1603, 1604, 525, 1603, 1605, 525, 1604, 1580, 525,
+    1604, 1581, 525, 1604, 1582, 525, 1604, 1605, 525, 1604, 1607, 525, 1605,
+    1580, 525, 1605, 1581, 525, 1605, 1582, 525, 1605, 1605, 525, 1606, 1580,
+    525, 1606, 1581, 525, 1606, 1582, 525, 1606, 1605, 525, 1606, 1607, 525,
+    1607, 1580, 525, 1607, 1605, 525, 1607, 1648, 525, 1610, 1580, 525, 1610,
+    1581, 525, 1610, 1582, 525, 1610, 1605, 525, 1610, 1607, 526, 1574, 1605,
+    526, 1574, 1607, 526, 1576, 1605, 526, 1576, 1607, 526, 1578, 1605, 526,
+    1578, 1607, 526, 1579, 1605, 526, 1579, 1607, 526, 1587, 1605, 526, 1587,
+    1607, 526, 1588, 1605, 526, 1588, 1607, 526, 1603, 1604, 526, 1603, 1605,
+    526, 1604, 1605, 526, 1606, 1605, 526, 1606, 1607, 526, 1610, 1605, 526,
+    1610, 1607, 782, 1600, 1614, 1617, 782, 1600, 1615, 1617, 782, 1600,
+    1616, 1617, 523, 1591, 1609, 523, 1591, 1610, 523, 1593, 1609, 523, 1593,
+    1610, 523, 1594, 1609, 523, 1594, 1610, 523, 1587, 1609, 523, 1587, 1610,
+    523, 1588, 1609, 523, 1588, 1610, 523, 1581, 1609, 523, 1581, 1610, 523,
+    1580, 1609, 523, 1580, 1610, 523, 1582, 1609, 523, 1582, 1610, 523, 1589,
+    1609, 523, 1589, 1610, 523, 1590, 1609, 523, 1590, 1610, 523, 1588, 1580,
+    523, 1588, 1581, 523, 1588, 1582, 523, 1588, 1605, 523, 1588, 1585, 523,
+    1587, 1585, 523, 1589, 1585, 523, 1590, 1585, 524, 1591, 1609, 524, 1591,
+    1610, 524, 1593, 1609, 524, 1593, 1610, 524, 1594, 1609, 524, 1594, 1610,
+    524, 1587, 1609, 524, 1587, 1610, 524, 1588, 1609, 524, 1588, 1610, 524,
+    1581, 1609, 524, 1581, 1610, 524, 1580, 1609, 524, 1580, 1610, 524, 1582,
+    1609, 524, 1582, 1610, 524, 1589, 1609, 524, 1589, 1610, 524, 1590, 1609,
+    524, 1590, 1610, 524, 1588, 1580, 524, 1588, 1581, 524, 1588, 1582, 524,
+    1588, 1605, 524, 1588, 1585, 524, 1587, 1585, 524, 1589, 1585, 524, 1590,
+    1585, 525, 1588, 1580, 525, 1588, 1581, 525, 1588, 1582, 525, 1588, 1605,
+    525, 1587, 1607, 525, 1588, 1607, 525, 1591, 1605, 526, 1587, 1580, 526,
+    1587, 1581, 526, 1587, 1582, 526, 1588, 1580, 526, 1588, 1581, 526, 1588,
+    1582, 526, 1591, 1605, 526, 1592, 1605, 524, 1575, 1611, 523, 1575, 1611,
+    781, 1578, 1580, 1605, 780, 1578, 1581, 1580, 781, 1578, 1581, 1580, 781,
+    1578, 1581, 1605, 781, 1578, 1582, 1605, 781, 1578, 1605, 1580, 781,
+    1578, 1605, 1581, 781, 1578, 1605, 1582, 780, 1580, 1605, 1581, 781,
+    1580, 1605, 1581, 780, 1581, 1605, 1610, 780, 1581, 1605, 1609, 781,
+    1587, 1581, 1580, 781, 1587, 1580, 1581, 780, 1587, 1580, 1609, 780,
+    1587, 1605, 1581, 781, 1587, 1605, 1581, 781, 1587, 1605, 1580, 780,
+    1587, 1605, 1605, 781, 1587, 1605, 1605, 780, 1589, 1581, 1581, 781,
+    1589, 1581, 1581, 780, 1589, 1605, 1605, 780, 1588, 1581, 1605, 781,
+    1588, 1581, 1605, 780, 1588, 1580, 1610, 780, 1588, 1605, 1582, 781,
+    1588, 1605, 1582, 780, 1588, 1605, 1605, 781, 1588, 1605, 1605, 780,
+    1590, 1581, 1609, 780, 1590, 1582, 1605, 781, 1590, 1582, 1605, 780,
+    1591, 1605, 1581, 781, 1591, 1605, 1581, 781, 1591, 1605, 1605, 780,
+    1591, 1605, 1610, 780, 1593, 1580, 1605, 780, 1593, 1605, 1605, 781,
+    1593, 1605, 1605, 780, 1593, 1605, 1609, 780, 1594, 1605, 1605, 780,
+    1594, 1605, 1610, 780, 1594, 1605, 1609, 780, 1601, 1582, 1605, 781,
+    1601, 1582, 1605, 780, 1602, 1605, 1581, 780, 1602, 1605, 1605, 780,
+    1604, 1581, 1605, 780, 1604, 1581, 1610, 780, 1604, 1581, 1609, 781,
+    1604, 1580, 1580, 780, 1604, 1580, 1580, 780, 1604, 1582, 1605, 781,
+    1604, 1582, 1605, 780, 1604, 1605, 1581, 781, 1604, 1605, 1581, 781,
+    1605, 1581, 1580, 781, 1605, 1581, 1605, 780, 1605, 1581, 1610, 781,
+    1605, 1580, 1581, 781, 1605, 1580, 1605, 781, 1605, 1582, 1580, 781,
+    1605, 1582, 1605, 781, 1605, 1580, 1582, 781, 1607, 1605, 1580, 781,
+    1607, 1605, 1605, 781, 1606, 1581, 1605, 780, 1606, 1581, 1609, 780,
+    1606, 1580, 1605, 781, 1606, 1580, 1605, 780, 1606, 1580, 1609, 780,
+    1606, 1605, 1610, 780, 1606, 1605, 1609, 780, 1610, 1605, 1605, 781,
+    1610, 1605, 1605, 780, 1576, 1582, 1610, 780, 1578, 1580, 1610, 780,
+    1578, 1580, 1609, 780, 1578, 1582, 1610, 780, 1578, 1582, 1609, 780,
+    1578, 1605, 1610, 780, 1578, 1605, 1609, 780, 1580, 1605, 1610, 780,
+    1580, 1581, 1609, 780, 1580, 1605, 1609, 780, 1587, 1582, 1609, 780,
+    1589, 1581, 1610, 780, 1588, 1581, 1610, 780, 1590, 1581, 1610, 780,
+    1604, 1580, 1610, 780, 1604, 1605, 1610, 780, 1610, 1581, 1610, 780,
+    1610, 1580, 1610, 780, 1610, 1605, 1610, 780, 1605, 1605, 1610, 780,
+    1602, 1605, 1610, 780, 1606, 1581, 1610, 781, 1602, 1605, 1581, 781,
+    1604, 1581, 1605, 780, 1593, 1605, 1610, 780, 1603, 1605, 1610, 781,
+    1606, 1580, 1581, 780, 1605, 1582, 1610, 781, 1604, 1580, 1605, 780,
+    1603, 1605, 1605, 780, 1604, 1580, 1605, 780, 1606, 1580, 1581, 780,
+    1580, 1581, 1610, 780, 1581, 1580, 1610, 780, 1605, 1580, 1610, 780,
+    1601, 1605, 1610, 780, 1576, 1581, 1610, 781, 1603, 1605, 1605, 781,
+    1593, 1580, 1605, 781, 1589, 1605, 1605, 780, 1587, 1582, 1610, 780,
+    1606, 1580, 1610, 779, 1589, 1604, 1746, 779, 1602, 1604, 1746, 1035,
+    1575, 1604, 1604, 1607, 1035, 1575, 1603, 1576, 1585, 1035, 1605, 1581,
+    1605, 1583, 1035, 1589, 1604, 1593, 1605, 1035, 1585, 1587, 1608, 1604,
+    1035, 1593, 1604, 1610, 1607, 1035, 1608, 1587, 1604, 1605, 779, 1589,
+    1604, 1609, 4619, 1589, 1604, 1609, 32, 1575, 1604, 1604, 1607, 32, 1593,
+    1604, 1610, 1607, 32, 1608, 1587, 1604, 1605, 2059, 1580, 1604, 32, 1580,
+    1604, 1575, 1604, 1607, 1035, 1585, 1740, 1575, 1604, 265, 44, 265,
+    12289, 265, 12290, 265, 58, 265, 59, 265, 33, 265, 63, 265, 12310, 265,
+    12311, 265, 8230, 265, 8229, 265, 8212, 265, 8211, 265, 95, 265, 95, 265,
+    40, 265, 41, 265, 123, 265, 125, 265, 12308, 265, 12309, 265, 12304, 265,
+    12305, 265, 12298, 265, 12299, 265, 12296, 265, 12297, 265, 12300, 265,
+    12301, 265, 12302, 265, 12303, 265, 91, 265, 93, 258, 8254, 258, 8254,
+    258, 8254, 258, 8254, 258, 95, 258, 95, 258, 95, 271, 44, 271, 12289,
+    271, 46, 271, 59, 271, 58, 271, 63, 271, 33, 271, 8212, 271, 40, 271, 41,
+    271, 123, 271, 125, 271, 12308, 271, 12309, 271, 35, 271, 38, 271, 42,
+    271, 43, 271, 45, 271, 60, 271, 62, 271, 61, 271, 92, 271, 36, 271, 37,
+    271, 64, 523, 32, 1611, 526, 1600, 1611, 523, 32, 1612, 523, 32, 1613,
+    523, 32, 1614, 526, 1600, 1614, 523, 32, 1615, 526, 1600, 1615, 523, 32,
+    1616, 526, 1600, 1616, 523, 32, 1617, 526, 1600, 1617, 523, 32, 1618,
+    526, 1600, 1618, 267, 1569, 267, 1570, 268, 1570, 267, 1571, 268, 1571,
+    267, 1572, 268, 1572, 267, 1573, 268, 1573, 267, 1574, 268, 1574, 269,
+    1574, 270, 1574, 267, 1575, 268, 1575, 267, 1576, 268, 1576, 269, 1576,
+    270, 1576, 267, 1577, 268, 1577, 267, 1578, 268, 1578, 269, 1578, 270,
+    1578, 267, 1579, 268, 1579, 269, 1579, 270, 1579, 267, 1580, 268, 1580,
+    269, 1580, 270, 1580, 267, 1581, 268, 1581, 269, 1581, 270, 1581, 267,
+    1582, 268, 1582, 269, 1582, 270, 1582, 267, 1583, 268, 1583, 267, 1584,
+    268, 1584, 267, 1585, 268, 1585, 267, 1586, 268, 1586, 267, 1587, 268,
+    1587, 269, 1587, 270, 1587, 267, 1588, 268, 1588, 269, 1588, 270, 1588,
+    267, 1589, 268, 1589, 269, 1589, 270, 1589, 267, 1590, 268, 1590, 269,
+    1590, 270, 1590, 267, 1591, 268, 1591, 269, 1591, 270, 1591, 267, 1592,
+    268, 1592, 269, 1592, 270, 1592, 267, 1593, 268, 1593, 269, 1593, 270,
+    1593, 267, 1594, 268, 1594, 269, 1594, 270, 1594, 267, 1601, 268, 1601,
+    269, 1601, 270, 1601, 267, 1602, 268, 1602, 269, 1602, 270, 1602, 267,
+    1603, 268, 1603, 269, 1603, 270, 1603, 267, 1604, 268, 1604, 269, 1604,
+    270, 1604, 267, 1605, 268, 1605, 269, 1605, 270, 1605, 267, 1606, 268,
+    1606, 269, 1606, 270, 1606, 267, 1607, 268, 1607, 269, 1607, 270, 1607,
+    267, 1608, 268, 1608, 267, 1609, 268, 1609, 267, 1610, 268, 1610, 269,
+    1610, 270, 1610, 523, 1604, 1570, 524, 1604, 1570, 523, 1604, 1571, 524,
+    1604, 1571, 523, 1604, 1573, 524, 1604, 1573, 523, 1604, 1575, 524, 1604,
+    1575, 264, 33, 264, 34, 264, 35, 264, 36, 264, 37, 264, 38, 264, 39, 264,
+    40, 264, 41, 264, 42, 264, 43, 264, 44, 264, 45, 264, 46, 264, 47, 264,
+    48, 264, 49, 264, 50, 264, 51, 264, 52, 264, 53, 264, 54, 264, 55, 264,
+    56, 264, 57, 264, 58, 264, 59, 264, 60, 264, 61, 264, 62, 264, 63, 264,
+    64, 264, 65, 264, 66, 264, 67, 264, 68, 264, 69, 264, 70, 264, 71, 264,
+    72, 264, 73, 264, 74, 264, 75, 264, 76, 264, 77, 264, 78, 264, 79, 264,
+    80, 264, 81, 264, 82, 264, 83, 264, 84, 264, 85, 264, 86, 264, 87, 264,
+    88, 264, 89, 264, 90, 264, 91, 264, 92, 264, 93, 264, 94, 264, 95, 264,
+    96, 264, 97, 264, 98, 264, 99, 264, 100, 264, 101, 264, 102, 264, 103,
+    264, 104, 264, 105, 264, 106, 264, 107, 264, 108, 264, 109, 264, 110,
+    264, 111, 264, 112, 264, 113, 264, 114, 264, 115, 264, 116, 264, 117,
+    264, 118, 264, 119, 264, 120, 264, 121, 264, 122, 264, 123, 264, 124,
+    264, 125, 264, 126, 264, 10629, 264, 10630, 272, 12290, 272, 12300, 272,
+    12301, 272, 12289, 272, 12539, 272, 12530, 272, 12449, 272, 12451, 272,
+    12453, 272, 12455, 272, 12457, 272, 12515, 272, 12517, 272, 12519, 272,
+    12483, 272, 12540, 272, 12450, 272, 12452, 272, 12454, 272, 12456, 272,
+    12458, 272, 12459, 272, 12461, 272, 12463, 272, 12465, 272, 12467, 272,
+    12469, 272, 12471, 272, 12473, 272, 12475, 272, 12477, 272, 12479, 272,
+    12481, 272, 12484, 272, 12486, 272, 12488, 272, 12490, 272, 12491, 272,
+    12492, 272, 12493, 272, 12494, 272, 12495, 272, 12498, 272, 12501, 272,
+    12504, 272, 12507, 272, 12510, 272, 12511, 272, 12512, 272, 12513, 272,
+    12514, 272, 12516, 272, 12518, 272, 12520, 272, 12521, 272, 12522, 272,
+    12523, 272, 12524, 272, 12525, 272, 12527, 272, 12531, 272, 12441, 272,
+    12442, 272, 12644, 272, 12593, 272, 12594, 272, 12595, 272, 12596, 272,
+    12597, 272, 12598, 272, 12599, 272, 12600, 272, 12601, 272, 12602, 272,
+    12603, 272, 12604, 272, 12605, 272, 12606, 272, 12607, 272, 12608, 272,
+    12609, 272, 12610, 272, 12611, 272, 12612, 272, 12613, 272, 12614, 272,
+    12615, 272, 12616, 272, 12617, 272, 12618, 272, 12619, 272, 12620, 272,
+    12621, 272, 12622, 272, 12623, 272, 12624, 272, 12625, 272, 12626, 272,
+    12627, 272, 12628, 272, 12629, 272, 12630, 272, 12631, 272, 12632, 272,
+    12633, 272, 12634, 272, 12635, 272, 12636, 272, 12637, 272, 12638, 272,
+    12639, 272, 12640, 272, 12641, 272, 12642, 272, 12643, 264, 162, 264,
+    163, 264, 172, 264, 175, 264, 166, 264, 165, 264, 8361, 272, 9474, 272,
+    8592, 272, 8593, 272, 8594, 272, 8595, 272, 9632, 272, 9675, 512, 55300,
+    56473, 55300, 56506, 512, 55300, 56475, 55300, 56506, 512, 55300, 56485,
+    55300, 56506, 512, 55300, 56625, 55300, 56615, 512, 55300, 56626, 55300,
+    56615, 512, 55300, 57159, 55300, 57150, 512, 55300, 57159, 55300, 57175,
+    512, 55301, 56505, 55301, 56506, 512, 55301, 56505, 55301, 56496, 512,
+    55301, 56505, 55301, 56509, 512, 55301, 56760, 55301, 56751, 512, 55301,
+    56761, 55301, 56751, 512, 55348, 56663, 55348, 56677, 512, 55348, 56664,
+    55348, 56677, 512, 55348, 56671, 55348, 56686, 512, 55348, 56671, 55348,
+    56687, 512, 55348, 56671, 55348, 56688, 512, 55348, 56671, 55348, 56689,
+    512, 55348, 56671, 55348, 56690, 512, 55348, 56761, 55348, 56677, 512,
+    55348, 56762, 55348, 56677, 512, 55348, 56763, 55348, 56686, 512, 55348,
+    56764, 55348, 56686, 512, 55348, 56763, 55348, 56687, 512, 55348, 56764,
+    55348, 56687, 262, 65, 262, 66, 262, 67, 262, 68, 262, 69, 262, 70, 262,
+    71, 262, 72, 262, 73, 262, 74, 262, 75, 262, 76, 262, 77, 262, 78, 262,
+    79, 262, 80, 262, 81, 262, 82, 262, 83, 262, 84, 262, 85, 262, 86, 262,
+    87, 262, 88, 262, 89, 262, 90, 262, 97, 262, 98, 262, 99, 262, 100, 262,
+    101, 262, 102, 262, 103, 262, 104, 262, 105, 262, 106, 262, 107, 262,
+    108, 262, 109, 262, 110, 262, 111, 262, 112, 262, 113, 262, 114, 262,
+    115, 262, 116, 262, 117, 262, 118, 262, 119, 262, 120, 262, 121, 262,
+    122, 262, 65, 262, 66, 262, 67, 262, 68, 262, 69, 262, 70, 262, 71, 262,
+    72, 262, 73, 262, 74, 262, 75, 262, 76, 262, 77, 262, 78, 262, 79, 262,
+    80, 262, 81, 262, 82, 262, 83, 262, 84, 262, 85, 262, 86, 262, 87, 262,
+    88, 262, 89, 262, 90, 262, 97, 262, 98, 262, 99, 262, 100, 262, 101, 262,
+    102, 262, 103, 262, 105, 262, 106, 262, 107, 262, 108, 262, 109, 262,
+    110, 262, 111, 262, 112, 262, 113, 262, 114, 262, 115, 262, 116, 262,
+    117, 262, 118, 262, 119, 262, 120, 262, 121, 262, 122, 262, 65, 262, 66,
+    262, 67, 262, 68, 262, 69, 262, 70, 262, 71, 262, 72, 262, 73, 262, 74,
+    262, 75, 262, 76, 262, 77, 262, 78, 262, 79, 262, 80, 262, 81, 262, 82,
+    262, 83, 262, 84, 262, 85, 262, 86, 262, 87, 262, 88, 262, 89, 262, 90,
+    262, 97, 262, 98, 262, 99, 262, 100, 262, 101, 262, 102, 262, 103, 262,
+    104, 262, 105, 262, 106, 262, 107, 262, 108, 262, 109, 262, 110, 262,
+    111, 262, 112, 262, 113, 262, 114, 262, 115, 262, 116, 262, 117, 262,
+    118, 262, 119, 262, 120, 262, 121, 262, 122, 262, 65, 262, 67, 262, 68,
+    262, 71, 262, 74, 262, 75, 262, 78, 262, 79, 262, 80, 262, 81, 262, 83,
+    262, 84, 262, 85, 262, 86, 262, 87, 262, 88, 262, 89, 262, 90, 262, 97,
+    262, 98, 262, 99, 262, 100, 262, 102, 262, 104, 262, 105, 262, 106, 262,
+    107, 262, 108, 262, 109, 262, 110, 262, 112, 262, 113, 262, 114, 262,
+    115, 262, 116, 262, 117, 262, 118, 262, 119, 262, 120, 262, 121, 262,
+    122, 262, 65, 262, 66, 262, 67, 262, 68, 262, 69, 262, 70, 262, 71, 262,
+    72, 262, 73, 262, 74, 262, 75, 262, 76, 262, 77, 262, 78, 262, 79, 262,
+    80, 262, 81, 262, 82, 262, 83, 262, 84, 262, 85, 262, 86, 262, 87, 262,
+    88, 262, 89, 262, 90, 262, 97, 262, 98, 262, 99, 262, 100, 262, 101, 262,
+    102, 262, 103, 262, 104, 262, 105, 262, 106, 262, 107, 262, 108, 262,
+    109, 262, 110, 262, 111, 262, 112, 262, 113, 262, 114, 262, 115, 262,
+    116, 262, 117, 262, 118, 262, 119, 262, 120, 262, 121, 262, 122, 262, 65,
+    262, 66, 262, 68, 262, 69, 262, 70, 262, 71, 262, 74, 262, 75, 262, 76,
+    262, 77, 262, 78, 262, 79, 262, 80, 262, 81, 262, 83, 262, 84, 262, 85,
+    262, 86, 262, 87, 262, 88, 262, 89, 262, 97, 262, 98, 262, 99, 262, 100,
+    262, 101, 262, 102, 262, 103, 262, 104, 262, 105, 262, 106, 262, 107,
+    262, 108, 262, 109, 262, 110, 262, 111, 262, 112, 262, 113, 262, 114,
+    262, 115, 262, 116, 262, 117, 262, 118, 262, 119, 262, 120, 262, 121,
+    262, 122, 262, 65, 262, 66, 262, 68, 262, 69, 262, 70, 262, 71, 262, 73,
+    262, 74, 262, 75, 262, 76, 262, 77, 262, 79, 262, 83, 262, 84, 262, 85,
+    262, 86, 262, 87, 262, 88, 262, 89, 262, 97, 262, 98, 262, 99, 262, 100,
+    262, 101, 262, 102, 262, 103, 262, 104, 262, 105, 262, 106, 262, 107,
+    262, 108, 262, 109, 262, 110, 262, 111, 262, 112, 262, 113, 262, 114,
+    262, 115, 262, 116, 262, 117, 262, 118, 262, 119, 262, 120, 262, 121,
+    262, 122, 262, 65, 262, 66, 262, 67, 262, 68, 262, 69, 262, 70, 262, 71,
+    262, 72, 262, 73, 262, 74, 262, 75, 262, 76, 262, 77, 262, 78, 262, 79,
+    262, 80, 262, 81, 262, 82, 262, 83, 262, 84, 262, 85, 262, 86, 262, 87,
+    262, 88, 262, 89, 262, 90, 262, 97, 262, 98, 262, 99, 262, 100, 262, 101,
+    262, 102, 262, 103, 262, 104, 262, 105, 262, 106, 262, 107, 262, 108,
+    262, 109, 262, 110, 262, 111, 262, 112, 262, 113, 262, 114, 262, 115,
+    262, 116, 262, 117, 262, 118, 262, 119, 262, 120, 262, 121, 262, 122,
+    262, 65, 262, 66, 262, 67, 262, 68, 262, 69, 262, 70, 262, 71, 262, 72,
+    262, 73, 262, 74, 262, 75, 262, 76, 262, 77, 262, 78, 262, 79, 262, 80,
+    262, 81, 262, 82, 262, 83, 262, 84, 262, 85, 262, 86, 262, 87, 262, 88,
+    262, 89, 262, 90, 262, 97, 262, 98, 262, 99, 262, 100, 262, 101, 262,
+    102, 262, 103, 262, 104, 262, 105, 262, 106, 262, 107, 262, 108, 262,
+    109, 262, 110, 262, 111, 262, 112, 262, 113, 262, 114, 262, 115, 262,
+    116, 262, 117, 262, 118, 262, 119, 262, 120, 262, 121, 262, 122, 262, 65,
+    262, 66, 262, 67, 262, 68, 262, 69, 262, 70, 262, 71, 262, 72, 262, 73,
+    262, 74, 262, 75, 262, 76, 262, 77, 262, 78, 262, 79, 262, 80, 262, 81,
+    262, 82, 262, 83, 262, 84, 262, 85, 262, 86, 262, 87, 262, 88, 262, 89,
+    262, 90, 262, 97, 262, 98, 262, 99, 262, 100, 262, 101, 262, 102, 262,
+    103, 262, 104, 262, 105, 262, 106, 262, 107, 262, 108, 262, 109, 262,
+    110, 262, 111, 262, 112, 262, 113, 262, 114, 262, 115, 262, 116, 262,
+    117, 262, 118, 262, 119, 262, 120, 262, 121, 262, 122, 262, 65, 262, 66,
+    262, 67, 262, 68, 262, 69, 262, 70, 262, 71, 262, 72, 262, 73, 262, 74,
+    262, 75, 262, 76, 262, 77, 262, 78, 262, 79, 262, 80, 262, 81, 262, 82,
+    262, 83, 262, 84, 262, 85, 262, 86, 262, 87, 262, 88, 262, 89, 262, 90,
+    262, 97, 262, 98, 262, 99, 262, 100, 262, 101, 262, 102, 262, 103, 262,
+    104, 262, 105, 262, 106, 262, 107, 262, 108, 262, 109, 262, 110, 262,
+    111, 262, 112, 262, 113, 262, 114, 262, 115, 262, 116, 262, 117, 262,
+    118, 262, 119, 262, 120, 262, 121, 262, 122, 262, 65, 262, 66, 262, 67,
+    262, 68, 262, 69, 262, 70, 262, 71, 262, 72, 262, 73, 262, 74, 262, 75,
+    262, 76, 262, 77, 262, 78, 262, 79, 262, 80, 262, 81, 262, 82, 262, 83,
+    262, 84, 262, 85, 262, 86, 262, 87, 262, 88, 262, 89, 262, 90, 262, 97,
+    262, 98, 262, 99, 262, 100, 262, 101, 262, 102, 262, 103, 262, 104, 262,
+    105, 262, 106, 262, 107, 262, 108, 262, 109, 262, 110, 262, 111, 262,
+    112, 262, 113, 262, 114, 262, 115, 262, 116, 262, 117, 262, 118, 262,
+    119, 262, 120, 262, 121, 262, 122, 262, 65, 262, 66, 262, 67, 262, 68,
+    262, 69, 262, 70, 262, 71, 262, 72, 262, 73, 262, 74, 262, 75, 262, 76,
+    262, 77, 262, 78, 262, 79, 262, 80, 262, 81, 262, 82, 262, 83, 262, 84,
+    262, 85, 262, 86, 262, 87, 262, 88, 262, 89, 262, 90, 262, 97, 262, 98,
+    262, 99, 262, 100, 262, 101, 262, 102, 262, 103, 262, 104, 262, 105, 262,
+    106, 262, 107, 262, 108, 262, 109, 262, 110, 262, 111, 262, 112, 262,
+    113, 262, 114, 262, 115, 262, 116, 262, 117, 262, 118, 262, 119, 262,
+    120, 262, 121, 262, 122, 262, 305, 262, 567, 262, 913, 262, 914, 262,
+    915, 262, 916, 262, 917, 262, 918, 262, 919, 262, 920, 262, 921, 262,
+    922, 262, 923, 262, 924, 262, 925, 262, 926, 262, 927, 262, 928, 262,
+    929, 262, 1012, 262, 931, 262, 932, 262, 933, 262, 934, 262, 935, 262,
+    936, 262, 937, 262, 8711, 262, 945, 262, 946, 262, 947, 262, 948, 262,
+    949, 262, 950, 262, 951, 262, 952, 262, 953, 262, 954, 262, 955, 262,
+    956, 262, 957, 262, 958, 262, 959, 262, 960, 262, 961, 262, 962, 262,
+    963, 262, 964, 262, 965, 262, 966, 262, 967, 262, 968, 262, 969, 262,
+    8706, 262, 1013, 262, 977, 262, 1008, 262, 981, 262, 1009, 262, 982, 262,
+    913, 262, 914, 262, 915, 262, 916, 262, 917, 262, 918, 262, 919, 262,
+    920, 262, 921, 262, 922, 262, 923, 262, 924, 262, 925, 262, 926, 262,
+    927, 262, 928, 262, 929, 262, 1012, 262, 931, 262, 932, 262, 933, 262,
+    934, 262, 935, 262, 936, 262, 937, 262, 8711, 262, 945, 262, 946, 262,
+    947, 262, 948, 262, 949, 262, 950, 262, 951, 262, 952, 262, 953, 262,
+    954, 262, 955, 262, 956, 262, 957, 262, 958, 262, 959, 262, 960, 262,
+    961, 262, 962, 262, 963, 262, 964, 262, 965, 262, 966, 262, 967, 262,
+    968, 262, 969, 262, 8706, 262, 1013, 262, 977, 262, 1008, 262, 981, 262,
+    1009, 262, 982, 262, 913, 262, 914, 262, 915, 262, 916, 262, 917, 262,
+    918, 262, 919, 262, 920, 262, 921, 262, 922, 262, 923, 262, 924, 262,
+    925, 262, 926, 262, 927, 262, 928, 262, 929, 262, 1012, 262, 931, 262,
+    932, 262, 933, 262, 934, 262, 935, 262, 936, 262, 937, 262, 8711, 262,
+    945, 262, 946, 262, 947, 262, 948, 262, 949, 262, 950, 262, 951, 262,
+    952, 262, 953, 262, 954, 262, 955, 262, 956, 262, 957, 262, 958, 262,
+    959, 262, 960, 262, 961, 262, 962, 262, 963, 262, 964, 262, 965, 262,
+    966, 262, 967, 262, 968, 262, 969, 262, 8706, 262, 1013, 262, 977, 262,
+    1008, 262, 981, 262, 1009, 262, 982, 262, 913, 262, 914, 262, 915, 262,
+    916, 262, 917, 262, 918, 262, 919, 262, 920, 262, 921, 262, 922, 262,
+    923, 262, 924, 262, 925, 262, 926, 262, 927, 262, 928, 262, 929, 262,
+    1012, 262, 931, 262, 932, 262, 933, 262, 934, 262, 935, 262, 936, 262,
+    937, 262, 8711, 262, 945, 262, 946, 262, 947, 262, 948, 262, 949, 262,
+    950, 262, 951, 262, 952, 262, 953, 262, 954, 262, 955, 262, 956, 262,
+    957, 262, 958, 262, 959, 262, 960, 262, 961, 262, 962, 262, 963, 262,
+    964, 262, 965, 262, 966, 262, 967, 262, 968, 262, 969, 262, 8706, 262,
+    1013, 262, 977, 262, 1008, 262, 981, 262, 1009, 262, 982, 262, 913, 262,
+    914, 262, 915, 262, 916, 262, 917, 262, 918, 262, 919, 262, 920, 262,
+    921, 262, 922, 262, 923, 262, 924, 262, 925, 262, 926, 262, 927, 262,
+    928, 262, 929, 262, 1012, 262, 931, 262, 932, 262, 933, 262, 934, 262,
+    935, 262, 936, 262, 937, 262, 8711, 262, 945, 262, 946, 262, 947, 262,
+    948, 262, 949, 262, 950, 262, 951, 262, 952, 262, 953, 262, 954, 262,
+    955, 262, 956, 262, 957, 262, 958, 262, 959, 262, 960, 262, 961, 262,
+    962, 262, 963, 262, 964, 262, 965, 262, 966, 262, 967, 262, 968, 262,
+    969, 262, 8706, 262, 1013, 262, 977, 262, 1008, 262, 981, 262, 1009, 262,
+    982, 262, 988, 262, 989, 262, 48, 262, 49, 262, 50, 262, 51, 262, 52,
+    262, 53, 262, 54, 262, 55, 262, 56, 262, 57, 262, 48, 262, 49, 262, 50,
+    262, 51, 262, 52, 262, 53, 262, 54, 262, 55, 262, 56, 262, 57, 262, 48,
+    262, 49, 262, 50, 262, 51, 262, 52, 262, 53, 262, 54, 262, 55, 262, 56,
+    262, 57, 262, 48, 262, 49, 262, 50, 262, 51, 262, 52, 262, 53, 262, 54,
+    262, 55, 262, 56, 262, 57, 262, 48, 262, 49, 262, 50, 262, 51, 262, 52,
+    262, 53, 262, 54, 262, 55, 262, 56, 262, 57, 262, 1575, 262, 1576, 262,
+    1580, 262, 1583, 262, 1608, 262, 1586, 262, 1581, 262, 1591, 262, 1610,
+    262, 1603, 262, 1604, 262, 1605, 262, 1606, 262, 1587, 262, 1593, 262,
+    1601, 262, 1589, 262, 1602, 262, 1585, 262, 1588, 262, 1578, 262, 1579,
+    262, 1582, 262, 1584, 262, 1590, 262, 1592, 262, 1594, 262, 1646, 262,
+    1722, 262, 1697, 262, 1647, 262, 1576, 262, 1580, 262, 1607, 262, 1581,
+    262, 1610, 262, 1603, 262, 1604, 262, 1605, 262, 1606, 262, 1587, 262,
+    1593, 262, 1601, 262, 1589, 262, 1602, 262, 1588, 262, 1578, 262, 1579,
+    262, 1582, 262, 1590, 262, 1594, 262, 1580, 262, 1581, 262, 1610, 262,
+    1604, 262, 1606, 262, 1587, 262, 1593, 262, 1589, 262, 1602, 262, 1588,
+    262, 1582, 262, 1590, 262, 1594, 262, 1722, 262, 1647, 262, 1576, 262,
+    1580, 262, 1607, 262, 1581, 262, 1591, 262, 1610, 262, 1603, 262, 1605,
+    262, 1606, 262, 1587, 262, 1593, 262, 1601, 262, 1589, 262, 1602, 262,
+    1588, 262, 1578, 262, 1579, 262, 1582, 262, 1590, 262, 1592, 262, 1594,
+    262, 1646, 262, 1697, 262, 1575, 262, 1576, 262, 1580, 262, 1583, 262,
+    1607, 262, 1608, 262, 1586, 262, 1581, 262, 1591, 262, 1610, 262, 1604,
+    262, 1605, 262, 1606, 262, 1587, 262, 1593, 262, 1601, 262, 1589, 262,
+    1602, 262, 1585, 262, 1588, 262, 1578, 262, 1579, 262, 1582, 262, 1584,
+    262, 1590, 262, 1592, 262, 1594, 262, 1576, 262, 1580, 262, 1583, 262,
+    1608, 262, 1586, 262, 1581, 262, 1591, 262, 1610, 262, 1604, 262, 1605,
+    262, 1606, 262, 1587, 262, 1593, 262, 1601, 262, 1589, 262, 1602, 262,
+    1585, 262, 1588, 262, 1578, 262, 1579, 262, 1582, 262, 1584, 262, 1590,
+    262, 1592, 262, 1594, 514, 48, 46, 514, 48, 44, 514, 49, 44, 514, 50, 44,
+    514, 51, 44, 514, 52, 44, 514, 53, 44, 514, 54, 44, 514, 55, 44, 514, 56,
+    44, 514, 57, 44, 770, 40, 65, 41, 770, 40, 66, 41, 770, 40, 67, 41, 770,
+    40, 68, 41, 770, 40, 69, 41, 770, 40, 70, 41, 770, 40, 71, 41, 770, 40,
+    72, 41, 770, 40, 73, 41, 770, 40, 74, 41, 770, 40, 75, 41, 770, 40, 76,
+    41, 770, 40, 77, 41, 770, 40, 78, 41, 770, 40, 79, 41, 770, 40, 80, 41,
+    770, 40, 81, 41, 770, 40, 82, 41, 770, 40, 83, 41, 770, 40, 84, 41, 770,
+    40, 85, 41, 770, 40, 86, 41, 770, 40, 87, 41, 770, 40, 88, 41, 770, 40,
+    89, 41, 770, 40, 90, 41, 770, 12308, 83, 12309, 263, 67, 263, 82, 519,
+    67, 68, 519, 87, 90, 266, 65, 266, 66, 266, 67, 266, 68, 266, 69, 266,
+    70, 266, 71, 266, 72, 266, 73, 266, 74, 266, 75, 266, 76, 266, 77, 266,
+    78, 266, 79, 266, 80, 266, 81, 266, 82, 266, 83, 266, 84, 266, 85, 266,
+    86, 266, 87, 266, 88, 266, 89, 266, 90, 522, 72, 86, 522, 77, 86, 522,
+    83, 68, 522, 83, 83, 778, 80, 80, 86, 522, 87, 67, 515, 77, 67, 515, 77,
+    68, 522, 68, 74, 522, 12411, 12363, 522, 12467, 12467, 266, 12469, 266,
+    25163, 266, 23383, 266, 21452, 266, 12487, 266, 20108, 266, 22810, 266,
+    35299, 266, 22825, 266, 20132, 266, 26144, 266, 28961, 266, 26009, 266,
+    21069, 266, 24460, 266, 20877, 266, 26032, 266, 21021, 266, 32066, 266,
+    29983, 266, 36009, 266, 22768, 266, 21561, 266, 28436, 266, 25237, 266,
+    25429, 266, 19968, 266, 19977, 266, 36938, 266, 24038, 266, 20013, 266,
+    21491, 266, 25351, 266, 36208, 266, 25171, 266, 31105, 266, 31354, 266,
+    21512, 266, 28288, 266, 26377, 266, 26376, 266, 30003, 266, 21106, 266,
+    21942, 266, 37197, 770, 12308, 26412, 12309, 770, 12308, 19977, 12309,
+    770, 12308, 20108, 12309, 770, 12308, 23433, 12309, 770, 12308, 28857,
+    12309, 770, 12308, 25171, 12309, 770, 12308, 30423, 12309, 770, 12308,
+    21213, 12309, 770, 12308, 25943, 12309, 263, 24471, 263, 21487, 256,
+    20029, 256, 20024, 256, 20033, 256, 55360, 56610, 256, 20320, 256, 20398,
+    256, 20411, 256, 20482, 256, 20602, 256, 20633, 256, 20711, 256, 20687,
+    256, 13470, 256, 55361, 56890, 256, 20813, 256, 20820, 256, 20836, 256,
+    20855, 256, 55361, 56604, 256, 13497, 256, 20839, 256, 20877, 256, 55361,
+    56651, 256, 20887, 256, 20900, 256, 20172, 256, 20908, 256, 20917, 256,
+    55396, 56799, 256, 20981, 256, 20995, 256, 13535, 256, 21051, 256, 21062,
+    256, 21106, 256, 21111, 256, 13589, 256, 21191, 256, 21193, 256, 21220,
+    256, 21242, 256, 21253, 256, 21254, 256, 21271, 256, 21321, 256, 21329,
+    256, 21338, 256, 21363, 256, 21373, 256, 21375, 256, 21375, 256, 21375,
+    256, 55362, 56876, 256, 28784, 256, 21450, 256, 21471, 256, 55362, 57187,
+    256, 21483, 256, 21489, 256, 21510, 256, 21662, 256, 21560, 256, 21576,
+    256, 21608, 256, 21666, 256, 21750, 256, 21776, 256, 21843, 256, 21859,
+    256, 21892, 256, 21892, 256, 21913, 256, 21931, 256, 21939, 256, 21954,
+    256, 22294, 256, 22022, 256, 22295, 256, 22097, 256, 22132, 256, 20999,
+    256, 22766, 256, 22478, 256, 22516, 256, 22541, 256, 22411, 256, 22578,
+    256, 22577, 256, 22700, 256, 55365, 56548, 256, 22770, 256, 22775, 256,
+    22790, 256, 22810, 256, 22818, 256, 22882, 256, 55365, 57000, 256, 55365,
+    57066, 256, 23020, 256, 23067, 256, 23079, 256, 23000, 256, 23142, 256,
+    14062, 256, 14076, 256, 23304, 256, 23358, 256, 23358, 256, 55366, 56776,
+    256, 23491, 256, 23512, 256, 23527, 256, 23539, 256, 55366, 57112, 256,
+    23551, 256, 23558, 256, 24403, 256, 23586, 256, 14209, 256, 23648, 256,
+    23662, 256, 23744, 256, 23693, 256, 55367, 56804, 256, 23875, 256, 55367,
+    56806, 256, 23918, 256, 23915, 256, 23932, 256, 24033, 256, 24034, 256,
+    14383, 256, 24061, 256, 24104, 256, 24125, 256, 24169, 256, 14434, 256,
+    55368, 56707, 256, 14460, 256, 24240, 256, 24243, 256, 24246, 256, 24266,
+    256, 55400, 57234, 256, 24318, 256, 55368, 57137, 256, 55368, 57137, 256,
+    33281, 256, 24354, 256, 24354, 256, 14535, 256, 55372, 57016, 256, 55384,
+    56794, 256, 24418, 256, 24427, 256, 14563, 256, 24474, 256, 24525, 256,
+    24535, 256, 24569, 256, 24705, 256, 14650, 256, 14620, 256, 24724, 256,
+    55369, 57044, 256, 24775, 256, 24904, 256, 24908, 256, 24910, 256, 24908,
+    256, 24954, 256, 24974, 256, 25010, 256, 24996, 256, 25007, 256, 25054,
+    256, 25074, 256, 25078, 256, 25104, 256, 25115, 256, 25181, 256, 25265,
+    256, 25300, 256, 25424, 256, 55370, 57100, 256, 25405, 256, 25340, 256,
+    25448, 256, 25475, 256, 25572, 256, 55370, 57329, 256, 25634, 256, 25541,
+    256, 25513, 256, 14894, 256, 25705, 256, 25726, 256, 25757, 256, 25719,
+    256, 14956, 256, 25935, 256, 25964, 256, 55372, 56330, 256, 26083, 256,
+    26360, 256, 26185, 256, 15129, 256, 26257, 256, 15112, 256, 15076, 256,
+    20882, 256, 20885, 256, 26368, 256, 26268, 256, 32941, 256, 17369, 256,
+    26391, 256, 26395, 256, 26401, 256, 26462, 256, 26451, 256, 55372, 57283,
+    256, 15177, 256, 26618, 256, 26501, 256, 26706, 256, 26757, 256, 55373,
+    56429, 256, 26766, 256, 26655, 256, 26900, 256, 15261, 256, 26946, 256,
+    27043, 256, 27114, 256, 27304, 256, 55373, 56995, 256, 27355, 256, 15384,
+    256, 27425, 256, 55374, 56487, 256, 27476, 256, 15438, 256, 27506, 256,
+    27551, 256, 27578, 256, 27579, 256, 55374, 56973, 256, 55367, 56587, 256,
+    55374, 57082, 256, 27726, 256, 55375, 56508, 256, 27839, 256, 27853, 256,
+    27751, 256, 27926, 256, 27966, 256, 28023, 256, 27969, 256, 28009, 256,
+    28024, 256, 28037, 256, 55375, 56606, 256, 27956, 256, 28207, 256, 28270,
+    256, 15667, 256, 28363, 256, 28359, 256, 55375, 57041, 256, 28153, 256,
+    28526, 256, 55375, 57182, 256, 55375, 57230, 256, 28614, 256, 28729, 256,
+    28702, 256, 28699, 256, 15766, 256, 28746, 256, 28797, 256, 28791, 256,
+    28845, 256, 55361, 56613, 256, 28997, 256, 55376, 56931, 256, 29084, 256,
+    55376, 57259, 256, 29224, 256, 29237, 256, 29264, 256, 55377, 56840, 256,
+    29312, 256, 29333, 256, 55377, 57141, 256, 55378, 56340, 256, 29562, 256,
+    29579, 256, 16044, 256, 29605, 256, 16056, 256, 16056, 256, 29767, 256,
+    29788, 256, 29809, 256, 29829, 256, 29898, 256, 16155, 256, 29988, 256,
+    55379, 56374, 256, 30014, 256, 55379, 56466, 256, 30064, 256, 55368,
+    56735, 256, 30224, 256, 55379, 57249, 256, 55379, 57272, 256, 55380,
+    56388, 256, 16380, 256, 16392, 256, 30452, 256, 55380, 56563, 256, 55380,
+    56562, 256, 55380, 56601, 256, 55380, 56627, 256, 30494, 256, 30495, 256,
+    30495, 256, 30538, 256, 16441, 256, 30603, 256, 16454, 256, 16534, 256,
+    55381, 56349, 256, 30798, 256, 30860, 256, 30924, 256, 16611, 256, 55381,
+    56870, 256, 31062, 256, 55381, 56986, 256, 55381, 57029, 256, 31119, 256,
+    31211, 256, 16687, 256, 31296, 256, 31306, 256, 31311, 256, 55382, 56700,
+    256, 55382, 56999, 256, 55382, 56999, 256, 31470, 256, 16898, 256, 55382,
+    57259, 256, 31686, 256, 31689, 256, 16935, 256, 55383, 56448, 256, 31954,
+    256, 17056, 256, 31976, 256, 31971, 256, 32000, 256, 55383, 57222, 256,
+    32099, 256, 17153, 256, 32199, 256, 32258, 256, 32325, 256, 17204, 256,
+    55384, 56872, 256, 55384, 56903, 256, 17241, 256, 55384, 57049, 256,
+    32634, 256, 55384, 57150, 256, 32661, 256, 32762, 256, 32773, 256, 55385,
+    56538, 256, 55385, 56611, 256, 32864, 256, 55385, 56744, 256, 32880, 256,
+    55372, 57183, 256, 17365, 256, 32946, 256, 33027, 256, 17419, 256, 33086,
+    256, 23221, 256, 55385, 57255, 256, 55385, 57269, 256, 55372, 57235, 256,
+    55372, 57244, 256, 33281, 256, 33284, 256, 36766, 256, 17515, 256, 33425,
+    256, 33419, 256, 33437, 256, 21171, 256, 33457, 256, 33459, 256, 33469,
+    256, 33510, 256, 55386, 57148, 256, 33509, 256, 33565, 256, 33635, 256,
+    33709, 256, 33571, 256, 33725, 256, 33767, 256, 33879, 256, 33619, 256,
+    33738, 256, 33740, 256, 33756, 256, 55387, 56374, 256, 55387, 56683, 256,
+    55387, 56533, 256, 17707, 256, 34033, 256, 34035, 256, 34070, 256, 55388,
+    57290, 256, 34148, 256, 55387, 57132, 256, 17757, 256, 17761, 256, 55387,
+    57265, 256, 55388, 56530, 256, 17771, 256, 34384, 256, 34396, 256, 34407,
+    256, 34409, 256, 34473, 256, 34440, 256, 34574, 256, 34530, 256, 34681,
+    256, 34600, 256, 34667, 256, 34694, 256, 17879, 256, 34785, 256, 34817,
+    256, 17913, 256, 34912, 256, 34915, 256, 55389, 56935, 256, 35031, 256,
+    35038, 256, 17973, 256, 35066, 256, 13499, 256, 55390, 56494, 256, 55390,
+    56678, 256, 18110, 256, 18119, 256, 35488, 256, 35565, 256, 35722, 256,
+    35925, 256, 55391, 56488, 256, 36011, 256, 36033, 256, 36123, 256, 36215,
+    256, 55391, 57135, 256, 55362, 56324, 256, 36299, 256, 36284, 256, 36336,
+    256, 55362, 56542, 256, 36564, 256, 36664, 256, 55393, 56786, 256, 55393,
+    56813, 256, 37012, 256, 37105, 256, 37137, 256, 55393, 57134, 256, 37147,
+    256, 37432, 256, 37591, 256, 37592, 256, 37500, 256, 37881, 256, 37909,
+    256, 55394, 57338, 256, 38283, 256, 18837, 256, 38327, 256, 55395, 56695,
+    256, 18918, 256, 38595, 256, 23986, 256, 38691, 256, 55396, 56645, 256,
+    55396, 56858, 256, 19054, 256, 19062, 256, 38880, 256, 55397, 56330, 256,
+    19122, 256, 55397, 56470, 256, 38923, 256, 38923, 256, 38953, 256, 55397,
+    56758, 256, 39138, 256, 19251, 256, 39209, 256, 39335, 256, 39362, 256,
+    39422, 256, 19406, 256, 55398, 57136, 256, 39698, 256, 40000, 256, 40189,
+    256, 19662, 256, 19693, 256, 40295, 256, 55400, 56526, 256, 19704, 256,
+    55400, 56581, 256, 55400, 56846, 256, 55400, 56977, 256, 40635, 256,
+    19798, 256, 40697, 256, 40702, 256, 40709, 256, 40719, 256, 40726, 256,
+    40763, 256, 55401, 56832,
+};
+
+/* index tables for the decomposition data */
+#define DECOMP_SHIFT1 6
+#define DECOMP_SHIFT2 4
+static const unsigned char decomp_index0[] = {
+    0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 13, 14, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 15, 16, 5, 5, 5, 5, 17, 18,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 19, 20,
+    5, 5, 5, 5, 5, 21, 22, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    23, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+};
+
+static const unsigned short decomp_index1[] = {
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
+    14, 0, 0, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 0, 0, 0, 0, 0, 0, 0,
+    25, 0, 26, 27, 0, 0, 0, 0, 0, 28, 0, 0, 29, 30, 31, 32, 33, 34, 35, 0,
+    36, 37, 38, 0, 39, 0, 40, 0, 41, 0, 0, 0, 0, 42, 43, 44, 45, 0, 0, 0, 0,
+    0, 0, 0, 0, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 48, 0, 0, 0,
+    0, 49, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 51, 52, 0, 53, 0, 0, 0, 0,
+    0, 0, 54, 55, 0, 0, 0, 0, 0, 56, 0, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 58, 59, 0, 0, 0, 60, 0, 0, 61, 0, 0, 0, 0, 0, 0, 0, 62, 0, 0, 0,
+    0, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 65, 0,
+    0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 0, 67, 0, 68, 0, 0, 69, 0, 0, 0, 70,
+    71, 72, 73, 74, 75, 76, 77, 0, 0, 0, 0, 0, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 81, 0,
+    82, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 84, 85, 86, 87, 88, 89, 0, 90, 91, 92, 0, 0, 0, 0,
+    93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108,
+    109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122,
+    123, 124, 125, 126, 127, 128, 129, 130, 0, 131, 132, 133, 134, 0, 0, 0,
+    0, 0, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 0, 146, 0,
+    0, 0, 147, 0, 148, 149, 150, 0, 151, 152, 153, 0, 154, 0, 0, 0, 155, 0,
+    0, 0, 156, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 157,
+    158, 159, 160, 161, 162, 163, 164, 165, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 166, 0,
+    0, 0, 0, 0, 0, 167, 0, 0, 0, 0, 0, 168, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 169, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 170, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    171, 0, 0, 0, 0, 0, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181,
+    182, 183, 184, 185, 186, 0, 0, 187, 0, 0, 188, 189, 190, 191, 192, 0,
+    193, 194, 195, 196, 197, 0, 198, 0, 0, 0, 199, 200, 201, 202, 203, 204,
+    205, 0, 0, 0, 0, 0, 0, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215,
+    216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229,
+    230, 231, 232, 233, 234, 235, 236, 237, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 238, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 239, 0, 0,
+    0, 0, 0, 0, 0, 240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 241, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 242, 243, 244, 245, 246, 247,
+    248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261,
+    262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 0, 272, 273, 274,
+    275, 276, 277, 278, 279, 280, 281, 282, 283, 0, 284, 285, 286, 287, 288,
+    289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302,
+    303, 304, 305, 306, 0, 307, 308, 309, 310, 311, 312, 313, 314, 0, 0, 315,
+    0, 316, 0, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328,
+    329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342,
+    343, 344, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 345, 346, 0, 0, 0, 0, 0, 0, 0,
+    347, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 348, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 349, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 350, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 351, 352, 0, 0, 0, 0, 353, 354, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
+    365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378,
+    379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392,
+    393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406,
+    407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 431, 432, 433, 434, 435, 0, 436, 0,
+    0, 437, 0, 0, 0, 0, 0, 0, 438, 439, 440, 441, 442, 443, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 444, 445,
+    446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459,
+    460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473,
+    474, 475, 476, 477, 0, 0, 0, 0, 0, 0, 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 unsigned short decomp_index2[] = {
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+    3, 0, 6, 0, 0, 0, 0, 8, 0, 0, 11, 13, 15, 18, 0, 0, 20, 23, 25, 0, 27,
+    31, 35, 0, 39, 42, 45, 48, 51, 54, 0, 57, 60, 63, 66, 69, 72, 75, 78, 81,
+    0, 84, 87, 90, 93, 96, 99, 0, 0, 102, 105, 108, 111, 114, 0, 0, 117, 120,
+    123, 126, 129, 132, 0, 135, 138, 141, 144, 147, 150, 153, 156, 159, 0,
+    162, 165, 168, 171, 174, 177, 0, 0, 180, 183, 186, 189, 192, 0, 195, 198,
+    201, 204, 207, 210, 213, 216, 219, 222, 225, 228, 231, 234, 237, 240,
+    243, 0, 0, 246, 249, 252, 255, 258, 261, 264, 267, 270, 273, 276, 279,
+    282, 285, 288, 291, 294, 297, 300, 303, 0, 0, 306, 309, 312, 315, 318,
+    321, 324, 327, 330, 0, 333, 336, 339, 342, 345, 348, 0, 351, 354, 357,
+    360, 363, 366, 369, 372, 0, 0, 375, 378, 381, 384, 387, 390, 393, 0, 0,
+    396, 399, 402, 405, 408, 411, 0, 0, 414, 417, 420, 423, 426, 429, 432,
+    435, 438, 441, 444, 447, 450, 453, 456, 459, 462, 465, 0, 0, 468, 471,
+    474, 477, 480, 483, 486, 489, 492, 495, 498, 501, 504, 507, 510, 513,
+    516, 519, 522, 525, 528, 531, 534, 537, 539, 542, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 545, 548, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 551, 554, 557, 560, 563, 566, 569, 572, 575, 578, 581, 584, 587,
+    590, 593, 596, 599, 602, 605, 608, 611, 614, 617, 620, 623, 0, 626, 629,
+    632, 635, 638, 641, 0, 0, 644, 647, 650, 653, 656, 659, 662, 665, 668,
+    671, 674, 677, 680, 683, 686, 689, 0, 0, 692, 695, 698, 701, 704, 707,
+    710, 713, 716, 719, 722, 725, 728, 731, 734, 737, 740, 743, 746, 749,
+    752, 755, 758, 761, 764, 767, 770, 773, 776, 779, 782, 785, 788, 791,
+    794, 797, 0, 0, 800, 803, 0, 0, 0, 0, 0, 0, 806, 809, 812, 815, 818, 821,
+    824, 827, 830, 833, 836, 839, 842, 845, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 848, 850, 852, 854, 856, 858, 860, 862, 864, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 866, 869, 872, 875, 878, 881, 0, 0, 884, 886, 888,
+    890, 892, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 894, 896, 0, 898, 900, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 903, 0, 0, 0, 0, 0, 905, 0, 0, 0,
+    908, 0, 0, 0, 0, 0, 910, 913, 916, 919, 921, 924, 927, 0, 930, 0, 933,
+    936, 939, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 942, 945, 948, 951, 954, 957, 960, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 963, 966, 969, 972, 975,
+    0, 978, 980, 982, 984, 987, 990, 992, 0, 0, 0, 0, 0, 0, 0, 0, 0, 994,
+    996, 998, 0, 1000, 1002, 0, 0, 0, 1004, 0, 0, 0, 0, 0, 0, 1006, 1009, 0,
+    1012, 0, 0, 0, 1015, 0, 0, 0, 0, 1018, 1021, 1024, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 1027, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1030, 0, 0,
+    0, 0, 0, 0, 1033, 1036, 0, 1039, 0, 0, 0, 1042, 0, 0, 0, 0, 1045, 1048,
+    1051, 0, 0, 0, 0, 0, 0, 0, 1054, 1057, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1060,
+    1063, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1066, 1069, 1072, 1075, 0,
+    0, 1078, 1081, 0, 0, 1084, 1087, 1090, 1093, 1096, 1099, 0, 0, 1102,
+    1105, 1108, 1111, 1114, 1117, 0, 0, 1120, 1123, 1126, 1129, 1132, 1135,
+    1138, 1141, 1144, 1147, 1150, 1153, 0, 0, 1156, 1159, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 1162, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1165, 1168,
+    1171, 1174, 1177, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1180, 1183,
+    1186, 1189, 0, 0, 0, 0, 0, 0, 0, 1192, 0, 1195, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 1198, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 1201, 0, 0, 0, 0, 0, 0, 0, 1204, 0, 0, 1207, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1210, 1213, 1216,
+    1219, 1222, 1225, 1228, 1231, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1234,
+    1237, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1240, 1243, 0, 1246,
+    0, 0, 0, 1249, 0, 0, 1252, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 1255, 1258, 1261, 0, 0, 1264, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1267,
+    0, 0, 1270, 1273, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1276,
+    1279, 0, 0, 0, 0, 0, 0, 1282, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 1285, 1288, 1291, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    1294, 0, 0, 0, 0, 0, 0, 0, 1297, 0, 0, 0, 0, 0, 0, 1300, 1303, 0, 1306,
+    1309, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1312, 1315, 1318, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1321, 0, 1324, 1327, 1330, 0, 0, 0, 0,
+    1333, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1336, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1339, 1342, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1345, 0, 0, 0, 0, 0, 0, 1347, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 1350, 0, 0, 0, 0, 1353, 0, 0, 0, 0, 1356, 0, 0,
+    0, 0, 1359, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1362, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 1365, 0, 1368, 1371, 1374, 1377, 1380, 0, 0, 0, 0, 0, 0, 0,
+    1383, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1386, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 1389, 0, 0, 0, 0, 1392, 0, 0, 0, 0, 1395, 0, 0, 0, 0,
+    1398, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1401, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 1404, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 1407, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1409, 0, 1412, 0, 1415, 0,
+    1418, 0, 1421, 0, 0, 0, 1424, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1427, 0, 1430, 0, 0, 1433, 1436, 0, 1439,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    1442, 1444, 1446, 0, 1448, 1450, 1452, 1454, 1456, 1458, 1460, 1462,
+    1464, 1466, 1468, 0, 1470, 1472, 1474, 1476, 1478, 1480, 1482, 1484,
+    1486, 1488, 1490, 1492, 1494, 1496, 1498, 1500, 1502, 1504, 0, 1506,
+    1508, 1510, 1512, 1514, 1516, 1518, 1520, 1522, 1524, 1526, 1528, 1530,
+    1532, 1534, 1536, 1538, 1540, 1542, 1544, 1546, 1548, 1550, 1552, 1554,
+    1556, 1558, 1560, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1562, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1564, 1566, 1568, 1570,
+    1572, 1574, 1576, 1578, 1580, 1582, 1584, 1586, 1588, 1590, 1592, 1594,
+    1596, 1598, 1600, 1602, 1604, 1606, 1608, 1610, 1612, 1614, 1616, 1618,
+    1620, 1622, 1624, 1626, 1628, 1630, 1632, 1634, 1636, 1638, 1641, 1644,
+    1647, 1650, 1653, 1656, 1659, 1662, 1665, 1668, 1671, 1674, 1677, 1680,
+    1683, 1686, 1689, 1692, 1695, 1698, 1701, 1704, 1707, 1710, 1713, 1716,
+    1719, 1722, 1725, 1728, 1731, 1734, 1737, 1740, 1743, 1746, 1749, 1752,
+    1755, 1758, 1761, 1764, 1767, 1770, 1773, 1776, 1779, 1782, 1785, 1788,
+    1791, 1794, 1797, 1800, 1803, 1806, 1809, 1812, 1815, 1818, 1821, 1824,
+    1827, 1830, 1833, 1836, 1839, 1842, 1845, 1848, 1851, 1854, 1857, 1860,
+    1863, 1866, 1869, 1872, 1875, 1878, 1881, 1884, 1887, 1890, 1893, 1896,
+    1899, 1902, 1905, 1908, 1911, 1914, 1917, 1920, 1923, 1926, 1929, 1932,
+    1935, 1938, 1941, 1944, 1947, 1950, 1953, 1956, 1959, 1962, 1965, 1968,
+    1971, 1974, 1977, 1980, 1983, 1986, 1989, 1992, 1995, 1998, 2001, 2004,
+    2007, 2010, 2013, 2016, 2019, 2022, 2025, 2028, 2031, 2034, 2037, 2040,
+    2043, 2046, 2049, 2052, 2055, 2058, 2061, 2064, 2067, 2070, 2073, 2076,
+    2079, 2082, 2085, 2088, 2091, 2094, 2097, 2100, 2103, 0, 0, 0, 0, 2106,
+    2109, 2112, 2115, 2118, 2121, 2124, 2127, 2130, 2133, 2136, 2139, 2142,
+    2145, 2148, 2151, 2154, 2157, 2160, 2163, 2166, 2169, 2172, 2175, 2178,
+    2181, 2184, 2187, 2190, 2193, 2196, 2199, 2202, 2205, 2208, 2211, 2214,
+    2217, 2220, 2223, 2226, 2229, 2232, 2235, 2238, 2241, 2244, 2247, 2250,
+    2253, 2256, 2259, 2262, 2265, 2268, 2271, 2274, 2277, 2280, 2283, 2286,
+    2289, 2292, 2295, 2298, 2301, 2304, 2307, 2310, 2313, 2316, 2319, 2322,
+    2325, 2328, 2331, 2334, 2337, 2340, 2343, 2346, 2349, 2352, 2355, 2358,
+    2361, 2364, 2367, 2370, 2373, 0, 0, 0, 0, 0, 0, 2376, 2379, 2382, 2385,
+    2388, 2391, 2394, 2397, 2400, 2403, 2406, 2409, 2412, 2415, 2418, 2421,
+    2424, 2427, 2430, 2433, 2436, 2439, 0, 0, 2442, 2445, 2448, 2451, 2454,
+    2457, 0, 0, 2460, 2463, 2466, 2469, 2472, 2475, 2478, 2481, 2484, 2487,
+    2490, 2493, 2496, 2499, 2502, 2505, 2508, 2511, 2514, 2517, 2520, 2523,
+    2526, 2529, 2532, 2535, 2538, 2541, 2544, 2547, 2550, 2553, 2556, 2559,
+    2562, 2565, 2568, 2571, 0, 0, 2574, 2577, 2580, 2583, 2586, 2589, 0, 0,
+    2592, 2595, 2598, 2601, 2604, 2607, 2610, 2613, 0, 2616, 0, 2619, 0,
+    2622, 0, 2625, 2628, 2631, 2634, 2637, 2640, 2643, 2646, 2649, 2652,
+    2655, 2658, 2661, 2664, 2667, 2670, 2673, 2676, 2679, 2681, 2684, 2686,
+    2689, 2691, 2694, 2696, 2699, 2701, 2704, 2706, 2709, 0, 0, 2711, 2714,
+    2717, 2720, 2723, 2726, 2729, 2732, 2735, 2738, 2741, 2744, 2747, 2750,
+    2753, 2756, 2759, 2762, 2765, 2768, 2771, 2774, 2777, 2780, 2783, 2786,
+    2789, 2792, 2795, 2798, 2801, 2804, 2807, 2810, 2813, 2816, 2819, 2822,
+    2825, 2828, 2831, 2834, 2837, 2840, 2843, 2846, 2849, 2852, 2855, 2858,
+    2861, 2864, 2867, 0, 2870, 2873, 2876, 2879, 2882, 2885, 2887, 2890,
+    2893, 2895, 2898, 2901, 2904, 2907, 2910, 0, 2913, 2916, 2919, 2922,
+    2924, 2927, 2929, 2932, 2935, 2938, 2941, 2944, 2947, 2950, 0, 0, 2952,
+    2955, 2958, 2961, 2964, 2967, 0, 2969, 2972, 2975, 2978, 2981, 2984,
+    2987, 2989, 2992, 2995, 2998, 3001, 3004, 3007, 3010, 3012, 3015, 3018,
+    3020, 0, 0, 3022, 3025, 3028, 0, 3031, 3034, 3037, 3040, 3042, 3045,
+    3047, 3050, 3052, 0, 3055, 3057, 3059, 3061, 3063, 3065, 3067, 3069,
+    3071, 3073, 3075, 0, 0, 0, 0, 0, 0, 3077, 0, 0, 0, 0, 0, 3079, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 3082, 3084, 3087, 0, 0, 0, 0, 0, 0, 0, 0,
+    3091, 0, 0, 0, 3093, 3096, 0, 3100, 3103, 0, 0, 0, 0, 3107, 0, 3110, 0,
+    0, 0, 0, 0, 0, 0, 0, 3113, 3116, 3119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 3122, 0, 0, 0, 0, 0, 0, 0, 3127, 3129, 3131, 0, 0, 3133, 3135,
+    3137, 3139, 3141, 3143, 3145, 3147, 3149, 3151, 3153, 3155, 3157, 3159,
+    3161, 3163, 3165, 3167, 3169, 3171, 3173, 3175, 3177, 3179, 3181, 3183,
+    3185, 0, 3187, 3189, 3191, 3193, 3195, 3197, 3199, 3201, 3203, 3205,
+    3207, 3209, 3211, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3213, 0, 0, 0, 0, 0,
+    0, 0, 3216, 3220, 3224, 3226, 0, 3229, 3233, 3237, 0, 3239, 3242, 3244,
+    3246, 3248, 3250, 3252, 3254, 3256, 3258, 3260, 0, 3262, 3264, 0, 0,
+    3267, 3269, 3271, 3273, 3275, 0, 0, 3277, 3280, 3284, 0, 3287, 0, 3289,
+    0, 3291, 0, 3293, 3295, 3297, 3299, 0, 3301, 3303, 3305, 0, 3307, 3309,
+    3311, 3313, 3315, 3317, 3319, 0, 3321, 3325, 3327, 3329, 3331, 3333, 0,
+    0, 0, 0, 3335, 3337, 3339, 3341, 3343, 0, 0, 0, 0, 0, 0, 3345, 3349,
+    3353, 3358, 3362, 3366, 3370, 3374, 3378, 3382, 3386, 3390, 3394, 3398,
+    3402, 3406, 3409, 3411, 3414, 3418, 3421, 3423, 3426, 3430, 3435, 3438,
+    3440, 3443, 3447, 3449, 3451, 3453, 3455, 3457, 3460, 3464, 3467, 3469,
+    3472, 3476, 3481, 3484, 3486, 3489, 3493, 3495, 3497, 3499, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 3501, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    3505, 3508, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3511,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3514, 3517, 3520, 0, 0, 0, 0,
+    3523, 0, 0, 0, 0, 3526, 0, 0, 3529, 0, 0, 0, 0, 0, 0, 0, 3532, 0, 3535,
+    0, 0, 0, 0, 0, 3538, 3541, 0, 3545, 3548, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 3552, 0, 0, 3555, 0, 0, 3558, 0, 3561, 0, 0, 0, 0, 0,
+    0, 3564, 0, 3567, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3570, 3573, 3576, 3579,
+    3582, 0, 0, 3585, 3588, 0, 0, 3591, 3594, 0, 0, 0, 0, 0, 0, 3597, 3600,
+    0, 0, 3603, 3606, 0, 0, 3609, 3612, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 3615, 3618, 3621, 3624, 3627, 3630, 3633, 3636, 0, 0,
+    0, 0, 0, 0, 3639, 3642, 3645, 3648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    3651, 3653, 0, 0, 0, 0, 0, 3655, 3657, 3659, 3661, 3663, 3665, 3667,
+    3669, 3671, 3673, 3676, 3679, 3682, 3685, 3688, 3691, 3694, 3697, 3700,
+    3703, 3706, 3710, 3714, 3718, 3722, 3726, 3730, 3734, 3738, 3742, 3747,
+    3752, 3757, 3762, 3767, 3772, 3777, 3782, 3787, 3792, 3797, 3800, 3803,
+    3806, 3809, 3812, 3815, 3818, 3821, 3824, 3828, 3832, 3836, 3840, 3844,
+    3848, 3852, 3856, 3860, 3864, 3868, 3872, 3876, 3880, 3884, 3888, 3892,
+    3896, 3900, 3904, 3908, 3912, 3916, 3920, 3924, 3928, 3932, 3936, 3940,
+    3944, 3948, 3952, 3956, 3960, 3964, 3968, 3972, 3974, 3976, 3978, 3980,
+    3982, 3984, 3986, 3988, 3990, 3992, 3994, 3996, 3998, 4000, 4002, 4004,
+    4006, 4008, 4010, 4012, 4014, 4016, 4018, 4020, 4022, 4024, 4026, 4028,
+    4030, 4032, 4034, 4036, 4038, 4040, 4042, 4044, 4046, 4048, 4050, 4052,
+    4054, 4056, 4058, 4060, 4062, 4064, 4066, 4068, 4070, 4072, 4074, 4076,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4078, 0, 0, 0, 0, 0,
+    0, 0, 4083, 4087, 4090, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 4094, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4097,
+    4099, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4101, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4103, 0, 0, 0, 4105, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 4107, 4109, 4111, 4113, 4115, 4117, 4119, 4121,
+    4123, 4125, 4127, 4129, 4131, 4133, 4135, 4137, 4139, 4141, 4143, 4145,
+    4147, 4149, 4151, 4153, 4155, 4157, 4159, 4161, 4163, 4165, 4167, 4169,
+    4171, 4173, 4175, 4177, 4179, 4181, 4183, 4185, 4187, 4189, 4191, 4193,
+    4195, 4197, 4199, 4201, 4203, 4205, 4207, 4209, 4211, 4213, 4215, 4217,
+    4219, 4221, 4223, 4225, 4227, 4229, 4231, 4233, 4235, 4237, 4239, 4241,
+    4243, 4245, 4247, 4249, 4251, 4253, 4255, 4257, 4259, 4261, 4263, 4265,
+    4267, 4269, 4271, 4273, 4275, 4277, 4279, 4281, 4283, 4285, 4287, 4289,
+    4291, 4293, 4295, 4297, 4299, 4301, 4303, 4305, 4307, 4309, 4311, 4313,
+    4315, 4317, 4319, 4321, 4323, 4325, 4327, 4329, 4331, 4333, 4335, 4337,
+    4339, 4341, 4343, 4345, 4347, 4349, 4351, 4353, 4355, 4357, 4359, 4361,
+    4363, 4365, 4367, 4369, 4371, 4373, 4375, 4377, 4379, 4381, 4383, 4385,
+    4387, 4389, 4391, 4393, 4395, 4397, 4399, 4401, 4403, 4405, 4407, 4409,
+    4411, 4413, 4415, 4417, 4419, 4421, 4423, 4425, 4427, 4429, 4431, 4433,
+    4435, 4437, 4439, 4441, 4443, 4445, 4447, 4449, 4451, 4453, 4455, 4457,
+    4459, 4461, 4463, 4465, 4467, 4469, 4471, 4473, 4475, 4477, 4479, 4481,
+    4483, 4485, 4487, 4489, 4491, 4493, 4495, 4497, 4499, 4501, 4503, 4505,
+    4507, 4509, 4511, 4513, 4515, 4517, 4519, 4521, 4523, 4525, 4527, 4529,
+    4531, 4533, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4535, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4537, 0, 4539, 4541, 4543, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4545, 0, 4548, 0, 4551, 0,
+    4554, 0, 4557, 0, 4560, 0, 4563, 0, 4566, 0, 4569, 0, 4572, 0, 4575, 0,
+    4578, 0, 0, 4581, 0, 4584, 0, 4587, 0, 0, 0, 0, 0, 0, 4590, 4593, 0,
+    4596, 4599, 0, 4602, 4605, 0, 4608, 4611, 0, 4614, 4617, 0, 0, 0, 0, 0,
+    0, 4620, 0, 0, 0, 0, 0, 0, 4623, 4626, 0, 4629, 4632, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 4635, 0, 4638, 0, 4641, 0, 4644, 0, 4647, 0, 4650, 0,
+    4653, 0, 4656, 0, 4659, 0, 4662, 0, 4665, 0, 4668, 0, 0, 4671, 0, 4674,
+    0, 4677, 0, 0, 0, 0, 0, 0, 4680, 4683, 0, 4686, 4689, 0, 4692, 4695, 0,
+    4698, 4701, 0, 4704, 4707, 0, 0, 0, 0, 0, 0, 4710, 0, 0, 4713, 4716,
+    4719, 4722, 0, 0, 0, 4725, 4728, 0, 4731, 4733, 4735, 4737, 4739, 4741,
+    4743, 4745, 4747, 4749, 4751, 4753, 4755, 4757, 4759, 4761, 4763, 4765,
+    4767, 4769, 4771, 4773, 4775, 4777, 4779, 4781, 4783, 4785, 4787, 4789,
+    4791, 4793, 4795, 4797, 4799, 4801, 4803, 4805, 4807, 4809, 4811, 4813,
+    4815, 4817, 4819, 4821, 4823, 4825, 4827, 4829, 4831, 4833, 4835, 4837,
+    4839, 4841, 4843, 4845, 4847, 4849, 4851, 4853, 4855, 4857, 4859, 4861,
+    4863, 4865, 4867, 4869, 4871, 4873, 4875, 4877, 4879, 4881, 4883, 4885,
+    4887, 4889, 4891, 4893, 4895, 4897, 4899, 4901, 4903, 4905, 4907, 4909,
+    4911, 4913, 4915, 4917, 0, 0, 0, 4919, 4921, 4923, 4925, 4927, 4929,
+    4931, 4933, 4935, 4937, 4939, 4941, 4943, 4945, 4947, 4951, 4955, 4959,
+    4963, 4967, 4971, 4975, 4979, 4983, 4987, 4991, 4995, 4999, 5003, 5008,
+    5013, 5018, 5023, 5028, 5033, 5038, 5043, 5048, 5053, 5058, 5063, 5068,
+    5073, 5078, 5086, 0, 5093, 5097, 5101, 5105, 5109, 5113, 5117, 5121,
+    5125, 5129, 5133, 5137, 5141, 5145, 5149, 5153, 5157, 5161, 5165, 5169,
+    5173, 5177, 5181, 5185, 5189, 5193, 5197, 5201, 5205, 5209, 5213, 5217,
+    5221, 5225, 5229, 5233, 5237, 5239, 5241, 5243, 0, 0, 0, 0, 0, 0, 0, 0,
+    5245, 5249, 5252, 5255, 5258, 5261, 5264, 5267, 5270, 5273, 5276, 5279,
+    5282, 5285, 5288, 5291, 5294, 5296, 5298, 5300, 5302, 5304, 5306, 5308,
+    5310, 5312, 5314, 5316, 5318, 5320, 5322, 5325, 5328, 5331, 5334, 5337,
+    5340, 5343, 5346, 5349, 5352, 5355, 5358, 5361, 5364, 5370, 5375, 0,
+    5378, 5380, 5382, 5384, 5386, 5388, 5390, 5392, 5394, 5396, 5398, 5400,
+    5402, 5404, 5406, 5408, 5410, 5412, 5414, 5416, 5418, 5420, 5422, 5424,
+    5426, 5428, 5430, 5432, 5434, 5436, 5438, 5440, 5442, 5444, 5446, 5448,
+    5450, 5452, 5454, 5456, 5458, 5460, 5462, 5464, 5466, 5468, 5470, 5472,
+    5474, 5476, 5479, 5482, 5485, 5488, 5491, 5494, 5497, 5500, 5503, 5506,
+    5509, 5512, 5515, 5518, 5521, 5524, 5527, 5530, 5533, 5536, 5539, 5542,
+    5545, 5548, 5552, 5556, 5560, 5563, 5567, 5570, 5574, 5576, 5578, 5580,
+    5582, 5584, 5586, 5588, 5590, 5592, 5594, 5596, 5598, 5600, 5602, 5604,
+    5606, 5608, 5610, 5612, 5614, 5616, 5618, 5620, 5622, 5624, 5626, 5628,
+    5630, 5632, 5634, 5636, 5638, 5640, 5642, 5644, 5646, 5648, 5650, 5652,
+    5654, 5656, 5658, 5660, 5662, 5664, 5666, 0, 5668, 5673, 5678, 5683,
+    5687, 5692, 5696, 5700, 5706, 5711, 5715, 5719, 5723, 5728, 5733, 5737,
+    5741, 5744, 5748, 5753, 5758, 5761, 5767, 5774, 5780, 5784, 5790, 5796,
+    5801, 5805, 5809, 5813, 5818, 5824, 5829, 5833, 5837, 5841, 5844, 5847,
+    5850, 5853, 5857, 5861, 5867, 5871, 5876, 5882, 5886, 5889, 5892, 5898,
+    5903, 5909, 5913, 5919, 5922, 5926, 5930, 5934, 5938, 5942, 5947, 5951,
+    5954, 5958, 5962, 5966, 5971, 5975, 5979, 5983, 5989, 5994, 5997, 6003,
+    6006, 6011, 6016, 6020, 6024, 6028, 6033, 6036, 6040, 6045, 6048, 6054,
+    6058, 6061, 6064, 6067, 6070, 6073, 6076, 6079, 6082, 6085, 6088, 6092,
+    6096, 6100, 6104, 6108, 6112, 6116, 6120, 6124, 6128, 6132, 6136, 6140,
+    6144, 6148, 6152, 6155, 6158, 6162, 6165, 6168, 6171, 6175, 6179, 6182,
+    6185, 6188, 6191, 6194, 6199, 6202, 6205, 6208, 6211, 6214, 6217, 6220,
+    6223, 6227, 6232, 6235, 6238, 6241, 6244, 6247, 6250, 6253, 6257, 6261,
+    6265, 6269, 6272, 6275, 6278, 6281, 6284, 6287, 6290, 6293, 6296, 6299,
+    6303, 6307, 6310, 6314, 6318, 6322, 6325, 6329, 6333, 6338, 6341, 6345,
+    6349, 6353, 6357, 6363, 6370, 6373, 6376, 6379, 6382, 6385, 6388, 6391,
+    6394, 6397, 6400, 6403, 6406, 6409, 6412, 6415, 6418, 6421, 6424, 6429,
+    6432, 6435, 6438, 6443, 6447, 6450, 6453, 6456, 6459, 6462, 6465, 6468,
+    6471, 6474, 6477, 6481, 6484, 6487, 6491, 6495, 6498, 6503, 6507, 6510,
+    6513, 6516, 6519, 6523, 6527, 6530, 6533, 6536, 6539, 6542, 6545, 6548,
+    6551, 6554, 6558, 6562, 6566, 6570, 6574, 6578, 6582, 6586, 6590, 6594,
+    6598, 6602, 6606, 6610, 6614, 6618, 6622, 6626, 6630, 6634, 6638, 6642,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6646, 6648, 0, 0, 6650, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6652, 6654, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6656, 6658, 6660,
+    6662, 6664, 6666, 6668, 6670, 6672, 6674, 6676, 6678, 6680, 6682, 6684,
+    6686, 6688, 6690, 6692, 6694, 6696, 6698, 6700, 6702, 6704, 6706, 6708,
+    6710, 6712, 6714, 6716, 6718, 6720, 6722, 6724, 6726, 6728, 6730, 6732,
+    6734, 6736, 6738, 6740, 6742, 6744, 6746, 6748, 6750, 6752, 6754, 6756,
+    6758, 6760, 6762, 6764, 6766, 6768, 6770, 6772, 6774, 6776, 6778, 6780,
+    6782, 6784, 6786, 6788, 6790, 6792, 6794, 6796, 6798, 6800, 6802, 6804,
+    6806, 6808, 6810, 6812, 6814, 6816, 6818, 6820, 6822, 6824, 6826, 6828,
+    6830, 6832, 6834, 6836, 6838, 6840, 6842, 6844, 6846, 6848, 6850, 6852,
+    6854, 6856, 6858, 6860, 6862, 6864, 6866, 6868, 6870, 6872, 6874, 6876,
+    6878, 6880, 6882, 6884, 6886, 6888, 6890, 6892, 6894, 6896, 6898, 6900,
+    6902, 6904, 6906, 6908, 6910, 6912, 6914, 6916, 6918, 6920, 6922, 6924,
+    6926, 6928, 6930, 6932, 6934, 6936, 6938, 6940, 6942, 6944, 6946, 6948,
+    6950, 6952, 6954, 6956, 6958, 6960, 6962, 6964, 6966, 6968, 6970, 6972,
+    6974, 6976, 6978, 6980, 6982, 6984, 6986, 6988, 6990, 6992, 6994, 6996,
+    6998, 7000, 7002, 7004, 7006, 7008, 7010, 7012, 7014, 7016, 7018, 7020,
+    7022, 7024, 7026, 7028, 7030, 7032, 7034, 7036, 7038, 7040, 7042, 7044,
+    7046, 7048, 7050, 7052, 7054, 7056, 7058, 7060, 7062, 7064, 7066, 7068,
+    7070, 7072, 7074, 7076, 7078, 7080, 7082, 7084, 7086, 7088, 7090, 7092,
+    7094, 7096, 7098, 7100, 7102, 7104, 7106, 7108, 7110, 7112, 7114, 7116,
+    7118, 7120, 7122, 7124, 7126, 7128, 7130, 7132, 7134, 7136, 7138, 7140,
+    7142, 7144, 7146, 7148, 7150, 7152, 7154, 7156, 7158, 7160, 7162, 7164,
+    7166, 7168, 7170, 7172, 7174, 7176, 7178, 7180, 7182, 7184, 7186, 7188,
+    7190, 7192, 7194, 7196, 7198, 7200, 7202, 0, 0, 7204, 0, 7206, 0, 0,
+    7208, 7210, 7212, 7214, 7216, 7218, 7220, 7222, 7224, 7226, 0, 7228, 0,
+    7230, 0, 0, 7232, 7234, 0, 0, 0, 7236, 7238, 7240, 7242, 7244, 7246,
+    7248, 7250, 7252, 7254, 7256, 7258, 7260, 7262, 7264, 7266, 7268, 7270,
+    7272, 7274, 7276, 7278, 7280, 7282, 7284, 7286, 7288, 7290, 7292, 7294,
+    7296, 7298, 7300, 7302, 7304, 7306, 7308, 7310, 7312, 7314, 7316, 7318,
+    7320, 7322, 7324, 7326, 7328, 7330, 7332, 7334, 7336, 7338, 7340, 7342,
+    7344, 7346, 7348, 7350, 7352, 7354, 7356, 7358, 7360, 7362, 7364, 7366,
+    7368, 7371, 0, 0, 7373, 7375, 7377, 7379, 7381, 7383, 7385, 7387, 7389,
+    7391, 7393, 7395, 7397, 7399, 7401, 7403, 7405, 7407, 7409, 7411, 7413,
+    7415, 7417, 7419, 7421, 7423, 7425, 7427, 7429, 7431, 7433, 7435, 7437,
+    7439, 7441, 7443, 7445, 7447, 7449, 7451, 7453, 7455, 7457, 7459, 7461,
+    7463, 7465, 7467, 7469, 7471, 7473, 7475, 7477, 7479, 7481, 7483, 7485,
+    7487, 7489, 7491, 7493, 7495, 7497, 7499, 7501, 7503, 7505, 7507, 7509,
+    7511, 7513, 7515, 7517, 7519, 7521, 7523, 7525, 7527, 7529, 7531, 7533,
+    7535, 7537, 7539, 7541, 7543, 7545, 7547, 7549, 7551, 7553, 7555, 7557,
+    7559, 7561, 7563, 7566, 7569, 7572, 7574, 7576, 7578, 7581, 7584, 7587,
+    7589, 0, 0, 0, 0, 0, 0, 7591, 7594, 7597, 7600, 7604, 7608, 7611, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7614, 7617, 7620, 7623, 7626, 0, 0, 0, 0,
+    0, 7629, 0, 7632, 7635, 7637, 7639, 7641, 7643, 7645, 7647, 7649, 7651,
+    7653, 7655, 7658, 7661, 7664, 7667, 7670, 7673, 7676, 7679, 7682, 7685,
+    7688, 7691, 0, 7694, 7697, 7700, 7703, 7706, 0, 7709, 0, 7712, 7715, 0,
+    7718, 7721, 0, 7724, 7727, 7730, 7733, 7736, 7739, 7742, 7745, 7748,
+    7751, 7754, 7756, 7758, 7760, 7762, 7764, 7766, 7768, 7770, 7772, 7774,
+    7776, 7778, 7780, 7782, 7784, 7786, 7788, 7790, 7792, 7794, 7796, 7798,
+    7800, 7802, 7804, 7806, 7808, 7810, 7812, 7814, 7816, 7818, 7820, 7822,
+    7824, 7826, 7828, 7830, 7832, 7834, 7836, 7838, 7840, 7842, 7844, 7846,
+    7848, 7850, 7852, 7854, 7856, 7858, 7860, 7862, 7864, 7866, 7868, 7870,
+    7872, 7874, 7876, 7878, 7880, 7882, 7884, 7886, 7888, 7890, 7892, 7894,
+    7896, 7898, 7900, 7902, 7904, 7906, 7908, 7910, 7912, 7914, 7916, 7918,
+    7920, 7922, 7924, 7926, 7928, 7930, 7932, 7934, 7936, 7938, 7940, 7942,
+    7944, 7946, 7948, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    7950, 7952, 7954, 7956, 7958, 7960, 7962, 7964, 7966, 7968, 7970, 7972,
+    7974, 7976, 7978, 7980, 7982, 7984, 7986, 7988, 7990, 7992, 7994, 7996,
+    7999, 8002, 8005, 8008, 8011, 8014, 8017, 8020, 8023, 8026, 8029, 8032,
+    8035, 8038, 8041, 8044, 8047, 8050, 8052, 8054, 8056, 8058, 8061, 8064,
+    8067, 8070, 8073, 8076, 8079, 8082, 8085, 8088, 8091, 8094, 8097, 8100,
+    8103, 8106, 8109, 8112, 8115, 8118, 8121, 8124, 8127, 8130, 8133, 8136,
+    8139, 8142, 8145, 8148, 8151, 8154, 8157, 8160, 8163, 8166, 8169, 8172,
+    8175, 8178, 8181, 8184, 8187, 8190, 8193, 8196, 8199, 8202, 8205, 8208,
+    8211, 8214, 8217, 8220, 8223, 8226, 8229, 8232, 8235, 8238, 8241, 8244,
+    8247, 8250, 8253, 8256, 8259, 8262, 8265, 8268, 8271, 8274, 8277, 8280,
+    8283, 8286, 8289, 8292, 8295, 8298, 8301, 8304, 8307, 8310, 8313, 8316,
+    8319, 8322, 8325, 8328, 8331, 8334, 8337, 8340, 8344, 8348, 8352, 8356,
+    8360, 8364, 8367, 8370, 8373, 8376, 8379, 8382, 8385, 8388, 8391, 8394,
+    8397, 8400, 8403, 8406, 8409, 8412, 8415, 8418, 8421, 8424, 8427, 8430,
+    8433, 8436, 8439, 8442, 8445, 8448, 8451, 8454, 8457, 8460, 8463, 8466,
+    8469, 8472, 8475, 8478, 8481, 8484, 8487, 8490, 8493, 8496, 8499, 8502,
+    8505, 8508, 8511, 8514, 8517, 8520, 8523, 8526, 8529, 8532, 8535, 8538,
+    8541, 8544, 8547, 8550, 8553, 8556, 8559, 8562, 8565, 8568, 8571, 8574,
+    8577, 8580, 8583, 8586, 8589, 8592, 8595, 8598, 8601, 8604, 8607, 8610,
+    8613, 8616, 8619, 8622, 8625, 8628, 8631, 8634, 8637, 8640, 8643, 8646,
+    8649, 8652, 8655, 8658, 8661, 8664, 8667, 8670, 8673, 8676, 8679, 8682,
+    8685, 8688, 8691, 8694, 8697, 8700, 8703, 8706, 8709, 8712, 8715, 8718,
+    8721, 8724, 8727, 8730, 8733, 8736, 8739, 8742, 8745, 8748, 8751, 8754,
+    8757, 8760, 8763, 8766, 8769, 8772, 8775, 8778, 8781, 8784, 8787, 8790,
+    8794, 8798, 8802, 8805, 8808, 8811, 8814, 8817, 8820, 8823, 8826, 8829,
+    8832, 8835, 8838, 8841, 8844, 8847, 8850, 8853, 8856, 8859, 8862, 8865,
+    8868, 8871, 8874, 8877, 8880, 8883, 8886, 8889, 8892, 8895, 8898, 8901,
+    8904, 8907, 8910, 8913, 8916, 8919, 8922, 8925, 8928, 8931, 8934, 8937,
+    8940, 8943, 8946, 8949, 8952, 8955, 8958, 8961, 8964, 8967, 8970, 8973,
+    8976, 8979, 8982, 8985, 8988, 8991, 8994, 8997, 9000, 9003, 9006, 9009,
+    9012, 9015, 9018, 0, 0, 9021, 9025, 9029, 9033, 9037, 9041, 9045, 9049,
+    9053, 9057, 9061, 9065, 9069, 9073, 9077, 9081, 9085, 9089, 9093, 9097,
+    9101, 9105, 9109, 9113, 9117, 9121, 9125, 9129, 9133, 9137, 9141, 9145,
+    9149, 9153, 9157, 9161, 9165, 9169, 9173, 9177, 9181, 9185, 9189, 9193,
+    9197, 9201, 9205, 9209, 9213, 9217, 9221, 9225, 9229, 9233, 9237, 9241,
+    9245, 9249, 9253, 9257, 9261, 9265, 9269, 9273, 0, 0, 9277, 9281, 9285,
+    9289, 9293, 9297, 9301, 9305, 9309, 9313, 9317, 9321, 9325, 9329, 9333,
+    9337, 9341, 9345, 9349, 9353, 9357, 9361, 9365, 9369, 9373, 9377, 9381,
+    9385, 9389, 9393, 9397, 9401, 9405, 9409, 9413, 9417, 9421, 9425, 9429,
+    9433, 9437, 9441, 9445, 9449, 9453, 9457, 9461, 9465, 9469, 9473, 9477,
+    9481, 9485, 9489, 0, 0, 0, 0, 0, 0, 0, 0, 9493, 9497, 9501, 9506, 9511,
+    9516, 9521, 9526, 9531, 9536, 9540, 9559, 9568, 0, 0, 0, 9573, 9575,
+    9577, 9579, 9581, 9583, 9585, 9587, 9589, 9591, 0, 0, 0, 0, 0, 0, 9593,
+    9595, 9597, 9599, 9601, 9603, 9605, 9607, 9609, 9611, 9613, 9615, 9617,
+    9619, 9621, 9623, 9625, 9627, 9629, 9631, 9633, 0, 0, 9635, 9637, 9639,
+    9641, 9643, 9645, 9647, 9649, 9651, 9653, 9655, 9657, 0, 9659, 9661,
+    9663, 9665, 9667, 9669, 9671, 9673, 9675, 9677, 9679, 9681, 9683, 9685,
+    9687, 9689, 9691, 9693, 9695, 0, 9697, 9699, 9701, 9703, 0, 0, 0, 0,
+    9705, 9708, 9711, 0, 9714, 0, 9717, 9720, 9723, 9726, 9729, 9732, 9735,
+    9738, 9741, 9744, 9747, 9749, 9751, 9753, 9755, 9757, 9759, 9761, 9763,
+    9765, 9767, 9769, 9771, 9773, 9775, 9777, 9779, 9781, 9783, 9785, 9787,
+    9789, 9791, 9793, 9795, 9797, 9799, 9801, 9803, 9805, 9807, 9809, 9811,
+    9813, 9815, 9817, 9819, 9821, 9823, 9825, 9827, 9829, 9831, 9833, 9835,
+    9837, 9839, 9841, 9843, 9845, 9847, 9849, 9851, 9853, 9855, 9857, 9859,
+    9861, 9863, 9865, 9867, 9869, 9871, 9873, 9875, 9877, 9879, 9881, 9883,
+    9885, 9887, 9889, 9891, 9893, 9895, 9897, 9899, 9901, 9903, 9905, 9907,
+    9909, 9911, 9913, 9915, 9917, 9919, 9921, 9923, 9925, 9927, 9929, 9931,
+    9933, 9935, 9937, 9939, 9941, 9943, 9945, 9947, 9949, 9951, 9953, 9955,
+    9957, 9959, 9961, 9963, 9965, 9967, 9969, 9971, 9973, 9975, 9977, 9979,
+    9981, 9984, 9987, 9990, 9993, 9996, 9999, 10002, 0, 0, 0, 0, 10005,
+    10007, 10009, 10011, 10013, 10015, 10017, 10019, 10021, 10023, 10025,
+    10027, 10029, 10031, 10033, 10035, 10037, 10039, 10041, 10043, 10045,
+    10047, 10049, 10051, 10053, 10055, 10057, 10059, 10061, 10063, 10065,
+    10067, 10069, 10071, 10073, 10075, 10077, 10079, 10081, 10083, 10085,
+    10087, 10089, 10091, 10093, 10095, 10097, 10099, 10101, 10103, 10105,
+    10107, 10109, 10111, 10113, 10115, 10117, 10119, 10121, 10123, 10125,
+    10127, 10129, 10131, 10133, 10135, 10137, 10139, 10141, 10143, 10145,
+    10147, 10149, 10151, 10153, 10155, 10157, 10159, 10161, 10163, 10165,
+    10167, 10169, 10171, 10173, 10175, 10177, 10179, 10181, 10183, 10185,
+    10187, 10189, 10191, 10193, 10195, 10197, 10199, 10201, 10203, 10205,
+    10207, 10209, 10211, 10213, 10215, 10217, 10219, 10221, 10223, 10225,
+    10227, 10229, 10231, 10233, 10235, 10237, 10239, 10241, 10243, 10245,
+    10247, 10249, 10251, 10253, 10255, 10257, 10259, 10261, 10263, 10265,
+    10267, 10269, 10271, 10273, 10275, 10277, 10279, 10281, 10283, 10285,
+    10287, 10289, 10291, 10293, 10295, 10297, 10299, 10301, 10303, 10305,
+    10307, 10309, 10311, 10313, 10315, 10317, 10319, 10321, 10323, 10325,
+    10327, 10329, 10331, 10333, 10335, 10337, 10339, 10341, 10343, 10345,
+    10347, 10349, 10351, 10353, 10355, 10357, 10359, 10361, 10363, 10365,
+    10367, 10369, 10371, 10373, 10375, 10377, 10379, 10381, 10383, 0, 0, 0,
+    10385, 10387, 10389, 10391, 10393, 10395, 0, 0, 10397, 10399, 10401,
+    10403, 10405, 10407, 0, 0, 10409, 10411, 10413, 10415, 10417, 10419, 0,
+    0, 10421, 10423, 10425, 0, 0, 0, 10427, 10429, 10431, 10433, 10435,
+    10437, 10439, 0, 10441, 10443, 10445, 10447, 10449, 10451, 10453, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 10455, 0, 10460, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 10465, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    10470, 10475, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10480, 10485, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10490, 10495, 0, 10500, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 10505, 10510, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 10515, 10520, 10525, 10530, 10535, 10540, 10545, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10550, 10555, 10560,
+    10565, 10570, 10575, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10580,
+    10582, 10584, 10586, 10588, 10590, 10592, 10594, 10596, 10598, 10600,
+    10602, 10604, 10606, 10608, 10610, 10612, 10614, 10616, 10618, 10620,
+    10622, 10624, 10626, 10628, 10630, 10632, 10634, 10636, 10638, 10640,
+    10642, 10644, 10646, 10648, 10650, 10652, 10654, 10656, 10658, 10660,
+    10662, 10664, 10666, 10668, 10670, 10672, 10674, 10676, 10678, 10680,
+    10682, 10684, 10686, 10688, 10690, 10692, 10694, 10696, 10698, 10700,
+    10702, 10704, 10706, 10708, 10710, 10712, 10714, 10716, 10718, 10720,
+    10722, 10724, 10726, 10728, 10730, 10732, 10734, 10736, 10738, 10740,
+    10742, 10744, 10746, 10748, 0, 10750, 10752, 10754, 10756, 10758, 10760,
+    10762, 10764, 10766, 10768, 10770, 10772, 10774, 10776, 10778, 10780,
+    10782, 10784, 10786, 10788, 10790, 10792, 10794, 10796, 10798, 10800,
+    10802, 10804, 10806, 10808, 10810, 10812, 10814, 10816, 10818, 10820,
+    10822, 10824, 10826, 10828, 10830, 10832, 10834, 10836, 10838, 10840,
+    10842, 10844, 10846, 10848, 10850, 10852, 10854, 10856, 10858, 10860,
+    10862, 10864, 10866, 10868, 10870, 10872, 10874, 10876, 10878, 10880,
+    10882, 10884, 10886, 10888, 10890, 0, 10892, 10894, 0, 0, 10896, 0, 0,
+    10898, 10900, 0, 0, 10902, 10904, 10906, 10908, 0, 10910, 10912, 10914,
+    10916, 10918, 10920, 10922, 10924, 10926, 10928, 10930, 10932, 0, 10934,
+    0, 10936, 10938, 10940, 10942, 10944, 10946, 10948, 0, 10950, 10952,
+    10954, 10956, 10958, 10960, 10962, 10964, 10966, 10968, 10970, 10972,
+    10974, 10976, 10978, 10980, 10982, 10984, 10986, 10988, 10990, 10992,
+    10994, 10996, 10998, 11000, 11002, 11004, 11006, 11008, 11010, 11012,
+    11014, 11016, 11018, 11020, 11022, 11024, 11026, 11028, 11030, 11032,
+    11034, 11036, 11038, 11040, 11042, 11044, 11046, 11048, 11050, 11052,
+    11054, 11056, 11058, 11060, 11062, 11064, 11066, 11068, 11070, 11072,
+    11074, 11076, 11078, 0, 11080, 11082, 11084, 11086, 0, 0, 11088, 11090,
+    11092, 11094, 11096, 11098, 11100, 11102, 0, 11104, 11106, 11108, 11110,
+    11112, 11114, 11116, 0, 11118, 11120, 11122, 11124, 11126, 11128, 11130,
+    11132, 11134, 11136, 11138, 11140, 11142, 11144, 11146, 11148, 11150,
+    11152, 11154, 11156, 11158, 11160, 11162, 11164, 11166, 11168, 11170,
+    11172, 0, 11174, 11176, 11178, 11180, 0, 11182, 11184, 11186, 11188,
+    11190, 0, 11192, 0, 0, 0, 11194, 11196, 11198, 11200, 11202, 11204,
+    11206, 0, 11208, 11210, 11212, 11214, 11216, 11218, 11220, 11222, 11224,
+    11226, 11228, 11230, 11232, 11234, 11236, 11238, 11240, 11242, 11244,
+    11246, 11248, 11250, 11252, 11254, 11256, 11258, 11260, 11262, 11264,
+    11266, 11268, 11270, 11272, 11274, 11276, 11278, 11280, 11282, 11284,
+    11286, 11288, 11290, 11292, 11294, 11296, 11298, 11300, 11302, 11304,
+    11306, 11308, 11310, 11312, 11314, 11316, 11318, 11320, 11322, 11324,
+    11326, 11328, 11330, 11332, 11334, 11336, 11338, 11340, 11342, 11344,
+    11346, 11348, 11350, 11352, 11354, 11356, 11358, 11360, 11362, 11364,
+    11366, 11368, 11370, 11372, 11374, 11376, 11378, 11380, 11382, 11384,
+    11386, 11388, 11390, 11392, 11394, 11396, 11398, 11400, 11402, 11404,
+    11406, 11408, 11410, 11412, 11414, 11416, 11418, 11420, 11422, 11424,
+    11426, 11428, 11430, 11432, 11434, 11436, 11438, 11440, 11442, 11444,
+    11446, 11448, 11450, 11452, 11454, 11456, 11458, 11460, 11462, 11464,
+    11466, 11468, 11470, 11472, 11474, 11476, 11478, 11480, 11482, 11484,
+    11486, 11488, 11490, 11492, 11494, 11496, 11498, 11500, 11502, 11504,
+    11506, 11508, 11510, 11512, 11514, 11516, 11518, 11520, 11522, 11524,
+    11526, 11528, 11530, 11532, 11534, 11536, 11538, 11540, 11542, 11544,
+    11546, 11548, 11550, 11552, 11554, 11556, 11558, 11560, 11562, 11564,
+    11566, 11568, 11570, 11572, 11574, 11576, 11578, 11580, 11582, 11584,
+    11586, 11588, 11590, 11592, 11594, 11596, 11598, 11600, 11602, 11604,
+    11606, 11608, 11610, 11612, 11614, 11616, 11618, 11620, 11622, 11624,
+    11626, 11628, 11630, 11632, 11634, 11636, 11638, 11640, 11642, 11644,
+    11646, 11648, 11650, 11652, 11654, 11656, 11658, 11660, 11662, 11664,
+    11666, 11668, 11670, 11672, 11674, 11676, 11678, 11680, 11682, 11684,
+    11686, 11688, 11690, 11692, 11694, 11696, 11698, 11700, 11702, 11704,
+    11706, 11708, 11710, 11712, 11714, 11716, 11718, 11720, 11722, 11724,
+    11726, 11728, 11730, 11732, 11734, 11736, 11738, 11740, 11742, 11744,
+    11746, 11748, 11750, 11752, 11754, 11756, 11758, 11760, 11762, 11764,
+    11766, 11768, 11770, 11772, 11774, 11776, 11778, 11780, 11782, 11784,
+    11786, 11788, 11790, 11792, 11794, 11796, 11798, 11800, 11802, 11804,
+    11806, 11808, 11810, 11812, 11814, 11816, 11818, 11820, 11822, 11824,
+    11826, 11828, 11830, 11832, 11834, 11836, 11838, 11840, 11842, 11844,
+    11846, 11848, 11850, 11852, 11854, 11856, 11858, 11860, 11862, 11864,
+    11866, 11868, 11870, 11872, 11874, 11876, 11878, 11880, 11882, 11884,
+    11886, 0, 0, 11888, 11890, 11892, 11894, 11896, 11898, 11900, 11902,
+    11904, 11906, 11908, 11910, 11912, 11914, 11916, 11918, 11920, 11922,
+    11924, 11926, 11928, 11930, 11932, 11934, 11936, 11938, 11940, 11942,
+    11944, 11946, 11948, 11950, 11952, 11954, 11956, 11958, 11960, 11962,
+    11964, 11966, 11968, 11970, 11972, 11974, 11976, 11978, 11980, 11982,
+    11984, 11986, 11988, 11990, 11992, 11994, 11996, 11998, 12000, 12002,
+    12004, 12006, 12008, 12010, 12012, 12014, 12016, 12018, 12020, 12022,
+    12024, 12026, 12028, 12030, 12032, 12034, 12036, 12038, 12040, 12042,
+    12044, 12046, 12048, 12050, 12052, 12054, 12056, 12058, 12060, 12062,
+    12064, 12066, 12068, 12070, 12072, 12074, 12076, 12078, 12080, 12082,
+    12084, 12086, 12088, 12090, 12092, 12094, 12096, 12098, 12100, 12102,
+    12104, 12106, 12108, 12110, 12112, 12114, 12116, 12118, 12120, 12122,
+    12124, 12126, 12128, 12130, 12132, 12134, 12136, 12138, 12140, 12142,
+    12144, 12146, 12148, 12150, 12152, 12154, 12156, 12158, 12160, 12162,
+    12164, 12166, 12168, 12170, 12172, 12174, 12176, 12178, 12180, 12182,
+    12184, 12186, 12188, 12190, 12192, 12194, 12196, 12198, 12200, 12202,
+    12204, 12206, 12208, 12210, 12212, 12214, 12216, 12218, 12220, 12222,
+    12224, 12226, 12228, 12230, 12232, 12234, 12236, 12238, 12240, 12242,
+    12244, 12246, 12248, 12250, 12252, 12254, 12256, 12258, 12260, 12262,
+    12264, 12266, 12268, 12270, 12272, 12274, 12276, 12278, 12280, 12282,
+    12284, 12286, 12288, 12290, 12292, 12294, 12296, 12298, 12300, 12302,
+    12304, 12306, 12308, 12310, 12312, 12314, 12316, 12318, 12320, 12322,
+    12324, 12326, 12328, 12330, 12332, 12334, 12336, 12338, 12340, 12342,
+    12344, 12346, 12348, 12350, 12352, 12354, 12356, 12358, 12360, 12362,
+    12364, 12366, 12368, 12370, 12372, 12374, 12376, 12378, 12380, 12382,
+    12384, 12386, 12388, 12390, 12392, 12394, 12396, 12398, 12400, 12402,
+    12404, 12406, 12408, 12410, 12412, 12414, 12416, 12418, 12420, 12422,
+    12424, 12426, 12428, 12430, 12432, 12434, 12436, 12438, 12440, 12442,
+    12444, 12446, 12448, 12450, 12452, 12454, 12456, 12458, 12460, 12462,
+    12464, 12466, 12468, 12470, 0, 0, 12472, 12474, 12476, 12478, 12480,
+    12482, 12484, 12486, 12488, 12490, 12492, 12494, 12496, 12498, 12500,
+    12502, 12504, 12506, 12508, 12510, 12512, 12514, 12516, 12518, 12520,
+    12522, 12524, 12526, 12528, 12530, 12532, 12534, 12536, 12538, 12540,
+    12542, 12544, 12546, 12548, 12550, 12552, 12554, 12556, 12558, 12560,
+    12562, 12564, 12566, 12568, 12570, 12572, 12574, 12576, 12578, 0, 12580,
+    12582, 12584, 12586, 12588, 12590, 12592, 12594, 12596, 12598, 12600,
+    12602, 12604, 12606, 12608, 12610, 12612, 12614, 12616, 12618, 12620,
+    12622, 12624, 12626, 12628, 12630, 12632, 0, 12634, 12636, 0, 12638, 0,
+    0, 12640, 0, 12642, 12644, 12646, 12648, 12650, 12652, 12654, 12656,
+    12658, 12660, 0, 12662, 12664, 12666, 12668, 0, 12670, 0, 12672, 0, 0, 0,
+    0, 0, 0, 12674, 0, 0, 0, 0, 12676, 0, 12678, 0, 12680, 0, 12682, 12684,
+    12686, 0, 12688, 12690, 0, 12692, 0, 0, 12694, 0, 12696, 0, 12698, 0,
+    12700, 0, 12702, 0, 12704, 12706, 0, 12708, 0, 0, 12710, 12712, 12714,
+    12716, 0, 12718, 12720, 12722, 12724, 12726, 12728, 12730, 0, 12732,
+    12734, 12736, 12738, 0, 12740, 12742, 12744, 12746, 0, 12748, 0, 12750,
+    12752, 12754, 12756, 12758, 12760, 12762, 12764, 12766, 12768, 0, 12770,
+    12772, 12774, 12776, 12778, 12780, 12782, 12784, 12786, 12788, 12790,
+    12792, 12794, 12796, 12798, 12800, 12802, 0, 0, 0, 0, 0, 12804, 12806,
+    12808, 0, 12810, 12812, 12814, 12816, 12818, 0, 12820, 12822, 12824,
+    12826, 12828, 12830, 12832, 12834, 12836, 12838, 12840, 12842, 12844,
+    12846, 12848, 12850, 12852, 0, 0, 0, 0, 12854, 12857, 12860, 12863,
+    12866, 12869, 12872, 12875, 12878, 12881, 12884, 0, 0, 0, 0, 0, 12887,
+    12891, 12895, 12899, 12903, 12907, 12911, 12915, 12919, 12923, 12927,
+    12931, 12935, 12939, 12943, 12947, 12951, 12955, 12959, 12963, 12967,
+    12971, 12975, 12979, 12983, 12987, 12991, 12995, 12997, 12999, 13002, 0,
+    13005, 13007, 13009, 13011, 13013, 13015, 13017, 13019, 13021, 13023,
+    13025, 13027, 13029, 13031, 13033, 13035, 13037, 13039, 13041, 13043,
+    13045, 13047, 13049, 13051, 13053, 13055, 13057, 13060, 13063, 13066,
+    13069, 13073, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13076, 13079, 0, 0, 0, 0,
+    13082, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13085, 13088, 13091,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13093, 13095, 13097, 13099, 13101,
+    13103, 13105, 13107, 13109, 13111, 13113, 13115, 13117, 13119, 13121,
+    13123, 13125, 13127, 13129, 13131, 13133, 13135, 13137, 13139, 13141,
+    13143, 13145, 13147, 13149, 13151, 13153, 13155, 13157, 13159, 13161,
+    13163, 13165, 13167, 13169, 13171, 13173, 13175, 13177, 13179, 0, 0, 0,
+    0, 13181, 13185, 13189, 13193, 13197, 13201, 13205, 13209, 13213, 0, 0,
+    0, 0, 0, 0, 0, 13217, 13219, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    13221, 13223, 13225, 13227, 13230, 13232, 13234, 13236, 13238, 13240,
+    13242, 13244, 13246, 13248, 13251, 13253, 13255, 13257, 13259, 13262,
+    13264, 13266, 13268, 13271, 13273, 13275, 13277, 13279, 13281, 13284,
+    13286, 13288, 13290, 13292, 13294, 13296, 13298, 13300, 13302, 13304,
+    13306, 13308, 13310, 13312, 13314, 13316, 13318, 13320, 13322, 13324,
+    13326, 13328, 13330, 13333, 13335, 13337, 13339, 13342, 13344, 13346,
+    13348, 13350, 13352, 13354, 13356, 13358, 13360, 13362, 13364, 13366,
+    13368, 13370, 13372, 13374, 13376, 13378, 13380, 13382, 13384, 13386,
+    13388, 13390, 13392, 13394, 13396, 13398, 13400, 13402, 13404, 13406,
+    13409, 13411, 13413, 13415, 13417, 13419, 13421, 13424, 13427, 13429,
+    13431, 13433, 13435, 13437, 13439, 13441, 13443, 13445, 13447, 13450,
+    13452, 13454, 13456, 13458, 13461, 13463, 13465, 13467, 13469, 13471,
+    13473, 13475, 13477, 13479, 13482, 13484, 13487, 13489, 13491, 13493,
+    13495, 13497, 13499, 13501, 13503, 13505, 13507, 13509, 13512, 13514,
+    13516, 13518, 13520, 13522, 13525, 13527, 13530, 13533, 13535, 13537,
+    13539, 13541, 13544, 13547, 13549, 13551, 13553, 13555, 13557, 13559,
+    13561, 13563, 13565, 13567, 13569, 13572, 13574, 13576, 13578, 13580,
+    13582, 13584, 13586, 13588, 13590, 13592, 13594, 13596, 13598, 13600,
+    13602, 13604, 13606, 13608, 13610, 13613, 13615, 13617, 13619, 13621,
+    13623, 13626, 13628, 13630, 13632, 13634, 13636, 13638, 13640, 13642,
+    13644, 13646, 13648, 13651, 13653, 13655, 13657, 13659, 13661, 13663,
+    13665, 13667, 13669, 13671, 13673, 13675, 13677, 13679, 13681, 13683,
+    13685, 13687, 13690, 13692, 13694, 13696, 13698, 13700, 13703, 13705,
+    13707, 13709, 13711, 13713, 13715, 13717, 13719, 13722, 13724, 13726,
+    13728, 13731, 13733, 13735, 13737, 13739, 13741, 13743, 13746, 13749,
+    13752, 13754, 13757, 13759, 13761, 13763, 13765, 13767, 13769, 13771,
+    13773, 13775, 13777, 13780, 13782, 13784, 13786, 13788, 13790, 13792,
+    13795, 13797, 13799, 13802, 13805, 13807, 13809, 13811, 13813, 13815,
+    13817, 13819, 13821, 13823, 13826, 13828, 13831, 13833, 13836, 13838,
+    13840, 13842, 13845, 13847, 13849, 13852, 13855, 13857, 13859, 13861,
+    13863, 13865, 13867, 13869, 13871, 13873, 13875, 13877, 13879, 13881,
+    13884, 13886, 13889, 13891, 13894, 13896, 13899, 13902, 13905, 13907,
+    13909, 13911, 13914, 13917, 13920, 13923, 13925, 13927, 13929, 13931,
+    13933, 13935, 13937, 13939, 13942, 13944, 13946, 13948, 13950, 13953,
+    13955, 13958, 13961, 13963, 13965, 13967, 13969, 13971, 13973, 13976,
+    13979, 13982, 13984, 13986, 13989, 13991, 13993, 13995, 13998, 14000,
+    14002, 14004, 14006, 14008, 14011, 14013, 14015, 14017, 14019, 14021,
+    14023, 14026, 14029, 14031, 14034, 14036, 14039, 14041, 14043, 14045,
+    14048, 14051, 14053, 14056, 14058, 14061, 14063, 14065, 14067, 14069,
+    14071, 14073, 14076, 14079, 14082, 14085, 14087, 14089, 14091, 14093,
+    14095, 14097, 14099, 14101, 14103, 14105, 14107, 14109, 14112, 14114,
+    14116, 14118, 14120, 14122, 14124, 14126, 14128, 14130, 14132, 14134,
+    14136, 14139, 14142, 14145, 14147, 14149, 14151, 14153, 14156, 14158,
+    14161, 14163, 14165, 14168, 14171, 14173, 14175, 14177, 14179, 14181,
+    14183, 14185, 14187, 14189, 14191, 14193, 14195, 14197, 14199, 14201,
+    14203, 14205, 14207, 14209, 14212, 14214, 14216, 14218, 14220, 14222,
+    14225, 14228, 14230, 14232, 14234, 14236, 14238, 14240, 14243, 14245,
+    14247, 14249, 14251, 14254, 14257, 14259, 14261, 14263, 14266, 14268,
+    14270, 14273, 14276, 14278, 14280, 14282, 14285, 14287, 14289, 14291,
+    14293, 14295, 14297, 14299, 14302, 14304, 14306, 14308, 14311, 14313,
+    14315, 14317, 14319, 14322, 14325, 14327, 14329, 14331, 14334, 14336,
+    14339, 14341, 14343, 14345, 14348, 14350, 14352, 14354, 14356, 14358,
+    14360, 14362, 14365, 14367, 14369, 14371, 14373, 14375, 14377, 14380,
+    14382, 14385, 14388, 14391, 14393, 14395, 14397, 14399, 14401, 14403,
+    14405, 14407, 0, 0,
+};
+
+/* NFC pairs */
+#define COMP_SHIFT1 2
+#define COMP_SHIFT2 1
+static const unsigned short comp_index0[] = {
+    0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 4,
+    5, 6, 7, 0, 0, 0, 0, 8, 0, 9, 10, 0, 0, 0, 11, 12, 13, 14, 0, 0, 0, 0, 0,
+    15, 16, 17, 0, 0, 0, 0, 18, 19, 20, 21, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0,
+    23, 24, 25, 26, 0, 0, 0, 0, 27, 28, 29, 30, 0, 0, 0, 0, 31, 32, 33, 34,
+    0, 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 36, 0, 37, 38, 39, 0, 0, 0, 40, 41, 42,
+    43, 0, 0, 0, 0, 44, 45, 46, 0, 0, 0, 0, 0, 47, 48, 49, 50, 0, 0, 0, 51,
+    52, 53, 54, 0, 0, 0, 0, 55, 56, 0, 0, 0, 0, 0, 0, 57, 58, 59, 60, 0, 0,
+    0, 0, 61, 62, 63, 0, 0, 0, 0, 0, 64, 65, 66, 67, 0, 0, 0, 68, 69, 70, 71,
+    0, 0, 0, 0, 72, 0, 73, 0, 0, 0, 0, 0, 74, 0, 75, 0, 0, 0, 0, 0, 76, 0, 0,
+    0, 0, 0, 0, 77, 78, 79, 0, 0, 0, 0, 0, 80, 81, 82, 83, 0, 0, 0, 0, 84,
+    85, 86, 0, 0, 0, 0, 0, 87, 88, 0, 89, 0, 0, 0, 90, 91, 0, 92, 0, 0, 0, 0,
+    0, 93, 94, 95, 0, 0, 0, 0, 96, 97, 98, 99, 0, 0, 0, 0, 100, 0, 0, 0, 0,
+    0, 0, 101, 102, 0, 103, 0, 0, 0, 0, 104, 105, 106, 107, 0, 0, 0, 0, 108,
+    109, 110, 111, 0, 0, 0, 0, 112, 113, 0, 0, 0, 0, 0, 114, 115, 116, 117,
+    0, 0, 0, 0, 118, 119, 120, 121, 0, 0, 0, 0, 122, 0, 123, 0, 0, 0, 0, 124,
+    125, 126, 127, 128, 0, 0, 0, 129, 130, 131, 132, 0, 0, 0, 0, 133, 134, 0,
+    0, 0, 0, 0, 0, 135, 136, 137, 138, 0, 0, 0, 139, 140, 141, 142, 0, 0, 0,
+    0, 0, 143, 144, 145, 0, 0, 0, 0, 146, 147, 148, 149, 0, 0, 0, 0, 150, 0,
+    151, 0, 0, 0, 0, 152, 153, 154, 0, 0, 0, 0, 0, 0, 155, 0, 0, 0, 0, 0, 0,
+    156, 157, 158, 0, 0, 0, 0, 0, 159, 160, 161, 162, 0, 0, 0, 163, 0, 0, 0,
+    164, 0, 0, 0, 165, 166, 0, 0, 0, 0, 0, 0, 167, 0, 0, 0, 0, 0, 0, 0, 168,
+    0, 0, 0, 0, 0, 0, 169, 170, 0, 0, 0, 0, 0, 0, 171, 0, 0, 0, 0, 0, 0, 0,
+    172, 173, 0, 0, 0, 0, 0, 0, 174, 0, 0, 0, 0, 0, 0, 175, 176, 0, 0, 0, 0,
+    0, 0, 177, 178, 0, 0, 0, 0, 0, 0, 179, 0, 0, 0, 0, 0, 0, 0, 180, 0, 0, 0,
+    0, 0, 0, 181, 182, 183, 0, 0, 0, 0, 0, 184, 185, 0, 0, 0, 0, 0, 0, 186,
+    0, 0, 0, 0, 0, 0, 0, 187, 0, 0, 0, 0, 0, 0, 188, 189, 0, 0, 0, 0, 0, 0,
+    190, 0, 0, 0, 0, 0, 0, 0, 191, 192, 0, 0, 0, 0, 0, 0, 193, 0, 0, 0, 0, 0,
+    0, 194, 195, 0, 0, 0, 0, 0, 0, 196, 197, 0, 0, 0, 0, 0, 0, 198, 0, 0, 0,
+    0, 0, 0, 0, 199, 0, 0, 0, 0, 0, 0, 200, 201, 202, 0, 0, 0, 0, 0, 203,
+    204, 0, 0, 0, 0, 0, 0, 205, 206, 0, 0, 0, 0, 0, 0, 207, 0, 0, 0, 0, 0, 0,
+    208, 0, 0, 0, 0, 0, 0, 0, 209, 0, 0, 0, 0, 0, 0, 0, 210, 0, 0, 0, 0, 0,
+    0, 0, 211, 0, 0, 0, 0, 0, 0, 0, 212, 0, 0, 0, 0, 0, 0, 0, 213, 0, 0, 0,
+    0, 0, 0, 0, 214, 0, 0, 0, 0, 0, 0, 215, 0, 0, 0, 0, 0, 0, 216, 0, 0, 0,
+    0, 0, 0, 0, 0, 217, 0, 0, 0, 0, 0, 0, 0, 218, 0, 0, 0, 0, 0, 0, 219, 0,
+    0, 0, 0, 0, 0, 220, 221, 222, 0, 0, 0, 0, 0, 223, 224, 225, 0, 0, 0, 0,
+    0, 226, 227, 228, 0, 0, 0, 0, 0, 229, 230, 231, 0, 0, 0, 0, 0, 0, 232, 0,
+    0, 0, 0, 0, 0, 233, 0, 0, 0, 0, 0, 0, 234, 0, 0, 0, 0, 0, 0, 0, 235, 0,
+    0, 0, 0, 0, 0, 0, 236, 0, 0, 0, 0, 0, 0, 0, 237, 0, 0, 0, 0, 0, 0, 238,
+    0, 0, 0, 0, 0, 0, 0, 239, 0, 0, 0, 0, 0, 0, 0, 240, 0, 0, 0, 0, 0, 0, 0,
+    241, 0, 0, 0, 0, 0, 0, 242, 0, 243, 244, 0, 0, 0, 0, 245, 246, 0, 0, 0,
+    0, 0, 247, 0, 248, 0, 249, 0, 0, 0, 250, 251, 252, 0, 0, 0, 0, 0, 253, 0,
+    254, 0, 0, 0, 0, 0, 0, 255, 0, 0, 0, 0, 0, 256, 257, 258, 0, 0, 0, 0, 0,
+    259, 0, 260, 0, 261, 0, 0, 0, 0, 0, 0, 262, 0, 0, 0, 0, 0, 0, 0, 263, 0,
+    0, 0, 264, 265, 266, 0, 267, 0, 0, 0, 268, 0, 269, 0, 0, 0, 0, 0, 270, 0,
+    271, 272, 0, 0, 0, 0, 273, 274, 0, 275, 0, 0, 0, 276, 0, 277, 0, 0, 0, 0,
+    0, 0, 0, 278, 0, 0, 0, 0, 0, 279, 280, 281, 282, 0, 0, 0, 0, 283, 284, 0,
+    285, 0, 0, 0, 286, 0, 0, 0, 287, 0, 0, 0, 288, 0, 0, 0, 289, 0, 0, 0, 0,
+    0, 0, 290, 0, 0, 0, 0, 291, 0, 0, 0, 0, 0, 0, 0, 292, 0, 0, 0, 0, 0, 0,
+    0, 293, 0, 0, 0, 0, 0, 0, 294, 0, 0, 0, 0, 0, 0, 0, 295, 0, 0, 0, 0, 0,
+    0, 0, 296, 0, 0, 0, 0, 0, 0, 0, 297, 0, 0, 0, 0, 0, 0, 298, 299, 0, 0, 0,
+    0, 0, 0, 300, 0, 0, 0, 0, 0, 0, 0, 301, 0, 0, 0, 0, 0, 0, 0, 302, 0, 0,
+    0, 0, 0, 0, 0, 303, 0, 0, 0, 0, 0, 0, 304, 0, 0, 0, 0, 0, 0, 0, 305, 0,
+    0, 0, 0, 0, 0, 0, 306, 0, 0, 0, 0, 0, 0, 307, 0, 0, 0, 0, 0, 0, 0, 308,
+    0, 0, 0, 0, 0, 0, 0, 309, 0, 0, 0, 0, 0, 0, 0, 310, 0, 0, 0, 0, 0, 0,
+    311, 312, 0, 0, 0, 0, 0, 0, 313, 0, 0, 0, 0, 0, 0, 0, 314, 0, 0, 0, 0, 0,
+    0, 0, 315, 0, 0, 0, 0, 0, 0, 0, 316, 0, 0, 0, 0, 0, 0, 317, 0, 0, 0, 0,
+    0, 0, 0, 318, 0, 0, 0, 0, 0, 0, 0, 319, 0, 0, 0, 0, 0, 0, 0, 320, 0, 0,
+    0, 0, 0, 0, 0, 321, 0, 0, 0, 0, 0, 0, 322, 0, 0, 0, 0, 0, 0, 0, 323, 0,
+    0, 0, 0, 0, 0, 0, 324, 0, 0, 0, 0, 0, 0, 325, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 326, 0, 0, 0, 0, 0, 0, 0, 327, 0, 0, 0, 0, 0, 0, 0, 328, 0, 0, 0, 0,
+    0, 0, 329, 0, 0, 0, 0, 0, 0, 0, 330, 0, 0, 0, 0, 0, 0, 0, 331, 0, 0, 0,
+    0, 0, 0, 0, 332, 0, 0, 0, 0, 0, 0, 0, 333, 0, 0, 0, 0, 0, 0, 334, 0, 0,
+    0, 0, 0, 0, 0, 335, 0, 0, 0, 0, 0, 0, 0, 336, 337, 0, 0, 0, 0, 0, 0, 0,
+    338, 0, 0, 0, 0, 0, 0, 339, 0, 0, 0, 0, 0, 0, 0, 340, 0, 0, 0, 0, 0, 0,
+    0, 341, 0, 0, 0, 0, 0, 0, 0, 342, 0, 0, 0, 0, 0, 0, 0, 343, 0, 0, 0, 0,
+    0, 0, 344, 0, 0, 0, 0, 0, 0, 0, 345, 346, 0, 0, 0, 0, 0, 0, 347, 0, 0, 0,
+    0, 0, 0, 0, 348, 0, 0, 0, 0, 0, 0, 0, 349, 0, 0, 0, 0, 0, 0, 0, 350, 0,
+    0, 0, 0, 0, 0, 0, 351, 0, 0, 0, 0, 0, 0, 0, 352, 0, 0, 0, 0, 0, 0, 353,
+    0, 0, 0, 0, 0, 0, 0, 354, 0, 0, 0, 0, 0, 0, 0, 355, 0, 0, 0, 0, 0, 0, 0,
+    356, 0, 0, 0, 0, 0, 0, 357, 0, 0, 0, 0, 0, 0, 0, 358, 0, 0, 0, 0, 0, 0,
+    0, 359, 0, 0, 0, 0, 0, 0, 0, 360, 0, 0, 0, 0, 0, 0, 361, 0, 362, 0, 0, 0,
+    0, 0, 0, 0, 363, 0, 0, 0, 0, 0, 0, 0, 364, 0, 0, 0, 0, 0, 0, 0, 365, 0,
+    0, 0, 0, 0, 0, 0, 366, 0, 0, 0, 0, 0, 0, 367, 0, 0, 0, 0, 0, 0, 0, 368,
+    0, 0, 0, 0, 0, 0, 369, 370, 0, 0, 0, 0, 0, 0, 371, 0, 0, 0, 0, 0, 0, 0,
+    372, 0, 0, 0, 0, 0, 0, 0, 373, 0, 0, 0, 0, 0, 0, 374, 0, 0, 0, 0, 0, 0,
+    0, 375, 0, 0, 376, 0, 0, 0, 0, 377, 0, 0, 378, 0, 0, 0, 0, 0, 0, 0, 379,
+    0, 0, 0, 0, 0, 0, 0, 380, 0, 0, 0, 0, 0, 0, 381, 0, 0, 0, 0, 0, 0, 0,
+    382, 0, 0, 0, 0, 0, 0, 0, 383, 0, 0, 0, 0, 0, 0, 0, 384, 0, 0, 0, 385, 0,
+    0, 386, 0, 0, 0, 0, 387, 0, 0, 388, 0, 0, 0, 0, 0, 0, 0, 389, 0, 0, 0, 0,
+    0, 0, 0, 390, 0, 0, 0, 0, 0, 0, 391, 0, 0, 0, 0, 0, 0, 0, 392, 0, 0, 0,
+    0, 0, 0, 0, 393, 0, 0, 0, 0, 0, 0, 0, 394, 0, 0, 0, 395, 0, 0, 0, 0, 0,
+    0, 0, 396, 0, 0, 0, 0, 0, 0, 397, 0, 0, 0, 0, 0, 0, 0, 398, 0, 0, 0, 0,
+    0, 0, 0, 399, 0, 0, 400, 0, 0, 0, 0, 401, 0, 0, 402, 0, 0, 0, 0, 0, 0, 0,
+    403, 0, 0, 0, 0, 0, 0, 0, 404, 0, 0, 0, 0, 0, 0, 405, 0, 0, 0, 0, 0, 0,
+    0, 406, 0, 0, 0, 0, 0, 0, 0, 407, 0, 0, 0, 0, 0, 0, 0, 408, 0, 0, 0, 409,
+    0, 0, 410, 0, 0, 0, 0, 411, 0, 0, 412, 0, 0, 0, 0, 0, 0, 0, 413, 0, 0, 0,
+    0, 0, 0, 0, 414, 0, 0, 0, 0, 0, 0, 415, 0, 0, 0, 0, 0, 0, 0, 416, 0, 0,
+    0, 0, 0, 0, 0, 417, 0, 0, 0, 0, 0, 0, 0, 418, 0, 0, 0, 419, 0, 0, 420, 0,
+    0, 0, 0, 421, 0, 0, 422, 0, 0, 0, 423, 0, 0, 0, 424, 0, 0, 0, 425, 0, 0,
+    0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 428, 0, 0, 0, 0, 0, 0, 429, 0,
+    0, 0, 0, 0, 0, 0, 430, 0, 0, 0, 0, 0, 0, 0, 431, 0, 0, 432, 0, 0, 0, 0,
+    433, 0, 0, 434, 0, 0, 0, 435, 0, 0, 0, 436, 0, 0, 0, 437, 0, 0, 0, 438,
+    0, 0, 0, 439, 0, 0, 440, 0, 0, 0, 0, 0, 0, 0, 441, 0, 0, 0, 0, 0, 0, 0,
+    442, 0, 0, 0, 0, 0, 0, 0, 443, 0, 0, 0, 0, 0, 0, 444, 0, 0, 0, 0, 0, 0,
+    0, 445, 0, 0, 0, 0, 0, 0, 0, 446, 0, 0, 0, 447, 0, 0, 0, 448, 0, 0, 0,
+    449, 0, 0, 450, 0, 0, 0, 0, 0, 0, 0, 451, 0, 0, 0, 0, 0, 0, 0, 452, 0, 0,
+    0, 0, 0, 0, 0, 453, 0, 0, 0, 0, 0, 0, 454, 0, 0, 0, 0, 0, 0, 0, 455, 0,
+    0, 0, 0, 0, 0, 0, 456, 0, 0, 0, 0, 0, 0, 0, 457, 0, 0, 0, 0, 0, 0, 458,
+    0, 0, 0, 0, 0, 0, 0, 459, 0, 0, 0, 0, 0, 0, 0, 460, 0, 0, 0, 461, 0, 0,
+    0, 462, 0, 0, 0, 0, 0, 0, 463, 0, 0, 0, 0, 0, 0, 0, 464, 0, 0, 0, 465, 0,
+    0, 0, 466, 0, 0, 0, 0, 0, 0, 467, 0, 0, 0, 0, 0, 0, 0, 468, 0, 0, 0, 0,
+    0, 0, 0, 469, 0, 0, 0, 0, 0, 0, 0, 470, 0, 0, 0, 0, 0, 0, 471, 0, 0, 0,
+    0, 0, 0, 0, 472, 0, 0, 0, 0, 0, 0, 0, 473, 0, 0, 0, 0, 0, 0, 0, 474, 0,
+    0, 0, 0, 0, 0, 475, 0, 0, 0, 0, 0, 0, 0, 476, 0, 0, 0, 0, 0, 0, 0, 477,
+    0, 0, 0, 0, 0, 0, 0, 478, 0, 0, 0, 0, 0, 0, 479, 0, 0, 0, 0, 0, 0, 0,
+    480, 0, 0, 0, 0, 0, 0, 0, 481, 0, 0, 0, 0, 0, 0, 0, 482, 0, 0, 0, 0, 0,
+    0, 483, 0, 0, 0, 0, 0, 0, 0, 484, 0, 0, 0, 0, 0, 0, 0, 485, 0, 0, 0, 0,
+    0, 0, 0, 486, 0, 0, 0, 0, 0, 0, 487, 0, 0, 0, 0, 0, 0, 0, 488, 0, 0, 0,
+    0, 0, 0, 0, 489, 0, 0, 0, 0, 0, 0, 0, 490, 0, 0, 0, 0, 0, 0, 491, 0, 0,
+    0, 0, 0, 0, 0, 492, 0, 0, 0, 0, 0, 0, 0, 493, 0, 0, 0, 0, 0, 0, 0, 494,
+    0, 0, 0, 0, 0, 0, 495, 0, 0, 0, 0, 0, 0, 0, 496, 0, 0, 0, 0, 0, 0, 0,
+    497, 0, 0, 0, 0, 0, 0, 0, 498, 0, 0, 0, 0, 0, 0, 499, 0, 0, 0, 0, 0, 0,
+    0, 500, 0, 0, 0, 0, 0, 0, 0, 501, 0, 0, 0, 0, 0, 0, 0, 502, 0, 0, 0, 0,
+    0, 0, 503, 0, 0, 0, 0, 0, 0, 0, 504, 0, 0, 0, 0, 0, 0, 0, 505, 0, 0, 0,
+    0, 0, 0, 0, 506, 0, 0, 0, 0, 0, 0, 507, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    508, 0, 0, 0, 0, 0, 0, 0, 509, 0, 0, 0, 0, 0, 0, 0, 510, 0, 0, 0, 0, 0,
+    0, 0, 511, 0, 0, 0, 0, 0, 0, 512, 0, 0, 0, 0, 0, 0, 0, 513, 0, 0, 0, 0,
+    0, 0, 0, 514, 0, 0, 0, 0, 0, 0, 0, 515, 0, 0, 0, 0, 0, 0, 516, 0, 0, 0,
+    0, 0, 0, 0, 517, 0, 0, 0, 0, 0, 0, 0, 518, 0, 0, 0, 0, 0, 0, 0, 519, 0,
+    0, 0, 0, 0, 0, 520, 0, 0, 0, 0, 0, 0, 0, 521, 0, 0, 0, 0, 0, 0, 0, 522,
+    0, 0, 0, 0, 0, 0, 0, 523, 0, 0, 0, 0, 0, 0, 524, 0, 0, 0, 0, 0, 0, 0,
+    525, 0, 0, 0, 0, 0, 0, 0, 526, 0, 0, 0, 0, 0, 0, 0, 527, 0, 0, 0, 0, 0,
+    0, 528, 0, 0, 0, 0, 0, 0, 0, 529, 0, 0, 0, 0, 0, 0, 0, 530, 0, 0, 0, 0,
+    0, 0, 0, 531, 0, 0, 0, 0, 0, 0, 532, 0, 0, 0, 0, 0, 0, 0, 533, 0, 0, 0,
+    0, 0, 0, 0, 534, 0, 0, 0, 0, 0, 0, 0, 535, 0, 0, 0, 0, 0, 0, 536, 0, 0,
+    0, 0, 0, 0, 0, 537, 0, 0, 0, 0, 0, 0, 0, 538, 0, 0, 0, 0, 0, 0, 0, 539,
+    0, 0, 0, 0, 0, 0, 540, 0, 0, 0, 0, 0, 0, 0, 541, 0, 0, 0, 0, 0, 0, 0,
+    542, 0, 0, 0, 0, 0, 0, 0, 543, 0, 0, 0, 0, 0, 0, 544, 0, 0, 0, 0, 0, 0,
+    0, 545, 0, 0, 0, 0, 0, 0, 0, 546, 0, 0, 0, 0, 0, 0, 0, 547, 0, 0, 0, 0,
+    0, 0, 548, 0, 0, 0, 0, 0, 0, 0, 549, 0, 0, 0, 0, 0, 0, 0, 550, 0, 0, 0,
+    0, 0, 0, 0, 551, 0, 0, 0, 0, 0, 0, 552, 0, 0, 0, 0, 0, 0, 0, 553, 0, 0,
+    0, 0, 0, 0, 0, 554, 0, 0, 0, 0, 0, 0, 0, 555, 0, 0, 0, 0, 0, 0, 0, 556,
+    0, 0, 0, 0, 0, 0, 557, 0, 0, 0, 0, 0, 0, 0, 558, 0, 0, 0, 0, 0, 0, 0,
+    559, 0, 0, 0, 0, 0, 0, 0, 560, 0, 0, 0, 0, 0, 0, 0, 561, 0, 0, 0, 0, 0,
+    0, 0, 562, 0, 0, 0, 0, 0, 0, 0, 563, 0, 0, 0, 0, 0, 0, 564,
+};
+
+static const unsigned short comp_index1[] = {
+    0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 3, 0, 4, 5, 6, 7, 8, 9, 10,
+    0, 11, 12, 0, 13, 0, 0, 0, 0, 0, 0, 14, 15, 0, 0, 0, 0, 16, 0, 0, 0, 0,
+    0, 17, 18, 0, 19, 0, 20, 0, 0, 0, 0, 21, 0, 0, 0, 22, 0, 23, 0, 0, 24, 0,
+    25, 26, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 0, 35, 0, 36, 37, 38, 0, 0,
+    0, 0, 0, 39, 0, 0, 0, 40, 41, 42, 43, 0, 44, 0, 0, 0, 0, 45, 0, 0, 0, 0,
+    0, 46, 0, 47, 0, 48, 0, 0, 49, 0, 50, 0, 51, 0, 0, 52, 53, 54, 55, 56,
+    57, 58, 0, 59, 0, 0, 60, 61, 0, 0, 0, 62, 0, 0, 0, 0, 0, 63, 64, 0, 0,
+    65, 0, 66, 0, 0, 67, 0, 0, 0, 0, 0, 68, 0, 0, 0, 0, 69, 0, 0, 70, 0, 71,
+    72, 0, 73, 0, 74, 0, 0, 75, 0, 0, 0, 0, 76, 0, 0, 77, 78, 0, 79, 0, 80,
+    0, 0, 81, 0, 82, 83, 0, 84, 0, 0, 0, 0, 0, 85, 86, 87, 88, 89, 90, 91, 0,
+    92, 0, 0, 93, 0, 0, 0, 94, 0, 0, 95, 0, 0, 0, 96, 0, 0, 97, 0, 98, 99, 0,
+    100, 0, 101, 0, 0, 102, 0, 103, 104, 0, 105, 0, 106, 0, 0, 107, 0, 108,
+    0, 0, 0, 109, 0, 110, 0, 0, 111, 0, 112, 113, 0, 114, 0, 0, 0, 0, 0, 115,
+    116, 117, 118, 119, 120, 121, 0, 122, 123, 0, 124, 125, 0, 0, 0, 126, 0,
+    0, 127, 0, 0, 128, 129, 0, 130, 131, 0, 0, 0, 0, 0, 132, 0, 0, 0, 133,
+    134, 135, 136, 137, 0, 0, 0, 138, 0, 0, 139, 140, 0, 141, 0, 142, 0, 0,
+    143, 0, 0, 0, 0, 144, 0, 145, 146, 147, 148, 149, 150, 151, 0, 152, 153,
+    0, 154, 0, 0, 155, 0, 0, 0, 0, 156, 157, 0, 0, 0, 0, 0, 158, 159, 0, 160,
+    0, 161, 162, 0, 0, 0, 163, 0, 164, 0, 0, 165, 0, 166, 167, 0, 168, 0,
+    169, 170, 171, 172, 173, 174, 175, 0, 176, 0, 177, 178, 179, 0, 0, 0, 0,
+    0, 180, 0, 0, 0, 181, 182, 183, 184, 0, 185, 186, 0, 0, 0, 0, 0, 187, 0,
+    188, 0, 189, 0, 0, 190, 0, 191, 0, 192, 193, 0, 194, 195, 196, 197, 198,
+    199, 200, 0, 201, 0, 0, 202, 203, 0, 0, 0, 204, 0, 0, 0, 205, 0, 0, 0, 0,
+    0, 206, 0, 0, 0, 0, 207, 0, 0, 208, 0, 209, 0, 0, 210, 0, 211, 0, 0, 0,
+    0, 212, 0, 0, 213, 0, 214, 215, 0, 216, 0, 217, 0, 0, 218, 219, 0, 0, 0,
+    0, 0, 0, 220, 221, 0, 222, 0, 223, 0, 0, 224, 0, 225, 226, 0, 227, 0, 0,
+    0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 0, 235, 0, 0, 236, 0, 0, 0,
+    237, 0, 0, 238, 0, 0, 0, 239, 0, 0, 240, 0, 241, 242, 0, 243, 0, 244, 0,
+    0, 245, 0, 0, 0, 0, 0, 246, 247, 0, 248, 0, 249, 0, 0, 250, 0, 251, 0, 0,
+    0, 252, 0, 253, 0, 0, 254, 0, 255, 256, 0, 257, 0, 258, 259, 260, 261,
+    262, 263, 264, 0, 265, 266, 0, 267, 268, 0, 0, 0, 269, 0, 0, 270, 0, 0,
+    0, 0, 0, 0, 271, 272, 0, 273, 274, 0, 0, 0, 275, 0, 276, 0, 0, 0, 277,
+    278, 279, 280, 281, 0, 0, 0, 282, 0, 0, 283, 284, 0, 285, 0, 286, 0, 0,
+    287, 0, 0, 0, 0, 288, 0, 0, 0, 0, 0, 289, 0, 290, 0, 0, 0, 0, 291, 292,
+    0, 0, 293, 0, 0, 0, 0, 294, 295, 0, 0, 0, 0, 0, 0, 296, 0, 297, 0, 0, 0,
+    0, 298, 0, 0, 299, 300, 0, 0, 301, 0, 0, 302, 0, 0, 0, 0, 0, 0, 303, 304,
+    0, 0, 305, 0, 0, 306, 0, 307, 308, 0, 0, 0, 0, 0, 309, 310, 0, 0, 0, 0,
+    0, 0, 311, 0, 312, 0, 0, 313, 0, 0, 0, 0, 0, 314, 315, 0, 0, 316, 0, 0,
+    0, 0, 317, 318, 0, 0, 0, 0, 0, 0, 319, 0, 320, 0, 0, 0, 0, 321, 0, 0,
+    322, 323, 0, 0, 324, 0, 0, 325, 0, 0, 0, 0, 0, 0, 326, 327, 0, 0, 328, 0,
+    0, 329, 0, 330, 331, 0, 0, 0, 0, 0, 332, 333, 0, 0, 0, 0, 0, 0, 334, 0,
+    335, 0, 0, 336, 0, 0, 0, 0, 0, 337, 338, 0, 0, 339, 0, 0, 340, 341, 0, 0,
+    342, 0, 0, 343, 0, 0, 0, 0, 0, 0, 344, 0, 0, 345, 0, 0, 346, 0, 0, 0, 0,
+    0, 347, 0, 0, 348, 0, 0, 349, 0, 0, 350, 0, 0, 0, 351, 0, 0, 0, 0, 0, 0,
+    352, 0, 353, 0, 0, 354, 0, 0, 0, 0, 0, 0, 355, 0, 0, 0, 356, 357, 0, 0,
+    358, 0, 0, 0, 359, 0, 0, 360, 361, 0, 0, 362, 0, 0, 0, 363, 0, 0, 364,
+    365, 0, 0, 366, 0, 0, 0, 367, 0, 0, 368, 369, 0, 0, 370, 0, 0, 0, 371, 0,
+    0, 0, 372, 0, 0, 0, 373, 0, 0, 0, 0, 0, 0, 374, 0, 0, 375, 0, 0, 376, 0,
+    0, 377, 0, 0, 0, 0, 0, 0, 378, 0, 0, 379, 0, 0, 380, 0, 0, 0, 0, 0, 381,
+    0, 382, 0, 383, 384, 0, 0, 0, 0, 0, 0, 385, 386, 0, 0, 0, 0, 0, 0, 387,
+    0, 0, 0, 388, 0, 0, 389, 0, 0, 390, 0, 0, 0, 0, 391, 0, 392, 393, 0, 0,
+    0, 394, 0, 0, 0, 395, 0, 0, 396, 0, 0, 0, 0, 0, 0, 397, 0, 0, 0, 398, 0,
+    399, 400, 0, 0, 0, 401, 0, 0, 0, 402, 0, 0, 403, 0, 0, 404, 0, 0, 0, 0,
+    0, 0, 405, 0, 0, 406, 0, 0, 0, 0, 407, 0, 408, 0, 0, 0, 0, 409, 0, 0,
+    410, 0, 0, 0, 0, 411, 0, 0, 412, 0, 0, 0, 413, 0, 0, 414, 0, 0, 0, 0, 0,
+    0, 415, 416, 0, 417, 418, 0, 0, 0, 419, 0, 0, 420, 0, 0, 0, 0, 421, 0, 0,
+    422, 0, 0, 423, 0, 0, 0, 424, 0, 425, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0,
+    0, 428, 429, 0, 0, 0, 0, 0, 0, 430, 0, 0, 431, 0, 0, 0, 0, 432, 0, 433,
+    0, 0, 0, 0, 434, 0, 435, 0, 0, 0, 0, 0, 0, 436, 437, 0, 0, 438, 0, 0,
+    439, 0, 440, 441, 0, 0, 0, 442, 0, 0, 443, 0, 444, 445, 0, 446, 447, 0,
+    0, 448, 0, 0, 0, 449, 0, 450, 451, 0, 0, 0, 452, 0, 0, 0, 0, 0, 453, 0,
+    454, 455, 0, 456, 457, 0, 0, 0, 0, 0, 0, 458, 0, 0, 459, 0, 460, 461, 0,
+    0, 0, 462, 0, 0, 463, 0, 464, 465, 0, 466, 467, 0, 0, 468, 0, 0, 0, 469,
+    0, 470, 471, 0, 0, 0, 472, 0, 0, 0, 0, 0, 473, 0, 474, 475, 0, 476, 477,
+    0, 0, 0, 0, 0, 0, 478, 0, 0, 479, 0, 0, 480, 0, 0, 0, 0, 0, 481, 0, 0,
+    482, 0, 0, 0, 483, 0, 0, 484, 0, 0, 485, 0, 0, 0, 0, 0, 0, 486, 0, 0,
+    487, 488, 0, 489, 0, 0, 490, 0, 0, 0, 0, 0, 0, 491, 0, 0, 492, 0, 0, 493,
+    0, 0, 0, 494, 0, 0, 495, 0, 0, 0, 0, 0, 0, 496, 0, 0, 0, 497, 0, 0, 0,
+    498, 499, 0, 0, 0, 500, 0, 0, 0, 0, 0, 501, 502, 0, 503, 0, 0, 0, 504, 0,
+    0, 0, 505, 0, 0, 506, 507, 0, 0, 0, 0, 0, 508, 0, 0, 0, 509, 510, 0, 0,
+    0, 0, 0, 511, 0, 0, 0, 512, 513, 0, 514, 0, 0, 0, 0, 515, 0, 0, 516, 0,
+    0, 517, 0, 0, 0, 0, 0, 0, 518, 0, 0, 519, 0, 0, 520, 0, 0, 521, 0, 0, 0,
+    0, 0, 0, 522, 0, 0, 523, 0, 0, 524, 0, 0, 525, 0, 0, 0, 0, 0, 0, 526, 0,
+    0, 0, 527, 0, 0, 528, 0, 0, 529, 0, 0, 530, 0, 0, 0, 531, 0, 0, 0, 0, 0,
+    0, 532, 533, 534, 0, 0, 0, 0, 0, 535, 536, 0, 0, 0, 0, 0, 537, 0, 0, 538,
+    0, 0, 539, 0, 0, 0, 0, 0, 0, 540, 0, 541, 0, 0, 0, 0, 0, 542, 543, 0, 0,
+    0, 0, 0, 544, 0, 0, 545, 0, 0, 546, 0, 0, 0, 0, 0, 0, 547, 0, 0, 548, 0,
+    0, 549, 0, 0, 550, 0, 0, 0, 0, 551, 0, 0, 0, 0, 0, 552, 553, 0, 0, 0, 0,
+    0, 554, 0, 0, 555, 0, 0, 556, 0, 0, 0, 0, 0, 0, 557, 0, 0, 558, 0, 0,
+    559, 0, 0, 560, 0, 0, 0, 0, 561, 0, 0, 562, 0, 0, 0, 0, 0, 0, 563, 0, 0,
+    564, 0, 0, 565, 0, 0, 0, 0, 0, 566, 567, 0, 0, 0, 0, 0, 568, 0, 0, 569,
+    0, 0, 570, 0, 0, 0, 0, 0, 0, 571, 0, 0, 572, 0, 0, 573, 0, 0, 574, 0, 0,
+    0, 0, 575, 0, 0, 0, 0, 0, 576, 577, 0, 0, 0, 0, 0, 578, 0, 0, 579, 0, 0,
+    580, 0, 0, 0, 0, 0, 0, 581, 0, 0, 582, 0, 0, 583, 0, 0, 584, 0, 0, 0, 0,
+    585, 0, 0, 0, 0, 0, 586, 587, 0, 0, 0, 0, 0, 588, 0, 0, 0, 0, 589, 0,
+    590, 0, 0, 0, 0, 591, 0, 592, 0, 0, 0, 0, 593, 0, 0, 594, 0, 0, 0, 0, 0,
+    0, 595, 0, 0, 596, 0, 0, 597, 0, 0, 0, 0, 0, 598, 599, 0, 0, 0, 0, 0,
+    600, 0, 0, 0, 0, 601, 0, 602, 0, 0, 0, 0, 603, 0, 604, 0, 0, 0, 0, 605,
+    0, 0, 0, 0, 0, 606, 0, 0, 607, 0, 0, 608, 0, 0, 609, 0, 0, 0, 0, 0, 0,
+    610, 0, 0, 611, 0, 0, 612, 0, 0, 0, 0, 613, 0, 614, 0, 0, 0, 0, 615, 0,
+    0, 0, 0, 0, 616, 0, 0, 617, 0, 0, 618, 0, 0, 619, 0, 0, 0, 0, 0, 0, 620,
+    0, 0, 621, 0, 0, 622, 0, 0, 623, 0, 0, 0, 0, 0, 0, 624, 0, 0, 625, 0, 0,
+    626, 0, 0, 0, 0, 627, 0, 628, 0, 0, 0, 0, 0, 0, 629, 0, 0, 630, 0, 0, 0,
+    0, 631, 0, 632, 0, 0, 0, 0, 0, 633, 0, 0, 634, 0, 0, 635, 0, 0, 636, 0,
+    0, 0, 0, 0, 0, 637, 0, 0, 638, 0, 0, 639, 0, 0, 640, 0, 0, 0, 0, 0, 0,
+    641, 0, 0, 642, 0, 0, 643, 0, 0, 644, 0, 0, 0, 0, 0, 0, 645, 0, 0, 646,
+    0, 0, 647, 0, 0, 648, 0, 0, 0, 0, 0, 0, 649, 0, 0, 650, 0, 0, 651, 0, 0,
+    652, 0, 0, 0, 0, 0, 0, 653, 0, 0, 654, 0, 0, 655, 0, 0, 656, 0, 0, 0, 0,
+    0, 0, 657, 0, 0, 658, 0, 0, 659, 0, 0, 660, 0, 0, 0, 0, 0, 0, 661, 0, 0,
+    662, 0, 0, 663, 0, 0, 664, 0, 0, 0, 0, 0, 0, 665, 0, 0, 666, 0, 0, 667,
+    0, 0, 668, 0, 0, 0, 0, 0, 0, 669, 0, 0, 670, 0, 0, 671, 0, 0, 672, 0, 0,
+    0, 0, 0, 0, 673, 0, 0, 0, 674, 0, 0, 675, 0, 0, 676, 0, 0, 677, 0, 0, 0,
+    0, 0, 0, 678, 0, 0, 679, 0, 0, 680, 0, 0, 681, 0, 0, 0, 0, 0, 0, 682, 0,
+    0, 683, 0, 0, 684, 0, 0, 685, 0, 0, 0, 0, 0, 0, 686, 0, 0, 687, 0, 0,
+    688, 0, 0, 689, 0, 0, 0, 0, 0, 0, 690, 0, 0, 691, 0, 0, 692, 0, 0, 693,
+    0, 0, 0, 0, 0, 0, 694, 0, 0, 695, 0, 0, 696, 0, 0, 697, 0, 0, 0, 0, 0, 0,
+    698, 0, 0, 699, 0, 0, 700, 0, 0, 701, 0, 0, 0, 0, 0, 0, 702, 0, 0, 703,
+    0, 0, 704, 0, 0, 705, 0, 0, 0, 0, 0, 0, 706, 0, 0, 707, 0, 0, 708, 0, 0,
+    709, 0, 0, 0, 0, 0, 0, 710, 0, 0, 711, 0, 0, 712, 0, 0, 713, 0, 0, 0, 0,
+    0, 0, 714, 0, 0, 715, 0, 0, 716, 0, 0, 717, 0, 0, 0, 0, 0, 0, 718, 0, 0,
+    719, 0, 0, 720, 0, 0, 721, 0, 0, 0, 722, 0, 0, 0, 0, 0, 0, 723, 0, 0,
+    724, 0, 0, 725, 0, 0, 726, 0, 0, 0, 727, 0, 0, 0, 728, 729, 0, 0, 730, 0,
+    0, 0, 0, 0, 0, 731,
+};
+
+static const unsigned int comp_data[] = {
+    0, 0, 0, 8814, 0, 8800, 0, 8815, 192, 193, 194, 195, 256, 258, 550, 196,
+    7842, 197, 0, 461, 512, 514, 0, 7840, 0, 7680, 260, 0, 7682, 0, 0, 7684,
+    7686, 0, 0, 262, 264, 0, 266, 0, 0, 268, 0, 199, 7690, 0, 0, 270, 0,
+    7692, 0, 7696, 0, 7698, 7694, 0, 200, 201, 202, 7868, 274, 276, 278, 203,
+    7866, 0, 0, 282, 516, 518, 0, 7864, 0, 552, 280, 7704, 0, 7706, 7710, 0,
+    0, 500, 284, 0, 7712, 286, 288, 0, 0, 486, 0, 290, 292, 0, 7714, 7718, 0,
+    542, 0, 7716, 0, 7720, 7722, 0, 204, 205, 206, 296, 298, 300, 304, 207,
+    7880, 0, 0, 463, 520, 522, 0, 7882, 302, 0, 0, 7724, 308, 0, 0, 7728, 0,
+    488, 0, 7730, 0, 310, 7732, 0, 0, 313, 0, 317, 0, 7734, 0, 315, 0, 7740,
+    7738, 0, 0, 7742, 7744, 0, 0, 7746, 504, 323, 0, 209, 7748, 0, 0, 327, 0,
+    7750, 0, 325, 0, 7754, 7752, 0, 210, 211, 212, 213, 332, 334, 558, 214,
+    7886, 0, 336, 465, 524, 526, 416, 7884, 490, 0, 0, 7764, 7766, 0, 0, 340,
+    7768, 0, 0, 344, 528, 530, 0, 7770, 0, 342, 7774, 0, 0, 346, 348, 0,
+    7776, 0, 0, 352, 0, 7778, 536, 350, 7786, 0, 0, 356, 0, 7788, 538, 354,
+    0, 7792, 7790, 0, 217, 218, 219, 360, 362, 364, 0, 220, 7910, 366, 368,
+    467, 532, 534, 431, 7908, 7794, 0, 370, 7798, 0, 7796, 0, 7804, 0, 7806,
+    7808, 7810, 372, 0, 7814, 7812, 0, 7816, 7818, 7820, 7922, 221, 374,
+    7928, 562, 0, 7822, 376, 7926, 0, 0, 7924, 0, 377, 7824, 0, 379, 0, 0,
+    381, 0, 7826, 7828, 0, 224, 225, 226, 227, 257, 259, 551, 228, 7843, 229,
+    0, 462, 513, 515, 0, 7841, 0, 7681, 261, 0, 7683, 0, 0, 7685, 7687, 0, 0,
+    263, 265, 0, 267, 0, 0, 269, 0, 231, 7691, 0, 0, 271, 0, 7693, 0, 7697,
+    0, 7699, 7695, 0, 232, 233, 234, 7869, 275, 277, 279, 235, 7867, 0, 0,
+    283, 517, 519, 0, 7865, 0, 553, 281, 7705, 0, 7707, 7711, 0, 0, 501, 285,
+    0, 7713, 287, 289, 0, 0, 487, 0, 291, 293, 0, 7715, 7719, 0, 543, 0,
+    7717, 0, 7721, 7723, 0, 7830, 0, 236, 237, 238, 297, 299, 301, 0, 239,
+    7881, 0, 0, 464, 521, 523, 0, 7883, 303, 0, 0, 7725, 309, 0, 0, 496, 0,
+    7729, 0, 489, 0, 7731, 0, 311, 7733, 0, 0, 314, 0, 318, 0, 7735, 0, 316,
+    0, 7741, 7739, 0, 0, 7743, 7745, 0, 0, 7747, 505, 324, 0, 241, 7749, 0,
+    0, 328, 0, 7751, 0, 326, 0, 7755, 7753, 0, 242, 243, 244, 245, 333, 335,
+    559, 246, 7887, 0, 337, 466, 525, 527, 417, 7885, 491, 0, 0, 7765, 7767,
+    0, 0, 341, 7769, 0, 0, 345, 529, 531, 0, 7771, 0, 343, 7775, 0, 0, 347,
+    349, 0, 7777, 0, 0, 353, 0, 7779, 537, 351, 7787, 7831, 0, 357, 0, 7789,
+    539, 355, 0, 7793, 7791, 0, 249, 250, 251, 361, 363, 365, 0, 252, 7911,
+    367, 369, 468, 533, 535, 432, 7909, 7795, 0, 371, 7799, 0, 7797, 0, 7805,
+    0, 7807, 7809, 7811, 373, 0, 7815, 7813, 0, 7832, 0, 7817, 7819, 7821,
+    7923, 253, 375, 7929, 563, 0, 7823, 255, 7927, 7833, 0, 7925, 0, 378,
+    7825, 0, 380, 0, 0, 382, 0, 7827, 7829, 0, 8173, 901, 8129, 0, 7846,
+    7844, 0, 7850, 7848, 0, 478, 0, 0, 506, 0, 508, 482, 0, 0, 7688, 7872,
+    7870, 0, 7876, 7874, 0, 0, 7726, 7890, 7888, 0, 7894, 7892, 0, 0, 7756,
+    556, 0, 0, 7758, 554, 0, 0, 510, 475, 471, 469, 0, 0, 473, 7847, 7845, 0,
+    7851, 7849, 0, 479, 0, 0, 507, 0, 509, 483, 0, 0, 7689, 7873, 7871, 0,
+    7877, 7875, 0, 0, 7727, 7891, 7889, 0, 7895, 7893, 0, 0, 7757, 557, 0, 0,
+    7759, 555, 0, 0, 511, 476, 472, 470, 0, 0, 474, 7856, 7854, 0, 7860,
+    7858, 0, 7857, 7855, 0, 7861, 7859, 0, 7700, 7702, 7701, 7703, 7760,
+    7762, 7761, 7763, 7780, 0, 7781, 0, 7782, 0, 7783, 0, 0, 7800, 0, 7801,
+    0, 7802, 0, 7803, 7835, 0, 7900, 7898, 0, 7904, 7902, 0, 0, 7906, 7901,
+    7899, 0, 7905, 7903, 0, 0, 7907, 7914, 7912, 0, 7918, 7916, 0, 0, 7920,
+    7915, 7913, 0, 7919, 7917, 0, 0, 7921, 0, 494, 492, 0, 493, 0, 480, 0,
+    481, 0, 0, 7708, 0, 7709, 560, 0, 561, 0, 0, 495, 8122, 902, 8121, 8120,
+    7944, 7945, 0, 8124, 8136, 904, 7960, 7961, 8138, 905, 7976, 7977, 0,
+    8140, 8154, 906, 8153, 8152, 0, 938, 7992, 7993, 8184, 908, 8008, 8009,
+    0, 8172, 8170, 910, 8169, 8168, 0, 939, 0, 8025, 8186, 911, 8040, 8041,
+    0, 8188, 0, 8116, 0, 8132, 8048, 940, 8113, 8112, 7936, 7937, 8118, 8115,
+    8050, 941, 7952, 7953, 8052, 942, 7968, 7969, 8134, 8131, 8054, 943,
+    8145, 8144, 0, 970, 7984, 7985, 8150, 0, 8056, 972, 8000, 8001, 8164,
+    8165, 8058, 973, 8161, 8160, 0, 971, 8016, 8017, 8166, 0, 8060, 974,
+    8032, 8033, 8182, 8179, 8146, 912, 8151, 0, 8162, 944, 8167, 0, 0, 8180,
+    0, 979, 0, 980, 0, 1031, 0, 1232, 0, 1234, 0, 1027, 1024, 0, 0, 1238, 0,
+    1025, 0, 1217, 0, 1244, 0, 1246, 1037, 0, 1250, 1049, 0, 1252, 0, 1036,
+    0, 1254, 1262, 1038, 0, 1264, 1266, 0, 0, 1268, 0, 1272, 0, 1260, 0,
+    1233, 0, 1235, 0, 1107, 1104, 0, 0, 1239, 0, 1105, 0, 1218, 0, 1245, 0,
+    1247, 1117, 0, 1251, 1081, 0, 1253, 0, 1116, 0, 1255, 1263, 1118, 0,
+    1265, 1267, 0, 0, 1269, 0, 1273, 0, 1261, 0, 1111, 1142, 0, 1143, 0, 0,
+    1242, 0, 1243, 0, 1258, 0, 1259, 1570, 1571, 1573, 0, 0, 1572, 0, 1574,
+    0, 1730, 0, 1747, 0, 1728, 0, 2345, 0, 2353, 0, 2356, 2507, 2508, 2891,
+    2888, 2892, 0, 2964, 0, 0, 3018, 3020, 0, 0, 3019, 0, 3144, 0, 3264,
+    3274, 3271, 3272, 0, 0, 3275, 0, 3402, 3404, 0, 0, 3403, 0, 3546, 3548,
+    3550, 0, 3549, 4134, 0, 0, 6918, 0, 6920, 0, 6922, 0, 6924, 0, 6926, 0,
+    6930, 0, 6971, 0, 6973, 0, 6976, 0, 6977, 0, 6979, 7736, 0, 7737, 0,
+    7772, 0, 7773, 0, 7784, 0, 7785, 0, 7852, 0, 0, 7862, 7853, 0, 0, 7863,
+    7878, 0, 7879, 0, 7896, 0, 7897, 0, 7938, 7940, 7942, 8064, 7939, 7941,
+    7943, 8065, 0, 8066, 0, 8067, 0, 8068, 0, 8069, 0, 8070, 0, 8071, 7946,
+    7948, 7950, 8072, 7947, 7949, 7951, 8073, 0, 8074, 0, 8075, 0, 8076, 0,
+    8077, 0, 8078, 0, 8079, 7954, 7956, 7955, 7957, 7962, 7964, 7963, 7965,
+    7970, 7972, 7974, 8080, 7971, 7973, 7975, 8081, 0, 8082, 0, 8083, 0,
+    8084, 0, 8085, 0, 8086, 0, 8087, 7978, 7980, 7982, 8088, 7979, 7981,
+    7983, 8089, 0, 8090, 0, 8091, 0, 8092, 0, 8093, 0, 8094, 0, 8095, 7986,
+    7988, 7990, 0, 7987, 7989, 7991, 0, 7994, 7996, 7998, 0, 7995, 7997,
+    7999, 0, 8002, 8004, 8003, 8005, 8010, 8012, 8011, 8013, 8018, 8020,
+    8022, 0, 8019, 8021, 8023, 0, 8027, 8029, 8031, 0, 8034, 8036, 8038,
+    8096, 8035, 8037, 8039, 8097, 0, 8098, 0, 8099, 0, 8100, 0, 8101, 0,
+    8102, 0, 8103, 8042, 8044, 8046, 8104, 8043, 8045, 8047, 8105, 0, 8106,
+    0, 8107, 0, 8108, 0, 8109, 0, 8110, 0, 8111, 0, 8114, 0, 8130, 0, 8178,
+    0, 8119, 8141, 8142, 8143, 0, 0, 8135, 0, 8183, 8157, 8158, 8159, 0, 0,
+    8602, 0, 8603, 0, 8622, 0, 8653, 0, 8655, 0, 8654, 0, 8708, 0, 8713, 0,
+    8716, 0, 8740, 0, 8742, 0, 8769, 0, 8772, 0, 8775, 0, 8777, 0, 8813, 0,
+    8802, 0, 8816, 0, 8817, 0, 8820, 0, 8821, 0, 8824, 0, 8825, 0, 8832, 0,
+    8833, 0, 8928, 0, 8929, 0, 8836, 0, 8837, 0, 8840, 0, 8841, 0, 8930, 0,
+    8931, 0, 8876, 0, 8877, 0, 8878, 0, 8879, 0, 8938, 0, 8939, 0, 8940, 0,
+    8941, 12436, 0, 12364, 0, 12366, 0, 12368, 0, 12370, 0, 12372, 0, 12374,
+    0, 12376, 0, 12378, 0, 12380, 0, 12382, 0, 12384, 0, 12386, 0, 12389, 0,
+    12391, 0, 12393, 0, 12400, 12401, 12403, 12404, 12406, 12407, 12409,
+    12410, 12412, 12413, 12446, 0, 12532, 0, 12460, 0, 12462, 0, 12464, 0,
+    12466, 0, 12468, 0, 12470, 0, 12472, 0, 12474, 0, 12476, 0, 12478, 0,
+    12480, 0, 12482, 0, 12485, 0, 12487, 0, 12489, 0, 12496, 12497, 12499,
+    12500, 12502, 12503, 12505, 12506, 12508, 12509, 12535, 0, 12536, 0,
+    12537, 0, 12538, 0, 12542, 0, 69786, 0, 69788, 0, 69803, 0, 0, 69934, 0,
+    69935, 70475, 70476, 70844, 70843, 70846, 0, 0, 71098, 0, 71099,
+};
+
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ucdn/unicodedata_db.h	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5514 +0,0 @@
-/* this file was generated by makeunicodedata.py 3.2 */
-
-#define UNIDATA_VERSION "9.0.0"
-/* a list of unique database records */
-static const UCDRecord ucd_records[] = {
-    {2, 0, 18, 0, 5, 102, 41},
-    {0, 0, 14, 0, 5, 0, 21},
-    {0, 0, 16, 0, 5, 0, 17},
-    {0, 0, 15, 0, 5, 0, 35},
-    {0, 0, 16, 0, 5, 0, 30},
-    {0, 0, 17, 0, 5, 0, 30},
-    {0, 0, 15, 0, 5, 0, 33},
-    {0, 0, 15, 0, 5, 0, 21},
-    {0, 0, 16, 0, 5, 0, 21},
-    {29, 0, 17, 0, 3, 0, 40},
-    {21, 0, 18, 0, 3, 0, 6},
-    {21, 0, 18, 0, 3, 0, 3},
-    {21, 0, 10, 0, 3, 0, 12},
-    {23, 0, 10, 0, 3, 0, 9},
-    {21, 0, 10, 0, 3, 0, 10},
-    {21, 0, 18, 0, 3, 0, 12},
-    {22, 0, 18, 1, 3, 0, 0},
-    {18, 0, 18, 1, 3, 0, 2},
-    {25, 0, 9, 0, 3, 0, 9},
-    {21, 0, 12, 0, 3, 0, 8},
-    {17, 0, 9, 0, 3, 0, 16},
-    {21, 0, 12, 0, 3, 0, 7},
-    {13, 0, 8, 0, 3, 0, 11},
-    {21, 0, 18, 0, 3, 0, 8},
-    {25, 0, 18, 1, 3, 0, 12},
-    {25, 0, 18, 0, 3, 0, 12},
-    {9, 0, 0, 0, 3, 1, 12},
-    {21, 0, 18, 0, 3, 0, 9},
-    {24, 0, 18, 0, 3, 0, 12},
-    {16, 0, 18, 0, 3, 0, 12},
-    {5, 0, 0, 0, 3, 1, 12},
-    {25, 0, 18, 0, 3, 0, 17},
-    {18, 0, 18, 1, 3, 0, 1},
-    {0, 0, 15, 0, 5, 0, 36},
-    {29, 0, 12, 0, 5, 0, 4},
-    {21, 0, 18, 0, 4, 0, 0},
-    {23, 0, 10, 0, 3, 0, 10},
-    {23, 0, 10, 0, 4, 0, 9},
-    {26, 0, 18, 0, 3, 0, 12},
-    {21, 0, 18, 0, 4, 0, 29},
-    {24, 0, 18, 0, 4, 0, 29},
-    {26, 0, 18, 0, 5, 0, 12},
-    {7, 0, 0, 0, 4, 1, 29},
-    {20, 0, 18, 1, 5, 0, 3},
-    {1, 0, 14, 0, 4, 0, 17},
-    {26, 0, 18, 0, 4, 0, 12},
-    {26, 0, 10, 0, 4, 0, 10},
-    {25, 0, 10, 0, 4, 0, 9},
-    {15, 0, 8, 0, 4, 0, 29},
-    {24, 0, 18, 0, 4, 0, 18},
-    {5, 0, 0, 0, 5, 0, 12},
-    {19, 0, 18, 1, 5, 0, 3},
-    {15, 0, 18, 0, 4, 0, 29},
-    {9, 0, 0, 0, 5, 1, 12},
-    {9, 0, 0, 0, 4, 1, 12},
-    {25, 0, 18, 0, 4, 0, 29},
-    {5, 0, 0, 0, 4, 1, 12},
-    {5, 0, 0, 0, 5, 1, 12},
-    {7, 0, 0, 0, 5, 1, 12},
-    {8, 0, 0, 0, 5, 1, 12},
-    {6, 0, 0, 0, 5, 1, 12},
-    {6, 0, 18, 0, 5, 0, 12},
-    {6, 0, 0, 0, 5, 0, 12},
-    {24, 0, 18, 0, 5, 0, 12},
-    {24, 0, 18, 0, 4, 0, 12},
-    {6, 0, 18, 0, 4, 0, 29},
-    {6, 0, 18, 0, 5, 0, 18},
-    {6, 0, 0, 0, 4, 0, 29},
-    {24, 0, 18, 0, 5, 34, 12},
-    {12, 230, 13, 0, 4, 40, 21},
-    {12, 232, 13, 0, 4, 40, 21},
-    {12, 220, 13, 0, 4, 40, 21},
-    {12, 216, 13, 0, 4, 40, 21},
-    {12, 202, 13, 0, 4, 40, 21},
-    {12, 1, 13, 0, 4, 40, 21},
-    {12, 240, 13, 0, 4, 40, 21},
-    {12, 0, 13, 0, 4, 40, 4},
-    {12, 233, 13, 0, 4, 40, 4},
-    {12, 234, 13, 0, 4, 40, 4},
-    {9, 0, 0, 0, 5, 2, 12},
-    {5, 0, 0, 0, 5, 2, 12},
-    {24, 0, 18, 0, 5, 2, 12},
-    {2, 0, 18, 0, 5, 102, 41},
-    {6, 0, 0, 0, 5, 2, 12},
-    {21, 0, 18, 0, 5, 0, 8},
-    {21, 0, 18, 0, 5, 0, 12},
-    {9, 0, 0, 0, 4, 2, 12},
-    {5, 0, 0, 0, 4, 2, 12},
-    {9, 0, 0, 0, 5, 54, 12},
-    {5, 0, 0, 0, 5, 54, 12},
-    {25, 0, 18, 0, 5, 2, 12},
-    {9, 0, 0, 0, 5, 3, 12},
-    {9, 0, 0, 0, 4, 3, 12},
-    {5, 0, 0, 0, 4, 3, 12},
-    {5, 0, 0, 0, 5, 3, 12},
-    {26, 0, 0, 0, 5, 3, 12},
-    {12, 230, 13, 0, 5, 3, 21},
-    {12, 230, 13, 0, 5, 40, 21},
-    {11, 0, 13, 0, 5, 3, 21},
-    {9, 0, 0, 0, 5, 4, 12},
-    {6, 0, 0, 0, 5, 4, 12},
-    {21, 0, 0, 0, 5, 4, 12},
-    {5, 0, 0, 0, 5, 4, 12},
-    {21, 0, 0, 0, 5, 0, 8},
-    {17, 0, 18, 0, 5, 4, 17},
-    {26, 0, 18, 0, 5, 4, 12},
-    {23, 0, 10, 0, 5, 4, 9},
-    {12, 220, 13, 0, 5, 5, 21},
-    {12, 230, 13, 0, 5, 5, 21},
-    {12, 222, 13, 0, 5, 5, 21},
-    {12, 228, 13, 0, 5, 5, 21},
-    {12, 10, 13, 0, 5, 5, 21},
-    {12, 11, 13, 0, 5, 5, 21},
-    {12, 12, 13, 0, 5, 5, 21},
-    {12, 13, 13, 0, 5, 5, 21},
-    {12, 14, 13, 0, 5, 5, 21},
-    {12, 15, 13, 0, 5, 5, 21},
-    {12, 16, 13, 0, 5, 5, 21},
-    {12, 17, 13, 0, 5, 5, 21},
-    {12, 18, 13, 0, 5, 5, 21},
-    {12, 19, 13, 0, 5, 5, 21},
-    {12, 20, 13, 0, 5, 5, 21},
-    {12, 21, 13, 0, 5, 5, 21},
-    {12, 22, 13, 0, 5, 5, 21},
-    {17, 0, 3, 0, 5, 5, 17},
-    {12, 23, 13, 0, 5, 5, 21},
-    {21, 0, 3, 0, 5, 5, 12},
-    {12, 24, 13, 0, 5, 5, 21},
-    {12, 25, 13, 0, 5, 5, 21},
-    {21, 0, 3, 0, 5, 5, 6},
-    {7, 0, 3, 0, 5, 5, 13},
-    {1, 0, 11, 0, 5, 6, 12},
-    {1, 0, 11, 0, 5, 0, 12},
-    {25, 0, 18, 0, 5, 6, 12},
-    {25, 0, 4, 0, 5, 6, 12},
-    {21, 0, 10, 0, 5, 6, 10},
-    {23, 0, 4, 0, 5, 6, 10},
-    {21, 0, 12, 0, 5, 0, 8},
-    {21, 0, 4, 0, 5, 6, 8},
-    {26, 0, 18, 0, 5, 6, 12},
-    {12, 230, 13, 0, 5, 6, 21},
-    {12, 30, 13, 0, 5, 6, 21},
-    {12, 31, 13, 0, 5, 6, 21},
-    {12, 32, 13, 0, 5, 6, 21},
-    {21, 0, 4, 0, 5, 0, 6},
-    {1, 0, 4, 0, 5, 0, 21},
-    {21, 0, 4, 0, 5, 6, 6},
-    {7, 0, 4, 0, 5, 6, 12},
-    {6, 0, 4, 0, 5, 0, 12},
-    {12, 27, 13, 0, 5, 40, 21},
-    {12, 28, 13, 0, 5, 40, 21},
-    {12, 29, 13, 0, 5, 40, 21},
-    {12, 30, 13, 0, 5, 40, 21},
-    {12, 31, 13, 0, 5, 40, 21},
-    {12, 32, 13, 0, 5, 40, 21},
-    {12, 33, 13, 0, 5, 40, 21},
-    {12, 34, 13, 0, 5, 40, 21},
-    {12, 220, 13, 0, 5, 40, 21},
-    {12, 220, 13, 0, 5, 6, 21},
-    {13, 0, 11, 0, 5, 6, 11},
-    {21, 0, 11, 0, 5, 6, 11},
-    {21, 0, 4, 0, 5, 6, 12},
-    {12, 35, 13, 0, 5, 40, 21},
-    {6, 0, 4, 0, 5, 6, 12},
-    {13, 0, 8, 0, 5, 6, 11},
-    {26, 0, 4, 0, 5, 6, 12},
-    {21, 0, 4, 0, 5, 7, 12},
-    {1, 0, 4, 0, 5, 7, 12},
-    {7, 0, 4, 0, 5, 7, 12},
-    {12, 36, 13, 0, 5, 7, 21},
-    {12, 230, 13, 0, 5, 7, 21},
-    {12, 220, 13, 0, 5, 7, 21},
-    {7, 0, 4, 0, 5, 8, 12},
-    {12, 0, 13, 0, 5, 8, 21},
-    {13, 0, 3, 0, 5, 65, 11},
-    {7, 0, 3, 0, 5, 65, 12},
-    {12, 230, 13, 0, 5, 65, 21},
-    {12, 220, 13, 0, 5, 65, 21},
-    {6, 0, 3, 0, 5, 65, 12},
-    {26, 0, 18, 0, 5, 65, 12},
-    {21, 0, 18, 0, 5, 65, 12},
-    {21, 0, 18, 0, 5, 65, 8},
-    {21, 0, 18, 0, 5, 65, 6},
-    {7, 0, 3, 0, 5, 81, 12},
-    {12, 230, 13, 0, 5, 81, 21},
-    {6, 0, 3, 0, 5, 81, 12},
-    {21, 0, 3, 0, 5, 81, 12},
-    {7, 0, 3, 0, 5, 94, 12},
-    {12, 220, 13, 0, 5, 94, 21},
-    {21, 0, 3, 0, 5, 94, 12},
-    {12, 27, 13, 0, 5, 6, 21},
-    {12, 28, 13, 0, 5, 6, 21},
-    {12, 29, 13, 0, 5, 6, 21},
-    {12, 0, 13, 0, 5, 9, 21},
-    {10, 0, 0, 0, 5, 9, 21},
-    {7, 0, 0, 0, 5, 9, 12},
-    {12, 7, 13, 0, 5, 9, 21},
-    {12, 9, 13, 0, 5, 9, 21},
-    {12, 230, 13, 0, 5, 9, 21},
-    {21, 0, 0, 0, 5, 0, 17},
-    {13, 0, 0, 0, 5, 9, 11},
-    {21, 0, 0, 0, 5, 9, 12},
-    {6, 0, 0, 0, 5, 9, 12},
-    {7, 0, 0, 0, 5, 10, 12},
-    {12, 0, 13, 0, 5, 10, 21},
-    {10, 0, 0, 0, 5, 10, 21},
-    {12, 7, 13, 0, 5, 10, 21},
-    {12, 9, 13, 0, 5, 10, 21},
-    {13, 0, 0, 0, 5, 10, 11},
-    {23, 0, 10, 0, 5, 10, 10},
-    {15, 0, 0, 0, 5, 10, 12},
-    {15, 0, 0, 0, 5, 10, 10},
-    {26, 0, 0, 0, 5, 10, 12},
-    {23, 0, 10, 0, 5, 10, 9},
-    {12, 0, 13, 0, 5, 11, 21},
-    {10, 0, 0, 0, 5, 11, 21},
-    {7, 0, 0, 0, 5, 11, 12},
-    {12, 7, 13, 0, 5, 11, 21},
-    {12, 9, 13, 0, 5, 11, 21},
-    {13, 0, 0, 0, 5, 11, 11},
-    {12, 0, 13, 0, 5, 12, 21},
-    {10, 0, 0, 0, 5, 12, 21},
-    {7, 0, 0, 0, 5, 12, 12},
-    {12, 7, 13, 0, 5, 12, 21},
-    {12, 9, 13, 0, 5, 12, 21},
-    {13, 0, 0, 0, 5, 12, 11},
-    {21, 0, 0, 0, 5, 12, 12},
-    {23, 0, 10, 0, 5, 12, 9},
-    {12, 0, 13, 0, 5, 13, 21},
-    {10, 0, 0, 0, 5, 13, 21},
-    {7, 0, 0, 0, 5, 13, 12},
-    {12, 7, 13, 0, 5, 13, 21},
-    {12, 9, 13, 0, 5, 13, 21},
-    {13, 0, 0, 0, 5, 13, 11},
-    {26, 0, 0, 0, 5, 13, 12},
-    {15, 0, 0, 0, 5, 13, 12},
-    {12, 0, 13, 0, 5, 14, 21},
-    {7, 0, 0, 0, 5, 14, 12},
-    {10, 0, 0, 0, 5, 14, 21},
-    {12, 9, 13, 0, 5, 14, 21},
-    {13, 0, 0, 0, 5, 14, 11},
-    {15, 0, 0, 0, 5, 14, 12},
-    {26, 0, 18, 0, 5, 14, 12},
-    {23, 0, 10, 0, 5, 14, 9},
-    {12, 0, 13, 0, 5, 15, 21},
-    {10, 0, 0, 0, 5, 15, 21},
-    {7, 0, 0, 0, 5, 15, 12},
-    {12, 9, 13, 0, 5, 15, 21},
-    {12, 84, 13, 0, 5, 15, 21},
-    {12, 91, 13, 0, 5, 15, 21},
-    {13, 0, 0, 0, 5, 15, 11},
-    {15, 0, 18, 0, 5, 15, 12},
-    {26, 0, 0, 0, 5, 15, 12},
-    {7, 0, 0, 0, 5, 16, 12},
-    {12, 0, 13, 0, 5, 16, 21},
-    {10, 0, 0, 0, 5, 16, 21},
-    {12, 7, 13, 0, 5, 16, 21},
-    {12, 0, 0, 0, 5, 16, 21},
-    {12, 9, 13, 0, 5, 16, 21},
-    {13, 0, 0, 0, 5, 16, 11},
-    {12, 0, 13, 0, 5, 17, 21},
-    {10, 0, 0, 0, 5, 17, 21},
-    {7, 0, 0, 0, 5, 17, 12},
-    {12, 9, 13, 0, 5, 17, 21},
-    {26, 0, 0, 0, 5, 17, 12},
-    {15, 0, 0, 0, 5, 17, 12},
-    {13, 0, 0, 0, 5, 17, 11},
-    {26, 0, 0, 0, 5, 17, 10},
-    {10, 0, 0, 0, 5, 18, 21},
-    {7, 0, 0, 0, 5, 18, 12},
-    {12, 9, 13, 0, 5, 18, 21},
-    {12, 0, 13, 0, 5, 18, 21},
-    {13, 0, 0, 0, 5, 18, 11},
-    {21, 0, 0, 0, 5, 18, 12},
-    {7, 0, 0, 0, 5, 19, 38},
-    {12, 0, 13, 0, 5, 19, 38},
-    {12, 103, 13, 0, 5, 19, 38},
-    {12, 9, 13, 0, 5, 19, 38},
-    {23, 0, 10, 0, 5, 0, 9},
-    {6, 0, 0, 0, 5, 19, 38},
-    {12, 107, 13, 0, 5, 19, 38},
-    {21, 0, 0, 0, 5, 19, 12},
-    {13, 0, 0, 0, 5, 19, 11},
-    {21, 0, 0, 0, 5, 19, 17},
-    {7, 0, 0, 0, 5, 20, 38},
-    {12, 0, 13, 0, 5, 20, 38},
-    {12, 118, 13, 0, 5, 20, 38},
-    {6, 0, 0, 0, 5, 20, 38},
-    {12, 122, 13, 0, 5, 20, 38},
-    {13, 0, 0, 0, 5, 20, 11},
-    {7, 0, 0, 0, 5, 21, 12},
-    {26, 0, 0, 0, 5, 21, 18},
-    {21, 0, 0, 0, 5, 21, 18},
-    {21, 0, 0, 0, 5, 21, 12},
-    {21, 0, 0, 0, 5, 21, 4},
-    {21, 0, 0, 0, 5, 21, 17},
-    {21, 0, 0, 0, 5, 21, 6},
-    {26, 0, 0, 0, 5, 21, 12},
-    {12, 220, 13, 0, 5, 21, 21},
-    {13, 0, 0, 0, 5, 21, 11},
-    {15, 0, 0, 0, 5, 21, 12},
-    {26, 0, 0, 0, 5, 21, 17},
-    {12, 216, 13, 0, 5, 21, 21},
-    {22, 0, 18, 1, 5, 21, 0},
-    {18, 0, 18, 1, 5, 21, 1},
-    {10, 0, 0, 0, 5, 21, 21},
-    {12, 129, 13, 0, 5, 21, 21},
-    {12, 130, 13, 0, 5, 21, 21},
-    {12, 0, 13, 0, 5, 21, 21},
-    {12, 132, 13, 0, 5, 21, 21},
-    {10, 0, 0, 0, 5, 21, 17},
-    {12, 230, 13, 0, 5, 21, 21},
-    {12, 9, 13, 0, 5, 21, 21},
-    {26, 0, 0, 0, 5, 0, 12},
-    {7, 0, 0, 0, 5, 22, 38},
-    {10, 0, 0, 0, 5, 22, 38},
-    {12, 0, 13, 0, 5, 22, 38},
-    {12, 7, 13, 0, 5, 22, 38},
-    {12, 9, 13, 0, 5, 22, 38},
-    {13, 0, 0, 0, 5, 22, 11},
-    {21, 0, 0, 0, 5, 22, 17},
-    {21, 0, 0, 0, 5, 22, 12},
-    {12, 220, 13, 0, 5, 22, 38},
-    {26, 0, 0, 0, 5, 22, 38},
-    {9, 0, 0, 0, 5, 23, 12},
-    {7, 0, 0, 0, 5, 23, 12},
-    {21, 0, 0, 0, 5, 0, 12},
-    {6, 0, 0, 0, 5, 23, 12},
-    {7, 0, 0, 0, 2, 24, 25},
-    {7, 0, 0, 0, 5, 24, 26},
-    {7, 0, 0, 0, 5, 24, 27},
-    {7, 0, 0, 0, 5, 25, 12},
-    {12, 230, 13, 0, 5, 25, 21},
-    {21, 0, 0, 0, 5, 25, 12},
-    {21, 0, 0, 0, 5, 25, 17},
-    {15, 0, 0, 0, 5, 25, 12},
-    {26, 0, 18, 0, 5, 25, 12},
-    {9, 0, 0, 0, 5, 26, 12},
-    {5, 0, 0, 0, 5, 26, 12},
-    {17, 0, 18, 0, 5, 27, 17},
-    {7, 0, 0, 0, 5, 27, 12},
-    {21, 0, 0, 0, 5, 27, 12},
-    {29, 0, 17, 0, 5, 28, 17},
-    {7, 0, 0, 0, 5, 28, 12},
-    {22, 0, 18, 1, 5, 28, 0},
-    {18, 0, 18, 1, 5, 28, 1},
-    {7, 0, 0, 0, 5, 29, 12},
-    {14, 0, 0, 0, 5, 29, 12},
-    {7, 0, 0, 0, 5, 41, 12},
-    {12, 0, 13, 0, 5, 41, 21},
-    {12, 9, 13, 0, 5, 41, 21},
-    {7, 0, 0, 0, 5, 42, 12},
-    {12, 0, 13, 0, 5, 42, 21},
-    {12, 9, 13, 0, 5, 42, 21},
-    {7, 0, 0, 0, 5, 43, 12},
-    {12, 0, 13, 0, 5, 43, 21},
-    {7, 0, 0, 0, 5, 44, 12},
-    {12, 0, 13, 0, 5, 44, 21},
-    {7, 0, 0, 0, 5, 30, 38},
-    {12, 0, 13, 0, 5, 30, 38},
-    {10, 0, 0, 0, 5, 30, 38},
-    {12, 9, 13, 0, 5, 30, 38},
-    {21, 0, 0, 0, 5, 30, 17},
-    {21, 0, 0, 0, 5, 30, 5},
-    {6, 0, 0, 0, 5, 30, 38},
-    {21, 0, 0, 0, 5, 30, 12},
-    {23, 0, 10, 0, 5, 30, 9},
-    {12, 230, 13, 0, 5, 30, 38},
-    {13, 0, 0, 0, 5, 30, 11},
-    {15, 0, 18, 0, 5, 30, 12},
-    {21, 0, 18, 0, 5, 31, 12},
-    {21, 0, 18, 0, 5, 0, 6},
-    {21, 0, 18, 0, 5, 31, 17},
-    {21, 0, 18, 0, 5, 0, 17},
-    {17, 0, 18, 0, 5, 31, 18},
-    {21, 0, 18, 0, 5, 31, 6},
-    {12, 0, 13, 0, 5, 31, 21},
-    {1, 0, 14, 0, 5, 31, 4},
-    {13, 0, 0, 0, 5, 31, 11},
-    {7, 0, 0, 0, 5, 31, 12},
-    {6, 0, 0, 0, 5, 31, 12},
-    {12, 228, 13, 0, 5, 31, 21},
-    {7, 0, 0, 0, 5, 45, 12},
-    {12, 0, 13, 0, 5, 45, 21},
-    {10, 0, 0, 0, 5, 45, 21},
-    {12, 222, 13, 0, 5, 45, 21},
-    {12, 230, 13, 0, 5, 45, 21},
-    {12, 220, 13, 0, 5, 45, 21},
-    {26, 0, 18, 0, 5, 45, 12},
-    {21, 0, 18, 0, 5, 45, 6},
-    {13, 0, 0, 0, 5, 45, 11},
-    {7, 0, 0, 0, 5, 46, 38},
-    {7, 0, 0, 0, 5, 55, 38},
-    {13, 0, 0, 0, 5, 55, 11},
-    {15, 0, 0, 0, 5, 55, 38},
-    {26, 0, 18, 0, 5, 55, 38},
-    {26, 0, 18, 0, 5, 30, 12},
-    {7, 0, 0, 0, 5, 53, 12},
-    {12, 230, 13, 0, 5, 53, 21},
-    {12, 220, 13, 0, 5, 53, 21},
-    {10, 0, 0, 0, 5, 53, 21},
-    {12, 0, 13, 0, 5, 53, 21},
-    {21, 0, 0, 0, 5, 53, 12},
-    {7, 0, 0, 0, 5, 77, 38},
-    {10, 0, 0, 0, 5, 77, 38},
-    {12, 0, 13, 0, 5, 77, 38},
-    {12, 9, 13, 0, 5, 77, 38},
-    {12, 230, 13, 0, 5, 77, 38},
-    {12, 220, 13, 0, 5, 77, 21},
-    {13, 0, 0, 0, 5, 77, 11},
-    {21, 0, 0, 0, 5, 77, 38},
-    {6, 0, 0, 0, 5, 77, 38},
-    {11, 0, 13, 0, 5, 40, 21},
-    {12, 0, 13, 0, 5, 61, 21},
-    {10, 0, 0, 0, 5, 61, 21},
-    {7, 0, 0, 0, 5, 61, 12},
-    {12, 7, 13, 0, 5, 61, 21},
-    {10, 9, 0, 0, 5, 61, 21},
-    {13, 0, 0, 0, 5, 61, 11},
-    {21, 0, 0, 0, 5, 61, 17},
-    {21, 0, 0, 0, 5, 61, 12},
-    {26, 0, 0, 0, 5, 61, 12},
-    {12, 230, 13, 0, 5, 61, 21},
-    {12, 220, 13, 0, 5, 61, 21},
-    {12, 0, 13, 0, 5, 66, 21},
-    {10, 0, 0, 0, 5, 66, 21},
-    {7, 0, 0, 0, 5, 66, 12},
-    {10, 9, 0, 0, 5, 66, 21},
-    {12, 9, 13, 0, 5, 66, 21},
-    {13, 0, 0, 0, 5, 66, 11},
-    {7, 0, 0, 0, 5, 92, 12},
-    {12, 7, 13, 0, 5, 92, 21},
-    {10, 0, 0, 0, 5, 92, 21},
-    {12, 0, 13, 0, 5, 92, 21},
-    {10, 9, 0, 0, 5, 92, 21},
-    {21, 0, 0, 0, 5, 92, 12},
-    {7, 0, 0, 0, 5, 67, 12},
-    {10, 0, 0, 0, 5, 67, 21},
-    {12, 0, 13, 0, 5, 67, 21},
-    {12, 7, 13, 0, 5, 67, 21},
-    {21, 0, 0, 0, 5, 67, 17},
-    {13, 0, 0, 0, 5, 67, 11},
-    {13, 0, 0, 0, 5, 68, 11},
-    {7, 0, 0, 0, 5, 68, 12},
-    {6, 0, 0, 0, 5, 68, 12},
-    {21, 0, 0, 0, 5, 68, 17},
-    {21, 0, 0, 0, 5, 66, 12},
-    {12, 1, 13, 0, 5, 40, 21},
-    {10, 0, 0, 0, 5, 0, 21},
-    {7, 0, 0, 0, 5, 0, 12},
-    {6, 0, 0, 0, 5, 3, 12},
-    {12, 234, 13, 0, 5, 40, 21},
-    {12, 214, 13, 0, 5, 40, 21},
-    {12, 202, 13, 0, 5, 40, 21},
-    {12, 233, 13, 0, 5, 40, 21},
-    {8, 0, 0, 0, 5, 2, 12},
-    {24, 0, 18, 0, 5, 2, 18},
-    {29, 0, 17, 0, 5, 0, 17},
-    {29, 0, 17, 0, 5, 0, 4},
-    {1, 0, 14, 0, 5, 0, 20},
-    {1, 0, 14, 0, 5, 40, 21},
-    {1, 0, 14, 0, 5, 40, 41},
-    {1, 0, 0, 0, 5, 0, 21},
-    {1, 0, 3, 0, 5, 0, 21},
-    {17, 0, 18, 0, 4, 0, 17},
-    {17, 0, 18, 0, 5, 0, 4},
-    {17, 0, 18, 0, 5, 0, 17},
-    {17, 0, 18, 0, 4, 0, 19},
-    {17, 0, 18, 0, 4, 0, 29},
-    {20, 0, 18, 0, 4, 0, 3},
-    {19, 0, 18, 0, 4, 0, 3},
-    {22, 0, 18, 0, 5, 0, 0},
-    {20, 0, 18, 0, 5, 0, 3},
-    {21, 0, 18, 0, 4, 0, 12},
-    {21, 0, 18, 0, 4, 0, 15},
-    {21, 0, 18, 0, 4, 0, 17},
-    {27, 0, 17, 0, 5, 0, 30},
-    {28, 0, 15, 0, 5, 0, 30},
-    {1, 0, 1, 0, 5, 0, 21},
-    {1, 0, 5, 0, 5, 0, 21},
-    {1, 0, 7, 0, 5, 0, 21},
-    {1, 0, 2, 0, 5, 0, 21},
-    {1, 0, 6, 0, 5, 0, 21},
-    {21, 0, 10, 0, 4, 0, 10},
-    {21, 0, 10, 0, 5, 0, 10},
-    {21, 0, 18, 0, 4, 0, 10},
-    {21, 0, 18, 0, 5, 0, 10},
-    {21, 0, 18, 0, 5, 0, 5},
-    {16, 0, 18, 0, 5, 0, 12},
-    {25, 0, 12, 0, 5, 0, 8},
-    {22, 0, 18, 1, 5, 0, 0},
-    {18, 0, 18, 1, 5, 0, 1},
-    {25, 0, 18, 0, 5, 0, 12},
-    {1, 0, 14, 0, 5, 0, 22},
-    {1, 0, 14, 0, 5, 0, 12},
-    {1, 0, 19, 0, 5, 0, 21},
-    {1, 0, 20, 0, 5, 0, 21},
-    {1, 0, 21, 0, 5, 0, 21},
-    {1, 0, 22, 0, 5, 0, 21},
-    {1, 0, 14, 0, 5, 0, 21},
-    {15, 0, 8, 0, 5, 0, 12},
-    {25, 0, 9, 0, 5, 0, 12},
-    {6, 0, 0, 0, 4, 1, 29},
-    {23, 0, 10, 0, 5, 0, 10},
-    {23, 0, 10, 0, 1, 0, 9},
-    {2, 0, 18, 0, 5, 102, 9},
-    {9, 0, 0, 0, 5, 0, 12},
-    {26, 0, 18, 0, 4, 0, 10},
-    {26, 0, 18, 0, 4, 0, 29},
-    {5, 0, 0, 0, 4, 0, 29},
-    {26, 0, 18, 0, 4, 0, 9},
-    {9, 0, 0, 0, 4, 1, 29},
-    {26, 0, 10, 0, 5, 0, 12},
-    {25, 0, 18, 1, 5, 0, 12},
-    {15, 0, 18, 0, 5, 0, 12},
-    {15, 0, 18, 0, 4, 0, 12},
-    {15, 0, 18, 0, 5, 0, 29},
-    {14, 0, 0, 0, 4, 1, 29},
-    {14, 0, 0, 0, 5, 1, 12},
-    {25, 0, 18, 1, 4, 0, 29},
-    {25, 0, 9, 0, 5, 0, 9},
-    {25, 0, 10, 0, 5, 0, 9},
-    {25, 0, 18, 0, 5, 0, 15},
-    {26, 0, 18, 0, 2, 0, 14},
-    {22, 0, 18, 1, 2, 0, 0},
-    {18, 0, 18, 1, 2, 0, 1},
-    {26, 0, 18, 0, 2, 0, 12},
-    {26, 0, 18, 0, 5, 0, 14},
-    {26, 0, 0, 0, 4, 0, 29},
-    {26, 0, 18, 0, 5, 0, 29},
-    {25, 0, 18, 0, 2, 0, 12},
-    {26, 0, 18, 0, 4, 0, 14},
-    {26, 0, 18, 0, 5, 0, 41},
-    {26, 0, 18, 0, 4, 0, 41},
-    {26, 0, 18, 0, 2, 0, 41},
-    {26, 0, 18, 0, 2, 0, 29},
-    {26, 0, 18, 0, 5, 0, 3},
-    {26, 0, 18, 0, 5, 0, 6},
-    {26, 0, 0, 0, 5, 52, 12},
-    {9, 0, 0, 0, 5, 56, 12},
-    {5, 0, 0, 0, 5, 56, 12},
-    {26, 0, 18, 0, 5, 54, 12},
-    {12, 230, 13, 0, 5, 54, 21},
-    {21, 0, 18, 0, 5, 54, 6},
-    {21, 0, 18, 0, 5, 54, 17},
-    {15, 0, 18, 0, 5, 54, 12},
-    {5, 0, 0, 0, 5, 23, 12},
-    {7, 0, 0, 0, 5, 57, 12},
-    {6, 0, 0, 0, 5, 57, 12},
-    {21, 0, 0, 0, 5, 57, 17},
-    {12, 9, 13, 0, 5, 57, 21},
-    {21, 0, 18, 0, 5, 0, 3},
-    {21, 0, 18, 0, 5, 0, 0},
-    {17, 0, 18, 0, 5, 0, 12},
-    {17, 0, 18, 0, 5, 0, 19},
-    {26, 0, 18, 0, 2, 35, 14},
-    {29, 0, 17, 0, 0, 0, 17},
-    {21, 0, 18, 0, 2, 0, 1},
-    {21, 0, 18, 0, 2, 0, 14},
-    {6, 0, 0, 0, 2, 35, 5},
-    {7, 0, 0, 0, 2, 0, 14},
-    {14, 0, 0, 0, 2, 35, 14},
-    {17, 0, 18, 0, 2, 0, 5},
-    {22, 0, 18, 0, 2, 0, 0},
-    {18, 0, 18, 0, 2, 0, 1},
-    {12, 218, 13, 0, 2, 40, 21},
-    {12, 228, 13, 0, 2, 40, 21},
-    {12, 232, 13, 0, 2, 40, 21},
-    {12, 222, 13, 0, 2, 40, 21},
-    {10, 224, 0, 0, 2, 24, 21},
-    {17, 0, 18, 0, 2, 0, 14},
-    {6, 0, 0, 0, 2, 0, 14},
-    {6, 0, 0, 0, 2, 0, 21},
-    {7, 0, 0, 0, 2, 0, 5},
-    {7, 0, 0, 0, 2, 32, 32},
-    {7, 0, 0, 0, 2, 32, 14},
-    {12, 8, 13, 0, 2, 40, 21},
-    {24, 0, 18, 0, 2, 0, 5},
-    {6, 0, 0, 0, 2, 32, 5},
-    {7, 0, 0, 0, 2, 33, 32},
-    {7, 0, 0, 0, 2, 33, 14},
-    {21, 0, 18, 0, 2, 0, 5},
-    {6, 0, 0, 0, 2, 0, 32},
-    {6, 0, 0, 0, 2, 33, 5},
-    {7, 0, 0, 0, 2, 34, 14},
-    {7, 0, 0, 0, 2, 24, 14},
-    {26, 0, 0, 0, 2, 0, 14},
-    {15, 0, 0, 0, 2, 0, 14},
-    {26, 0, 0, 0, 2, 24, 14},
-    {26, 0, 18, 0, 2, 24, 14},
-    {15, 0, 0, 0, 4, 0, 29},
-    {15, 0, 18, 0, 2, 0, 14},
-    {26, 0, 0, 0, 2, 33, 14},
-    {7, 0, 0, 0, 2, 35, 14},
-    {2, 0, 18, 0, 2, 102, 14},
-    {7, 0, 0, 0, 2, 36, 14},
-    {6, 0, 0, 0, 2, 36, 5},
-    {26, 0, 18, 0, 2, 36, 14},
-    {7, 0, 0, 0, 5, 82, 12},
-    {6, 0, 0, 0, 5, 82, 12},
-    {21, 0, 0, 0, 5, 82, 17},
-    {7, 0, 0, 0, 5, 69, 12},
-    {6, 0, 0, 0, 5, 69, 12},
-    {21, 0, 18, 0, 5, 69, 17},
-    {21, 0, 18, 0, 5, 69, 6},
-    {13, 0, 0, 0, 5, 69, 11},
-    {7, 0, 0, 0, 5, 3, 12},
-    {21, 0, 18, 0, 5, 3, 12},
-    {6, 0, 18, 0, 5, 3, 12},
-    {7, 0, 0, 0, 5, 83, 12},
-    {14, 0, 0, 0, 5, 83, 12},
-    {12, 230, 13, 0, 5, 83, 21},
-    {21, 0, 0, 0, 5, 83, 12},
-    {21, 0, 0, 0, 5, 83, 17},
-    {24, 0, 0, 0, 5, 0, 12},
-    {7, 0, 0, 0, 5, 58, 12},
-    {12, 0, 13, 0, 5, 58, 21},
-    {12, 9, 13, 0, 5, 58, 21},
-    {10, 0, 0, 0, 5, 58, 21},
-    {26, 0, 18, 0, 5, 58, 12},
-    {15, 0, 0, 0, 5, 0, 12},
-    {7, 0, 0, 0, 5, 64, 12},
-    {21, 0, 18, 0, 5, 64, 18},
-    {21, 0, 18, 0, 5, 64, 6},
-    {10, 0, 0, 0, 5, 70, 21},
-    {7, 0, 0, 0, 5, 70, 12},
-    {12, 9, 13, 0, 5, 70, 21},
-    {12, 0, 13, 0, 5, 70, 21},
-    {21, 0, 0, 0, 5, 70, 17},
-    {13, 0, 0, 0, 5, 70, 11},
-    {21, 0, 0, 0, 5, 9, 18},
-    {13, 0, 0, 0, 5, 71, 11},
-    {7, 0, 0, 0, 5, 71, 12},
-    {12, 0, 13, 0, 5, 71, 21},
-    {12, 220, 13, 0, 5, 71, 21},
-    {21, 0, 0, 0, 5, 71, 17},
-    {7, 0, 0, 0, 5, 72, 12},
-    {12, 0, 13, 0, 5, 72, 21},
-    {10, 0, 0, 0, 5, 72, 21},
-    {10, 9, 0, 0, 5, 72, 21},
-    {21, 0, 0, 0, 5, 72, 12},
-    {12, 0, 13, 0, 5, 84, 21},
-    {10, 0, 0, 0, 5, 84, 21},
-    {7, 0, 0, 0, 5, 84, 12},
-    {12, 7, 13, 0, 5, 84, 21},
-    {10, 9, 0, 0, 5, 84, 21},
-    {21, 0, 0, 0, 5, 84, 12},
-    {21, 0, 0, 0, 5, 84, 17},
-    {13, 0, 0, 0, 5, 84, 11},
-    {6, 0, 0, 0, 5, 22, 38},
-    {7, 0, 0, 0, 5, 76, 12},
-    {12, 0, 13, 0, 5, 76, 21},
-    {10, 0, 0, 0, 5, 76, 21},
-    {13, 0, 0, 0, 5, 76, 11},
-    {21, 0, 0, 0, 5, 76, 12},
-    {21, 0, 0, 0, 5, 76, 17},
-    {7, 0, 0, 0, 5, 78, 38},
-    {12, 230, 13, 0, 5, 78, 38},
-    {12, 220, 13, 0, 5, 78, 38},
-    {6, 0, 0, 0, 5, 78, 38},
-    {21, 0, 0, 0, 5, 78, 38},
-    {7, 0, 0, 0, 5, 85, 12},
-    {10, 0, 0, 0, 5, 85, 21},
-    {12, 0, 13, 0, 5, 85, 21},
-    {21, 0, 0, 0, 5, 85, 17},
-    {6, 0, 0, 0, 5, 85, 12},
-    {12, 9, 13, 0, 5, 85, 21},
-    {13, 0, 0, 0, 5, 85, 11},
-    {7, 0, 0, 0, 2, 24, 23},
-    {7, 0, 0, 0, 2, 24, 24},
-    {4, 0, 0, 0, 5, 102, 39},
-    {3, 0, 0, 0, 4, 102, 41},
-    {12, 26, 13, 0, 5, 5, 21},
-    {25, 0, 9, 0, 5, 5, 12},
-    {24, 0, 4, 0, 5, 6, 12},
-    {18, 0, 18, 0, 5, 0, 1},
-    {12, 0, 13, 0, 4, 40, 21},
-    {21, 0, 18, 0, 2, 0, 8},
-    {21, 0, 18, 0, 2, 0, 6},
-    {21, 0, 18, 0, 2, 0, 15},
-    {16, 0, 18, 0, 2, 0, 14},
-    {21, 0, 12, 0, 2, 0, 1},
-    {21, 0, 12, 0, 2, 0, 5},
-    {21, 0, 10, 0, 2, 0, 14},
-    {25, 0, 9, 0, 2, 0, 14},
-    {17, 0, 9, 0, 2, 0, 14},
-    {25, 0, 18, 1, 2, 0, 14},
-    {25, 0, 18, 0, 2, 0, 14},
-    {23, 0, 10, 0, 2, 0, 9},
-    {21, 0, 10, 0, 2, 0, 10},
-    {21, 0, 18, 0, 0, 0, 6},
-    {21, 0, 18, 0, 0, 0, 14},
-    {21, 0, 10, 0, 0, 0, 14},
-    {23, 0, 10, 0, 0, 0, 9},
-    {21, 0, 10, 0, 0, 0, 10},
-    {22, 0, 18, 1, 0, 0, 0},
-    {18, 0, 18, 1, 0, 0, 1},
-    {25, 0, 9, 0, 0, 0, 14},
-    {21, 0, 12, 0, 0, 0, 1},
-    {17, 0, 9, 0, 0, 0, 14},
-    {21, 0, 12, 0, 0, 0, 14},
-    {13, 0, 8, 0, 0, 0, 14},
-    {21, 0, 12, 0, 0, 0, 5},
-    {21, 0, 18, 0, 0, 0, 5},
-    {25, 0, 18, 1, 0, 0, 14},
-    {25, 0, 18, 0, 0, 0, 14},
-    {9, 0, 0, 0, 0, 1, 14},
-    {24, 0, 18, 0, 0, 0, 14},
-    {16, 0, 18, 0, 0, 0, 14},
-    {5, 0, 0, 0, 0, 1, 14},
-    {21, 0, 18, 0, 1, 0, 1},
-    {22, 0, 18, 1, 1, 0, 0},
-    {18, 0, 18, 1, 1, 0, 1},
-    {21, 0, 18, 0, 1, 0, 5},
-    {7, 0, 0, 0, 1, 33, 14},
-    {7, 0, 0, 0, 1, 33, 32},
-    {6, 0, 0, 0, 1, 0, 32},
-    {6, 0, 0, 0, 1, 0, 5},
-    {7, 0, 0, 0, 1, 24, 14},
-    {23, 0, 10, 0, 0, 0, 10},
-    {26, 0, 18, 0, 0, 0, 14},
-    {26, 0, 18, 0, 1, 0, 12},
-    {25, 0, 18, 0, 1, 0, 12},
-    {1, 0, 18, 0, 5, 0, 21},
-    {26, 0, 18, 0, 5, 0, 31},
-    {7, 0, 0, 0, 5, 47, 12},
-    {14, 0, 18, 0, 5, 2, 12},
-    {15, 0, 18, 0, 5, 2, 12},
-    {26, 0, 18, 0, 5, 2, 12},
-    {26, 0, 0, 0, 5, 2, 12},
-    {7, 0, 0, 0, 5, 73, 12},
-    {7, 0, 0, 0, 5, 74, 12},
-    {7, 0, 0, 0, 5, 37, 12},
-    {15, 0, 0, 0, 5, 37, 12},
-    {7, 0, 0, 0, 5, 38, 12},
-    {14, 0, 0, 0, 5, 38, 12},
-    {7, 0, 0, 0, 5, 118, 12},
-    {12, 230, 13, 0, 5, 118, 21},
-    {7, 0, 0, 0, 5, 48, 12},
-    {21, 0, 0, 0, 5, 48, 17},
-    {7, 0, 0, 0, 5, 59, 12},
-    {21, 0, 0, 0, 5, 59, 17},
-    {14, 0, 0, 0, 5, 59, 12},
-    {9, 0, 0, 0, 5, 39, 12},
-    {5, 0, 0, 0, 5, 39, 12},
-    {7, 0, 0, 0, 5, 49, 12},
-    {7, 0, 0, 0, 5, 50, 12},
-    {13, 0, 0, 0, 5, 50, 11},
-    {9, 0, 0, 0, 5, 136, 12},
-    {5, 0, 0, 0, 5, 136, 12},
-    {7, 0, 0, 0, 5, 106, 12},
-    {7, 0, 0, 0, 5, 104, 12},
-    {21, 0, 0, 0, 5, 104, 12},
-    {7, 0, 0, 0, 5, 110, 12},
-    {7, 0, 3, 0, 5, 51, 12},
-    {7, 0, 3, 0, 5, 86, 12},
-    {21, 0, 3, 0, 5, 86, 17},
-    {15, 0, 3, 0, 5, 86, 12},
-    {7, 0, 3, 0, 5, 120, 12},
-    {26, 0, 3, 0, 5, 120, 12},
-    {15, 0, 3, 0, 5, 120, 12},
-    {7, 0, 3, 0, 5, 116, 12},
-    {15, 0, 3, 0, 5, 116, 12},
-    {7, 0, 3, 0, 5, 128, 12},
-    {15, 0, 3, 0, 5, 128, 12},
-    {7, 0, 3, 0, 5, 63, 12},
-    {15, 0, 3, 0, 5, 63, 12},
-    {21, 0, 18, 0, 5, 63, 17},
-    {7, 0, 3, 0, 5, 75, 12},
-    {21, 0, 3, 0, 5, 75, 12},
-    {7, 0, 3, 0, 5, 97, 12},
-    {7, 0, 3, 0, 5, 96, 12},
-    {15, 0, 3, 0, 5, 96, 12},
-    {7, 0, 3, 0, 5, 60, 12},
-    {12, 0, 13, 0, 5, 60, 21},
-    {12, 220, 13, 0, 5, 60, 21},
-    {12, 230, 13, 0, 5, 60, 21},
-    {12, 1, 13, 0, 5, 60, 21},
-    {12, 9, 13, 0, 5, 60, 21},
-    {15, 0, 3, 0, 5, 60, 12},
-    {21, 0, 3, 0, 5, 60, 17},
-    {21, 0, 3, 0, 5, 60, 12},
-    {7, 0, 3, 0, 5, 87, 12},
-    {15, 0, 3, 0, 5, 87, 12},
-    {21, 0, 3, 0, 5, 87, 12},
-    {7, 0, 3, 0, 5, 117, 12},
-    {15, 0, 3, 0, 5, 117, 12},
-    {7, 0, 3, 0, 5, 112, 12},
-    {26, 0, 3, 0, 5, 112, 12},
-    {12, 230, 13, 0, 5, 112, 21},
-    {12, 220, 13, 0, 5, 112, 21},
-    {15, 0, 3, 0, 5, 112, 12},
-    {21, 0, 3, 0, 5, 112, 17},
-    {21, 0, 3, 0, 5, 112, 15},
-    {7, 0, 3, 0, 5, 79, 12},
-    {21, 0, 18, 0, 5, 79, 17},
-    {7, 0, 3, 0, 5, 88, 12},
-    {15, 0, 3, 0, 5, 88, 12},
-    {7, 0, 3, 0, 5, 89, 12},
-    {15, 0, 3, 0, 5, 89, 12},
-    {7, 0, 3, 0, 5, 122, 12},
-    {21, 0, 3, 0, 5, 122, 12},
-    {15, 0, 3, 0, 5, 122, 12},
-    {7, 0, 3, 0, 5, 90, 12},
-    {9, 0, 3, 0, 5, 130, 12},
-    {5, 0, 3, 0, 5, 130, 12},
-    {15, 0, 3, 0, 5, 130, 12},
-    {15, 0, 11, 0, 5, 6, 12},
-    {10, 0, 0, 0, 5, 93, 21},
-    {12, 0, 13, 0, 5, 93, 21},
-    {7, 0, 0, 0, 5, 93, 12},
-    {12, 9, 13, 0, 5, 93, 21},
-    {21, 0, 0, 0, 5, 93, 17},
-    {21, 0, 0, 0, 5, 93, 12},
-    {15, 0, 18, 0, 5, 93, 12},
-    {13, 0, 0, 0, 5, 93, 11},
-    {12, 0, 13, 0, 5, 91, 21},
-    {10, 0, 0, 0, 5, 91, 21},
-    {7, 0, 0, 0, 5, 91, 12},
-    {12, 9, 13, 0, 5, 91, 21},
-    {12, 7, 13, 0, 5, 91, 21},
-    {21, 0, 0, 0, 5, 91, 12},
-    {1, 0, 0, 0, 5, 91, 12},
-    {21, 0, 0, 0, 5, 91, 17},
-    {7, 0, 0, 0, 5, 100, 12},
-    {13, 0, 0, 0, 5, 100, 11},
-    {12, 230, 13, 0, 5, 95, 21},
-    {7, 0, 0, 0, 5, 95, 12},
-    {12, 0, 13, 0, 5, 95, 21},
-    {10, 0, 0, 0, 5, 95, 21},
-    {12, 9, 13, 0, 5, 95, 21},
-    {13, 0, 0, 0, 5, 95, 11},
-    {21, 0, 0, 0, 5, 95, 17},
-    {7, 0, 0, 0, 5, 111, 12},
-    {12, 7, 13, 0, 5, 111, 21},
-    {21, 0, 0, 0, 5, 111, 12},
-    {21, 0, 0, 0, 5, 111, 18},
-    {12, 0, 13, 0, 5, 99, 21},
-    {10, 0, 0, 0, 5, 99, 21},
-    {7, 0, 0, 0, 5, 99, 12},
-    {10, 9, 0, 0, 5, 99, 21},
-    {21, 0, 0, 0, 5, 99, 17},
-    {21, 0, 0, 0, 5, 99, 12},
-    {12, 7, 13, 0, 5, 99, 21},
-    {13, 0, 0, 0, 5, 99, 11},
-    {21, 0, 0, 0, 5, 99, 18},
-    {15, 0, 0, 0, 5, 18, 12},
-    {7, 0, 0, 0, 5, 108, 12},
-    {10, 0, 0, 0, 5, 108, 21},
-    {12, 0, 13, 0, 5, 108, 21},
-    {10, 9, 0, 0, 5, 108, 21},
-    {12, 7, 13, 0, 5, 108, 21},
-    {21, 0, 0, 0, 5, 108, 17},
-    {21, 0, 0, 0, 5, 108, 12},
-    {7, 0, 0, 0, 5, 129, 12},
-    {21, 0, 0, 0, 5, 129, 17},
-    {7, 0, 0, 0, 5, 109, 12},
-    {12, 0, 13, 0, 5, 109, 21},
-    {10, 0, 0, 0, 5, 109, 21},
-    {12, 7, 13, 0, 5, 109, 21},
-    {12, 9, 13, 0, 5, 109, 21},
-    {13, 0, 0, 0, 5, 109, 11},
-    {12, 0, 13, 0, 5, 107, 21},
-    {10, 0, 0, 0, 5, 107, 21},
-    {7, 0, 0, 0, 5, 107, 12},
-    {12, 7, 13, 0, 5, 107, 21},
-    {10, 9, 0, 0, 5, 107, 21},
-    {12, 230, 13, 0, 5, 107, 21},
-    {7, 0, 0, 0, 5, 135, 12},
-    {10, 0, 0, 0, 5, 135, 21},
-    {12, 0, 13, 0, 5, 135, 21},
-    {12, 9, 13, 0, 5, 135, 21},
-    {12, 7, 13, 0, 5, 135, 21},
-    {21, 0, 0, 0, 5, 135, 17},
-    {21, 0, 0, 0, 5, 135, 12},
-    {13, 0, 0, 0, 5, 135, 11},
-    {7, 0, 0, 0, 5, 124, 12},
-    {10, 0, 0, 0, 5, 124, 21},
-    {12, 0, 13, 0, 5, 124, 21},
-    {12, 9, 13, 0, 5, 124, 21},
-    {12, 7, 13, 0, 5, 124, 21},
-    {21, 0, 0, 0, 5, 124, 12},
-    {13, 0, 0, 0, 5, 124, 11},
-    {7, 0, 0, 0, 5, 123, 12},
-    {10, 0, 0, 0, 5, 123, 21},
-    {12, 0, 13, 0, 5, 123, 21},
-    {12, 9, 13, 0, 5, 123, 21},
-    {12, 7, 13, 0, 5, 123, 21},
-    {21, 0, 0, 0, 5, 123, 18},
-    {21, 0, 0, 0, 5, 123, 17},
-    {21, 0, 0, 0, 5, 123, 6},
-    {21, 0, 0, 0, 5, 123, 12},
-    {7, 0, 0, 0, 5, 114, 12},
-    {10, 0, 0, 0, 5, 114, 21},
-    {12, 0, 13, 0, 5, 114, 21},
-    {12, 9, 13, 0, 5, 114, 21},
-    {21, 0, 0, 0, 5, 114, 17},
-    {21, 0, 0, 0, 5, 114, 12},
-    {13, 0, 0, 0, 5, 114, 11},
-    {21, 0, 18, 0, 5, 31, 18},
-    {7, 0, 0, 0, 5, 101, 12},
-    {12, 0, 13, 0, 5, 101, 21},
-    {10, 0, 0, 0, 5, 101, 21},
-    {10, 9, 0, 0, 5, 101, 21},
-    {12, 7, 13, 0, 5, 101, 21},
-    {13, 0, 0, 0, 5, 101, 11},
-    {7, 0, 0, 0, 5, 126, 38},
-    {12, 0, 13, 0, 5, 126, 38},
-    {10, 0, 0, 0, 5, 126, 38},
-    {12, 9, 13, 0, 5, 126, 38},
-    {13, 0, 0, 0, 5, 126, 11},
-    {15, 0, 0, 0, 5, 126, 38},
-    {21, 0, 0, 0, 5, 126, 17},
-    {26, 0, 0, 0, 5, 126, 38},
-    {9, 0, 0, 0, 5, 125, 12},
-    {5, 0, 0, 0, 5, 125, 12},
-    {13, 0, 0, 0, 5, 125, 11},
-    {15, 0, 0, 0, 5, 125, 12},
-    {7, 0, 0, 0, 5, 125, 12},
-    {7, 0, 0, 0, 5, 121, 12},
-    {7, 0, 0, 0, 5, 133, 12},
-    {10, 0, 0, 0, 5, 133, 21},
-    {12, 0, 13, 0, 5, 133, 21},
-    {12, 9, 0, 0, 5, 133, 21},
-    {21, 0, 0, 0, 5, 133, 17},
-    {13, 0, 0, 0, 5, 133, 11},
-    {15, 0, 0, 0, 5, 133, 12},
-    {21, 0, 0, 0, 5, 134, 18},
-    {21, 0, 0, 0, 5, 134, 6},
-    {7, 0, 0, 0, 5, 134, 12},
-    {12, 0, 13, 0, 5, 134, 21},
-    {10, 0, 0, 0, 5, 134, 21},
-    {7, 0, 0, 0, 5, 62, 12},
-    {14, 0, 0, 0, 5, 62, 12},
-    {21, 0, 0, 0, 5, 62, 17},
-    {7, 0, 0, 0, 5, 80, 12},
-    {7, 0, 0, 0, 5, 80, 0},
-    {7, 0, 0, 0, 5, 80, 1},
-    {7, 0, 0, 0, 5, 127, 12},
-    {7, 0, 0, 0, 5, 127, 0},
-    {7, 0, 0, 0, 5, 127, 1},
-    {7, 0, 0, 0, 5, 115, 12},
-    {13, 0, 0, 0, 5, 115, 11},
-    {21, 0, 0, 0, 5, 115, 17},
-    {7, 0, 0, 0, 5, 103, 12},
-    {12, 1, 13, 0, 5, 103, 21},
-    {21, 0, 0, 0, 5, 103, 17},
-    {7, 0, 0, 0, 5, 119, 12},
-    {12, 230, 13, 0, 5, 119, 21},
-    {21, 0, 0, 0, 5, 119, 17},
-    {21, 0, 0, 0, 5, 119, 12},
-    {26, 0, 0, 0, 5, 119, 12},
-    {6, 0, 0, 0, 5, 119, 12},
-    {13, 0, 0, 0, 5, 119, 11},
-    {15, 0, 0, 0, 5, 119, 12},
-    {7, 0, 0, 0, 5, 98, 12},
-    {10, 0, 0, 0, 5, 98, 21},
-    {12, 0, 13, 0, 5, 98, 21},
-    {6, 0, 0, 0, 5, 98, 12},
-    {6, 0, 0, 0, 2, 137, 5},
-    {7, 0, 0, 0, 2, 137, 14},
-    {7, 0, 0, 0, 5, 105, 12},
-    {26, 0, 0, 0, 5, 105, 12},
-    {12, 0, 13, 0, 5, 105, 21},
-    {12, 1, 13, 0, 5, 105, 21},
-    {21, 0, 0, 0, 5, 105, 17},
-    {10, 216, 0, 0, 5, 0, 21},
-    {10, 226, 0, 0, 5, 0, 21},
-    {12, 230, 13, 0, 5, 2, 21},
-    {25, 0, 0, 0, 5, 0, 12},
-    {13, 0, 8, 0, 5, 0, 11},
-    {26, 0, 0, 0, 5, 131, 12},
-    {12, 0, 13, 0, 5, 131, 21},
-    {21, 0, 0, 0, 5, 131, 17},
-    {21, 0, 0, 0, 5, 131, 12},
-    {12, 230, 13, 0, 5, 56, 21},
-    {7, 0, 3, 0, 5, 113, 12},
-    {15, 0, 3, 0, 5, 113, 12},
-    {12, 220, 13, 0, 5, 113, 21},
-    {9, 0, 3, 0, 5, 132, 12},
-    {5, 0, 3, 0, 5, 132, 12},
-    {12, 230, 13, 0, 5, 132, 21},
-    {12, 7, 13, 0, 5, 132, 21},
-    {13, 0, 3, 0, 5, 132, 11},
-    {21, 0, 3, 0, 5, 132, 0},
-    {2, 0, 18, 0, 5, 102, 14},
-    {26, 0, 0, 0, 2, 0, 29},
-    {26, 0, 0, 0, 5, 0, 28},
-    {26, 0, 0, 0, 2, 32, 14},
-    {24, 0, 18, 0, 2, 0, 41},
-    {26, 0, 18, 0, 5, 0, 5},
-};
-
-#define BIDI_MIRROR_LEN 364
-static const MirrorPair mirror_pairs[] = {
-    {40, 41},
-    {41, 40},
-    {60, 62},
-    {62, 60},
-    {91, 93},
-    {93, 91},
-    {123, 125},
-    {125, 123},
-    {171, 187},
-    {187, 171},
-    {3898, 3899},
-    {3899, 3898},
-    {3900, 3901},
-    {3901, 3900},
-    {5787, 5788},
-    {5788, 5787},
-    {8249, 8250},
-    {8250, 8249},
-    {8261, 8262},
-    {8262, 8261},
-    {8317, 8318},
-    {8318, 8317},
-    {8333, 8334},
-    {8334, 8333},
-    {8712, 8715},
-    {8713, 8716},
-    {8714, 8717},
-    {8715, 8712},
-    {8716, 8713},
-    {8717, 8714},
-    {8725, 10741},
-    {8764, 8765},
-    {8765, 8764},
-    {8771, 8909},
-    {8786, 8787},
-    {8787, 8786},
-    {8788, 8789},
-    {8789, 8788},
-    {8804, 8805},
-    {8805, 8804},
-    {8806, 8807},
-    {8807, 8806},
-    {8808, 8809},
-    {8809, 8808},
-    {8810, 8811},
-    {8811, 8810},
-    {8814, 8815},
-    {8815, 8814},
-    {8816, 8817},
-    {8817, 8816},
-    {8818, 8819},
-    {8819, 8818},
-    {8820, 8821},
-    {8821, 8820},
-    {8822, 8823},
-    {8823, 8822},
-    {8824, 8825},
-    {8825, 8824},
-    {8826, 8827},
-    {8827, 8826},
-    {8828, 8829},
-    {8829, 8828},
-    {8830, 8831},
-    {8831, 8830},
-    {8832, 8833},
-    {8833, 8832},
-    {8834, 8835},
-    {8835, 8834},
-    {8836, 8837},
-    {8837, 8836},
-    {8838, 8839},
-    {8839, 8838},
-    {8840, 8841},
-    {8841, 8840},
-    {8842, 8843},
-    {8843, 8842},
-    {8847, 8848},
-    {8848, 8847},
-    {8849, 8850},
-    {8850, 8849},
-    {8856, 10680},
-    {8866, 8867},
-    {8867, 8866},
-    {8870, 10974},
-    {8872, 10980},
-    {8873, 10979},
-    {8875, 10981},
-    {8880, 8881},
-    {8881, 8880},
-    {8882, 8883},
-    {8883, 8882},
-    {8884, 8885},
-    {8885, 8884},
-    {8886, 8887},
-    {8887, 8886},
-    {8905, 8906},
-    {8906, 8905},
-    {8907, 8908},
-    {8908, 8907},
-    {8909, 8771},
-    {8912, 8913},
-    {8913, 8912},
-    {8918, 8919},
-    {8919, 8918},
-    {8920, 8921},
-    {8921, 8920},
-    {8922, 8923},
-    {8923, 8922},
-    {8924, 8925},
-    {8925, 8924},
-    {8926, 8927},
-    {8927, 8926},
-    {8928, 8929},
-    {8929, 8928},
-    {8930, 8931},
-    {8931, 8930},
-    {8932, 8933},
-    {8933, 8932},
-    {8934, 8935},
-    {8935, 8934},
-    {8936, 8937},
-    {8937, 8936},
-    {8938, 8939},
-    {8939, 8938},
-    {8940, 8941},
-    {8941, 8940},
-    {8944, 8945},
-    {8945, 8944},
-    {8946, 8954},
-    {8947, 8955},
-    {8948, 8956},
-    {8950, 8957},
-    {8951, 8958},
-    {8954, 8946},
-    {8955, 8947},
-    {8956, 8948},
-    {8957, 8950},
-    {8958, 8951},
-    {8968, 8969},
-    {8969, 8968},
-    {8970, 8971},
-    {8971, 8970},
-    {9001, 9002},
-    {9002, 9001},
-    {10088, 10089},
-    {10089, 10088},
-    {10090, 10091},
-    {10091, 10090},
-    {10092, 10093},
-    {10093, 10092},
-    {10094, 10095},
-    {10095, 10094},
-    {10096, 10097},
-    {10097, 10096},
-    {10098, 10099},
-    {10099, 10098},
-    {10100, 10101},
-    {10101, 10100},
-    {10179, 10180},
-    {10180, 10179},
-    {10181, 10182},
-    {10182, 10181},
-    {10184, 10185},
-    {10185, 10184},
-    {10187, 10189},
-    {10189, 10187},
-    {10197, 10198},
-    {10198, 10197},
-    {10205, 10206},
-    {10206, 10205},
-    {10210, 10211},
-    {10211, 10210},
-    {10212, 10213},
-    {10213, 10212},
-    {10214, 10215},
-    {10215, 10214},
-    {10216, 10217},
-    {10217, 10216},
-    {10218, 10219},
-    {10219, 10218},
-    {10220, 10221},
-    {10221, 10220},
-    {10222, 10223},
-    {10223, 10222},
-    {10627, 10628},
-    {10628, 10627},
-    {10629, 10630},
-    {10630, 10629},
-    {10631, 10632},
-    {10632, 10631},
-    {10633, 10634},
-    {10634, 10633},
-    {10635, 10636},
-    {10636, 10635},
-    {10637, 10640},
-    {10638, 10639},
-    {10639, 10638},
-    {10640, 10637},
-    {10641, 10642},
-    {10642, 10641},
-    {10643, 10644},
-    {10644, 10643},
-    {10645, 10646},
-    {10646, 10645},
-    {10647, 10648},
-    {10648, 10647},
-    {10680, 8856},
-    {10688, 10689},
-    {10689, 10688},
-    {10692, 10693},
-    {10693, 10692},
-    {10703, 10704},
-    {10704, 10703},
-    {10705, 10706},
-    {10706, 10705},
-    {10708, 10709},
-    {10709, 10708},
-    {10712, 10713},
-    {10713, 10712},
-    {10714, 10715},
-    {10715, 10714},
-    {10741, 8725},
-    {10744, 10745},
-    {10745, 10744},
-    {10748, 10749},
-    {10749, 10748},
-    {10795, 10796},
-    {10796, 10795},
-    {10797, 10798},
-    {10798, 10797},
-    {10804, 10805},
-    {10805, 10804},
-    {10812, 10813},
-    {10813, 10812},
-    {10852, 10853},
-    {10853, 10852},
-    {10873, 10874},
-    {10874, 10873},
-    {10877, 10878},
-    {10878, 10877},
-    {10879, 10880},
-    {10880, 10879},
-    {10881, 10882},
-    {10882, 10881},
-    {10883, 10884},
-    {10884, 10883},
-    {10891, 10892},
-    {10892, 10891},
-    {10897, 10898},
-    {10898, 10897},
-    {10899, 10900},
-    {10900, 10899},
-    {10901, 10902},
-    {10902, 10901},
-    {10903, 10904},
-    {10904, 10903},
-    {10905, 10906},
-    {10906, 10905},
-    {10907, 10908},
-    {10908, 10907},
-    {10913, 10914},
-    {10914, 10913},
-    {10918, 10919},
-    {10919, 10918},
-    {10920, 10921},
-    {10921, 10920},
-    {10922, 10923},
-    {10923, 10922},
-    {10924, 10925},
-    {10925, 10924},
-    {10927, 10928},
-    {10928, 10927},
-    {10931, 10932},
-    {10932, 10931},
-    {10939, 10940},
-    {10940, 10939},
-    {10941, 10942},
-    {10942, 10941},
-    {10943, 10944},
-    {10944, 10943},
-    {10945, 10946},
-    {10946, 10945},
-    {10947, 10948},
-    {10948, 10947},
-    {10949, 10950},
-    {10950, 10949},
-    {10957, 10958},
-    {10958, 10957},
-    {10959, 10960},
-    {10960, 10959},
-    {10961, 10962},
-    {10962, 10961},
-    {10963, 10964},
-    {10964, 10963},
-    {10965, 10966},
-    {10966, 10965},
-    {10974, 8870},
-    {10979, 8873},
-    {10980, 8872},
-    {10981, 8875},
-    {10988, 10989},
-    {10989, 10988},
-    {10999, 11000},
-    {11000, 10999},
-    {11001, 11002},
-    {11002, 11001},
-    {11778, 11779},
-    {11779, 11778},
-    {11780, 11781},
-    {11781, 11780},
-    {11785, 11786},
-    {11786, 11785},
-    {11788, 11789},
-    {11789, 11788},
-    {11804, 11805},
-    {11805, 11804},
-    {11808, 11809},
-    {11809, 11808},
-    {11810, 11811},
-    {11811, 11810},
-    {11812, 11813},
-    {11813, 11812},
-    {11814, 11815},
-    {11815, 11814},
-    {11816, 11817},
-    {11817, 11816},
-    {12296, 12297},
-    {12297, 12296},
-    {12298, 12299},
-    {12299, 12298},
-    {12300, 12301},
-    {12301, 12300},
-    {12302, 12303},
-    {12303, 12302},
-    {12304, 12305},
-    {12305, 12304},
-    {12308, 12309},
-    {12309, 12308},
-    {12310, 12311},
-    {12311, 12310},
-    {12312, 12313},
-    {12313, 12312},
-    {12314, 12315},
-    {12315, 12314},
-    {65113, 65114},
-    {65114, 65113},
-    {65115, 65116},
-    {65116, 65115},
-    {65117, 65118},
-    {65118, 65117},
-    {65124, 65125},
-    {65125, 65124},
-    {65288, 65289},
-    {65289, 65288},
-    {65308, 65310},
-    {65310, 65308},
-    {65339, 65341},
-    {65341, 65339},
-    {65371, 65373},
-    {65373, 65371},
-    {65375, 65376},
-    {65376, 65375},
-    {65378, 65379},
-    {65379, 65378},
-};
-
-#define BIDI_BRACKET_LEN 120
-static const BracketPair bracket_pairs[] = {
-    {40, 41, 0},
-    {41, 40, 1},
-    {91, 93, 0},
-    {93, 91, 1},
-    {123, 125, 0},
-    {125, 123, 1},
-    {3898, 3899, 0},
-    {3899, 3898, 1},
-    {3900, 3901, 0},
-    {3901, 3900, 1},
-    {5787, 5788, 0},
-    {5788, 5787, 1},
-    {8261, 8262, 0},
-    {8262, 8261, 1},
-    {8317, 8318, 0},
-    {8318, 8317, 1},
-    {8333, 8334, 0},
-    {8334, 8333, 1},
-    {8968, 8969, 0},
-    {8969, 8968, 1},
-    {8970, 8971, 0},
-    {8971, 8970, 1},
-    {9001, 9002, 0},
-    {9002, 9001, 1},
-    {10088, 10089, 0},
-    {10089, 10088, 1},
-    {10090, 10091, 0},
-    {10091, 10090, 1},
-    {10092, 10093, 0},
-    {10093, 10092, 1},
-    {10094, 10095, 0},
-    {10095, 10094, 1},
-    {10096, 10097, 0},
-    {10097, 10096, 1},
-    {10098, 10099, 0},
-    {10099, 10098, 1},
-    {10100, 10101, 0},
-    {10101, 10100, 1},
-    {10181, 10182, 0},
-    {10182, 10181, 1},
-    {10214, 10215, 0},
-    {10215, 10214, 1},
-    {10216, 10217, 0},
-    {10217, 10216, 1},
-    {10218, 10219, 0},
-    {10219, 10218, 1},
-    {10220, 10221, 0},
-    {10221, 10220, 1},
-    {10222, 10223, 0},
-    {10223, 10222, 1},
-    {10627, 10628, 0},
-    {10628, 10627, 1},
-    {10629, 10630, 0},
-    {10630, 10629, 1},
-    {10631, 10632, 0},
-    {10632, 10631, 1},
-    {10633, 10634, 0},
-    {10634, 10633, 1},
-    {10635, 10636, 0},
-    {10636, 10635, 1},
-    {10637, 10640, 0},
-    {10638, 10639, 1},
-    {10639, 10638, 0},
-    {10640, 10637, 1},
-    {10641, 10642, 0},
-    {10642, 10641, 1},
-    {10643, 10644, 0},
-    {10644, 10643, 1},
-    {10645, 10646, 0},
-    {10646, 10645, 1},
-    {10647, 10648, 0},
-    {10648, 10647, 1},
-    {10712, 10713, 0},
-    {10713, 10712, 1},
-    {10714, 10715, 0},
-    {10715, 10714, 1},
-    {10748, 10749, 0},
-    {10749, 10748, 1},
-    {11810, 11811, 0},
-    {11811, 11810, 1},
-    {11812, 11813, 0},
-    {11813, 11812, 1},
-    {11814, 11815, 0},
-    {11815, 11814, 1},
-    {11816, 11817, 0},
-    {11817, 11816, 1},
-    {12296, 12297, 0},
-    {12297, 12296, 1},
-    {12298, 12299, 0},
-    {12299, 12298, 1},
-    {12300, 12301, 0},
-    {12301, 12300, 1},
-    {12302, 12303, 0},
-    {12303, 12302, 1},
-    {12304, 12305, 0},
-    {12305, 12304, 1},
-    {12308, 12309, 0},
-    {12309, 12308, 1},
-    {12310, 12311, 0},
-    {12311, 12310, 1},
-    {12312, 12313, 0},
-    {12313, 12312, 1},
-    {12314, 12315, 0},
-    {12315, 12314, 1},
-    {65113, 65114, 0},
-    {65114, 65113, 1},
-    {65115, 65116, 0},
-    {65116, 65115, 1},
-    {65117, 65118, 0},
-    {65118, 65117, 1},
-    {65288, 65289, 0},
-    {65289, 65288, 1},
-    {65339, 65341, 0},
-    {65341, 65339, 1},
-    {65371, 65373, 0},
-    {65373, 65371, 1},
-    {65375, 65376, 0},
-    {65376, 65375, 1},
-    {65378, 65379, 0},
-    {65379, 65378, 1},
-};
-
-/* Reindexing of NFC first characters. */
-#define TOTAL_FIRST 376
-#define TOTAL_LAST 62
-static const Reindex nfc_first[] = {
-  { 60, 2, 0},
-  { 65, 15, 3},
-  { 82, 8, 19},
-  { 97, 15, 28},
-  { 114, 8, 44},
-  { 168, 0, 53},
-  { 194, 0, 54},
-  { 196, 3, 55},
-  { 202, 0, 59},
-  { 207, 0, 60},
-  { 212, 2, 61},
-  { 216, 0, 64},
-  { 220, 0, 65},
-  { 226, 0, 66},
-  { 228, 3, 67},
-  { 234, 0, 71},
-  { 239, 0, 72},
-  { 244, 2, 73},
-  { 248, 0, 76},
-  { 252, 0, 77},
-  { 258, 1, 78},
-  { 274, 1, 80},
-  { 332, 1, 82},
-  { 346, 1, 84},
-  { 352, 1, 86},
-  { 360, 3, 88},
-  { 383, 0, 92},
-  { 416, 1, 93},
-  { 431, 1, 95},
-  { 439, 0, 97},
-  { 490, 1, 98},
-  { 550, 3, 100},
-  { 558, 1, 104},
-  { 658, 0, 106},
-  { 913, 0, 107},
-  { 917, 0, 108},
-  { 919, 0, 109},
-  { 921, 0, 110},
-  { 927, 0, 111},
-  { 929, 0, 112},
-  { 933, 0, 113},
-  { 937, 0, 114},
-  { 940, 0, 115},
-  { 942, 0, 116},
-  { 945, 0, 117},
-  { 949, 0, 118},
-  { 951, 0, 119},
-  { 953, 0, 120},
-  { 959, 0, 121},
-  { 961, 0, 122},
-  { 965, 0, 123},
-  { 969, 2, 124},
-  { 974, 0, 127},
-  { 978, 0, 128},
-  { 1030, 0, 129},
-  { 1040, 0, 130},
-  { 1043, 0, 131},
-  { 1045, 3, 132},
-  { 1050, 0, 136},
-  { 1054, 0, 137},
-  { 1059, 0, 138},
-  { 1063, 0, 139},
-  { 1067, 0, 140},
-  { 1069, 0, 141},
-  { 1072, 0, 142},
-  { 1075, 0, 143},
-  { 1077, 3, 144},
-  { 1082, 0, 148},
-  { 1086, 0, 149},
-  { 1091, 0, 150},
-  { 1095, 0, 151},
-  { 1099, 0, 152},
-  { 1101, 0, 153},
-  { 1110, 0, 154},
-  { 1140, 1, 155},
-  { 1240, 1, 157},
-  { 1256, 1, 159},
-  { 1575, 0, 161},
-  { 1608, 0, 162},
-  { 1610, 0, 163},
-  { 1729, 0, 164},
-  { 1746, 0, 165},
-  { 1749, 0, 166},
-  { 2344, 0, 167},
-  { 2352, 0, 168},
-  { 2355, 0, 169},
-  { 2503, 0, 170},
-  { 2887, 0, 171},
-  { 2962, 0, 172},
-  { 3014, 1, 173},
-  { 3142, 0, 175},
-  { 3263, 0, 176},
-  { 3270, 0, 177},
-  { 3274, 0, 178},
-  { 3398, 1, 179},
-  { 3545, 0, 181},
-  { 3548, 0, 182},
-  { 4133, 0, 183},
-  { 6917, 0, 184},
-  { 6919, 0, 185},
-  { 6921, 0, 186},
-  { 6923, 0, 187},
-  { 6925, 0, 188},
-  { 6929, 0, 189},
-  { 6970, 0, 190},
-  { 6972, 0, 191},
-  { 6974, 1, 192},
-  { 6978, 0, 194},
-  { 7734, 1, 195},
-  { 7770, 1, 197},
-  { 7778, 1, 199},
-  { 7840, 1, 201},
-  { 7864, 1, 203},
-  { 7884, 1, 205},
-  { 7936, 17, 207},
-  { 7960, 1, 225},
-  { 7968, 17, 227},
-  { 7992, 1, 245},
-  { 8000, 1, 247},
-  { 8008, 1, 249},
-  { 8016, 1, 251},
-  { 8025, 0, 253},
-  { 8032, 16, 254},
-  { 8052, 0, 271},
-  { 8060, 0, 272},
-  { 8118, 0, 273},
-  { 8127, 0, 274},
-  { 8134, 0, 275},
-  { 8182, 0, 276},
-  { 8190, 0, 277},
-  { 8592, 0, 278},
-  { 8594, 0, 279},
-  { 8596, 0, 280},
-  { 8656, 0, 281},
-  { 8658, 0, 282},
-  { 8660, 0, 283},
-  { 8707, 0, 284},
-  { 8712, 0, 285},
-  { 8715, 0, 286},
-  { 8739, 0, 287},
-  { 8741, 0, 288},
-  { 8764, 0, 289},
-  { 8771, 0, 290},
-  { 8773, 0, 291},
-  { 8776, 0, 292},
-  { 8781, 0, 293},
-  { 8801, 0, 294},
-  { 8804, 1, 295},
-  { 8818, 1, 297},
-  { 8822, 1, 299},
-  { 8826, 3, 301},
-  { 8834, 1, 305},
-  { 8838, 1, 307},
-  { 8849, 1, 309},
-  { 8866, 0, 311},
-  { 8872, 1, 312},
-  { 8875, 0, 314},
-  { 8882, 3, 315},
-  { 12358, 0, 319},
-  { 12363, 0, 320},
-  { 12365, 0, 321},
-  { 12367, 0, 322},
-  { 12369, 0, 323},
-  { 12371, 0, 324},
-  { 12373, 0, 325},
-  { 12375, 0, 326},
-  { 12377, 0, 327},
-  { 12379, 0, 328},
-  { 12381, 0, 329},
-  { 12383, 0, 330},
-  { 12385, 0, 331},
-  { 12388, 0, 332},
-  { 12390, 0, 333},
-  { 12392, 0, 334},
-  { 12399, 0, 335},
-  { 12402, 0, 336},
-  { 12405, 0, 337},
-  { 12408, 0, 338},
-  { 12411, 0, 339},
-  { 12445, 0, 340},
-  { 12454, 0, 341},
-  { 12459, 0, 342},
-  { 12461, 0, 343},
-  { 12463, 0, 344},
-  { 12465, 0, 345},
-  { 12467, 0, 346},
-  { 12469, 0, 347},
-  { 12471, 0, 348},
-  { 12473, 0, 349},
-  { 12475, 0, 350},
-  { 12477, 0, 351},
-  { 12479, 0, 352},
-  { 12481, 0, 353},
-  { 12484, 0, 354},
-  { 12486, 0, 355},
-  { 12488, 0, 356},
-  { 12495, 0, 357},
-  { 12498, 0, 358},
-  { 12501, 0, 359},
-  { 12504, 0, 360},
-  { 12507, 0, 361},
-  { 12527, 3, 362},
-  { 12541, 0, 366},
-  { 69785, 0, 367},
-  { 69787, 0, 368},
-  { 69797, 0, 369},
-  { 69937, 1, 370},
-  { 70471, 0, 372},
-  { 70841, 0, 373},
-  { 71096, 1, 374},
-  {0,0,0}
-};
-
-static const Reindex nfc_last[] = {
-  { 768, 4, 0},
-  { 774, 6, 5},
-  { 783, 0, 12},
-  { 785, 0, 13},
-  { 787, 1, 14},
-  { 795, 0, 16},
-  { 803, 5, 17},
-  { 813, 1, 23},
-  { 816, 1, 25},
-  { 824, 0, 27},
-  { 834, 0, 28},
-  { 837, 0, 29},
-  { 1619, 2, 30},
-  { 2364, 0, 33},
-  { 2494, 0, 34},
-  { 2519, 0, 35},
-  { 2878, 0, 36},
-  { 2902, 1, 37},
-  { 3006, 0, 39},
-  { 3031, 0, 40},
-  { 3158, 0, 41},
-  { 3266, 0, 42},
-  { 3285, 1, 43},
-  { 3390, 0, 45},
-  { 3415, 0, 46},
-  { 3530, 0, 47},
-  { 3535, 0, 48},
-  { 3551, 0, 49},
-  { 4142, 0, 50},
-  { 6965, 0, 51},
-  { 12441, 1, 52},
-  { 69818, 0, 54},
-  { 69927, 0, 55},
-  { 70462, 0, 56},
-  { 70487, 0, 57},
-  { 70832, 0, 58},
-  { 70842, 0, 59},
-  { 70845, 0, 60},
-  { 71087, 0, 61},
-  {0,0,0}
-};
-
-#define UCDN_EAST_ASIAN_F 0
-#define UCDN_EAST_ASIAN_H 1
-#define UCDN_EAST_ASIAN_W 2
-#define UCDN_EAST_ASIAN_NA 3
-#define UCDN_EAST_ASIAN_A 4
-#define UCDN_EAST_ASIAN_N 5
-
-#define UCDN_SCRIPT_COMMON 0
-#define UCDN_SCRIPT_LATIN 1
-#define UCDN_SCRIPT_GREEK 2
-#define UCDN_SCRIPT_CYRILLIC 3
-#define UCDN_SCRIPT_ARMENIAN 4
-#define UCDN_SCRIPT_HEBREW 5
-#define UCDN_SCRIPT_ARABIC 6
-#define UCDN_SCRIPT_SYRIAC 7
-#define UCDN_SCRIPT_THAANA 8
-#define UCDN_SCRIPT_DEVANAGARI 9
-#define UCDN_SCRIPT_BENGALI 10
-#define UCDN_SCRIPT_GURMUKHI 11
-#define UCDN_SCRIPT_GUJARATI 12
-#define UCDN_SCRIPT_ORIYA 13
-#define UCDN_SCRIPT_TAMIL 14
-#define UCDN_SCRIPT_TELUGU 15
-#define UCDN_SCRIPT_KANNADA 16
-#define UCDN_SCRIPT_MALAYALAM 17
-#define UCDN_SCRIPT_SINHALA 18
-#define UCDN_SCRIPT_THAI 19
-#define UCDN_SCRIPT_LAO 20
-#define UCDN_SCRIPT_TIBETAN 21
-#define UCDN_SCRIPT_MYANMAR 22
-#define UCDN_SCRIPT_GEORGIAN 23
-#define UCDN_SCRIPT_HANGUL 24
-#define UCDN_SCRIPT_ETHIOPIC 25
-#define UCDN_SCRIPT_CHEROKEE 26
-#define UCDN_SCRIPT_CANADIAN_ABORIGINAL 27
-#define UCDN_SCRIPT_OGHAM 28
-#define UCDN_SCRIPT_RUNIC 29
-#define UCDN_SCRIPT_KHMER 30
-#define UCDN_SCRIPT_MONGOLIAN 31
-#define UCDN_SCRIPT_HIRAGANA 32
-#define UCDN_SCRIPT_KATAKANA 33
-#define UCDN_SCRIPT_BOPOMOFO 34
-#define UCDN_SCRIPT_HAN 35
-#define UCDN_SCRIPT_YI 36
-#define UCDN_SCRIPT_OLD_ITALIC 37
-#define UCDN_SCRIPT_GOTHIC 38
-#define UCDN_SCRIPT_DESERET 39
-#define UCDN_SCRIPT_INHERITED 40
-#define UCDN_SCRIPT_TAGALOG 41
-#define UCDN_SCRIPT_HANUNOO 42
-#define UCDN_SCRIPT_BUHID 43
-#define UCDN_SCRIPT_TAGBANWA 44
-#define UCDN_SCRIPT_LIMBU 45
-#define UCDN_SCRIPT_TAI_LE 46
-#define UCDN_SCRIPT_LINEAR_B 47
-#define UCDN_SCRIPT_UGARITIC 48
-#define UCDN_SCRIPT_SHAVIAN 49
-#define UCDN_SCRIPT_OSMANYA 50
-#define UCDN_SCRIPT_CYPRIOT 51
-#define UCDN_SCRIPT_BRAILLE 52
-#define UCDN_SCRIPT_BUGINESE 53
-#define UCDN_SCRIPT_COPTIC 54
-#define UCDN_SCRIPT_NEW_TAI_LUE 55
-#define UCDN_SCRIPT_GLAGOLITIC 56
-#define UCDN_SCRIPT_TIFINAGH 57
-#define UCDN_SCRIPT_SYLOTI_NAGRI 58
-#define UCDN_SCRIPT_OLD_PERSIAN 59
-#define UCDN_SCRIPT_KHAROSHTHI 60
-#define UCDN_SCRIPT_BALINESE 61
-#define UCDN_SCRIPT_CUNEIFORM 62
-#define UCDN_SCRIPT_PHOENICIAN 63
-#define UCDN_SCRIPT_PHAGS_PA 64
-#define UCDN_SCRIPT_NKO 65
-#define UCDN_SCRIPT_SUNDANESE 66
-#define UCDN_SCRIPT_LEPCHA 67
-#define UCDN_SCRIPT_OL_CHIKI 68
-#define UCDN_SCRIPT_VAI 69
-#define UCDN_SCRIPT_SAURASHTRA 70
-#define UCDN_SCRIPT_KAYAH_LI 71
-#define UCDN_SCRIPT_REJANG 72
-#define UCDN_SCRIPT_LYCIAN 73
-#define UCDN_SCRIPT_CARIAN 74
-#define UCDN_SCRIPT_LYDIAN 75
-#define UCDN_SCRIPT_CHAM 76
-#define UCDN_SCRIPT_TAI_THAM 77
-#define UCDN_SCRIPT_TAI_VIET 78
-#define UCDN_SCRIPT_AVESTAN 79
-#define UCDN_SCRIPT_EGYPTIAN_HIEROGLYPHS 80
-#define UCDN_SCRIPT_SAMARITAN 81
-#define UCDN_SCRIPT_LISU 82
-#define UCDN_SCRIPT_BAMUM 83
-#define UCDN_SCRIPT_JAVANESE 84
-#define UCDN_SCRIPT_MEETEI_MAYEK 85
-#define UCDN_SCRIPT_IMPERIAL_ARAMAIC 86
-#define UCDN_SCRIPT_OLD_SOUTH_ARABIAN 87
-#define UCDN_SCRIPT_INSCRIPTIONAL_PARTHIAN 88
-#define UCDN_SCRIPT_INSCRIPTIONAL_PAHLAVI 89
-#define UCDN_SCRIPT_OLD_TURKIC 90
-#define UCDN_SCRIPT_KAITHI 91
-#define UCDN_SCRIPT_BATAK 92
-#define UCDN_SCRIPT_BRAHMI 93
-#define UCDN_SCRIPT_MANDAIC 94
-#define UCDN_SCRIPT_CHAKMA 95
-#define UCDN_SCRIPT_MEROITIC_CURSIVE 96
-#define UCDN_SCRIPT_MEROITIC_HIEROGLYPHS 97
-#define UCDN_SCRIPT_MIAO 98
-#define UCDN_SCRIPT_SHARADA 99
-#define UCDN_SCRIPT_SORA_SOMPENG 100
-#define UCDN_SCRIPT_TAKRI 101
-#define UCDN_SCRIPT_UNKNOWN 102
-#define UCDN_SCRIPT_BASSA_VAH 103
-#define UCDN_SCRIPT_CAUCASIAN_ALBANIAN 104
-#define UCDN_SCRIPT_DUPLOYAN 105
-#define UCDN_SCRIPT_ELBASAN 106
-#define UCDN_SCRIPT_GRANTHA 107
-#define UCDN_SCRIPT_KHOJKI 108
-#define UCDN_SCRIPT_KHUDAWADI 109
-#define UCDN_SCRIPT_LINEAR_A 110
-#define UCDN_SCRIPT_MAHAJANI 111
-#define UCDN_SCRIPT_MANICHAEAN 112
-#define UCDN_SCRIPT_MENDE_KIKAKUI 113
-#define UCDN_SCRIPT_MODI 114
-#define UCDN_SCRIPT_MRO 115
-#define UCDN_SCRIPT_NABATAEAN 116
-#define UCDN_SCRIPT_OLD_NORTH_ARABIAN 117
-#define UCDN_SCRIPT_OLD_PERMIC 118
-#define UCDN_SCRIPT_PAHAWH_HMONG 119
-#define UCDN_SCRIPT_PALMYRENE 120
-#define UCDN_SCRIPT_PAU_CIN_HAU 121
-#define UCDN_SCRIPT_PSALTER_PAHLAVI 122
-#define UCDN_SCRIPT_SIDDHAM 123
-#define UCDN_SCRIPT_TIRHUTA 124
-#define UCDN_SCRIPT_WARANG_CITI 125
-#define UCDN_SCRIPT_AHOM 126
-#define UCDN_SCRIPT_ANATOLIAN_HIEROGLYPHS 127
-#define UCDN_SCRIPT_HATRAN 128
-#define UCDN_SCRIPT_MULTANI 129
-#define UCDN_SCRIPT_OLD_HUNGARIAN 130
-#define UCDN_SCRIPT_SIGNWRITING 131
-#define UCDN_SCRIPT_ADLAM 132
-#define UCDN_SCRIPT_BHAIKSUKI 133
-#define UCDN_SCRIPT_MARCHEN 134
-#define UCDN_SCRIPT_NEWA 135
-#define UCDN_SCRIPT_OSAGE 136
-#define UCDN_SCRIPT_TANGUT 137
-
-#define UCDN_GENERAL_CATEGORY_CC 0
-#define UCDN_GENERAL_CATEGORY_CF 1
-#define UCDN_GENERAL_CATEGORY_CN 2
-#define UCDN_GENERAL_CATEGORY_CO 3
-#define UCDN_GENERAL_CATEGORY_CS 4
-#define UCDN_GENERAL_CATEGORY_LL 5
-#define UCDN_GENERAL_CATEGORY_LM 6
-#define UCDN_GENERAL_CATEGORY_LO 7
-#define UCDN_GENERAL_CATEGORY_LT 8
-#define UCDN_GENERAL_CATEGORY_LU 9
-#define UCDN_GENERAL_CATEGORY_MC 10
-#define UCDN_GENERAL_CATEGORY_ME 11
-#define UCDN_GENERAL_CATEGORY_MN 12
-#define UCDN_GENERAL_CATEGORY_ND 13
-#define UCDN_GENERAL_CATEGORY_NL 14
-#define UCDN_GENERAL_CATEGORY_NO 15
-#define UCDN_GENERAL_CATEGORY_PC 16
-#define UCDN_GENERAL_CATEGORY_PD 17
-#define UCDN_GENERAL_CATEGORY_PE 18
-#define UCDN_GENERAL_CATEGORY_PF 19
-#define UCDN_GENERAL_CATEGORY_PI 20
-#define UCDN_GENERAL_CATEGORY_PO 21
-#define UCDN_GENERAL_CATEGORY_PS 22
-#define UCDN_GENERAL_CATEGORY_SC 23
-#define UCDN_GENERAL_CATEGORY_SK 24
-#define UCDN_GENERAL_CATEGORY_SM 25
-#define UCDN_GENERAL_CATEGORY_SO 26
-#define UCDN_GENERAL_CATEGORY_ZL 27
-#define UCDN_GENERAL_CATEGORY_ZP 28
-#define UCDN_GENERAL_CATEGORY_ZS 29
-
-#define UCDN_BIDI_CLASS_L 0
-#define UCDN_BIDI_CLASS_LRE 1
-#define UCDN_BIDI_CLASS_LRO 2
-#define UCDN_BIDI_CLASS_R 3
-#define UCDN_BIDI_CLASS_AL 4
-#define UCDN_BIDI_CLASS_RLE 5
-#define UCDN_BIDI_CLASS_RLO 6
-#define UCDN_BIDI_CLASS_PDF 7
-#define UCDN_BIDI_CLASS_EN 8
-#define UCDN_BIDI_CLASS_ES 9
-#define UCDN_BIDI_CLASS_ET 10
-#define UCDN_BIDI_CLASS_AN 11
-#define UCDN_BIDI_CLASS_CS 12
-#define UCDN_BIDI_CLASS_NSM 13
-#define UCDN_BIDI_CLASS_BN 14
-#define UCDN_BIDI_CLASS_B 15
-#define UCDN_BIDI_CLASS_S 16
-#define UCDN_BIDI_CLASS_WS 17
-#define UCDN_BIDI_CLASS_ON 18
-#define UCDN_BIDI_CLASS_LRI 19
-#define UCDN_BIDI_CLASS_RLI 20
-#define UCDN_BIDI_CLASS_FSI 21
-#define UCDN_BIDI_CLASS_PDI 22
-
-/* index tables for the database records */
-#define SHIFT1 5
-#define SHIFT2 3
-static const unsigned char index0[] = {
-    0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
-    21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
-    39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 52, 52, 52, 52,
-    52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
-    52, 52, 53, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
-    52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
-    52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
-    52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
-    52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 54, 55, 56, 56, 56, 57,
-    58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 65, 66, 67, 68,
-    69, 70, 71, 65, 66, 67, 68, 69, 70, 71, 65, 66, 67, 68, 69, 70, 71, 65,
-    66, 67, 68, 69, 70, 71, 65, 66, 67, 68, 69, 70, 71, 65, 72, 73, 73, 73,
-    73, 73, 73, 73, 73, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
-    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 52, 75, 76, 77, 78, 79,
-    80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 94, 96,
-    97, 98, 99, 100, 101, 102, 103, 104, 94, 105, 94, 106, 94, 94, 94, 107,
-    107, 107, 108, 109, 110, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 111,
-    111, 112, 113, 114, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 115, 116, 117, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 118, 118, 119, 120, 94, 94, 94, 121, 122, 122, 122, 122, 122,
-    122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
-    122, 122, 122, 122, 123, 122, 122, 124, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 125, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 126, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 127, 128, 129, 130, 131, 132, 133, 134, 135,
-    135, 136, 94, 94, 94, 94, 94, 137, 94, 94, 94, 94, 94, 94, 94, 138, 139,
-    94, 94, 94, 94, 140, 94, 141, 142, 143, 144, 145, 146, 147, 148, 149,
-    150, 151, 151, 151, 151, 151, 152, 52, 52, 52, 52, 52, 52, 52, 52, 52,
-    52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
-    52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
-    52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
-    52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
-    52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
-    52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
-    52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
-    52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
-    52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 153, 52, 52, 52, 52,
-    52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 154, 155, 52, 52, 52, 52,
-    52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 156,
-    157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
-    157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
-    157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 52, 52,
-    158, 157, 157, 157, 157, 159, 157, 157, 157, 157, 157, 157, 157, 157,
-    157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
-    157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
-    157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
-    157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
-    157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
-    157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
-    157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
-    157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
-    157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
-    157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
-    157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
-    157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
-    157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
-    157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
-    157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
-    157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
-    157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
-    157, 157, 157, 157, 157, 157, 157, 157, 157, 159, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 160, 161,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
-    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
-    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
-    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
-    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
-    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
-    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
-    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
-    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
-    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
-    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
-    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
-    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
-    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
-    74, 74, 74, 74, 74, 162, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
-    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
-    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
-    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
-    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
-    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
-    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
-    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
-    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
-    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
-    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
-    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
-    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
-    74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
-    74, 74, 74, 74, 74, 74, 74, 74, 74, 162,
-};
-
-static const unsigned short index1[] = {
-    0, 1, 0, 2, 3, 4, 5, 6, 7, 8, 8, 9, 10, 11, 11, 12, 13, 0, 0, 0, 14, 15,
-    16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 29, 31, 32,
-    33, 34, 35, 27, 30, 29, 27, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
-    47, 48, 27, 27, 49, 27, 27, 27, 27, 27, 27, 27, 50, 51, 52, 27, 53, 54,
-    53, 54, 54, 54, 54, 54, 55, 54, 54, 54, 56, 57, 58, 59, 60, 61, 62, 63,
-    64, 64, 65, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 65, 77, 78,
-    79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
-    97, 97, 97, 97, 98, 98, 98, 98, 99, 100, 101, 101, 101, 101, 102, 103,
-    101, 101, 101, 101, 101, 101, 104, 105, 101, 101, 101, 101, 101, 101,
-    101, 101, 101, 101, 101, 101, 106, 107, 107, 107, 108, 109, 110, 111,
-    111, 111, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 121,
-    121, 122, 123, 120, 124, 125, 126, 127, 128, 128, 128, 128, 129, 130,
-    131, 132, 133, 134, 135, 128, 128, 128, 128, 128, 128, 128, 128, 128,
-    128, 128, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 145, 145,
-    146, 147, 148, 149, 128, 128, 128, 128, 128, 128, 150, 150, 150, 150,
-    151, 152, 153, 120, 154, 155, 156, 156, 156, 157, 158, 159, 160, 160,
-    161, 162, 163, 164, 165, 166, 167, 167, 167, 168, 120, 120, 120, 120,
-    120, 120, 120, 120, 128, 128, 169, 170, 120, 120, 171, 126, 172, 173,
-    174, 175, 176, 177, 177, 177, 177, 177, 177, 178, 179, 180, 181, 177,
-    182, 183, 184, 177, 185, 186, 187, 188, 188, 189, 190, 191, 192, 193,
-    194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 203, 204, 205, 206,
-    207, 208, 209, 210, 211, 212, 213, 120, 214, 215, 216, 217, 217, 218,
-    219, 220, 221, 222, 223, 120, 224, 225, 226, 227, 228, 229, 230, 231,
-    231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 120, 242, 243,
-    244, 245, 246, 243, 247, 248, 249, 250, 251, 120, 252, 253, 254, 255,
-    256, 257, 258, 259, 259, 258, 259, 260, 261, 262, 263, 264, 265, 266,
-    120, 267, 268, 269, 270, 271, 271, 270, 272, 273, 274, 275, 276, 277,
-    278, 279, 280, 120, 281, 282, 283, 284, 284, 284, 284, 285, 286, 287,
-    288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 295, 295, 298, 299,
-    296, 300, 301, 302, 303, 304, 305, 120, 306, 307, 307, 307, 307, 307,
-    308, 309, 310, 311, 312, 313, 120, 120, 120, 120, 314, 315, 316, 317,
-    318, 319, 320, 321, 322, 323, 324, 325, 120, 120, 120, 120, 326, 327,
-    328, 329, 330, 331, 332, 333, 334, 335, 334, 334, 334, 336, 337, 338,
-    339, 340, 341, 342, 341, 341, 341, 343, 344, 345, 346, 347, 120, 120,
-    120, 120, 348, 348, 348, 348, 348, 349, 350, 351, 352, 353, 354, 355,
-    356, 357, 358, 348, 359, 360, 352, 361, 362, 362, 362, 362, 363, 364,
-    365, 365, 365, 365, 365, 366, 367, 367, 367, 367, 367, 367, 367, 367,
-    367, 367, 367, 367, 368, 368, 368, 368, 368, 368, 368, 368, 368, 369,
-    369, 369, 369, 369, 369, 369, 369, 369, 369, 369, 370, 370, 370, 370,
-    370, 370, 370, 370, 370, 371, 372, 371, 370, 370, 370, 370, 370, 371,
-    370, 370, 370, 370, 371, 372, 371, 370, 372, 370, 370, 370, 370, 370,
-    370, 370, 371, 370, 370, 370, 370, 370, 370, 370, 370, 373, 374, 375,
-    376, 377, 370, 370, 378, 379, 380, 380, 380, 380, 380, 380, 380, 380,
-    380, 380, 381, 382, 383, 384, 384, 384, 384, 384, 384, 384, 384, 384,
-    384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 384,
-    384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 384,
-    384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 384,
-    384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 384,
-    384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 385, 384, 384,
-    386, 387, 387, 388, 389, 389, 389, 389, 389, 389, 389, 389, 389, 390,
-    391, 392, 393, 394, 395, 120, 396, 396, 397, 120, 398, 398, 399, 120,
-    400, 401, 402, 120, 403, 403, 403, 403, 403, 403, 404, 405, 406, 407,
-    408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 418, 418, 418,
-    419, 418, 418, 418, 418, 418, 418, 120, 420, 418, 418, 418, 418, 421,
-    384, 384, 384, 384, 384, 384, 384, 384, 422, 120, 423, 423, 423, 424,
-    425, 426, 427, 428, 429, 430, 431, 431, 431, 432, 433, 120, 434, 434,
-    434, 434, 434, 435, 434, 434, 434, 436, 437, 438, 439, 439, 439, 439,
-    440, 440, 441, 442, 443, 443, 443, 443, 443, 443, 444, 445, 446, 447,
-    448, 449, 450, 451, 450, 451, 452, 453, 454, 455, 120, 120, 120, 120,
-    120, 120, 120, 120, 456, 457, 457, 457, 457, 457, 458, 459, 460, 461,
-    462, 463, 464, 465, 466, 467, 468, 469, 469, 469, 470, 471, 472, 473,
-    474, 474, 474, 474, 475, 476, 477, 478, 479, 479, 479, 479, 480, 481,
-    482, 483, 484, 485, 486, 487, 488, 488, 488, 489, 100, 490, 120, 120,
-    120, 120, 120, 120, 491, 120, 492, 493, 494, 495, 496, 497, 54, 54, 54,
-    54, 498, 499, 56, 56, 56, 56, 56, 500, 501, 502, 54, 503, 54, 54, 54,
-    504, 56, 56, 56, 505, 506, 507, 508, 509, 509, 509, 510, 511, 27, 27, 27,
-    27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 512, 513, 27,
-    27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 514, 515, 516, 517, 514, 515,
-    514, 515, 516, 517, 514, 518, 514, 515, 514, 516, 514, 519, 514, 519,
-    514, 519, 520, 521, 522, 523, 524, 525, 514, 526, 527, 528, 529, 530,
-    531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544,
-    545, 546, 56, 547, 548, 549, 550, 551, 552, 552, 553, 554, 555, 556, 557,
-    120, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570,
-    571, 570, 572, 573, 574, 575, 576, 577, 578, 579, 580, 579, 581, 582,
-    579, 583, 579, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594,
-    595, 596, 597, 598, 599, 594, 594, 600, 601, 602, 603, 604, 594, 594,
-    605, 585, 606, 607, 594, 594, 608, 594, 594, 579, 609, 610, 611, 612,
-    613, 614, 615, 615, 615, 615, 615, 615, 615, 615, 616, 579, 579, 617,
-    618, 585, 585, 619, 579, 579, 579, 579, 584, 620, 621, 622, 623, 579,
-    579, 579, 579, 623, 120, 120, 120, 579, 624, 120, 120, 625, 625, 625,
-    625, 625, 626, 626, 627, 628, 628, 628, 628, 628, 628, 628, 628, 628,
-    629, 625, 630, 631, 631, 631, 631, 631, 631, 631, 631, 631, 632, 631,
-    631, 631, 631, 633, 579, 631, 631, 634, 579, 635, 636, 637, 638, 639,
-    640, 636, 579, 634, 641, 579, 642, 643, 644, 645, 646, 579, 579, 579,
-    647, 648, 649, 650, 579, 651, 652, 579, 653, 579, 579, 654, 655, 656,
-    657, 579, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 579,
-    579, 579, 669, 579, 670, 579, 671, 672, 673, 674, 675, 676, 625, 677,
-    677, 678, 579, 579, 579, 669, 679, 680, 681, 682, 683, 684, 685, 585,
-    585, 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, 686,
-    686, 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, 686,
-    686, 686, 686, 686, 686, 585, 585, 585, 585, 585, 585, 585, 585, 585,
-    585, 585, 585, 585, 585, 585, 585, 687, 688, 688, 689, 594, 594, 585,
-    690, 691, 692, 693, 694, 695, 696, 697, 698, 585, 699, 594, 700, 701,
-    702, 703, 683, 585, 585, 597, 690, 703, 704, 705, 706, 594, 594, 594,
-    594, 707, 708, 594, 594, 594, 594, 709, 710, 711, 683, 712, 713, 579,
-    579, 579, 714, 579, 579, 585, 585, 715, 716, 717, 636, 579, 579, 718,
-    579, 579, 579, 719, 579, 579, 579, 579, 720, 579, 721, 722, 120, 120,
-    723, 120, 120, 724, 724, 724, 724, 724, 725, 726, 726, 726, 726, 726,
-    727, 728, 729, 730, 731, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
-    732, 733, 734, 735, 736, 736, 736, 736, 737, 738, 739, 739, 739, 739,
-    739, 739, 739, 740, 741, 742, 370, 370, 372, 120, 372, 372, 372, 372,
-    372, 372, 372, 372, 743, 743, 743, 743, 744, 745, 746, 747, 748, 749,
-    750, 751, 752, 120, 120, 120, 120, 120, 120, 120, 753, 753, 753, 754,
-    753, 753, 753, 753, 753, 753, 753, 753, 753, 753, 755, 120, 753, 753,
-    753, 753, 753, 753, 753, 753, 753, 753, 753, 753, 753, 753, 753, 753,
-    753, 753, 753, 753, 753, 753, 753, 753, 753, 753, 756, 120, 120, 120,
-    757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 769,
-    770, 769, 769, 769, 771, 772, 773, 774, 775, 776, 777, 777, 778, 777,
-    777, 777, 779, 780, 781, 782, 783, 784, 784, 784, 784, 785, 786, 787,
-    787, 787, 787, 787, 787, 787, 787, 787, 787, 788, 789, 790, 784, 784,
-    784, 791, 757, 757, 757, 757, 758, 120, 792, 792, 793, 793, 793, 794,
-    795, 796, 790, 790, 790, 797, 798, 799, 793, 793, 793, 800, 795, 796,
-    790, 790, 790, 790, 801, 799, 790, 802, 803, 803, 803, 803, 803, 804,
-    803, 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, 790, 790, 790,
-    805, 806, 790, 790, 790, 790, 790, 790, 790, 790, 790, 790, 790, 807,
-    790, 790, 790, 805, 808, 808, 808, 808, 808, 808, 808, 808, 808, 808,
-    808, 808, 808, 808, 808, 808, 808, 808, 808, 808, 808, 808, 808, 808,
-    808, 808, 808, 808, 808, 808, 808, 808, 808, 808, 808, 808, 808, 808,
-    808, 808, 808, 808, 808, 808, 808, 808, 808, 808, 808, 808, 808, 808,
-    808, 808, 809, 810, 579, 579, 579, 579, 579, 579, 579, 579, 808, 808,
-    808, 808, 808, 808, 808, 808, 808, 808, 808, 808, 808, 808, 808, 808,
-    808, 808, 808, 808, 808, 808, 808, 808, 808, 808, 809, 810, 810, 810,
-    810, 810, 811, 811, 812, 811, 811, 811, 811, 811, 811, 811, 811, 811,
-    811, 811, 811, 811, 811, 811, 811, 811, 811, 811, 811, 811, 811, 811,
-    811, 811, 811, 811, 811, 811, 811, 811, 811, 811, 811, 811, 811, 811,
-    811, 811, 811, 811, 811, 811, 811, 811, 811, 811, 811, 811, 811, 811,
-    811, 811, 811, 811, 811, 811, 811, 811, 811, 811, 811, 811, 811, 811,
-    811, 811, 811, 811, 811, 811, 811, 811, 811, 811, 811, 811, 811, 813,
-    814, 814, 814, 814, 814, 814, 815, 120, 816, 816, 816, 816, 816, 817,
-    818, 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, 818,
-    818, 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, 818,
-    818, 818, 818, 818, 818, 819, 818, 818, 820, 821, 120, 120, 101, 101,
-    101, 101, 101, 822, 823, 824, 101, 101, 101, 825, 826, 826, 826, 826,
-    826, 826, 826, 826, 827, 828, 829, 120, 64, 64, 830, 831, 832, 27, 833,
-    27, 27, 27, 27, 27, 27, 27, 834, 835, 27, 836, 837, 27, 27, 838, 839,
-    120, 120, 120, 120, 120, 120, 120, 840, 841, 842, 843, 844, 844, 845,
-    846, 847, 848, 849, 849, 849, 849, 849, 849, 850, 120, 851, 852, 852,
-    852, 852, 852, 853, 854, 855, 856, 857, 858, 859, 859, 860, 861, 862,
-    863, 864, 864, 865, 866, 867, 867, 868, 869, 870, 871, 367, 367, 367,
-    872, 873, 874, 874, 874, 874, 874, 875, 876, 877, 878, 879, 880, 881,
-    348, 352, 882, 883, 883, 883, 883, 883, 884, 885, 120, 886, 887, 888,
-    889, 348, 348, 890, 891, 892, 892, 892, 892, 892, 892, 893, 894, 895,
-    120, 120, 896, 897, 898, 899, 120, 900, 900, 900, 120, 372, 372, 54, 54,
-    54, 54, 54, 901, 902, 120, 903, 903, 903, 903, 903, 903, 903, 903, 903,
-    903, 897, 897, 897, 897, 904, 905, 906, 907, 908, 909, 909, 910, 909,
-    909, 909, 908, 909, 909, 910, 909, 909, 909, 908, 909, 909, 910, 909,
-    909, 909, 908, 909, 909, 910, 909, 909, 909, 908, 909, 909, 910, 909,
-    909, 909, 908, 909, 909, 910, 909, 909, 909, 908, 909, 909, 910, 909,
-    909, 909, 908, 909, 909, 910, 909, 909, 909, 908, 909, 909, 910, 909,
-    909, 909, 908, 909, 909, 910, 909, 909, 909, 908, 909, 909, 910, 909,
-    909, 909, 908, 909, 909, 910, 909, 909, 909, 908, 909, 909, 910, 909,
-    909, 909, 908, 909, 909, 910, 909, 909, 909, 908, 909, 909, 910, 909,
-    909, 909, 908, 909, 909, 910, 909, 909, 909, 908, 909, 909, 910, 909,
-    909, 909, 908, 909, 909, 910, 909, 909, 909, 908, 909, 909, 910, 909,
-    909, 909, 908, 909, 909, 910, 909, 909, 909, 908, 909, 909, 910, 909,
-    909, 909, 908, 909, 909, 910, 909, 909, 909, 908, 909, 909, 910, 909,
-    909, 909, 908, 909, 909, 910, 909, 909, 909, 908, 909, 909, 910, 909,
-    909, 909, 908, 909, 909, 910, 909, 909, 909, 908, 909, 909, 910, 909,
-    909, 909, 908, 909, 909, 910, 909, 909, 909, 908, 909, 909, 910, 909,
-    909, 909, 908, 909, 909, 910, 909, 909, 909, 908, 909, 909, 910, 909,
-    909, 909, 908, 909, 909, 910, 909, 909, 909, 909, 909, 909, 908, 909,
-    909, 910, 909, 909, 909, 908, 909, 909, 910, 909, 909, 909, 908, 909,
-    909, 911, 120, 368, 368, 912, 913, 369, 369, 369, 369, 369, 914, 915,
-    915, 915, 915, 915, 915, 915, 915, 915, 915, 915, 915, 915, 915, 915,
-    915, 915, 915, 915, 915, 915, 915, 915, 915, 915, 915, 915, 915, 915,
-    915, 915, 915, 916, 916, 916, 916, 916, 916, 916, 916, 916, 916, 916,
-    916, 916, 916, 916, 916, 916, 916, 916, 916, 916, 916, 916, 916, 916,
-    916, 916, 916, 916, 916, 916, 916, 808, 808, 808, 808, 808, 808, 808,
-    808, 808, 808, 808, 808, 808, 809, 808, 808, 808, 808, 808, 808, 808,
-    808, 808, 808, 808, 808, 808, 917, 810, 810, 810, 810, 918, 120, 919,
-    920, 121, 921, 922, 923, 924, 121, 128, 128, 128, 128, 128, 128, 128,
-    128, 128, 128, 128, 128, 925, 926, 927, 120, 928, 128, 128, 128, 128,
-    128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
-    128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
-    128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 929, 120,
-    120, 128, 128, 128, 128, 128, 128, 128, 128, 930, 128, 128, 128, 128,
-    128, 128, 120, 120, 120, 120, 120, 128, 931, 932, 932, 933, 934, 935,
-    936, 937, 938, 939, 940, 941, 942, 943, 944, 169, 128, 128, 128, 128,
-    128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 945, 946,
-    947, 948, 949, 950, 951, 951, 952, 953, 954, 954, 955, 956, 957, 958,
-    959, 959, 959, 959, 960, 961, 961, 961, 962, 963, 963, 963, 964, 965,
-    966, 120, 967, 968, 969, 968, 968, 970, 968, 968, 971, 968, 972, 968,
-    972, 120, 120, 120, 120, 968, 968, 968, 968, 968, 968, 968, 968, 968,
-    968, 968, 968, 968, 968, 968, 973, 974, 975, 975, 975, 975, 975, 976,
-    615, 977, 977, 977, 977, 977, 977, 978, 979, 980, 981, 579, 982, 983,
-    120, 120, 120, 120, 120, 615, 615, 615, 615, 615, 984, 120, 120, 120,
-    120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 985,
-    985, 985, 986, 987, 987, 987, 987, 987, 987, 988, 120, 989, 990, 990,
-    991, 992, 992, 992, 992, 993, 120, 994, 994, 995, 996, 997, 997, 997,
-    997, 998, 999, 1000, 1000, 1000, 1001, 1002, 1002, 1002, 1002, 1003,
-    1002, 1004, 120, 120, 120, 120, 120, 1005, 1005, 1005, 1005, 1005, 1006,
-    1006, 1006, 1006, 1006, 1007, 1007, 1007, 1007, 1007, 1007, 1008, 1008,
-    1008, 1009, 1010, 1011, 1012, 1012, 1012, 1012, 1013, 1014, 1014, 1014,
-    1014, 1015, 1016, 1016, 1016, 1016, 1016, 120, 1017, 1017, 1017, 1017,
-    1017, 1017, 1018, 1019, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
-    120, 120, 120, 120, 120, 120, 120, 120, 1020, 1020, 1020, 1020, 1020,
-    1020, 1020, 1020, 1020, 1020, 1020, 1020, 1020, 1020, 1020, 1020, 1020,
-    1020, 1020, 1020, 1020, 1020, 1020, 1020, 1020, 1020, 1020, 1020, 1020,
-    1020, 1020, 1020, 1020, 1020, 1020, 1020, 1020, 1020, 1021, 120, 1020,
-    1020, 1022, 120, 1020, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
-    120, 120, 120, 120, 120, 120, 120, 120, 120, 1023, 1024, 1025, 1025,
-    1025, 1025, 1026, 1027, 1028, 1028, 1029, 1030, 1031, 1031, 1032, 1033,
-    1034, 1034, 1034, 1035, 1036, 1037, 120, 120, 120, 120, 120, 120, 1038,
-    1038, 1039, 1040, 1041, 1041, 1042, 1043, 1044, 1044, 1044, 1045, 120,
-    120, 120, 120, 120, 120, 120, 120, 1046, 1046, 1046, 1046, 1047, 1047,
-    1047, 1048, 1049, 1049, 1050, 1049, 1049, 1049, 1049, 1049, 1051, 1052,
-    1053, 1054, 1055, 1055, 1056, 1057, 1058, 120, 1059, 1060, 1061, 1061,
-    1061, 1062, 1063, 1063, 1063, 1064, 120, 120, 120, 120, 1065, 1066, 1065,
-    1065, 1067, 1068, 1069, 120, 1070, 1070, 1070, 1070, 1070, 1070, 1071,
-    1072, 1073, 1073, 1074, 1075, 1076, 1076, 1077, 1078, 1079, 1079, 1080,
-    1081, 120, 1082, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 1083,
-    1083, 1083, 1083, 1083, 1083, 1083, 1083, 1083, 1084, 120, 120, 120, 120,
-    120, 120, 1085, 1085, 1085, 1085, 1085, 1085, 1086, 120, 1087, 1087,
-    1087, 1087, 1087, 1087, 1088, 1089, 120, 120, 120, 120, 120, 120, 120,
-    120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
-    120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
-    120, 120, 120, 120, 120, 120, 120, 120, 120, 1090, 1090, 1090, 1091, 120,
-    120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
-    120, 1092, 1093, 1093, 1093, 1093, 1093, 1093, 1094, 1095, 1096, 1097,
-    1098, 1099, 1100, 120, 1101, 1102, 1103, 1103, 1103, 1103, 1103, 1104,
-    1105, 1106, 120, 1107, 1107, 1107, 1108, 1109, 1110, 1111, 1112, 1112,
-    1112, 1113, 1114, 1115, 1116, 1117, 120, 1118, 1118, 1118, 1118, 1119,
-    120, 1120, 1121, 1121, 1121, 1121, 1121, 1122, 1123, 1124, 1125, 1126,
-    1127, 1128, 1129, 1130, 120, 1131, 1131, 1132, 1131, 1131, 1133, 1134,
-    1135, 120, 120, 120, 120, 120, 120, 120, 120, 1136, 1137, 1138, 1139,
-    1138, 1140, 1141, 1141, 1141, 1141, 1141, 1142, 1143, 1144, 1145, 1146,
-    1147, 1148, 1149, 1150, 1150, 1151, 1152, 1153, 1154, 1155, 1156, 1157,
-    1158, 1159, 1159, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
-    120, 120, 120, 120, 120, 120, 1160, 1160, 1160, 1160, 1160, 1160, 1161,
-    1162, 1163, 1164, 1165, 1166, 120, 120, 120, 120, 1167, 1167, 1167, 1167,
-    1167, 1167, 1168, 1169, 1170, 120, 1171, 1172, 120, 120, 120, 120, 120,
-    120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
-    120, 1173, 1173, 1173, 1173, 1173, 1174, 1175, 1176, 1177, 1178, 1179,
-    1180, 120, 120, 120, 120, 1181, 1181, 1181, 1181, 1181, 1181, 1182, 1183,
-    1184, 120, 1185, 1186, 1187, 1188, 120, 120, 1189, 1189, 1189, 1189,
-    1189, 1190, 1191, 120, 1192, 1193, 120, 120, 120, 120, 120, 120, 1194,
-    1194, 1194, 1195, 1196, 1197, 1198, 1199, 120, 120, 120, 120, 120, 120,
-    120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
-    120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
-    120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 1200, 1200, 1200, 1200,
-    1201, 1201, 1201, 1201, 1202, 1203, 1204, 1205, 120, 120, 120, 120, 120,
-    120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
-    120, 120, 120, 120, 120, 1206, 1206, 1206, 1206, 1206, 1206, 1206, 1207,
-    1208, 1209, 1208, 1208, 1208, 1210, 1211, 1212, 1213, 120, 1214, 1215,
-    1216, 1217, 1218, 1219, 1219, 1219, 1220, 1221, 1221, 1222, 1223, 120,
-    120, 120, 120, 120, 120, 120, 120, 120, 1224, 1224, 1224, 1224, 1224,
-    1224, 1224, 1224, 1224, 1224, 1224, 1224, 1224, 1224, 1224, 1224, 1224,
-    1224, 1224, 1224, 1224, 1224, 1224, 1224, 1224, 1224, 1224, 1224, 1224,
-    1224, 1224, 1224, 1224, 1224, 1224, 1224, 1224, 1224, 1224, 1224, 1224,
-    1224, 1224, 1224, 1224, 1224, 1224, 1224, 1224, 1224, 1224, 1225, 120,
-    120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 1226, 1226, 1226,
-    1226, 1226, 1226, 1226, 1226, 1226, 1226, 1226, 1226, 1226, 1227, 1228,
-    120, 1224, 1224, 1224, 1224, 1224, 1224, 1224, 1224, 1224, 1224, 1224,
-    1224, 1224, 1224, 1224, 1224, 1224, 1224, 1224, 1224, 1224, 1224, 1224,
-    1224, 1229, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
-    120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 1230, 1230, 1230,
-    1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230,
-    1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230,
-    1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230,
-    1230, 1230, 1230, 1230, 1231, 1230, 1230, 1230, 1230, 1232, 1233, 1230,
-    1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230,
-    1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230,
-    1230, 1230, 1230, 1230, 1234, 1230, 1230, 1230, 1230, 1230, 1230, 1230,
-    1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230, 1230,
-    1230, 1230, 1235, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
-    120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
-    120, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
-    1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
-    1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
-    1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
-    1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1237, 1236,
-    1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
-    1236, 1238, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
-    120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 826, 826, 826,
-    826, 826, 826, 826, 826, 826, 826, 826, 826, 826, 826, 826, 826, 826,
-    826, 826, 826, 826, 826, 826, 826, 826, 826, 826, 826, 826, 826, 826,
-    826, 826, 826, 826, 826, 826, 826, 826, 1239, 1240, 1240, 1240, 1241,
-    1242, 1243, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
-    1244, 1244, 1244, 1245, 1246, 120, 1247, 1247, 1247, 1247, 1247, 1247,
-    1248, 1249, 1250, 120, 1251, 1252, 1253, 1247, 1247, 1254, 1247, 1247,
-    120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
-    1255, 1255, 1255, 1255, 1255, 1255, 1255, 1255, 1256, 120, 1257, 1258,
-    1258, 1258, 1258, 1259, 120, 1260, 1261, 1262, 120, 120, 120, 120, 120,
-    120, 120, 120, 1263, 120, 120, 120, 1264, 1264, 1264, 1264, 1264, 1264,
-    1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264,
-    1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264,
-    1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264,
-    1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264,
-    1264, 1264, 1264, 1264, 1264, 1264, 1264, 1265, 120, 120, 1264, 1264,
-    1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264,
-    1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264,
-    1264, 1264, 1264, 1264, 1266, 120, 1267, 120, 120, 120, 120, 120, 120,
-    120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
-    120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 1268, 1268, 1268,
-    1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1269, 1268,
-    1270, 1268, 1271, 1268, 1272, 1273, 120, 120, 120, 120, 120, 120, 120,
-    120, 120, 120, 120, 615, 615, 615, 615, 615, 615, 615, 615, 615, 615,
-    615, 615, 615, 615, 615, 615, 615, 615, 615, 615, 615, 615, 615, 615,
-    615, 615, 615, 615, 615, 615, 1274, 120, 615, 615, 615, 615, 1275, 1276,
-    615, 615, 615, 615, 615, 615, 1277, 1278, 1279, 1280, 1281, 1282, 615,
-    615, 615, 1283, 615, 615, 615, 615, 615, 615, 615, 1284, 120, 120, 980,
-    980, 980, 980, 980, 980, 980, 980, 1285, 120, 120, 120, 120, 120, 120,
-    120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
-    120, 120, 120, 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, 623,
-    120, 975, 975, 1286, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
-    120, 120, 120, 120, 120, 120, 120, 1287, 1287, 1287, 1288, 1289, 1289,
-    1290, 1287, 1287, 1291, 1292, 1289, 1289, 1287, 1287, 1287, 1288, 1289,
-    1289, 1293, 1294, 1295, 1291, 1296, 1297, 1289, 1287, 1287, 1287, 1288,
-    1289, 1289, 1298, 1299, 1300, 1301, 1289, 1289, 1289, 1302, 1303, 1304,
-    1305, 1289, 1289, 1290, 1287, 1287, 1291, 1289, 1289, 1289, 1287, 1287,
-    1287, 1288, 1289, 1289, 1290, 1287, 1287, 1291, 1289, 1289, 1289, 1287,
-    1287, 1287, 1288, 1289, 1289, 1290, 1287, 1287, 1291, 1289, 1289, 1289,
-    1287, 1287, 1287, 1288, 1289, 1289, 1306, 1287, 1287, 1287, 1307, 1289,
-    1289, 1308, 1309, 1287, 1287, 1310, 1289, 1289, 1311, 1290, 1287, 1287,
-    1312, 1289, 1289, 1313, 1314, 1287, 1287, 1315, 1289, 1289, 1289, 1316,
-    1287, 1287, 1287, 1307, 1289, 1289, 1308, 1317, 1318, 1318, 1318, 1318,
-    1318, 1318, 1319, 1319, 1319, 1319, 1319, 1319, 1319, 1319, 1319, 1319,
-    1319, 1319, 1319, 1319, 1319, 1319, 1319, 1319, 1319, 1319, 1319, 1319,
-    1319, 1319, 1319, 1319, 1319, 1319, 1319, 1319, 1319, 1319, 1320, 1320,
-    1320, 1320, 1320, 1320, 1321, 1322, 1320, 1320, 1320, 1320, 1320, 1323,
-    1324, 1319, 1325, 1326, 120, 1327, 1328, 1320, 120, 120, 120, 120, 120,
-    120, 120, 120, 120, 120, 1329, 1330, 1330, 1331, 1332, 1333, 120, 120,
-    120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
-    120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 1334, 1334, 1334, 1334,
-    1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334,
-    1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1335, 1336, 1337, 120,
-    120, 120, 120, 120, 1338, 1338, 1338, 1338, 1339, 1340, 1340, 1340, 1341,
-    1342, 1343, 1344, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
-    120, 120, 120, 120, 120, 120, 120, 120, 120, 1345, 128, 128, 128, 1346,
-    1347, 1348, 1349, 1350, 1351, 1346, 1352, 1346, 1348, 1348, 1353, 128,
-    1354, 128, 1355, 1356, 1354, 128, 1355, 120, 120, 120, 120, 120, 120,
-    1357, 120, 1358, 1359, 1359, 1359, 1359, 1360, 1359, 1359, 1359, 1359,
-    1359, 1359, 1359, 1359, 1359, 1359, 1359, 1359, 1360, 1361, 1359, 1362,
-    1363, 1359, 1363, 1364, 1363, 1359, 1359, 1359, 1365, 1361, 626, 1366,
-    628, 628, 628, 1367, 628, 628, 628, 628, 628, 628, 628, 1368, 628, 628,
-    628, 1369, 1370, 1371, 628, 1372, 1361, 1361, 1361, 1361, 1361, 1361,
-    1373, 1374, 1374, 1374, 1375, 1361, 790, 790, 790, 790, 790, 1376, 790,
-    1377, 1378, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
-    1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 757,
-    757, 757, 757, 1379, 1380, 1381, 757, 757, 757, 757, 757, 757, 757, 757,
-    1382, 1383, 757, 1384, 1385, 757, 757, 1386, 1387, 1388, 1389, 1384,
-    1359, 757, 757, 1390, 1391, 757, 757, 757, 757, 757, 757, 757, 1392,
-    1393, 1394, 1395, 757, 1396, 1397, 1394, 1398, 1399, 757, 757, 757, 1400,
-    1401, 1402, 757, 757, 757, 757, 757, 757, 757, 757, 1403, 1404, 757,
-    1405, 649, 1406, 757, 1407, 1408, 579, 1409, 757, 757, 757, 1359, 1410,
-    1411, 1359, 1359, 1412, 1359, 1358, 1359, 1359, 1359, 1359, 1359, 1413,
-    1414, 1359, 1359, 1413, 1415, 757, 757, 757, 757, 757, 757, 757, 757,
-    1416, 1417, 579, 579, 579, 579, 1418, 1419, 757, 757, 757, 757, 1420,
-    757, 1421, 757, 1422, 1358, 1423, 1361, 1359, 1424, 1425, 1361, 579, 579,
-    579, 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, 1426, 1361,
-    579, 579, 579, 579, 579, 579, 579, 579, 579, 579, 1427, 1361, 1361, 1361,
-    1361, 1361, 579, 1426, 579, 579, 579, 579, 579, 579, 579, 1361, 579,
-    1428, 579, 579, 579, 579, 579, 1361, 579, 579, 579, 1429, 1361, 1361,
-    1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 757, 1430,
-    1431, 1361, 1432, 1433, 757, 1434, 757, 1435, 1361, 1361, 1361, 1361,
-    757, 757, 1436, 1361, 1361, 1361, 1361, 1361, 1437, 1361, 1361, 1361,
-    1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
-    1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
-    1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
-    1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
-    1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
-    1361, 1361, 1361, 1361, 1361, 1361, 1361, 1438, 808, 808, 808, 808, 808,
-    808, 808, 808, 808, 808, 808, 808, 808, 808, 808, 808, 808, 808, 808,
-    808, 808, 808, 808, 808, 808, 808, 1439, 810, 810, 810, 810, 810, 808,
-    808, 808, 808, 808, 808, 1440, 810, 808, 808, 808, 808, 808, 808, 808,
-    808, 808, 808, 808, 808, 808, 808, 808, 808, 808, 808, 808, 808, 808,
-    808, 808, 808, 808, 808, 808, 809, 808, 808, 808, 808, 808, 808, 808,
-    808, 808, 808, 808, 808, 808, 808, 808, 808, 808, 808, 808, 808, 808,
-    808, 808, 808, 808, 808, 808, 808, 808, 808, 808, 808, 808, 808, 808,
-    808, 808, 808, 808, 808, 808, 808, 808, 808, 808, 808, 808, 808, 917,
-    810, 810, 810, 810, 810, 810, 810, 810, 810, 810, 810, 810, 810, 810,
-    810, 810, 810, 810, 810, 810, 810, 810, 810, 810, 810, 810, 810, 810,
-    810, 810, 810, 810, 810, 810, 810, 810, 810, 810, 810, 810, 810, 810,
-    810, 808, 808, 808, 809, 810, 810, 810, 810, 810, 810, 810, 810, 810,
-    810, 810, 810, 810, 810, 810, 810, 810, 810, 810, 810, 810, 810, 810,
-    810, 810, 810, 810, 810, 810, 810, 810, 810, 810, 810, 810, 810, 810,
-    810, 810, 810, 810, 810, 810, 810, 810, 810, 810, 810, 810, 810, 810,
-    810, 810, 810, 810, 810, 810, 810, 810, 1441, 1442, 120, 120, 120, 1443,
-    1443, 1443, 1443, 1443, 1443, 1443, 1443, 1443, 1443, 1443, 1443, 120,
-    120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
-    120, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932,
-    932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932,
-    932, 932, 932, 120, 120, 916, 916, 916, 916, 916, 916, 916, 916, 916,
-    916, 916, 916, 916, 916, 916, 916, 916, 916, 916, 916, 916, 916, 916,
-    916, 916, 916, 916, 916, 916, 916, 916, 1444,
-};
-
-static const unsigned short index2[] = {
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 5, 6, 1, 1, 1, 1, 1, 1, 7, 7, 7, 8,
-    9, 10, 11, 12, 13, 14, 15, 11, 16, 17, 15, 18, 19, 20, 19, 21, 22, 22,
-    22, 22, 22, 22, 22, 22, 22, 22, 19, 23, 24, 25, 24, 10, 15, 26, 26, 26,
-    26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 16, 27, 17,
-    28, 29, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
-    30, 30, 30, 16, 31, 32, 25, 1, 1, 1, 1, 1, 1, 33, 1, 1, 34, 35, 36, 13,
-    37, 13, 38, 39, 40, 41, 42, 43, 25, 44, 45, 28, 46, 47, 48, 48, 49, 50,
-    39, 39, 40, 48, 42, 51, 52, 52, 52, 35, 53, 53, 53, 53, 53, 53, 54, 53,
-    53, 53, 53, 53, 53, 53, 53, 53, 54, 53, 53, 53, 53, 53, 53, 55, 54, 53,
-    53, 53, 53, 53, 54, 56, 56, 56, 57, 57, 57, 57, 56, 57, 56, 56, 56, 57,
-    56, 56, 57, 57, 56, 57, 56, 56, 57, 57, 57, 55, 56, 56, 56, 57, 56, 57,
-    56, 57, 53, 56, 53, 57, 53, 57, 53, 57, 53, 57, 53, 57, 53, 57, 53, 57,
-    53, 56, 53, 56, 53, 57, 53, 57, 53, 57, 53, 56, 53, 57, 53, 57, 53, 57,
-    53, 57, 53, 57, 54, 56, 53, 56, 54, 56, 53, 57, 53, 57, 56, 53, 57, 53,
-    57, 53, 57, 54, 56, 54, 56, 53, 56, 53, 57, 53, 56, 56, 54, 56, 53, 56,
-    53, 57, 53, 57, 54, 56, 53, 57, 53, 57, 53, 53, 57, 53, 57, 53, 57, 57,
-    57, 53, 53, 57, 53, 57, 53, 53, 57, 53, 53, 53, 57, 57, 53, 53, 53, 53,
-    57, 53, 53, 57, 53, 53, 53, 57, 57, 57, 53, 53, 57, 53, 53, 57, 53, 57,
-    53, 57, 53, 53, 57, 53, 57, 57, 53, 57, 53, 53, 57, 53, 53, 53, 57, 53,
-    57, 53, 53, 57, 57, 58, 53, 57, 57, 57, 58, 58, 58, 58, 53, 59, 57, 53,
-    59, 57, 53, 59, 57, 53, 56, 53, 56, 53, 56, 53, 56, 53, 56, 53, 56, 53,
-    56, 53, 56, 57, 53, 57, 57, 53, 59, 57, 53, 57, 53, 53, 53, 57, 53, 57,
-    57, 57, 57, 57, 57, 57, 53, 53, 57, 53, 53, 57, 57, 53, 57, 53, 53, 53,
-    53, 57, 57, 56, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
-    57, 57, 57, 57, 58, 57, 57, 57, 60, 60, 60, 60, 60, 60, 60, 60, 60, 61,
-    61, 62, 62, 62, 62, 62, 62, 62, 63, 63, 64, 63, 61, 65, 66, 65, 65, 65,
-    66, 65, 61, 61, 67, 62, 63, 63, 63, 63, 63, 63, 40, 40, 40, 40, 63, 40,
-    63, 49, 60, 60, 60, 60, 60, 63, 63, 63, 63, 63, 68, 68, 61, 63, 62, 63,
-    63, 63, 63, 63, 63, 63, 63, 63, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
-    69, 69, 69, 70, 71, 71, 71, 71, 70, 72, 71, 71, 71, 71, 71, 73, 73, 71,
-    71, 71, 71, 73, 73, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 74, 74,
-    74, 74, 74, 71, 71, 71, 71, 69, 69, 69, 69, 69, 69, 69, 69, 75, 69, 71,
-    71, 71, 69, 69, 69, 71, 71, 76, 69, 69, 69, 71, 71, 71, 71, 69, 70, 71,
-    71, 69, 77, 78, 78, 77, 78, 78, 77, 69, 69, 69, 69, 69, 79, 80, 79, 80,
-    61, 81, 79, 80, 82, 82, 83, 80, 80, 80, 84, 79, 82, 82, 82, 82, 81, 63,
-    79, 85, 79, 79, 79, 82, 79, 82, 79, 79, 80, 86, 86, 86, 86, 86, 86, 86,
-    86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 82, 86, 86, 86, 86, 86, 86, 86,
-    79, 79, 80, 80, 80, 80, 80, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
-    87, 87, 87, 87, 87, 87, 80, 87, 87, 87, 87, 87, 87, 87, 80, 80, 80, 80,
-    80, 79, 80, 80, 79, 79, 79, 80, 80, 80, 79, 80, 79, 80, 79, 80, 79, 80,
-    79, 80, 88, 89, 88, 89, 88, 89, 88, 89, 88, 89, 88, 89, 88, 89, 80, 80,
-    80, 80, 79, 80, 90, 79, 80, 79, 79, 80, 80, 79, 79, 79, 91, 92, 91, 91,
-    91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 92, 92, 92, 92, 92, 92,
-    92, 92, 93, 93, 93, 93, 93, 93, 93, 93, 94, 93, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 94, 94, 94, 94, 94, 91, 94, 91, 94, 91, 94, 91, 94, 91, 94,
-    95, 96, 96, 97, 97, 96, 98, 98, 91, 94, 91, 94, 91, 94, 91, 91, 94, 91,
-    94, 91, 94, 91, 94, 91, 94, 91, 94, 91, 94, 94, 82, 99, 99, 99, 99, 99,
-    99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 82,
-    82, 100, 101, 101, 101, 101, 101, 101, 82, 102, 102, 102, 102, 102, 102,
-    102, 102, 102, 102, 102, 102, 102, 102, 102, 82, 103, 104, 82, 82, 105,
-    105, 106, 82, 107, 108, 108, 108, 108, 107, 108, 108, 108, 109, 107, 108,
-    108, 108, 108, 108, 108, 107, 107, 107, 107, 107, 107, 108, 108, 107,
-    108, 108, 109, 110, 108, 111, 112, 113, 114, 115, 116, 117, 118, 119,
-    120, 120, 121, 122, 123, 124, 125, 126, 127, 128, 126, 108, 107, 129,
-    119, 82, 82, 82, 82, 82, 82, 82, 82, 130, 130, 130, 130, 130, 130, 130,
-    130, 130, 130, 130, 82, 82, 82, 82, 82, 130, 130, 130, 126, 126, 82, 82,
-    82, 131, 131, 131, 131, 131, 132, 133, 133, 134, 135, 135, 136, 137, 138,
-    139, 139, 140, 140, 140, 140, 140, 140, 140, 140, 141, 142, 143, 144,
-    145, 82, 146, 144, 147, 147, 147, 147, 147, 147, 147, 147, 148, 147, 147,
-    147, 147, 147, 147, 147, 147, 147, 147, 149, 150, 151, 152, 153, 154,
-    155, 156, 97, 97, 157, 158, 140, 140, 140, 140, 140, 158, 140, 140, 158,
-    159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 135, 160, 160, 161,
-    147, 147, 162, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
-    146, 147, 140, 140, 140, 140, 140, 140, 140, 132, 139, 140, 140, 140,
-    140, 158, 140, 163, 163, 140, 140, 139, 158, 140, 140, 158, 147, 147,
-    164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 147, 147, 147, 165,
-    165, 147, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166,
-    166, 166, 82, 167, 168, 169, 168, 168, 168, 168, 168, 168, 168, 168, 168,
-    168, 168, 168, 168, 168, 170, 171, 170, 170, 171, 170, 170, 171, 171,
-    171, 170, 171, 171, 170, 171, 170, 170, 170, 171, 170, 171, 170, 171,
-    170, 171, 170, 170, 82, 82, 168, 168, 168, 172, 172, 172, 172, 172, 172,
-    172, 172, 172, 172, 172, 172, 172, 172, 173, 173, 173, 173, 173, 173,
-    173, 173, 173, 173, 173, 172, 82, 82, 82, 82, 82, 82, 174, 174, 174, 174,
-    174, 174, 174, 174, 174, 174, 175, 175, 175, 175, 175, 175, 175, 175,
-    175, 175, 175, 175, 175, 175, 175, 175, 175, 176, 176, 176, 176, 176,
-    176, 176, 177, 176, 178, 178, 179, 180, 181, 182, 178, 82, 82, 82, 82,
-    82, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183,
-    184, 184, 184, 184, 185, 184, 184, 184, 184, 184, 184, 184, 184, 184,
-    185, 184, 184, 184, 185, 184, 184, 184, 184, 184, 82, 82, 186, 186, 186,
-    186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 82, 187, 187,
-    187, 187, 187, 187, 187, 187, 187, 188, 188, 188, 82, 82, 189, 82, 147,
-    147, 147, 147, 147, 82, 147, 147, 147, 147, 147, 147, 147, 147, 82, 82,
-    82, 82, 82, 82, 140, 140, 140, 140, 140, 140, 132, 158, 140, 140, 158,
-    140, 140, 158, 140, 140, 140, 158, 158, 158, 190, 191, 192, 140, 140,
-    140, 158, 140, 140, 158, 158, 140, 140, 140, 140, 140, 193, 193, 193,
-    194, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195,
-    195, 193, 194, 196, 195, 194, 194, 194, 193, 193, 193, 193, 193, 193,
-    193, 193, 194, 194, 194, 194, 197, 194, 194, 195, 97, 157, 198, 198, 193,
-    193, 193, 195, 195, 193, 193, 199, 199, 200, 200, 200, 200, 200, 200,
-    200, 200, 200, 200, 201, 202, 195, 195, 195, 195, 195, 195, 203, 204,
-    205, 205, 82, 203, 203, 203, 203, 203, 203, 203, 203, 82, 82, 203, 203,
-    82, 82, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203,
-    203, 82, 203, 203, 203, 203, 203, 203, 203, 82, 203, 82, 82, 82, 203,
-    203, 203, 203, 82, 82, 206, 203, 205, 205, 205, 204, 204, 204, 204, 82,
-    82, 205, 205, 82, 82, 205, 205, 207, 203, 82, 82, 82, 82, 82, 82, 82, 82,
-    205, 82, 82, 82, 82, 203, 203, 82, 203, 203, 203, 204, 204, 82, 82, 208,
-    208, 208, 208, 208, 208, 208, 208, 208, 208, 203, 203, 209, 209, 210,
-    210, 210, 210, 210, 211, 212, 213, 82, 82, 82, 82, 82, 214, 214, 215, 82,
-    216, 216, 216, 216, 216, 216, 82, 82, 82, 82, 216, 216, 82, 82, 216, 216,
-    216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 82, 216, 216,
-    216, 216, 216, 216, 216, 82, 216, 216, 82, 216, 216, 82, 216, 216, 82,
-    82, 217, 82, 215, 215, 215, 214, 214, 82, 82, 82, 82, 214, 214, 82, 82,
-    214, 214, 218, 82, 82, 82, 214, 82, 82, 82, 82, 82, 82, 82, 216, 216,
-    216, 216, 82, 216, 82, 82, 82, 82, 82, 82, 82, 219, 219, 219, 219, 219,
-    219, 219, 219, 219, 219, 214, 214, 216, 216, 216, 214, 82, 82, 82, 220,
-    220, 221, 82, 222, 222, 222, 222, 222, 222, 222, 222, 222, 82, 222, 222,
-    222, 82, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222,
-    222, 82, 222, 222, 222, 222, 222, 222, 222, 82, 222, 222, 82, 222, 222,
-    222, 222, 222, 82, 82, 223, 222, 221, 221, 221, 220, 220, 220, 220, 220,
-    82, 220, 220, 221, 82, 221, 221, 224, 82, 82, 222, 82, 82, 82, 82, 82,
-    82, 82, 222, 222, 220, 220, 82, 82, 225, 225, 225, 225, 225, 225, 225,
-    225, 225, 225, 226, 227, 82, 82, 82, 82, 82, 82, 82, 222, 82, 82, 82, 82,
-    82, 82, 82, 228, 229, 229, 82, 230, 230, 230, 230, 230, 230, 230, 230,
-    82, 82, 230, 230, 82, 82, 230, 230, 230, 230, 230, 230, 230, 230, 230,
-    230, 230, 230, 230, 230, 82, 230, 230, 230, 230, 230, 230, 230, 82, 230,
-    230, 82, 230, 230, 230, 230, 230, 82, 82, 231, 230, 229, 228, 229, 228,
-    228, 228, 228, 82, 82, 229, 229, 82, 82, 229, 229, 232, 82, 82, 82, 82,
-    82, 82, 82, 82, 228, 229, 82, 82, 82, 82, 230, 230, 82, 230, 230, 230,
-    228, 228, 82, 82, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 234,
-    230, 235, 235, 235, 235, 235, 235, 82, 82, 236, 237, 82, 237, 237, 237,
-    237, 237, 237, 82, 82, 82, 237, 237, 237, 82, 237, 237, 237, 237, 82, 82,
-    82, 237, 237, 82, 237, 82, 237, 237, 82, 82, 82, 237, 237, 82, 82, 82,
-    237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 82, 82, 82, 82, 238,
-    238, 236, 238, 238, 82, 82, 82, 238, 238, 238, 82, 238, 238, 238, 239,
-    82, 82, 237, 82, 82, 82, 82, 82, 82, 238, 82, 82, 82, 82, 82, 82, 240,
-    240, 240, 240, 240, 240, 240, 240, 240, 240, 241, 241, 241, 242, 242,
-    242, 242, 242, 242, 243, 242, 82, 82, 82, 82, 82, 244, 245, 245, 245, 82,
-    246, 246, 246, 246, 246, 246, 246, 246, 82, 246, 246, 246, 82, 246, 246,
-    246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 82,
-    82, 82, 246, 244, 244, 244, 245, 245, 245, 245, 82, 244, 244, 244, 82,
-    244, 244, 244, 247, 82, 82, 82, 82, 82, 82, 82, 248, 249, 82, 246, 246,
-    246, 82, 82, 82, 82, 82, 246, 246, 244, 244, 82, 82, 250, 250, 250, 250,
-    250, 250, 250, 250, 250, 250, 251, 251, 251, 251, 251, 251, 251, 252,
-    253, 254, 255, 255, 82, 253, 253, 253, 253, 253, 253, 253, 253, 82, 253,
-    253, 253, 82, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253,
-    253, 253, 253, 253, 253, 253, 82, 253, 253, 253, 253, 253, 82, 82, 256,
-    253, 255, 257, 255, 255, 255, 255, 255, 82, 257, 255, 255, 82, 255, 255,
-    254, 258, 82, 82, 82, 82, 82, 82, 82, 255, 255, 82, 82, 82, 82, 82, 82,
-    82, 253, 82, 253, 253, 254, 254, 82, 82, 259, 259, 259, 259, 259, 259,
-    259, 259, 259, 259, 82, 253, 253, 82, 82, 82, 82, 82, 82, 260, 261, 261,
-    82, 262, 262, 262, 262, 262, 262, 262, 262, 82, 262, 262, 262, 82, 262,
-    262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
-    262, 262, 82, 82, 262, 261, 261, 261, 260, 260, 260, 260, 82, 261, 261,
-    261, 82, 261, 261, 261, 263, 262, 264, 82, 82, 82, 82, 262, 262, 262,
-    261, 265, 265, 265, 265, 265, 265, 265, 262, 262, 262, 260, 260, 82, 82,
-    266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 265, 265, 265, 265,
-    265, 265, 265, 265, 265, 267, 262, 262, 262, 262, 262, 262, 82, 82, 268,
-    268, 82, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269,
-    269, 269, 269, 269, 269, 82, 82, 82, 269, 269, 269, 269, 269, 269, 269,
-    269, 82, 269, 269, 269, 269, 269, 269, 269, 269, 269, 82, 269, 82, 82,
-    82, 82, 270, 82, 82, 82, 82, 268, 268, 268, 271, 271, 271, 82, 271, 82,
-    268, 268, 268, 268, 268, 268, 268, 268, 82, 82, 82, 82, 82, 82, 272, 272,
-    272, 272, 272, 272, 272, 272, 272, 272, 82, 82, 268, 268, 273, 82, 82,
-    82, 82, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
-    274, 274, 274, 275, 274, 274, 275, 275, 275, 275, 276, 276, 277, 82, 82,
-    82, 82, 278, 274, 274, 274, 274, 274, 274, 279, 275, 280, 280, 280, 280,
-    275, 275, 275, 281, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282,
-    283, 283, 82, 82, 82, 82, 82, 284, 284, 82, 284, 82, 82, 284, 284, 82,
-    284, 82, 82, 284, 82, 82, 82, 82, 82, 82, 284, 284, 284, 284, 82, 284,
-    284, 284, 284, 284, 284, 284, 82, 284, 284, 284, 82, 284, 82, 284, 82,
-    82, 284, 284, 82, 284, 284, 284, 284, 285, 284, 284, 285, 285, 285, 285,
-    286, 286, 82, 285, 285, 284, 82, 82, 284, 284, 284, 284, 284, 82, 287,
-    82, 288, 288, 288, 288, 285, 285, 82, 82, 289, 289, 289, 289, 289, 289,
-    289, 289, 289, 289, 82, 82, 284, 284, 284, 284, 290, 291, 291, 291, 292,
-    293, 292, 292, 294, 292, 292, 295, 294, 296, 296, 296, 296, 296, 294,
-    297, 296, 297, 297, 297, 298, 298, 297, 297, 297, 297, 297, 297, 299,
-    299, 299, 299, 299, 299, 299, 299, 299, 299, 300, 300, 300, 300, 300,
-    300, 300, 300, 300, 300, 301, 298, 297, 298, 297, 302, 303, 304, 303,
-    304, 305, 305, 290, 290, 290, 290, 290, 290, 290, 290, 82, 290, 290, 290,
-    290, 290, 290, 290, 290, 290, 290, 290, 290, 82, 82, 82, 82, 306, 307,
-    308, 309, 308, 308, 308, 308, 308, 307, 307, 307, 307, 308, 310, 307,
-    308, 311, 311, 312, 295, 311, 311, 290, 290, 290, 290, 290, 308, 308,
-    308, 308, 308, 308, 308, 308, 308, 308, 308, 82, 308, 308, 308, 308, 308,
-    308, 308, 308, 308, 308, 308, 308, 82, 301, 301, 297, 297, 297, 297, 297,
-    297, 298, 297, 297, 297, 297, 297, 297, 82, 297, 297, 292, 292, 295, 292,
-    293, 313, 313, 313, 313, 294, 294, 82, 82, 82, 82, 82, 314, 314, 314,
-    314, 314, 314, 314, 314, 314, 314, 314, 315, 315, 316, 316, 316, 316,
-    315, 316, 316, 316, 316, 316, 317, 315, 318, 318, 315, 315, 316, 316,
-    314, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 320, 320, 321,
-    321, 321, 321, 314, 314, 314, 314, 314, 314, 315, 315, 316, 316, 314,
-    314, 314, 314, 316, 316, 316, 314, 315, 315, 315, 314, 314, 315, 315,
-    315, 315, 315, 315, 315, 314, 314, 314, 316, 316, 316, 316, 314, 314,
-    314, 314, 314, 316, 315, 315, 316, 316, 315, 315, 315, 315, 315, 315,
-    322, 314, 315, 319, 319, 315, 315, 315, 316, 323, 323, 324, 324, 324,
-    324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 82, 324, 82, 82,
-    82, 82, 82, 324, 82, 82, 325, 325, 325, 325, 325, 325, 325, 325, 325,
-    325, 325, 326, 327, 325, 325, 325, 328, 328, 328, 328, 328, 328, 328,
-    328, 329, 329, 329, 329, 329, 329, 329, 329, 330, 330, 330, 330, 330,
-    330, 330, 330, 331, 331, 331, 331, 331, 331, 331, 331, 331, 82, 331, 331,
-    331, 331, 82, 82, 331, 331, 331, 331, 331, 331, 331, 82, 331, 331, 331,
-    82, 82, 332, 332, 332, 333, 334, 333, 333, 333, 333, 333, 333, 333, 335,
-    335, 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, 335,
-    335, 335, 335, 335, 335, 82, 82, 82, 336, 336, 336, 336, 336, 336, 336,
-    336, 336, 336, 82, 82, 82, 82, 82, 82, 337, 337, 337, 337, 337, 337, 337,
-    337, 337, 337, 337, 337, 337, 337, 82, 82, 338, 338, 338, 338, 338, 338,
-    82, 82, 339, 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, 340,
-    340, 340, 340, 340, 340, 340, 340, 340, 341, 341, 340, 342, 343, 343,
-    343, 343, 343, 343, 343, 343, 343, 343, 343, 343, 343, 343, 343, 343,
-    343, 343, 344, 345, 82, 82, 82, 346, 346, 346, 346, 346, 346, 346, 346,
-    346, 346, 346, 199, 199, 199, 347, 347, 347, 346, 346, 346, 346, 346,
-    346, 346, 346, 82, 82, 82, 82, 82, 82, 82, 348, 348, 348, 348, 348, 348,
-    348, 348, 348, 348, 348, 348, 348, 82, 348, 348, 348, 348, 349, 349, 350,
-    82, 82, 82, 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, 352, 352,
-    353, 199, 199, 82, 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, 355,
-    355, 82, 82, 82, 82, 356, 356, 356, 356, 356, 356, 356, 356, 356, 356,
-    356, 356, 356, 82, 356, 356, 356, 82, 357, 357, 82, 82, 82, 82, 358, 358,
-    358, 358, 358, 358, 358, 358, 358, 358, 358, 358, 359, 359, 360, 359,
-    359, 359, 359, 359, 359, 359, 360, 360, 360, 360, 360, 360, 360, 360,
-    359, 360, 360, 359, 359, 359, 359, 359, 359, 359, 359, 359, 361, 359,
-    362, 362, 363, 364, 362, 365, 362, 366, 358, 367, 82, 82, 368, 368, 368,
-    368, 368, 368, 368, 368, 368, 368, 82, 82, 82, 82, 82, 82, 369, 369, 369,
-    369, 369, 369, 369, 369, 369, 369, 82, 82, 82, 82, 82, 82, 370, 370, 371,
-    371, 372, 373, 374, 370, 375, 375, 370, 376, 376, 376, 377, 82, 378, 378,
-    378, 378, 378, 378, 378, 378, 378, 378, 82, 82, 82, 82, 82, 82, 379, 379,
-    379, 379, 379, 379, 379, 379, 379, 379, 379, 380, 379, 379, 379, 379,
-    379, 379, 379, 379, 379, 376, 376, 379, 379, 381, 379, 82, 82, 82, 82,
-    82, 340, 340, 340, 340, 340, 340, 82, 82, 382, 382, 382, 382, 382, 382,
-    382, 382, 382, 382, 382, 382, 382, 382, 382, 82, 383, 383, 383, 384, 384,
-    384, 384, 383, 383, 384, 384, 384, 82, 82, 82, 82, 384, 384, 383, 384,
-    384, 384, 384, 384, 384, 385, 386, 387, 82, 82, 82, 82, 388, 82, 82, 82,
-    389, 389, 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, 391, 391,
-    391, 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, 82, 82, 391,
-    391, 391, 391, 391, 82, 82, 82, 392, 392, 392, 392, 392, 392, 392, 392,
-    392, 392, 392, 392, 82, 82, 82, 82, 392, 392, 82, 82, 82, 82, 82, 82,
-    393, 393, 393, 393, 393, 393, 393, 393, 393, 393, 394, 82, 82, 82, 395,
-    395, 396, 396, 396, 396, 396, 396, 396, 396, 397, 397, 397, 397, 397,
-    397, 397, 397, 397, 397, 397, 397, 397, 397, 397, 398, 399, 400, 400,
-    401, 82, 82, 402, 402, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403,
-    403, 403, 403, 404, 405, 404, 405, 405, 405, 405, 405, 405, 405, 82, 406,
-    404, 405, 404, 404, 405, 405, 405, 405, 405, 405, 405, 405, 404, 404,
-    404, 404, 404, 404, 405, 405, 407, 407, 407, 407, 407, 407, 407, 407, 82,
-    82, 408, 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, 82, 82, 82,
-    82, 82, 82, 410, 410, 410, 410, 410, 410, 410, 411, 410, 410, 410, 410,
-    410, 410, 82, 82, 97, 97, 97, 97, 97, 157, 157, 157, 157, 157, 157, 97,
-    97, 157, 412, 82, 413, 413, 413, 413, 414, 415, 415, 415, 415, 415, 415,
-    415, 415, 415, 415, 415, 415, 415, 415, 415, 416, 414, 413, 413, 413,
-    413, 413, 414, 413, 414, 414, 414, 414, 414, 413, 414, 417, 415, 415,
-    415, 415, 415, 415, 415, 82, 82, 82, 82, 418, 418, 418, 418, 418, 418,
-    418, 418, 418, 418, 419, 419, 420, 419, 419, 419, 419, 421, 421, 421,
-    421, 421, 421, 421, 421, 421, 421, 422, 423, 422, 422, 422, 422, 422,
-    422, 422, 421, 421, 421, 421, 421, 421, 421, 421, 421, 82, 82, 82, 424,
-    424, 425, 426, 426, 426, 426, 426, 426, 426, 426, 426, 426, 426, 426,
-    426, 426, 425, 424, 424, 424, 424, 425, 425, 424, 424, 427, 428, 424,
-    424, 426, 426, 429, 429, 429, 429, 429, 429, 429, 429, 429, 429, 426,
-    426, 426, 426, 426, 426, 430, 430, 430, 430, 430, 430, 430, 430, 430,
-    430, 430, 430, 430, 430, 431, 432, 433, 433, 432, 432, 432, 433, 432,
-    433, 433, 433, 434, 434, 82, 82, 82, 82, 82, 82, 82, 82, 435, 435, 435,
-    435, 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, 437,
-    437, 437, 437, 437, 437, 437, 437, 438, 438, 438, 438, 438, 438, 438,
-    438, 437, 437, 438, 439, 82, 82, 82, 440, 440, 440, 440, 440, 441, 441,
-    441, 441, 441, 441, 441, 441, 441, 441, 82, 82, 82, 436, 436, 436, 442,
-    442, 442, 442, 442, 442, 442, 442, 442, 442, 443, 443, 443, 443, 443,
-    443, 443, 443, 443, 443, 443, 443, 443, 443, 444, 444, 444, 444, 444,
-    444, 445, 445, 94, 82, 82, 82, 82, 82, 82, 82, 446, 446, 446, 446, 446,
-    446, 446, 446, 97, 97, 97, 326, 447, 157, 157, 157, 157, 157, 97, 97,
-    157, 157, 157, 157, 97, 448, 447, 447, 447, 447, 447, 447, 447, 449, 449,
-    449, 449, 157, 449, 449, 449, 449, 448, 448, 97, 449, 449, 82, 97, 97,
-    82, 82, 82, 82, 82, 82, 57, 57, 57, 57, 57, 57, 80, 80, 80, 80, 80, 94,
-    60, 60, 60, 60, 60, 60, 60, 60, 60, 83, 83, 83, 83, 83, 60, 60, 60, 60,
-    83, 83, 83, 83, 83, 57, 57, 57, 57, 57, 450, 57, 57, 57, 57, 57, 57, 57,
-    57, 57, 57, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 83, 97, 97,
-    157, 97, 97, 97, 97, 97, 97, 97, 157, 97, 97, 451, 452, 157, 453, 97, 97,
-    97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
-    97, 82, 82, 82, 82, 82, 97, 454, 157, 97, 157, 53, 57, 53, 57, 53, 57,
-    57, 57, 57, 57, 57, 57, 57, 57, 53, 57, 80, 80, 80, 80, 80, 80, 80, 80,
-    79, 79, 79, 79, 79, 79, 79, 79, 80, 80, 80, 80, 80, 80, 82, 82, 79, 79,
-    79, 79, 79, 79, 82, 82, 82, 79, 82, 79, 82, 79, 82, 79, 455, 455, 455,
-    455, 455, 455, 455, 455, 80, 80, 80, 80, 80, 82, 80, 80, 79, 79, 79, 79,
-    455, 81, 80, 81, 81, 81, 80, 80, 80, 82, 80, 80, 79, 79, 79, 79, 455, 81,
-    81, 81, 80, 80, 80, 80, 82, 82, 80, 80, 79, 79, 79, 79, 82, 81, 81, 81,
-    79, 79, 79, 79, 79, 81, 81, 81, 82, 82, 80, 80, 80, 82, 80, 80, 79, 79,
-    79, 79, 455, 456, 81, 82, 457, 457, 457, 457, 457, 457, 457, 458, 457,
-    457, 457, 459, 460, 461, 462, 463, 464, 465, 466, 464, 467, 468, 39, 85,
-    469, 470, 471, 472, 469, 470, 471, 472, 39, 39, 473, 85, 474, 474, 474,
-    475, 476, 477, 478, 479, 480, 481, 482, 34, 483, 484, 483, 483, 484, 485,
-    486, 486, 85, 43, 51, 39, 487, 487, 473, 488, 488, 85, 85, 85, 489, 490,
-    491, 487, 487, 487, 85, 85, 85, 85, 85, 85, 85, 85, 492, 85, 488, 85,
-    373, 85, 373, 373, 373, 373, 85, 373, 373, 457, 493, 494, 494, 494, 494,
-    82, 495, 496, 497, 498, 499, 499, 499, 499, 499, 499, 500, 60, 82, 82,
-    48, 500, 500, 500, 500, 500, 501, 501, 492, 490, 491, 502, 500, 48, 48,
-    48, 48, 500, 500, 500, 500, 500, 501, 501, 492, 490, 491, 82, 60, 60, 60,
-    60, 60, 82, 82, 82, 278, 278, 278, 278, 278, 278, 278, 503, 278, 504,
-    278, 278, 37, 278, 278, 278, 278, 278, 278, 278, 278, 278, 503, 278, 278,
-    278, 278, 503, 278, 278, 503, 505, 505, 505, 505, 505, 505, 505, 505,
-    505, 97, 97, 447, 447, 97, 97, 97, 97, 447, 447, 447, 97, 97, 412, 412,
-    412, 412, 97, 412, 412, 412, 447, 447, 97, 157, 97, 447, 447, 157, 157,
-    157, 157, 97, 82, 82, 82, 82, 82, 82, 82, 41, 41, 506, 507, 41, 508, 41,
-    506, 41, 507, 50, 506, 506, 506, 50, 50, 506, 506, 506, 509, 41, 506,
-    510, 41, 492, 506, 506, 506, 506, 506, 41, 41, 41, 508, 508, 41, 506, 41,
-    86, 41, 506, 41, 53, 511, 506, 506, 512, 50, 506, 506, 53, 506, 50, 449,
-    449, 449, 449, 50, 41, 41, 50, 50, 506, 506, 513, 492, 492, 492, 492,
-    506, 50, 50, 50, 50, 41, 492, 41, 41, 57, 313, 514, 514, 514, 515, 52,
-    516, 514, 514, 514, 514, 514, 52, 515, 515, 52, 514, 517, 517, 517, 517,
-    517, 517, 517, 517, 517, 517, 517, 517, 518, 518, 518, 518, 517, 517,
-    518, 518, 518, 518, 518, 518, 518, 518, 518, 53, 57, 518, 518, 518, 518,
-    52, 41, 41, 82, 82, 82, 82, 55, 55, 55, 55, 55, 508, 508, 508, 508, 508,
-    492, 492, 41, 41, 41, 41, 492, 41, 41, 492, 41, 41, 492, 41, 41, 41, 41,
-    41, 41, 41, 492, 41, 41, 41, 41, 41, 41, 41, 41, 41, 45, 45, 41, 41, 41,
-    41, 41, 41, 41, 41, 41, 41, 41, 41, 492, 492, 41, 41, 55, 41, 55, 41, 41,
-    41, 41, 41, 41, 41, 41, 41, 41, 45, 41, 41, 41, 41, 492, 492, 492, 492,
-    492, 492, 492, 492, 492, 492, 492, 492, 55, 513, 519, 519, 513, 492, 492,
-    55, 519, 513, 513, 519, 513, 513, 492, 55, 492, 519, 520, 521, 492, 519,
-    513, 492, 492, 492, 519, 513, 513, 519, 55, 519, 519, 513, 513, 55, 513,
-    55, 513, 55, 55, 55, 55, 519, 519, 513, 519, 513, 513, 513, 513, 513, 55,
-    55, 55, 55, 492, 513, 492, 513, 519, 519, 513, 513, 513, 513, 513, 513,
-    513, 513, 513, 513, 519, 513, 513, 513, 519, 492, 492, 492, 492, 492,
-    519, 513, 513, 513, 492, 492, 492, 492, 492, 492, 492, 492, 492, 513,
-    519, 55, 513, 492, 519, 519, 519, 519, 513, 513, 519, 519, 492, 492, 519,
-    519, 513, 513, 519, 519, 513, 513, 519, 519, 513, 513, 513, 513, 513,
-    492, 492, 513, 513, 513, 513, 492, 492, 55, 492, 492, 513, 55, 492, 492,
-    492, 492, 492, 492, 492, 492, 513, 513, 492, 55, 513, 513, 513, 492, 492,
-    492, 492, 492, 513, 519, 492, 513, 513, 513, 513, 513, 492, 492, 513,
-    513, 492, 492, 492, 492, 513, 513, 513, 513, 513, 513, 513, 513, 492,
-    522, 490, 491, 490, 491, 41, 41, 41, 41, 41, 41, 508, 41, 41, 41, 41, 41,
-    41, 41, 523, 523, 41, 41, 41, 41, 513, 513, 41, 41, 41, 41, 41, 41, 41,
-    524, 525, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 313, 313, 313, 313,
-    313, 313, 313, 313, 313, 313, 313, 313, 313, 41, 492, 41, 41, 41, 41, 41,
-    41, 41, 41, 313, 41, 41, 41, 41, 41, 492, 492, 492, 492, 492, 492, 492,
-    492, 492, 41, 41, 41, 41, 492, 492, 41, 41, 41, 41, 41, 41, 41, 526, 526,
-    526, 526, 41, 41, 41, 523, 527, 527, 523, 41, 41, 41, 41, 41, 41, 41, 41,
-    41, 41, 41, 82, 41, 41, 41, 82, 82, 82, 82, 82, 52, 52, 52, 52, 52, 52,
-    52, 52, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 528, 528, 528,
-    528, 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, 516, 52, 52, 52,
-    52, 52, 52, 52, 52, 52, 52, 52, 52, 515, 508, 508, 508, 508, 508, 508,
-    508, 508, 508, 508, 508, 508, 41, 41, 41, 41, 508, 508, 508, 508, 529,
-    41, 41, 41, 41, 41, 508, 508, 508, 508, 41, 41, 508, 508, 41, 508, 508,
-    508, 508, 508, 508, 508, 41, 41, 41, 41, 41, 41, 41, 41, 508, 508, 41,
-    41, 508, 55, 41, 41, 41, 41, 508, 508, 41, 41, 508, 55, 41, 41, 41, 41,
-    508, 508, 508, 41, 41, 508, 41, 41, 508, 508, 41, 41, 41, 41, 41, 41, 41,
-    508, 492, 492, 492, 492, 492, 530, 530, 492, 527, 527, 527, 527, 41, 508,
-    508, 41, 41, 508, 41, 41, 41, 41, 508, 508, 41, 41, 41, 41, 523, 523,
-    529, 529, 527, 41, 527, 527, 531, 532, 531, 527, 41, 527, 527, 527, 41,
-    41, 41, 41, 508, 41, 508, 41, 41, 41, 41, 41, 526, 526, 526, 526, 526,
-    526, 526, 526, 526, 526, 526, 526, 41, 41, 41, 41, 508, 508, 41, 508,
-    508, 508, 41, 508, 531, 508, 508, 41, 508, 508, 41, 55, 41, 41, 41, 41,
-    41, 41, 41, 523, 41, 41, 41, 526, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
-    508, 508, 41, 526, 41, 41, 41, 41, 41, 41, 41, 41, 526, 526, 313, 41, 41,
-    41, 41, 41, 41, 41, 41, 523, 523, 531, 527, 527, 527, 527, 523, 523, 531,
-    531, 531, 508, 508, 508, 508, 531, 526, 531, 531, 531, 508, 531, 523,
-    508, 508, 508, 531, 531, 508, 508, 531, 508, 508, 531, 531, 531, 41, 508,
-    41, 41, 41, 41, 508, 508, 523, 508, 508, 508, 508, 508, 508, 531, 523,
-    523, 531, 523, 508, 531, 531, 533, 523, 508, 508, 523, 531, 531, 527,
-    527, 527, 527, 527, 526, 41, 41, 527, 527, 534, 534, 532, 532, 41, 41,
-    526, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 45, 41, 41, 41, 41,
-    41, 41, 526, 41, 526, 41, 41, 41, 41, 526, 526, 526, 41, 535, 41, 41, 41,
-    536, 536, 536, 536, 536, 536, 41, 537, 537, 527, 41, 41, 41, 490, 491,
-    490, 491, 490, 491, 490, 491, 490, 491, 490, 491, 490, 491, 52, 52, 516,
-    516, 516, 516, 516, 516, 516, 516, 516, 516, 516, 516, 41, 526, 526, 526,
-    41, 41, 41, 41, 41, 41, 41, 526, 513, 492, 492, 513, 513, 490, 491, 492,
-    513, 513, 492, 513, 513, 513, 492, 492, 492, 492, 492, 513, 513, 513,
-    513, 492, 492, 492, 492, 492, 513, 513, 513, 492, 492, 492, 513, 513,
-    513, 513, 16, 32, 16, 32, 16, 32, 16, 32, 490, 491, 538, 538, 538, 538,
-    538, 538, 538, 538, 492, 492, 492, 490, 491, 16, 32, 490, 491, 490, 491,
-    490, 491, 490, 491, 490, 491, 492, 492, 513, 513, 513, 513, 513, 513,
-    492, 492, 492, 492, 492, 492, 492, 513, 513, 513, 513, 513, 513, 492,
-    492, 492, 513, 492, 492, 492, 492, 513, 513, 513, 513, 513, 492, 513,
-    513, 492, 492, 490, 491, 490, 491, 513, 492, 492, 492, 492, 513, 492,
-    513, 513, 513, 492, 492, 513, 513, 492, 492, 492, 492, 492, 492, 492,
-    492, 492, 492, 513, 513, 513, 513, 513, 513, 492, 492, 490, 491, 492,
-    492, 492, 492, 513, 513, 513, 513, 513, 513, 513, 513, 513, 513, 513,
-    492, 513, 513, 513, 513, 492, 492, 513, 492, 513, 492, 492, 513, 492,
-    513, 513, 513, 513, 492, 492, 492, 492, 492, 513, 513, 492, 492, 492,
-    492, 513, 513, 513, 513, 492, 513, 513, 492, 492, 513, 513, 492, 492,
-    492, 492, 513, 513, 513, 513, 513, 513, 513, 513, 513, 513, 513, 492,
-    492, 513, 513, 513, 513, 513, 513, 513, 513, 492, 513, 513, 513, 513,
-    513, 513, 513, 513, 492, 492, 492, 492, 492, 513, 492, 513, 492, 492,
-    492, 513, 513, 513, 513, 513, 492, 492, 492, 492, 513, 492, 492, 492,
-    513, 513, 513, 513, 513, 492, 513, 492, 492, 41, 41, 41, 526, 526, 41,
-    41, 41, 492, 492, 492, 492, 492, 41, 41, 492, 492, 492, 492, 492, 492,
-    41, 41, 41, 526, 41, 41, 41, 41, 535, 508, 508, 41, 41, 41, 41, 82, 82,
-    41, 41, 41, 41, 41, 41, 41, 41, 82, 82, 41, 41, 82, 82, 82, 41, 41, 41,
-    41, 82, 41, 41, 41, 41, 41, 41, 41, 41, 82, 82, 82, 82, 82, 82, 82, 82,
-    82, 82, 41, 41, 41, 41, 539, 539, 539, 539, 539, 539, 539, 539, 539, 539,
-    539, 539, 539, 539, 539, 82, 540, 540, 540, 540, 540, 540, 540, 540, 540,
-    540, 540, 540, 540, 540, 540, 82, 53, 57, 53, 53, 53, 57, 57, 53, 57, 53,
-    57, 53, 57, 53, 53, 53, 53, 57, 53, 57, 57, 53, 57, 57, 57, 57, 57, 57,
-    60, 60, 53, 53, 88, 89, 88, 89, 89, 541, 541, 541, 541, 541, 541, 88, 89,
-    88, 89, 542, 542, 542, 88, 89, 82, 82, 82, 82, 82, 543, 544, 544, 544,
-    545, 543, 544, 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, 546,
-    546, 546, 546, 82, 546, 82, 82, 82, 82, 82, 546, 82, 82, 547, 547, 547,
-    547, 547, 547, 547, 547, 82, 82, 82, 82, 82, 82, 82, 548, 549, 82, 82,
-    82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 550, 96, 96, 96, 96, 96,
-    96, 96, 96, 551, 551, 43, 51, 43, 51, 551, 551, 551, 43, 51, 551, 43, 51,
-    373, 373, 373, 373, 373, 373, 373, 373, 85, 466, 552, 373, 553, 85, 43,
-    51, 85, 85, 43, 51, 490, 491, 490, 491, 490, 491, 490, 491, 373, 373,
-    373, 373, 371, 61, 373, 373, 85, 373, 373, 85, 85, 85, 85, 85, 554, 554,
-    373, 373, 373, 85, 466, 373, 471, 373, 373, 82, 82, 82, 555, 555, 555,
-    555, 555, 555, 555, 555, 555, 555, 82, 555, 555, 555, 555, 555, 555, 555,
-    555, 555, 82, 82, 82, 82, 555, 555, 555, 555, 555, 555, 82, 82, 523, 523,
-    523, 523, 523, 523, 523, 523, 523, 523, 523, 523, 82, 82, 82, 82, 556,
-    557, 557, 558, 523, 559, 560, 561, 524, 525, 524, 525, 524, 525, 524,
-    525, 524, 525, 523, 523, 524, 525, 524, 525, 524, 525, 524, 525, 562,
-    563, 564, 564, 523, 561, 561, 561, 561, 561, 561, 561, 561, 561, 565,
-    566, 567, 568, 569, 569, 570, 571, 571, 571, 571, 572, 523, 523, 561,
-    561, 561, 559, 573, 558, 523, 527, 82, 574, 575, 574, 575, 574, 575, 574,
-    575, 574, 575, 575, 575, 575, 575, 575, 575, 575, 575, 575, 575, 575,
-    575, 575, 575, 575, 575, 574, 575, 575, 575, 575, 575, 575, 575, 574,
-    575, 574, 575, 574, 575, 575, 575, 575, 575, 575, 574, 575, 575, 575,
-    575, 575, 575, 574, 574, 82, 82, 576, 576, 577, 577, 578, 578, 575, 562,
-    579, 580, 579, 580, 579, 580, 579, 580, 579, 580, 580, 580, 580, 580,
-    580, 580, 580, 580, 580, 580, 580, 580, 580, 580, 580, 580, 579, 580,
-    580, 580, 580, 580, 580, 580, 579, 580, 579, 580, 579, 580, 580, 580,
-    580, 580, 580, 579, 580, 580, 580, 580, 580, 580, 579, 579, 580, 580,
-    580, 580, 581, 582, 583, 583, 580, 82, 82, 82, 82, 82, 584, 584, 584,
-    584, 584, 584, 584, 584, 584, 584, 584, 584, 584, 584, 584, 584, 584, 82,
-    82, 82, 585, 585, 585, 585, 585, 585, 585, 585, 585, 585, 585, 585, 585,
-    585, 585, 585, 585, 585, 585, 585, 585, 585, 82, 586, 586, 587, 587, 587,
-    587, 586, 586, 586, 586, 586, 586, 586, 586, 586, 586, 584, 584, 584, 82,
-    82, 82, 82, 82, 579, 579, 579, 579, 579, 579, 579, 579, 588, 588, 588,
-    588, 588, 588, 588, 588, 588, 588, 588, 588, 588, 589, 589, 82, 587, 587,
-    587, 587, 587, 587, 587, 587, 587, 587, 586, 586, 586, 586, 586, 586,
-    590, 590, 590, 590, 590, 590, 590, 590, 523, 591, 591, 591, 591, 591,
-    591, 591, 591, 591, 591, 591, 591, 591, 591, 591, 588, 588, 588, 588,
-    589, 589, 589, 586, 586, 591, 591, 591, 591, 591, 591, 591, 586, 586,
-    586, 586, 523, 523, 523, 523, 592, 592, 592, 592, 592, 592, 592, 592,
-    592, 592, 592, 592, 592, 592, 592, 82, 586, 586, 586, 586, 586, 586, 586,
-    523, 523, 523, 523, 586, 586, 586, 586, 586, 586, 586, 586, 586, 586,
-    586, 523, 523, 593, 593, 593, 593, 593, 593, 593, 593, 593, 593, 593,
-    593, 593, 593, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 595,
-    595, 595, 595, 595, 595, 595, 595, 595, 595, 595, 595, 595, 596, 595,
-    595, 595, 595, 595, 595, 595, 82, 82, 82, 597, 597, 597, 597, 597, 597,
-    597, 597, 597, 597, 597, 597, 597, 597, 597, 82, 598, 598, 598, 598, 598,
-    598, 598, 598, 599, 599, 599, 599, 599, 599, 600, 600, 601, 601, 601,
-    601, 601, 601, 601, 601, 601, 601, 601, 601, 602, 603, 604, 603, 605,
-    605, 605, 605, 605, 605, 605, 605, 605, 605, 601, 601, 82, 82, 82, 82,
-    91, 94, 91, 94, 91, 94, 606, 96, 98, 98, 98, 607, 96, 96, 96, 96, 96, 96,
-    96, 96, 96, 96, 607, 608, 91, 94, 91, 94, 450, 450, 96, 96, 609, 609,
-    609, 609, 609, 609, 609, 609, 609, 609, 609, 609, 609, 609, 610, 610,
-    610, 610, 610, 610, 610, 610, 610, 610, 611, 611, 612, 613, 613, 613,
-    613, 613, 63, 63, 63, 63, 63, 63, 63, 61, 61, 61, 61, 61, 61, 61, 61, 61,
-    63, 63, 53, 57, 53, 57, 53, 57, 57, 57, 53, 57, 53, 57, 53, 57, 60, 57,
-    57, 57, 57, 57, 57, 57, 57, 53, 57, 53, 57, 53, 53, 57, 61, 614, 614, 53,
-    57, 53, 57, 58, 53, 57, 53, 57, 57, 57, 53, 57, 53, 57, 53, 53, 53, 53,
-    53, 82, 53, 53, 53, 53, 53, 57, 53, 57, 82, 82, 82, 82, 82, 82, 82, 58,
-    60, 60, 57, 58, 58, 58, 58, 58, 615, 615, 616, 615, 615, 615, 617, 615,
-    615, 615, 615, 616, 615, 615, 615, 615, 615, 615, 615, 615, 615, 615,
-    615, 615, 615, 615, 615, 618, 618, 616, 616, 618, 619, 619, 619, 619, 82,
-    82, 82, 82, 620, 620, 620, 620, 620, 620, 313, 313, 503, 512, 82, 82, 82,
-    82, 82, 82, 621, 621, 621, 621, 621, 621, 621, 621, 621, 621, 621, 621,
-    622, 622, 623, 623, 624, 624, 625, 625, 625, 625, 625, 625, 625, 625,
-    625, 625, 625, 625, 625, 625, 625, 625, 625, 625, 624, 624, 624, 624,
-    624, 624, 624, 624, 624, 624, 624, 624, 624, 624, 624, 624, 626, 627, 82,
-    82, 82, 82, 82, 82, 82, 82, 628, 628, 629, 629, 629, 629, 629, 629, 629,
-    629, 629, 629, 82, 82, 82, 82, 82, 82, 198, 198, 198, 198, 198, 198, 198,
-    198, 198, 198, 195, 195, 195, 195, 195, 195, 201, 201, 201, 195, 630,
-    195, 82, 82, 631, 631, 631, 631, 631, 631, 631, 631, 631, 631, 632, 632,
-    632, 632, 632, 632, 632, 632, 632, 632, 632, 632, 632, 632, 632, 632,
-    632, 632, 632, 632, 633, 633, 633, 633, 633, 634, 634, 634, 199, 635,
-    636, 636, 636, 636, 636, 636, 636, 636, 636, 636, 636, 636, 636, 636,
-    636, 637, 637, 637, 637, 637, 637, 637, 637, 637, 637, 637, 638, 639, 82,
-    82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 640, 328, 328, 328, 328, 328, 82,
-    82, 82, 641, 641, 641, 642, 643, 643, 643, 643, 643, 643, 643, 643, 643,
-    643, 643, 643, 643, 643, 643, 644, 642, 642, 641, 641, 641, 641, 642,
-    642, 641, 642, 642, 642, 645, 646, 646, 646, 646, 646, 646, 647, 647,
-    647, 646, 646, 646, 646, 82, 62, 648, 648, 648, 648, 648, 648, 648, 648,
-    648, 648, 82, 82, 82, 82, 646, 646, 314, 314, 314, 314, 314, 316, 649,
-    314, 319, 319, 314, 314, 314, 314, 314, 82, 650, 650, 650, 650, 650, 650,
-    650, 650, 650, 651, 651, 651, 651, 651, 651, 652, 652, 651, 651, 652,
-    652, 651, 651, 82, 650, 650, 650, 651, 650, 650, 650, 650, 650, 650, 650,
-    650, 651, 652, 82, 82, 653, 653, 653, 653, 653, 653, 653, 653, 653, 653,
-    82, 82, 654, 655, 655, 655, 649, 314, 314, 314, 314, 314, 314, 323, 323,
-    323, 314, 315, 316, 315, 314, 314, 656, 656, 656, 656, 656, 656, 656,
-    656, 657, 656, 657, 657, 658, 656, 656, 657, 657, 656, 656, 656, 656,
-    656, 657, 657, 656, 657, 656, 82, 82, 82, 82, 82, 82, 82, 82, 656, 656,
-    659, 660, 660, 661, 661, 661, 661, 661, 661, 661, 661, 661, 661, 661,
-    662, 663, 663, 662, 662, 664, 664, 661, 665, 665, 662, 666, 82, 82, 331,
-    331, 331, 331, 331, 331, 82, 57, 57, 57, 614, 60, 60, 60, 60, 57, 57, 57,
-    57, 57, 80, 82, 82, 338, 338, 338, 338, 338, 338, 338, 338, 661, 661,
-    661, 662, 662, 663, 662, 662, 663, 662, 662, 664, 662, 666, 82, 82, 667,
-    667, 667, 667, 667, 667, 667, 667, 667, 667, 82, 82, 82, 82, 82, 82, 668,
-    669, 669, 669, 669, 669, 669, 669, 669, 669, 669, 669, 669, 669, 669,
-    669, 669, 669, 669, 669, 668, 669, 669, 669, 669, 669, 669, 669, 82, 82,
-    82, 82, 329, 329, 329, 329, 329, 329, 329, 82, 82, 82, 82, 330, 330, 330,
-    330, 330, 330, 330, 330, 330, 82, 82, 82, 82, 670, 670, 670, 670, 670,
-    670, 670, 670, 671, 671, 671, 671, 671, 671, 671, 671, 593, 593, 594,
-    594, 594, 594, 594, 594, 57, 57, 57, 57, 57, 57, 57, 82, 82, 82, 82, 102,
-    102, 102, 102, 102, 82, 82, 82, 82, 82, 130, 672, 130, 130, 673, 130,
-    130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 82, 130, 130,
-    130, 130, 130, 82, 130, 82, 130, 130, 82, 130, 130, 82, 130, 130, 147,
-    147, 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, 674,
-    674, 674, 674, 82, 82, 82, 82, 82, 82, 82, 82, 82, 147, 147, 147, 147,
-    147, 147, 147, 147, 147, 147, 147, 675, 471, 82, 82, 147, 147, 147, 147,
-    147, 147, 147, 147, 147, 147, 136, 139, 82, 82, 676, 676, 676, 676, 676,
-    676, 676, 676, 677, 557, 557, 677, 677, 678, 678, 563, 564, 679, 82, 82,
-    82, 82, 82, 82, 97, 97, 97, 97, 97, 97, 97, 157, 157, 157, 157, 157, 157,
-    157, 96, 96, 558, 570, 570, 680, 680, 563, 564, 563, 564, 563, 564, 563,
-    564, 563, 564, 563, 564, 563, 564, 563, 564, 558, 558, 563, 564, 558,
-    558, 558, 558, 680, 680, 680, 681, 558, 681, 82, 581, 682, 678, 678, 570,
-    524, 525, 524, 525, 524, 525, 683, 558, 558, 684, 685, 686, 686, 687, 82,
-    558, 688, 689, 558, 82, 82, 82, 82, 147, 147, 147, 147, 147, 82, 82, 493,
-    82, 690, 691, 692, 693, 694, 691, 691, 695, 696, 691, 697, 698, 699, 698,
-    700, 701, 701, 701, 701, 701, 701, 701, 701, 701, 701, 702, 703, 704,
-    705, 704, 690, 691, 706, 706, 706, 706, 706, 706, 706, 706, 706, 706,
-    706, 706, 706, 706, 706, 706, 706, 706, 695, 691, 696, 707, 708, 707,
-    709, 709, 709, 709, 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
-    709, 709, 709, 709, 695, 705, 696, 705, 695, 696, 710, 711, 712, 710,
-    713, 714, 715, 715, 715, 715, 715, 715, 715, 715, 715, 716, 714, 714,
-    714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, 714,
-    714, 714, 714, 714, 714, 717, 717, 718, 718, 718, 718, 718, 718, 718,
-    718, 718, 718, 718, 718, 718, 718, 718, 82, 82, 82, 718, 718, 718, 718,
-    718, 718, 82, 82, 718, 718, 718, 82, 82, 82, 719, 693, 705, 707, 720,
-    693, 693, 82, 721, 722, 722, 722, 722, 721, 721, 82, 82, 723, 723, 723,
-    724, 508, 82, 82, 725, 725, 725, 725, 725, 725, 725, 725, 725, 725, 725,
-    725, 82, 725, 725, 725, 725, 725, 725, 725, 725, 725, 725, 82, 725, 725,
-    725, 82, 725, 725, 82, 725, 725, 725, 725, 725, 725, 725, 82, 82, 725,
-    725, 725, 82, 82, 82, 82, 82, 199, 373, 199, 82, 82, 82, 82, 620, 620,
-    620, 620, 620, 620, 620, 620, 620, 620, 620, 620, 620, 82, 82, 82, 313,
-    726, 726, 726, 726, 726, 726, 726, 726, 726, 726, 726, 726, 726, 727,
-    727, 727, 727, 728, 728, 728, 728, 728, 728, 728, 728, 728, 728, 728,
-    728, 728, 728, 728, 728, 728, 727, 727, 728, 729, 729, 82, 41, 41, 41,
-    41, 82, 82, 82, 82, 728, 82, 82, 82, 82, 82, 82, 82, 313, 313, 313, 313,
-    313, 157, 82, 82, 730, 730, 730, 730, 730, 730, 730, 730, 730, 730, 730,
-    730, 730, 82, 82, 82, 731, 731, 731, 731, 731, 731, 731, 731, 731, 82,
-    82, 82, 82, 82, 82, 82, 157, 500, 500, 500, 500, 500, 500, 500, 500, 500,
-    500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 82, 82, 82, 82, 732,
-    732, 732, 732, 732, 732, 732, 732, 733, 733, 733, 733, 82, 82, 82, 82,
-    734, 734, 734, 734, 734, 734, 734, 734, 734, 735, 734, 734, 734, 734,
-    734, 734, 734, 734, 735, 82, 82, 82, 82, 82, 736, 736, 736, 736, 736,
-    736, 736, 736, 736, 736, 736, 736, 736, 736, 737, 737, 737, 737, 737, 82,
-    82, 82, 82, 82, 738, 738, 738, 738, 738, 738, 738, 738, 738, 738, 738,
-    738, 738, 738, 82, 739, 740, 740, 740, 740, 740, 740, 740, 740, 740, 740,
-    740, 740, 82, 82, 82, 82, 741, 742, 742, 742, 742, 742, 82, 82, 743, 743,
-    743, 743, 743, 743, 743, 743, 744, 744, 744, 744, 744, 744, 744, 744,
-    745, 745, 745, 745, 745, 745, 745, 745, 746, 746, 746, 746, 746, 746,
-    746, 746, 746, 746, 746, 746, 746, 746, 82, 82, 747, 747, 747, 747, 747,
-    747, 747, 747, 747, 747, 82, 82, 82, 82, 82, 82, 748, 748, 748, 748, 748,
-    748, 748, 748, 748, 748, 748, 748, 82, 82, 82, 82, 749, 749, 749, 749,
-    749, 749, 749, 749, 749, 749, 749, 749, 82, 82, 82, 82, 750, 750, 750,
-    750, 750, 750, 750, 750, 751, 751, 751, 751, 751, 751, 751, 751, 751,
-    751, 751, 751, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 752, 753, 753,
-    753, 753, 753, 753, 753, 753, 753, 753, 753, 753, 753, 753, 753, 82, 753,
-    753, 753, 753, 753, 753, 82, 82, 754, 754, 754, 754, 754, 754, 82, 82,
-    754, 82, 754, 754, 754, 754, 754, 754, 754, 754, 754, 754, 754, 754, 754,
-    754, 754, 754, 754, 754, 754, 754, 82, 754, 754, 82, 82, 82, 754, 82, 82,
-    754, 755, 755, 755, 755, 755, 755, 755, 755, 755, 755, 755, 755, 755,
-    755, 82, 756, 757, 757, 757, 757, 757, 757, 757, 757, 758, 758, 758, 758,
-    758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 759, 759, 760,
-    760, 760, 760, 760, 760, 760, 761, 761, 761, 761, 761, 761, 761, 761,
-    761, 761, 761, 761, 761, 761, 761, 82, 82, 82, 82, 82, 82, 82, 82, 762,
-    762, 762, 762, 762, 762, 762, 762, 762, 763, 763, 763, 763, 763, 763,
-    763, 763, 763, 763, 763, 82, 763, 763, 82, 82, 82, 82, 82, 764, 764, 764,
-    764, 764, 765, 765, 765, 765, 765, 765, 765, 765, 765, 765, 765, 765,
-    765, 765, 766, 766, 766, 766, 766, 766, 82, 82, 82, 767, 768, 768, 768,
-    768, 768, 768, 768, 768, 768, 768, 82, 82, 82, 82, 82, 769, 770, 770,
-    770, 770, 770, 770, 770, 770, 771, 771, 771, 771, 771, 771, 771, 771, 82,
-    82, 82, 82, 772, 772, 771, 771, 772, 772, 772, 772, 772, 772, 772, 772,
-    82, 82, 772, 772, 772, 772, 772, 772, 773, 774, 774, 774, 82, 774, 774,
-    82, 82, 82, 82, 82, 774, 775, 774, 776, 773, 773, 773, 773, 82, 773, 773,
-    773, 82, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773,
-    773, 773, 773, 773, 773, 773, 82, 82, 82, 82, 776, 777, 775, 82, 82, 82,
-    82, 778, 779, 779, 779, 779, 779, 779, 779, 779, 780, 780, 780, 780, 780,
-    780, 780, 780, 781, 82, 82, 82, 82, 82, 82, 82, 782, 782, 782, 782, 782,
-    782, 782, 782, 782, 782, 782, 782, 782, 783, 783, 784, 785, 785, 785,
-    785, 785, 785, 785, 785, 785, 785, 785, 785, 785, 786, 786, 786, 787,
-    787, 787, 787, 787, 787, 787, 787, 788, 787, 787, 787, 787, 787, 787,
-    787, 787, 787, 787, 787, 787, 789, 790, 82, 82, 82, 82, 791, 791, 791,
-    791, 791, 792, 792, 792, 792, 792, 792, 793, 82, 794, 794, 794, 794, 794,
-    794, 794, 794, 794, 794, 794, 794, 794, 794, 82, 82, 82, 795, 795, 795,
-    795, 795, 795, 795, 796, 796, 796, 796, 796, 796, 796, 796, 796, 796,
-    796, 796, 796, 796, 82, 82, 797, 797, 797, 797, 797, 797, 797, 797, 798,
-    798, 798, 798, 798, 798, 798, 798, 798, 798, 798, 82, 82, 82, 82, 82,
-    799, 799, 799, 799, 799, 799, 799, 799, 800, 800, 800, 800, 800, 800,
-    800, 800, 800, 800, 82, 82, 82, 82, 82, 82, 82, 801, 801, 801, 801, 82,
-    82, 82, 82, 802, 802, 802, 802, 802, 802, 802, 803, 803, 803, 803, 803,
-    803, 803, 803, 803, 82, 82, 82, 82, 82, 82, 82, 804, 804, 804, 804, 804,
-    804, 804, 804, 804, 804, 804, 82, 82, 82, 82, 82, 805, 805, 805, 805,
-    805, 805, 805, 805, 805, 805, 805, 82, 82, 82, 82, 82, 82, 82, 806, 806,
-    806, 806, 806, 806, 807, 807, 807, 807, 807, 807, 807, 807, 807, 807,
-    807, 807, 807, 807, 807, 82, 808, 809, 808, 810, 810, 810, 810, 810, 810,
-    810, 810, 810, 810, 810, 810, 810, 809, 809, 809, 809, 809, 809, 809,
-    809, 809, 809, 809, 809, 809, 809, 811, 812, 812, 813, 813, 813, 813,
-    813, 82, 82, 82, 82, 814, 814, 814, 814, 814, 814, 814, 814, 814, 814,
-    814, 814, 814, 814, 814, 814, 814, 814, 814, 814, 815, 815, 815, 815,
-    815, 815, 815, 815, 815, 815, 82, 82, 82, 82, 82, 82, 82, 811, 816, 816,
-    817, 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, 818,
-    817, 817, 817, 816, 816, 816, 816, 817, 817, 819, 820, 821, 821, 822,
-    823, 823, 823, 823, 82, 82, 82, 82, 82, 82, 824, 824, 824, 824, 824, 824,
-    824, 824, 824, 82, 82, 82, 82, 82, 82, 82, 825, 825, 825, 825, 825, 825,
-    825, 825, 825, 825, 82, 82, 82, 82, 82, 82, 826, 826, 826, 827, 827, 827,
-    827, 827, 827, 827, 827, 827, 827, 827, 827, 827, 827, 827, 827, 827,
-    827, 827, 827, 828, 828, 828, 828, 828, 829, 828, 828, 828, 828, 828,
-    828, 830, 830, 82, 831, 831, 831, 831, 831, 831, 831, 831, 831, 831, 832,
-    832, 832, 832, 82, 82, 82, 82, 833, 833, 833, 833, 833, 833, 833, 833,
-    833, 833, 833, 834, 835, 836, 833, 82, 837, 837, 838, 839, 839, 839, 839,
-    839, 839, 839, 839, 839, 839, 839, 839, 839, 839, 839, 839, 838, 838,
-    838, 837, 837, 837, 837, 837, 837, 837, 837, 837, 838, 840, 839, 839,
-    839, 839, 841, 841, 842, 841, 842, 843, 837, 837, 842, 82, 82, 844, 844,
-    844, 844, 844, 844, 844, 844, 844, 844, 839, 845, 839, 841, 841, 841, 82,
-    846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846,
-    846, 846, 846, 846, 846, 846, 82, 82, 82, 847, 847, 847, 847, 847, 847,
-    847, 847, 847, 847, 82, 847, 847, 847, 847, 847, 847, 847, 847, 847, 848,
-    848, 848, 849, 849, 849, 848, 848, 849, 850, 851, 849, 852, 852, 853,
-    852, 852, 853, 849, 82, 854, 854, 854, 854, 854, 854, 854, 82, 854, 82,
-    854, 854, 854, 854, 82, 854, 854, 854, 854, 854, 854, 854, 854, 854, 854,
-    854, 854, 854, 854, 854, 82, 854, 854, 855, 82, 82, 82, 82, 82, 82, 856,
-    856, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856,
-    857, 858, 858, 858, 857, 857, 857, 857, 857, 857, 859, 860, 82, 82, 82,
-    82, 82, 861, 861, 861, 861, 861, 861, 861, 861, 861, 861, 82, 82, 82, 82,
-    82, 82, 862, 862, 863, 863, 82, 864, 864, 864, 864, 864, 864, 864, 864,
-    82, 82, 864, 864, 82, 82, 864, 864, 864, 864, 864, 864, 864, 864, 864,
-    864, 864, 864, 864, 864, 82, 864, 864, 864, 864, 864, 864, 864, 82, 864,
-    864, 82, 864, 864, 864, 864, 864, 82, 82, 865, 864, 863, 863, 862, 863,
-    863, 863, 863, 82, 82, 863, 863, 82, 82, 863, 863, 866, 82, 82, 864, 82,
-    82, 82, 82, 82, 82, 863, 82, 82, 82, 82, 82, 864, 864, 864, 864, 864,
-    863, 863, 82, 82, 867, 867, 867, 867, 867, 867, 867, 82, 82, 82, 868,
-    868, 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, 869, 869,
-    869, 870, 870, 870, 870, 870, 870, 870, 870, 869, 869, 871, 870, 870,
-    869, 872, 868, 868, 868, 868, 873, 873, 873, 873, 874, 875, 875, 875,
-    875, 875, 875, 875, 875, 875, 875, 82, 873, 82, 874, 82, 82, 876, 876,
-    876, 876, 876, 876, 876, 876, 877, 877, 877, 878, 878, 878, 878, 878,
-    878, 877, 878, 877, 877, 877, 877, 878, 878, 877, 879, 880, 876, 876,
-    881, 876, 882, 882, 882, 882, 882, 882, 882, 882, 882, 882, 82, 82, 82,
-    82, 82, 82, 883, 883, 883, 883, 883, 883, 883, 883, 883, 883, 883, 883,
-    883, 883, 883, 884, 884, 884, 885, 885, 885, 885, 82, 82, 884, 884, 884,
-    884, 885, 885, 884, 886, 887, 888, 889, 889, 890, 890, 891, 891, 891,
-    889, 889, 889, 889, 889, 889, 889, 889, 889, 889, 889, 889, 889, 889,
-    889, 883, 883, 883, 883, 885, 885, 82, 82, 892, 892, 892, 892, 892, 892,
-    892, 892, 893, 893, 893, 894, 894, 894, 894, 894, 894, 894, 894, 893,
-    893, 894, 893, 895, 894, 896, 896, 897, 892, 82, 82, 82, 898, 898, 898,
-    898, 898, 898, 898, 898, 898, 898, 82, 82, 82, 82, 82, 82, 899, 899, 899,
-    899, 899, 899, 899, 899, 899, 899, 899, 899, 899, 82, 82, 82, 900, 900,
-    900, 900, 900, 900, 900, 900, 900, 900, 900, 901, 902, 901, 902, 902,
-    901, 901, 901, 901, 901, 901, 903, 904, 905, 905, 905, 905, 905, 905,
-    905, 905, 905, 905, 82, 82, 82, 82, 82, 82, 906, 906, 906, 906, 906, 906,
-    906, 906, 906, 906, 82, 82, 82, 907, 907, 907, 908, 908, 907, 907, 907,
-    907, 908, 907, 907, 907, 907, 909, 82, 82, 82, 82, 910, 910, 910, 910,
-    910, 910, 910, 910, 910, 910, 911, 911, 912, 912, 912, 913, 914, 914,
-    914, 914, 914, 914, 914, 914, 915, 915, 915, 915, 915, 915, 915, 915,
-    916, 916, 916, 916, 916, 916, 916, 916, 916, 916, 917, 917, 917, 917,
-    917, 917, 917, 917, 917, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
-    918, 919, 919, 919, 919, 919, 919, 919, 919, 919, 82, 82, 82, 82, 82, 82,
-    82, 920, 920, 920, 920, 920, 920, 920, 920, 920, 82, 920, 920, 920, 920,
-    920, 920, 920, 920, 920, 920, 920, 920, 920, 921, 922, 922, 922, 922,
-    922, 922, 922, 82, 922, 922, 922, 922, 922, 922, 921, 923, 920, 924, 924,
-    924, 924, 924, 82, 82, 925, 925, 925, 925, 925, 925, 925, 925, 925, 925,
-    926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, 926,
-    926, 926, 926, 926, 926, 82, 82, 82, 927, 928, 929, 929, 929, 929, 929,
-    929, 929, 929, 929, 929, 929, 929, 929, 929, 82, 82, 930, 930, 930, 930,
-    930, 930, 930, 930, 930, 930, 930, 930, 930, 930, 82, 931, 930, 930, 930,
-    930, 930, 930, 930, 931, 930, 930, 931, 930, 930, 82, 932, 932, 932, 932,
-    932, 932, 932, 932, 932, 932, 82, 82, 82, 82, 82, 82, 933, 933, 933, 933,
-    933, 933, 933, 933, 933, 933, 933, 933, 933, 933, 933, 82, 934, 934, 934,
-    934, 934, 82, 82, 82, 932, 932, 932, 932, 82, 82, 82, 82, 935, 935, 935,
-    935, 935, 935, 935, 935, 936, 936, 936, 937, 937, 937, 935, 935, 935,
-    935, 937, 935, 935, 935, 936, 937, 936, 937, 935, 935, 935, 935, 935,
-    935, 935, 936, 937, 937, 935, 935, 935, 935, 935, 935, 935, 935, 935,
-    935, 935, 82, 938, 938, 938, 938, 938, 938, 938, 938, 938, 938, 938, 938,
-    938, 938, 939, 940, 938, 938, 938, 938, 938, 938, 938, 82, 609, 82, 82,
-    82, 82, 82, 82, 82, 941, 941, 941, 941, 941, 941, 941, 941, 941, 941,
-    941, 941, 941, 941, 941, 82, 942, 942, 942, 942, 942, 942, 942, 942, 942,
-    942, 82, 82, 82, 82, 943, 943, 944, 944, 944, 944, 944, 944, 944, 944,
-    944, 944, 944, 944, 944, 944, 82, 82, 945, 945, 945, 945, 945, 946, 82,
-    82, 947, 947, 947, 947, 947, 947, 947, 947, 948, 948, 948, 948, 948, 948,
-    948, 949, 949, 949, 950, 950, 951, 951, 951, 951, 952, 952, 952, 952,
-    949, 951, 82, 82, 953, 953, 953, 953, 953, 953, 953, 953, 953, 953, 82,
-    954, 954, 954, 954, 954, 954, 954, 82, 947, 947, 947, 947, 947, 82, 82,
-    82, 82, 82, 947, 947, 947, 955, 955, 955, 955, 955, 955, 955, 955, 955,
-    955, 955, 955, 955, 82, 82, 82, 955, 956, 956, 956, 956, 956, 956, 956,
-    956, 956, 956, 956, 956, 956, 956, 956, 956, 956, 956, 956, 956, 956,
-    956, 82, 82, 82, 82, 82, 82, 82, 82, 957, 957, 957, 957, 958, 958, 958,
-    958, 958, 958, 958, 958, 958, 958, 958, 958, 958, 959, 82, 82, 82, 82,
-    82, 82, 82, 960, 960, 960, 960, 960, 960, 960, 960, 960, 960, 960, 960,
-    960, 82, 82, 82, 960, 960, 960, 82, 82, 82, 82, 82, 580, 575, 82, 82, 82,
-    82, 82, 82, 961, 961, 961, 961, 961, 961, 961, 961, 961, 961, 961, 82,
-    82, 82, 82, 82, 961, 961, 961, 961, 961, 82, 82, 82, 961, 82, 82, 82, 82,
-    82, 82, 82, 961, 961, 82, 82, 962, 963, 964, 965, 499, 499, 499, 499, 82,
-    82, 82, 82, 313, 313, 313, 313, 313, 313, 82, 82, 313, 313, 313, 313,
-    313, 313, 313, 82, 82, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
-    313, 313, 966, 966, 447, 447, 447, 313, 313, 313, 967, 966, 966, 966,
-    966, 966, 499, 499, 499, 499, 499, 499, 499, 499, 157, 157, 157, 157,
-    157, 157, 157, 157, 313, 313, 97, 97, 97, 97, 97, 157, 157, 313, 313,
-    313, 313, 313, 313, 97, 97, 97, 97, 313, 313, 313, 82, 82, 82, 82, 82,
-    82, 82, 728, 728, 968, 968, 968, 728, 82, 82, 620, 620, 82, 82, 82, 82,
-    82, 82, 506, 506, 506, 506, 506, 506, 506, 506, 506, 506, 50, 50, 50, 50,
-    50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 506, 506, 506,
-    506, 506, 506, 506, 506, 506, 506, 50, 50, 50, 50, 50, 50, 50, 82, 50,
-    50, 50, 50, 50, 50, 506, 82, 506, 506, 82, 82, 506, 82, 82, 506, 506, 82,
-    82, 506, 506, 506, 506, 82, 506, 506, 50, 50, 82, 50, 82, 50, 50, 50, 50,
-    50, 50, 50, 82, 50, 50, 50, 50, 50, 50, 50, 506, 506, 82, 506, 506, 506,
-    506, 82, 82, 506, 506, 506, 506, 506, 506, 506, 506, 82, 506, 506, 506,
-    506, 506, 506, 506, 82, 50, 50, 506, 506, 82, 506, 506, 506, 506, 82,
-    506, 506, 506, 506, 506, 82, 506, 82, 82, 82, 506, 506, 506, 506, 506,
-    506, 506, 82, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 82, 82,
-    506, 969, 50, 50, 50, 50, 50, 50, 50, 50, 50, 513, 50, 50, 50, 50, 50,
-    50, 506, 506, 506, 506, 506, 506, 506, 506, 506, 969, 50, 50, 50, 50, 50,
-    50, 50, 50, 50, 513, 50, 50, 506, 506, 506, 506, 506, 969, 50, 50, 50,
-    50, 50, 50, 50, 50, 50, 513, 50, 50, 50, 50, 50, 50, 506, 506, 506, 506,
-    506, 506, 506, 506, 506, 969, 50, 513, 50, 50, 50, 50, 50, 50, 50, 50,
-    506, 50, 82, 82, 970, 970, 970, 970, 970, 970, 970, 970, 970, 970, 971,
-    971, 971, 971, 971, 971, 971, 971, 972, 972, 972, 972, 972, 972, 972,
-    972, 972, 972, 972, 972, 972, 972, 972, 971, 971, 971, 971, 972, 972,
-    972, 972, 972, 972, 972, 972, 972, 972, 971, 971, 971, 971, 971, 971,
-    971, 971, 972, 971, 971, 971, 971, 971, 971, 972, 971, 971, 973, 973,
-    973, 973, 974, 82, 82, 82, 82, 82, 82, 82, 972, 972, 972, 972, 972, 82,
-    972, 972, 972, 972, 972, 972, 972, 975, 975, 975, 975, 975, 975, 975, 82,
-    975, 975, 975, 975, 975, 975, 975, 975, 975, 82, 82, 975, 975, 975, 975,
-    975, 975, 975, 82, 975, 975, 82, 975, 975, 975, 975, 975, 82, 82, 82, 82,
-    82, 976, 976, 976, 976, 976, 976, 976, 976, 976, 976, 976, 976, 976, 82,
-    82, 977, 977, 977, 977, 977, 977, 977, 977, 977, 978, 978, 978, 978, 978,
-    978, 978, 82, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 980, 980,
-    980, 980, 980, 980, 980, 980, 980, 980, 980, 980, 980, 980, 980, 980,
-    980, 980, 981, 981, 981, 981, 981, 981, 982, 82, 82, 82, 82, 82, 983,
-    983, 983, 983, 983, 983, 983, 983, 983, 983, 82, 82, 82, 82, 984, 984,
-    147, 147, 147, 147, 82, 147, 147, 147, 82, 147, 147, 82, 147, 82, 82,
-    147, 82, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 82, 147, 147,
-    147, 147, 82, 147, 82, 147, 82, 82, 82, 82, 82, 82, 147, 82, 82, 82, 82,
-    147, 82, 147, 82, 147, 82, 147, 147, 147, 82, 147, 82, 147, 82, 147, 82,
-    147, 82, 147, 147, 147, 147, 82, 147, 82, 147, 147, 82, 147, 147, 147,
-    147, 147, 147, 147, 147, 147, 82, 82, 82, 82, 82, 147, 147, 147, 82, 147,
-    147, 147, 133, 133, 82, 82, 82, 82, 82, 82, 527, 527, 527, 527, 523, 527,
-    527, 527, 527, 527, 527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
-    985, 985, 985, 985, 985, 985, 985, 985, 985, 985, 985, 985, 527, 527,
-    527, 527, 527, 527, 527, 985, 985, 527, 527, 527, 527, 527, 527, 527,
-    527, 527, 527, 527, 527, 527, 527, 523, 527, 527, 527, 527, 527, 527,
-    985, 985, 48, 48, 48, 516, 516, 985, 985, 985, 528, 528, 528, 528, 528,
-    528, 313, 985, 528, 528, 41, 41, 985, 985, 985, 985, 528, 528, 528, 528,
-    528, 528, 986, 528, 528, 986, 986, 986, 986, 986, 986, 986, 986, 986,
-    986, 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, 985, 985, 985,
-    985, 985, 985, 985, 985, 985, 987, 987, 987, 987, 987, 987, 987, 987,
-    987, 987, 988, 586, 586, 985, 985, 985, 985, 985, 586, 586, 586, 586,
-    985, 985, 985, 985, 586, 985, 985, 985, 985, 985, 985, 985, 586, 586,
-    985, 985, 985, 985, 985, 985, 523, 527, 527, 527, 527, 527, 527, 527,
-    527, 527, 527, 527, 527, 523, 523, 523, 523, 523, 523, 523, 523, 523,
-    527, 523, 523, 523, 523, 523, 523, 527, 523, 523, 523, 523, 523, 523,
-    523, 534, 523, 523, 523, 523, 523, 523, 527, 527, 527, 527, 527, 527,
-    527, 527, 41, 41, 527, 527, 523, 523, 523, 523, 523, 526, 526, 523, 523,
-    523, 523, 523, 526, 523, 523, 523, 523, 523, 523, 534, 534, 523, 523,
-    523, 523, 523, 534, 532, 527, 527, 527, 523, 523, 527, 527, 527, 523,
-    527, 527, 527, 523, 523, 523, 989, 989, 989, 989, 989, 523, 523, 523,
-    523, 523, 523, 523, 527, 523, 527, 534, 534, 523, 523, 534, 534, 534,
-    534, 534, 534, 534, 534, 534, 534, 534, 523, 523, 523, 523, 523, 523,
-    523, 523, 523, 523, 523, 523, 523, 534, 534, 534, 534, 523, 523, 523,
-    523, 534, 523, 534, 523, 523, 523, 534, 523, 523, 523, 523, 534, 534,
-    534, 523, 534, 534, 534, 526, 523, 526, 523, 526, 523, 523, 523, 523,
-    523, 534, 523, 523, 523, 523, 526, 523, 526, 526, 523, 523, 523, 523,
-    523, 523, 523, 523, 523, 523, 527, 527, 523, 526, 526, 526, 526, 526,
-    526, 526, 523, 523, 523, 523, 523, 523, 523, 523, 526, 526, 526, 526,
-    526, 526, 523, 523, 523, 523, 523, 526, 526, 526, 526, 526, 526, 526,
-    526, 526, 526, 526, 526, 41, 41, 41, 41, 527, 523, 523, 523, 523, 527,
-    527, 527, 527, 527, 527, 532, 527, 527, 527, 527, 534, 527, 527, 527,
-    527, 527, 532, 527, 527, 527, 527, 534, 534, 527, 527, 527, 527, 527, 41,
-    41, 41, 41, 41, 41, 41, 41, 527, 527, 527, 527, 41, 41, 527, 523, 523,
-    523, 523, 523, 523, 523, 523, 523, 523, 534, 534, 534, 523, 523, 523,
-    534, 534, 534, 534, 534, 41, 41, 41, 41, 41, 41, 536, 536, 536, 990, 990,
-    990, 41, 41, 41, 41, 523, 523, 523, 534, 523, 523, 523, 523, 523, 523,
-    523, 523, 534, 534, 534, 523, 534, 523, 523, 523, 523, 523, 527, 527,
-    523, 523, 523, 985, 985, 985, 985, 985, 527, 527, 527, 523, 523, 985,
-    985, 985, 527, 527, 527, 527, 523, 523, 523, 985, 41, 41, 41, 41, 985,
-    985, 985, 985, 41, 41, 41, 41, 41, 985, 985, 985, 41, 41, 985, 985, 985,
-    985, 985, 985, 41, 41, 41, 41, 41, 41, 985, 985, 534, 534, 534, 534, 534,
-    534, 534, 985, 523, 523, 523, 523, 523, 523, 534, 523, 534, 985, 985,
-    534, 534, 534, 534, 534, 534, 534, 523, 523, 534, 534, 534, 985, 523,
-    523, 523, 523, 985, 985, 985, 985, 523, 523, 523, 523, 523, 523, 523,
-    985, 523, 523, 985, 985, 985, 985, 985, 985, 523, 985, 985, 985, 985,
-    985, 985, 985, 985, 985, 985, 985, 985, 985, 82, 82, 593, 593, 593, 593,
-    593, 593, 593, 594, 593, 593, 593, 593, 593, 594, 594, 594, 594, 594,
-    594, 594, 594, 594, 82, 82, 82, 499, 82, 82, 82, 82, 82, 82, 499, 499,
-    499, 499, 499, 499, 499, 499, 671, 671, 671, 671, 671, 671, 82, 82,
-};
-
-/* decomposition data */
-static const unsigned short decomp_data[] = {
-    0, 257, 32, 514, 32, 776, 259, 97, 514, 32, 772, 259, 50, 259, 51, 514,
-    32, 769, 258, 956, 514, 32, 807, 259, 49, 259, 111, 772, 49, 8260, 52,
-    772, 49, 8260, 50, 772, 51, 8260, 52, 512, 65, 768, 512, 65, 769, 512,
-    65, 770, 512, 65, 771, 512, 65, 776, 512, 65, 778, 512, 67, 807, 512, 69,
-    768, 512, 69, 769, 512, 69, 770, 512, 69, 776, 512, 73, 768, 512, 73,
-    769, 512, 73, 770, 512, 73, 776, 512, 78, 771, 512, 79, 768, 512, 79,
-    769, 512, 79, 770, 512, 79, 771, 512, 79, 776, 512, 85, 768, 512, 85,
-    769, 512, 85, 770, 512, 85, 776, 512, 89, 769, 512, 97, 768, 512, 97,
-    769, 512, 97, 770, 512, 97, 771, 512, 97, 776, 512, 97, 778, 512, 99,
-    807, 512, 101, 768, 512, 101, 769, 512, 101, 770, 512, 101, 776, 512,
-    105, 768, 512, 105, 769, 512, 105, 770, 512, 105, 776, 512, 110, 771,
-    512, 111, 768, 512, 111, 769, 512, 111, 770, 512, 111, 771, 512, 111,
-    776, 512, 117, 768, 512, 117, 769, 512, 117, 770, 512, 117, 776, 512,
-    121, 769, 512, 121, 776, 512, 65, 772, 512, 97, 772, 512, 65, 774, 512,
-    97, 774, 512, 65, 808, 512, 97, 808, 512, 67, 769, 512, 99, 769, 512, 67,
-    770, 512, 99, 770, 512, 67, 775, 512, 99, 775, 512, 67, 780, 512, 99,
-    780, 512, 68, 780, 512, 100, 780, 512, 69, 772, 512, 101, 772, 512, 69,
-    774, 512, 101, 774, 512, 69, 775, 512, 101, 775, 512, 69, 808, 512, 101,
-    808, 512, 69, 780, 512, 101, 780, 512, 71, 770, 512, 103, 770, 512, 71,
-    774, 512, 103, 774, 512, 71, 775, 512, 103, 775, 512, 71, 807, 512, 103,
-    807, 512, 72, 770, 512, 104, 770, 512, 73, 771, 512, 105, 771, 512, 73,
-    772, 512, 105, 772, 512, 73, 774, 512, 105, 774, 512, 73, 808, 512, 105,
-    808, 512, 73, 775, 514, 73, 74, 514, 105, 106, 512, 74, 770, 512, 106,
-    770, 512, 75, 807, 512, 107, 807, 512, 76, 769, 512, 108, 769, 512, 76,
-    807, 512, 108, 807, 512, 76, 780, 512, 108, 780, 514, 76, 183, 514, 108,
-    183, 512, 78, 769, 512, 110, 769, 512, 78, 807, 512, 110, 807, 512, 78,
-    780, 512, 110, 780, 514, 700, 110, 512, 79, 772, 512, 111, 772, 512, 79,
-    774, 512, 111, 774, 512, 79, 779, 512, 111, 779, 512, 82, 769, 512, 114,
-    769, 512, 82, 807, 512, 114, 807, 512, 82, 780, 512, 114, 780, 512, 83,
-    769, 512, 115, 769, 512, 83, 770, 512, 115, 770, 512, 83, 807, 512, 115,
-    807, 512, 83, 780, 512, 115, 780, 512, 84, 807, 512, 116, 807, 512, 84,
-    780, 512, 116, 780, 512, 85, 771, 512, 117, 771, 512, 85, 772, 512, 117,
-    772, 512, 85, 774, 512, 117, 774, 512, 85, 778, 512, 117, 778, 512, 85,
-    779, 512, 117, 779, 512, 85, 808, 512, 117, 808, 512, 87, 770, 512, 119,
-    770, 512, 89, 770, 512, 121, 770, 512, 89, 776, 512, 90, 769, 512, 122,
-    769, 512, 90, 775, 512, 122, 775, 512, 90, 780, 512, 122, 780, 258, 115,
-    512, 79, 795, 512, 111, 795, 512, 85, 795, 512, 117, 795, 514, 68, 381,
-    514, 68, 382, 514, 100, 382, 514, 76, 74, 514, 76, 106, 514, 108, 106,
-    514, 78, 74, 514, 78, 106, 514, 110, 106, 512, 65, 780, 512, 97, 780,
-    512, 73, 780, 512, 105, 780, 512, 79, 780, 512, 111, 780, 512, 85, 780,
-    512, 117, 780, 512, 220, 772, 512, 252, 772, 512, 220, 769, 512, 252,
-    769, 512, 220, 780, 512, 252, 780, 512, 220, 768, 512, 252, 768, 512,
-    196, 772, 512, 228, 772, 512, 550, 772, 512, 551, 772, 512, 198, 772,
-    512, 230, 772, 512, 71, 780, 512, 103, 780, 512, 75, 780, 512, 107, 780,
-    512, 79, 808, 512, 111, 808, 512, 490, 772, 512, 491, 772, 512, 439, 780,
-    512, 658, 780, 512, 106, 780, 514, 68, 90, 514, 68, 122, 514, 100, 122,
-    512, 71, 769, 512, 103, 769, 512, 78, 768, 512, 110, 768, 512, 197, 769,
-    512, 229, 769, 512, 198, 769, 512, 230, 769, 512, 216, 769, 512, 248,
-    769, 512, 65, 783, 512, 97, 783, 512, 65, 785, 512, 97, 785, 512, 69,
-    783, 512, 101, 783, 512, 69, 785, 512, 101, 785, 512, 73, 783, 512, 105,
-    783, 512, 73, 785, 512, 105, 785, 512, 79, 783, 512, 111, 783, 512, 79,
-    785, 512, 111, 785, 512, 82, 783, 512, 114, 783, 512, 82, 785, 512, 114,
-    785, 512, 85, 783, 512, 117, 783, 512, 85, 785, 512, 117, 785, 512, 83,
-    806, 512, 115, 806, 512, 84, 806, 512, 116, 806, 512, 72, 780, 512, 104,
-    780, 512, 65, 775, 512, 97, 775, 512, 69, 807, 512, 101, 807, 512, 214,
-    772, 512, 246, 772, 512, 213, 772, 512, 245, 772, 512, 79, 775, 512, 111,
-    775, 512, 558, 772, 512, 559, 772, 512, 89, 772, 512, 121, 772, 259, 104,
-    259, 614, 259, 106, 259, 114, 259, 633, 259, 635, 259, 641, 259, 119,
-    259, 121, 514, 32, 774, 514, 32, 775, 514, 32, 778, 514, 32, 808, 514,
-    32, 771, 514, 32, 779, 259, 611, 259, 108, 259, 115, 259, 120, 259, 661,
-    256, 768, 256, 769, 256, 787, 512, 776, 769, 256, 697, 514, 32, 837, 256,
-    59, 514, 32, 769, 512, 168, 769, 512, 913, 769, 256, 183, 512, 917, 769,
-    512, 919, 769, 512, 921, 769, 512, 927, 769, 512, 933, 769, 512, 937,
-    769, 512, 970, 769, 512, 921, 776, 512, 933, 776, 512, 945, 769, 512,
-    949, 769, 512, 951, 769, 512, 953, 769, 512, 971, 769, 512, 953, 776,
-    512, 965, 776, 512, 959, 769, 512, 965, 769, 512, 969, 769, 258, 946,
-    258, 952, 258, 933, 512, 978, 769, 512, 978, 776, 258, 966, 258, 960,
-    258, 954, 258, 961, 258, 962, 258, 920, 258, 949, 258, 931, 512, 1045,
-    768, 512, 1045, 776, 512, 1043, 769, 512, 1030, 776, 512, 1050, 769, 512,
-    1048, 768, 512, 1059, 774, 512, 1048, 774, 512, 1080, 774, 512, 1077,
-    768, 512, 1077, 776, 512, 1075, 769, 512, 1110, 776, 512, 1082, 769, 512,
-    1080, 768, 512, 1091, 774, 512, 1140, 783, 512, 1141, 783, 512, 1046,
-    774, 512, 1078, 774, 512, 1040, 774, 512, 1072, 774, 512, 1040, 776, 512,
-    1072, 776, 512, 1045, 774, 512, 1077, 774, 512, 1240, 776, 512, 1241,
-    776, 512, 1046, 776, 512, 1078, 776, 512, 1047, 776, 512, 1079, 776, 512,
-    1048, 772, 512, 1080, 772, 512, 1048, 776, 512, 1080, 776, 512, 1054,
-    776, 512, 1086, 776, 512, 1256, 776, 512, 1257, 776, 512, 1069, 776, 512,
-    1101, 776, 512, 1059, 772, 512, 1091, 772, 512, 1059, 776, 512, 1091,
-    776, 512, 1059, 779, 512, 1091, 779, 512, 1063, 776, 512, 1095, 776, 512,
-    1067, 776, 512, 1099, 776, 514, 1381, 1410, 512, 1575, 1619, 512, 1575,
-    1620, 512, 1608, 1620, 512, 1575, 1621, 512, 1610, 1620, 514, 1575, 1652,
-    514, 1608, 1652, 514, 1735, 1652, 514, 1610, 1652, 512, 1749, 1620, 512,
-    1729, 1620, 512, 1746, 1620, 512, 2344, 2364, 512, 2352, 2364, 512, 2355,
-    2364, 512, 2325, 2364, 512, 2326, 2364, 512, 2327, 2364, 512, 2332, 2364,
-    512, 2337, 2364, 512, 2338, 2364, 512, 2347, 2364, 512, 2351, 2364, 512,
-    2503, 2494, 512, 2503, 2519, 512, 2465, 2492, 512, 2466, 2492, 512, 2479,
-    2492, 512, 2610, 2620, 512, 2616, 2620, 512, 2582, 2620, 512, 2583, 2620,
-    512, 2588, 2620, 512, 2603, 2620, 512, 2887, 2902, 512, 2887, 2878, 512,
-    2887, 2903, 512, 2849, 2876, 512, 2850, 2876, 512, 2962, 3031, 512, 3014,
-    3006, 512, 3015, 3006, 512, 3014, 3031, 512, 3142, 3158, 512, 3263, 3285,
-    512, 3270, 3285, 512, 3270, 3286, 512, 3270, 3266, 512, 3274, 3285, 512,
-    3398, 3390, 512, 3399, 3390, 512, 3398, 3415, 512, 3545, 3530, 512, 3545,
-    3535, 512, 3548, 3530, 512, 3545, 3551, 514, 3661, 3634, 514, 3789, 3762,
-    514, 3755, 3737, 514, 3755, 3745, 257, 3851, 512, 3906, 4023, 512, 3916,
-    4023, 512, 3921, 4023, 512, 3926, 4023, 512, 3931, 4023, 512, 3904, 4021,
-    512, 3953, 3954, 512, 3953, 3956, 512, 4018, 3968, 514, 4018, 3969, 512,
-    4019, 3968, 514, 4019, 3969, 512, 3953, 3968, 512, 3986, 4023, 512, 3996,
-    4023, 512, 4001, 4023, 512, 4006, 4023, 512, 4011, 4023, 512, 3984, 4021,
-    512, 4133, 4142, 259, 4316, 512, 6917, 6965, 512, 6919, 6965, 512, 6921,
-    6965, 512, 6923, 6965, 512, 6925, 6965, 512, 6929, 6965, 512, 6970, 6965,
-    512, 6972, 6965, 512, 6974, 6965, 512, 6975, 6965, 512, 6978, 6965, 259,
-    65, 259, 198, 259, 66, 259, 68, 259, 69, 259, 398, 259, 71, 259, 72, 259,
-    73, 259, 74, 259, 75, 259, 76, 259, 77, 259, 78, 259, 79, 259, 546, 259,
-    80, 259, 82, 259, 84, 259, 85, 259, 87, 259, 97, 259, 592, 259, 593, 259,
-    7426, 259, 98, 259, 100, 259, 101, 259, 601, 259, 603, 259, 604, 259,
-    103, 259, 107, 259, 109, 259, 331, 259, 111, 259, 596, 259, 7446, 259,
-    7447, 259, 112, 259, 116, 259, 117, 259, 7453, 259, 623, 259, 118, 259,
-    7461, 259, 946, 259, 947, 259, 948, 259, 966, 259, 967, 261, 105, 261,
-    114, 261, 117, 261, 118, 261, 946, 261, 947, 261, 961, 261, 966, 261,
-    967, 259, 1085, 259, 594, 259, 99, 259, 597, 259, 240, 259, 604, 259,
-    102, 259, 607, 259, 609, 259, 613, 259, 616, 259, 617, 259, 618, 259,
-    7547, 259, 669, 259, 621, 259, 7557, 259, 671, 259, 625, 259, 624, 259,
-    626, 259, 627, 259, 628, 259, 629, 259, 632, 259, 642, 259, 643, 259,
-    427, 259, 649, 259, 650, 259, 7452, 259, 651, 259, 652, 259, 122, 259,
-    656, 259, 657, 259, 658, 259, 952, 512, 65, 805, 512, 97, 805, 512, 66,
-    775, 512, 98, 775, 512, 66, 803, 512, 98, 803, 512, 66, 817, 512, 98,
-    817, 512, 199, 769, 512, 231, 769, 512, 68, 775, 512, 100, 775, 512, 68,
-    803, 512, 100, 803, 512, 68, 817, 512, 100, 817, 512, 68, 807, 512, 100,
-    807, 512, 68, 813, 512, 100, 813, 512, 274, 768, 512, 275, 768, 512, 274,
-    769, 512, 275, 769, 512, 69, 813, 512, 101, 813, 512, 69, 816, 512, 101,
-    816, 512, 552, 774, 512, 553, 774, 512, 70, 775, 512, 102, 775, 512, 71,
-    772, 512, 103, 772, 512, 72, 775, 512, 104, 775, 512, 72, 803, 512, 104,
-    803, 512, 72, 776, 512, 104, 776, 512, 72, 807, 512, 104, 807, 512, 72,
-    814, 512, 104, 814, 512, 73, 816, 512, 105, 816, 512, 207, 769, 512, 239,
-    769, 512, 75, 769, 512, 107, 769, 512, 75, 803, 512, 107, 803, 512, 75,
-    817, 512, 107, 817, 512, 76, 803, 512, 108, 803, 512, 7734, 772, 512,
-    7735, 772, 512, 76, 817, 512, 108, 817, 512, 76, 813, 512, 108, 813, 512,
-    77, 769, 512, 109, 769, 512, 77, 775, 512, 109, 775, 512, 77, 803, 512,
-    109, 803, 512, 78, 775, 512, 110, 775, 512, 78, 803, 512, 110, 803, 512,
-    78, 817, 512, 110, 817, 512, 78, 813, 512, 110, 813, 512, 213, 769, 512,
-    245, 769, 512, 213, 776, 512, 245, 776, 512, 332, 768, 512, 333, 768,
-    512, 332, 769, 512, 333, 769, 512, 80, 769, 512, 112, 769, 512, 80, 775,
-    512, 112, 775, 512, 82, 775, 512, 114, 775, 512, 82, 803, 512, 114, 803,
-    512, 7770, 772, 512, 7771, 772, 512, 82, 817, 512, 114, 817, 512, 83,
-    775, 512, 115, 775, 512, 83, 803, 512, 115, 803, 512, 346, 775, 512, 347,
-    775, 512, 352, 775, 512, 353, 775, 512, 7778, 775, 512, 7779, 775, 512,
-    84, 775, 512, 116, 775, 512, 84, 803, 512, 116, 803, 512, 84, 817, 512,
-    116, 817, 512, 84, 813, 512, 116, 813, 512, 85, 804, 512, 117, 804, 512,
-    85, 816, 512, 117, 816, 512, 85, 813, 512, 117, 813, 512, 360, 769, 512,
-    361, 769, 512, 362, 776, 512, 363, 776, 512, 86, 771, 512, 118, 771, 512,
-    86, 803, 512, 118, 803, 512, 87, 768, 512, 119, 768, 512, 87, 769, 512,
-    119, 769, 512, 87, 776, 512, 119, 776, 512, 87, 775, 512, 119, 775, 512,
-    87, 803, 512, 119, 803, 512, 88, 775, 512, 120, 775, 512, 88, 776, 512,
-    120, 776, 512, 89, 775, 512, 121, 775, 512, 90, 770, 512, 122, 770, 512,
-    90, 803, 512, 122, 803, 512, 90, 817, 512, 122, 817, 512, 104, 817, 512,
-    116, 776, 512, 119, 778, 512, 121, 778, 514, 97, 702, 512, 383, 775, 512,
-    65, 803, 512, 97, 803, 512, 65, 777, 512, 97, 777, 512, 194, 769, 512,
-    226, 769, 512, 194, 768, 512, 226, 768, 512, 194, 777, 512, 226, 777,
-    512, 194, 771, 512, 226, 771, 512, 7840, 770, 512, 7841, 770, 512, 258,
-    769, 512, 259, 769, 512, 258, 768, 512, 259, 768, 512, 258, 777, 512,
-    259, 777, 512, 258, 771, 512, 259, 771, 512, 7840, 774, 512, 7841, 774,
-    512, 69, 803, 512, 101, 803, 512, 69, 777, 512, 101, 777, 512, 69, 771,
-    512, 101, 771, 512, 202, 769, 512, 234, 769, 512, 202, 768, 512, 234,
-    768, 512, 202, 777, 512, 234, 777, 512, 202, 771, 512, 234, 771, 512,
-    7864, 770, 512, 7865, 770, 512, 73, 777, 512, 105, 777, 512, 73, 803,
-    512, 105, 803, 512, 79, 803, 512, 111, 803, 512, 79, 777, 512, 111, 777,
-    512, 212, 769, 512, 244, 769, 512, 212, 768, 512, 244, 768, 512, 212,
-    777, 512, 244, 777, 512, 212, 771, 512, 244, 771, 512, 7884, 770, 512,
-    7885, 770, 512, 416, 769, 512, 417, 769, 512, 416, 768, 512, 417, 768,
-    512, 416, 777, 512, 417, 777, 512, 416, 771, 512, 417, 771, 512, 416,
-    803, 512, 417, 803, 512, 85, 803, 512, 117, 803, 512, 85, 777, 512, 117,
-    777, 512, 431, 769, 512, 432, 769, 512, 431, 768, 512, 432, 768, 512,
-    431, 777, 512, 432, 777, 512, 431, 771, 512, 432, 771, 512, 431, 803,
-    512, 432, 803, 512, 89, 768, 512, 121, 768, 512, 89, 803, 512, 121, 803,
-    512, 89, 777, 512, 121, 777, 512, 89, 771, 512, 121, 771, 512, 945, 787,
-    512, 945, 788, 512, 7936, 768, 512, 7937, 768, 512, 7936, 769, 512, 7937,
-    769, 512, 7936, 834, 512, 7937, 834, 512, 913, 787, 512, 913, 788, 512,
-    7944, 768, 512, 7945, 768, 512, 7944, 769, 512, 7945, 769, 512, 7944,
-    834, 512, 7945, 834, 512, 949, 787, 512, 949, 788, 512, 7952, 768, 512,
-    7953, 768, 512, 7952, 769, 512, 7953, 769, 512, 917, 787, 512, 917, 788,
-    512, 7960, 768, 512, 7961, 768, 512, 7960, 769, 512, 7961, 769, 512, 951,
-    787, 512, 951, 788, 512, 7968, 768, 512, 7969, 768, 512, 7968, 769, 512,
-    7969, 769, 512, 7968, 834, 512, 7969, 834, 512, 919, 787, 512, 919, 788,
-    512, 7976, 768, 512, 7977, 768, 512, 7976, 769, 512, 7977, 769, 512,
-    7976, 834, 512, 7977, 834, 512, 953, 787, 512, 953, 788, 512, 7984, 768,
-    512, 7985, 768, 512, 7984, 769, 512, 7985, 769, 512, 7984, 834, 512,
-    7985, 834, 512, 921, 787, 512, 921, 788, 512, 7992, 768, 512, 7993, 768,
-    512, 7992, 769, 512, 7993, 769, 512, 7992, 834, 512, 7993, 834, 512, 959,
-    787, 512, 959, 788, 512, 8000, 768, 512, 8001, 768, 512, 8000, 769, 512,
-    8001, 769, 512, 927, 787, 512, 927, 788, 512, 8008, 768, 512, 8009, 768,
-    512, 8008, 769, 512, 8009, 769, 512, 965, 787, 512, 965, 788, 512, 8016,
-    768, 512, 8017, 768, 512, 8016, 769, 512, 8017, 769, 512, 8016, 834, 512,
-    8017, 834, 512, 933, 788, 512, 8025, 768, 512, 8025, 769, 512, 8025, 834,
-    512, 969, 787, 512, 969, 788, 512, 8032, 768, 512, 8033, 768, 512, 8032,
-    769, 512, 8033, 769, 512, 8032, 834, 512, 8033, 834, 512, 937, 787, 512,
-    937, 788, 512, 8040, 768, 512, 8041, 768, 512, 8040, 769, 512, 8041, 769,
-    512, 8040, 834, 512, 8041, 834, 512, 945, 768, 256, 940, 512, 949, 768,
-    256, 941, 512, 951, 768, 256, 942, 512, 953, 768, 256, 943, 512, 959,
-    768, 256, 972, 512, 965, 768, 256, 973, 512, 969, 768, 256, 974, 512,
-    7936, 837, 512, 7937, 837, 512, 7938, 837, 512, 7939, 837, 512, 7940,
-    837, 512, 7941, 837, 512, 7942, 837, 512, 7943, 837, 512, 7944, 837, 512,
-    7945, 837, 512, 7946, 837, 512, 7947, 837, 512, 7948, 837, 512, 7949,
-    837, 512, 7950, 837, 512, 7951, 837, 512, 7968, 837, 512, 7969, 837, 512,
-    7970, 837, 512, 7971, 837, 512, 7972, 837, 512, 7973, 837, 512, 7974,
-    837, 512, 7975, 837, 512, 7976, 837, 512, 7977, 837, 512, 7978, 837, 512,
-    7979, 837, 512, 7980, 837, 512, 7981, 837, 512, 7982, 837, 512, 7983,
-    837, 512, 8032, 837, 512, 8033, 837, 512, 8034, 837, 512, 8035, 837, 512,
-    8036, 837, 512, 8037, 837, 512, 8038, 837, 512, 8039, 837, 512, 8040,
-    837, 512, 8041, 837, 512, 8042, 837, 512, 8043, 837, 512, 8044, 837, 512,
-    8045, 837, 512, 8046, 837, 512, 8047, 837, 512, 945, 774, 512, 945, 772,
-    512, 8048, 837, 512, 945, 837, 512, 940, 837, 512, 945, 834, 512, 8118,
-    837, 512, 913, 774, 512, 913, 772, 512, 913, 768, 256, 902, 512, 913,
-    837, 514, 32, 787, 256, 953, 514, 32, 787, 514, 32, 834, 512, 168, 834,
-    512, 8052, 837, 512, 951, 837, 512, 942, 837, 512, 951, 834, 512, 8134,
-    837, 512, 917, 768, 256, 904, 512, 919, 768, 256, 905, 512, 919, 837,
-    512, 8127, 768, 512, 8127, 769, 512, 8127, 834, 512, 953, 774, 512, 953,
-    772, 512, 970, 768, 256, 912, 512, 953, 834, 512, 970, 834, 512, 921,
-    774, 512, 921, 772, 512, 921, 768, 256, 906, 512, 8190, 768, 512, 8190,
-    769, 512, 8190, 834, 512, 965, 774, 512, 965, 772, 512, 971, 768, 256,
-    944, 512, 961, 787, 512, 961, 788, 512, 965, 834, 512, 971, 834, 512,
-    933, 774, 512, 933, 772, 512, 933, 768, 256, 910, 512, 929, 788, 512,
-    168, 768, 256, 901, 256, 96, 512, 8060, 837, 512, 969, 837, 512, 974,
-    837, 512, 969, 834, 512, 8182, 837, 512, 927, 768, 256, 908, 512, 937,
-    768, 256, 911, 512, 937, 837, 256, 180, 514, 32, 788, 256, 8194, 256,
-    8195, 258, 32, 258, 32, 258, 32, 258, 32, 258, 32, 257, 32, 258, 32, 258,
-    32, 258, 32, 257, 8208, 514, 32, 819, 258, 46, 514, 46, 46, 770, 46, 46,
-    46, 257, 32, 514, 8242, 8242, 770, 8242, 8242, 8242, 514, 8245, 8245,
-    770, 8245, 8245, 8245, 514, 33, 33, 514, 32, 773, 514, 63, 63, 514, 63,
-    33, 514, 33, 63, 1026, 8242, 8242, 8242, 8242, 258, 32, 259, 48, 259,
-    105, 259, 52, 259, 53, 259, 54, 259, 55, 259, 56, 259, 57, 259, 43, 259,
-    8722, 259, 61, 259, 40, 259, 41, 259, 110, 261, 48, 261, 49, 261, 50,
-    261, 51, 261, 52, 261, 53, 261, 54, 261, 55, 261, 56, 261, 57, 261, 43,
-    261, 8722, 261, 61, 261, 40, 261, 41, 261, 97, 261, 101, 261, 111, 261,
-    120, 261, 601, 261, 104, 261, 107, 261, 108, 261, 109, 261, 110, 261,
-    112, 261, 115, 261, 116, 514, 82, 115, 770, 97, 47, 99, 770, 97, 47, 115,
-    262, 67, 514, 176, 67, 770, 99, 47, 111, 770, 99, 47, 117, 258, 400, 514,
-    176, 70, 262, 103, 262, 72, 262, 72, 262, 72, 262, 104, 262, 295, 262,
-    73, 262, 73, 262, 76, 262, 108, 262, 78, 514, 78, 111, 262, 80, 262, 81,
-    262, 82, 262, 82, 262, 82, 515, 83, 77, 770, 84, 69, 76, 515, 84, 77,
-    262, 90, 256, 937, 262, 90, 256, 75, 256, 197, 262, 66, 262, 67, 262,
-    101, 262, 69, 262, 70, 262, 77, 262, 111, 258, 1488, 258, 1489, 258,
-    1490, 258, 1491, 262, 105, 770, 70, 65, 88, 262, 960, 262, 947, 262, 915,
-    262, 928, 262, 8721, 262, 68, 262, 100, 262, 101, 262, 105, 262, 106,
-    772, 49, 8260, 55, 772, 49, 8260, 57, 1028, 49, 8260, 49, 48, 772, 49,
-    8260, 51, 772, 50, 8260, 51, 772, 49, 8260, 53, 772, 50, 8260, 53, 772,
-    51, 8260, 53, 772, 52, 8260, 53, 772, 49, 8260, 54, 772, 53, 8260, 54,
-    772, 49, 8260, 56, 772, 51, 8260, 56, 772, 53, 8260, 56, 772, 55, 8260,
-    56, 516, 49, 8260, 258, 73, 514, 73, 73, 770, 73, 73, 73, 514, 73, 86,
-    258, 86, 514, 86, 73, 770, 86, 73, 73, 1026, 86, 73, 73, 73, 514, 73, 88,
-    258, 88, 514, 88, 73, 770, 88, 73, 73, 258, 76, 258, 67, 258, 68, 258,
-    77, 258, 105, 514, 105, 105, 770, 105, 105, 105, 514, 105, 118, 258, 118,
-    514, 118, 105, 770, 118, 105, 105, 1026, 118, 105, 105, 105, 514, 105,
-    120, 258, 120, 514, 120, 105, 770, 120, 105, 105, 258, 108, 258, 99, 258,
-    100, 258, 109, 772, 48, 8260, 51, 512, 8592, 824, 512, 8594, 824, 512,
-    8596, 824, 512, 8656, 824, 512, 8660, 824, 512, 8658, 824, 512, 8707,
-    824, 512, 8712, 824, 512, 8715, 824, 512, 8739, 824, 512, 8741, 824, 514,
-    8747, 8747, 770, 8747, 8747, 8747, 514, 8750, 8750, 770, 8750, 8750,
-    8750, 512, 8764, 824, 512, 8771, 824, 512, 8773, 824, 512, 8776, 824,
-    512, 61, 824, 512, 8801, 824, 512, 8781, 824, 512, 60, 824, 512, 62, 824,
-    512, 8804, 824, 512, 8805, 824, 512, 8818, 824, 512, 8819, 824, 512,
-    8822, 824, 512, 8823, 824, 512, 8826, 824, 512, 8827, 824, 512, 8834,
-    824, 512, 8835, 824, 512, 8838, 824, 512, 8839, 824, 512, 8866, 824, 512,
-    8872, 824, 512, 8873, 824, 512, 8875, 824, 512, 8828, 824, 512, 8829,
-    824, 512, 8849, 824, 512, 8850, 824, 512, 8882, 824, 512, 8883, 824, 512,
-    8884, 824, 512, 8885, 824, 256, 12296, 256, 12297, 263, 49, 263, 50, 263,
-    51, 263, 52, 263, 53, 263, 54, 263, 55, 263, 56, 263, 57, 519, 49, 48,
-    519, 49, 49, 519, 49, 50, 519, 49, 51, 519, 49, 52, 519, 49, 53, 519, 49,
-    54, 519, 49, 55, 519, 49, 56, 519, 49, 57, 519, 50, 48, 770, 40, 49, 41,
-    770, 40, 50, 41, 770, 40, 51, 41, 770, 40, 52, 41, 770, 40, 53, 41, 770,
-    40, 54, 41, 770, 40, 55, 41, 770, 40, 56, 41, 770, 40, 57, 41, 1026, 40,
-    49, 48, 41, 1026, 40, 49, 49, 41, 1026, 40, 49, 50, 41, 1026, 40, 49, 51,
-    41, 1026, 40, 49, 52, 41, 1026, 40, 49, 53, 41, 1026, 40, 49, 54, 41,
-    1026, 40, 49, 55, 41, 1026, 40, 49, 56, 41, 1026, 40, 49, 57, 41, 1026,
-    40, 50, 48, 41, 514, 49, 46, 514, 50, 46, 514, 51, 46, 514, 52, 46, 514,
-    53, 46, 514, 54, 46, 514, 55, 46, 514, 56, 46, 514, 57, 46, 770, 49, 48,
-    46, 770, 49, 49, 46, 770, 49, 50, 46, 770, 49, 51, 46, 770, 49, 52, 46,
-    770, 49, 53, 46, 770, 49, 54, 46, 770, 49, 55, 46, 770, 49, 56, 46, 770,
-    49, 57, 46, 770, 50, 48, 46, 770, 40, 97, 41, 770, 40, 98, 41, 770, 40,
-    99, 41, 770, 40, 100, 41, 770, 40, 101, 41, 770, 40, 102, 41, 770, 40,
-    103, 41, 770, 40, 104, 41, 770, 40, 105, 41, 770, 40, 106, 41, 770, 40,
-    107, 41, 770, 40, 108, 41, 770, 40, 109, 41, 770, 40, 110, 41, 770, 40,
-    111, 41, 770, 40, 112, 41, 770, 40, 113, 41, 770, 40, 114, 41, 770, 40,
-    115, 41, 770, 40, 116, 41, 770, 40, 117, 41, 770, 40, 118, 41, 770, 40,
-    119, 41, 770, 40, 120, 41, 770, 40, 121, 41, 770, 40, 122, 41, 263, 65,
-    263, 66, 263, 67, 263, 68, 263, 69, 263, 70, 263, 71, 263, 72, 263, 73,
-    263, 74, 263, 75, 263, 76, 263, 77, 263, 78, 263, 79, 263, 80, 263, 81,
-    263, 82, 263, 83, 263, 84, 263, 85, 263, 86, 263, 87, 263, 88, 263, 89,
-    263, 90, 263, 97, 263, 98, 263, 99, 263, 100, 263, 101, 263, 102, 263,
-    103, 263, 104, 263, 105, 263, 106, 263, 107, 263, 108, 263, 109, 263,
-    110, 263, 111, 263, 112, 263, 113, 263, 114, 263, 115, 263, 116, 263,
-    117, 263, 118, 263, 119, 263, 120, 263, 121, 263, 122, 263, 48, 1026,
-    8747, 8747, 8747, 8747, 770, 58, 58, 61, 514, 61, 61, 770, 61, 61, 61,
-    512, 10973, 824, 261, 106, 259, 86, 259, 11617, 258, 27597, 258, 40863,
-    258, 19968, 258, 20008, 258, 20022, 258, 20031, 258, 20057, 258, 20101,
-    258, 20108, 258, 20128, 258, 20154, 258, 20799, 258, 20837, 258, 20843,
-    258, 20866, 258, 20886, 258, 20907, 258, 20960, 258, 20981, 258, 20992,
-    258, 21147, 258, 21241, 258, 21269, 258, 21274, 258, 21304, 258, 21313,
-    258, 21340, 258, 21353, 258, 21378, 258, 21430, 258, 21448, 258, 21475,
-    258, 22231, 258, 22303, 258, 22763, 258, 22786, 258, 22794, 258, 22805,
-    258, 22823, 258, 22899, 258, 23376, 258, 23424, 258, 23544, 258, 23567,
-    258, 23586, 258, 23608, 258, 23662, 258, 23665, 258, 24027, 258, 24037,
-    258, 24049, 258, 24062, 258, 24178, 258, 24186, 258, 24191, 258, 24308,
-    258, 24318, 258, 24331, 258, 24339, 258, 24400, 258, 24417, 258, 24435,
-    258, 24515, 258, 25096, 258, 25142, 258, 25163, 258, 25903, 258, 25908,
-    258, 25991, 258, 26007, 258, 26020, 258, 26041, 258, 26080, 258, 26085,
-    258, 26352, 258, 26376, 258, 26408, 258, 27424, 258, 27490, 258, 27513,
-    258, 27571, 258, 27595, 258, 27604, 258, 27611, 258, 27663, 258, 27668,
-    258, 27700, 258, 28779, 258, 29226, 258, 29238, 258, 29243, 258, 29247,
-    258, 29255, 258, 29273, 258, 29275, 258, 29356, 258, 29572, 258, 29577,
-    258, 29916, 258, 29926, 258, 29976, 258, 29983, 258, 29992, 258, 30000,
-    258, 30091, 258, 30098, 258, 30326, 258, 30333, 258, 30382, 258, 30399,
-    258, 30446, 258, 30683, 258, 30690, 258, 30707, 258, 31034, 258, 31160,
-    258, 31166, 258, 31348, 258, 31435, 258, 31481, 258, 31859, 258, 31992,
-    258, 32566, 258, 32593, 258, 32650, 258, 32701, 258, 32769, 258, 32780,
-    258, 32786, 258, 32819, 258, 32895, 258, 32905, 258, 33251, 258, 33258,
-    258, 33267, 258, 33276, 258, 33292, 258, 33307, 258, 33311, 258, 33390,
-    258, 33394, 258, 33400, 258, 34381, 258, 34411, 258, 34880, 258, 34892,
-    258, 34915, 258, 35198, 258, 35211, 258, 35282, 258, 35328, 258, 35895,
-    258, 35910, 258, 35925, 258, 35960, 258, 35997, 258, 36196, 258, 36208,
-    258, 36275, 258, 36523, 258, 36554, 258, 36763, 258, 36784, 258, 36789,
-    258, 37009, 258, 37193, 258, 37318, 258, 37324, 258, 37329, 258, 38263,
-    258, 38272, 258, 38428, 258, 38582, 258, 38585, 258, 38632, 258, 38737,
-    258, 38750, 258, 38754, 258, 38761, 258, 38859, 258, 38893, 258, 38899,
-    258, 38913, 258, 39080, 258, 39131, 258, 39135, 258, 39318, 258, 39321,
-    258, 39340, 258, 39592, 258, 39640, 258, 39647, 258, 39717, 258, 39727,
-    258, 39730, 258, 39740, 258, 39770, 258, 40165, 258, 40565, 258, 40575,
-    258, 40613, 258, 40635, 258, 40643, 258, 40653, 258, 40657, 258, 40697,
-    258, 40701, 258, 40718, 258, 40723, 258, 40736, 258, 40763, 258, 40778,
-    258, 40786, 258, 40845, 258, 40860, 258, 40864, 264, 32, 258, 12306, 258,
-    21313, 258, 21316, 258, 21317, 512, 12363, 12441, 512, 12365, 12441, 512,
-    12367, 12441, 512, 12369, 12441, 512, 12371, 12441, 512, 12373, 12441,
-    512, 12375, 12441, 512, 12377, 12441, 512, 12379, 12441, 512, 12381,
-    12441, 512, 12383, 12441, 512, 12385, 12441, 512, 12388, 12441, 512,
-    12390, 12441, 512, 12392, 12441, 512, 12399, 12441, 512, 12399, 12442,
-    512, 12402, 12441, 512, 12402, 12442, 512, 12405, 12441, 512, 12405,
-    12442, 512, 12408, 12441, 512, 12408, 12442, 512, 12411, 12441, 512,
-    12411, 12442, 512, 12358, 12441, 514, 32, 12441, 514, 32, 12442, 512,
-    12445, 12441, 521, 12424, 12426, 512, 12459, 12441, 512, 12461, 12441,
-    512, 12463, 12441, 512, 12465, 12441, 512, 12467, 12441, 512, 12469,
-    12441, 512, 12471, 12441, 512, 12473, 12441, 512, 12475, 12441, 512,
-    12477, 12441, 512, 12479, 12441, 512, 12481, 12441, 512, 12484, 12441,
-    512, 12486, 12441, 512, 12488, 12441, 512, 12495, 12441, 512, 12495,
-    12442, 512, 12498, 12441, 512, 12498, 12442, 512, 12501, 12441, 512,
-    12501, 12442, 512, 12504, 12441, 512, 12504, 12442, 512, 12507, 12441,
-    512, 12507, 12442, 512, 12454, 12441, 512, 12527, 12441, 512, 12528,
-    12441, 512, 12529, 12441, 512, 12530, 12441, 512, 12541, 12441, 521,
-    12467, 12488, 258, 4352, 258, 4353, 258, 4522, 258, 4354, 258, 4524, 258,
-    4525, 258, 4355, 258, 4356, 258, 4357, 258, 4528, 258, 4529, 258, 4530,
-    258, 4531, 258, 4532, 258, 4533, 258, 4378, 258, 4358, 258, 4359, 258,
-    4360, 258, 4385, 258, 4361, 258, 4362, 258, 4363, 258, 4364, 258, 4365,
-    258, 4366, 258, 4367, 258, 4368, 258, 4369, 258, 4370, 258, 4449, 258,
-    4450, 258, 4451, 258, 4452, 258, 4453, 258, 4454, 258, 4455, 258, 4456,
-    258, 4457, 258, 4458, 258, 4459, 258, 4460, 258, 4461, 258, 4462, 258,
-    4463, 258, 4464, 258, 4465, 258, 4466, 258, 4467, 258, 4468, 258, 4469,
-    258, 4448, 258, 4372, 258, 4373, 258, 4551, 258, 4552, 258, 4556, 258,
-    4558, 258, 4563, 258, 4567, 258, 4569, 258, 4380, 258, 4573, 258, 4575,
-    258, 4381, 258, 4382, 258, 4384, 258, 4386, 258, 4387, 258, 4391, 258,
-    4393, 258, 4395, 258, 4396, 258, 4397, 258, 4398, 258, 4399, 258, 4402,
-    258, 4406, 258, 4416, 258, 4423, 258, 4428, 258, 4593, 258, 4594, 258,
-    4439, 258, 4440, 258, 4441, 258, 4484, 258, 4485, 258, 4488, 258, 4497,
-    258, 4498, 258, 4500, 258, 4510, 258, 4513, 259, 19968, 259, 20108, 259,
-    19977, 259, 22235, 259, 19978, 259, 20013, 259, 19979, 259, 30002, 259,
-    20057, 259, 19993, 259, 19969, 259, 22825, 259, 22320, 259, 20154, 770,
-    40, 4352, 41, 770, 40, 4354, 41, 770, 40, 4355, 41, 770, 40, 4357, 41,
-    770, 40, 4358, 41, 770, 40, 4359, 41, 770, 40, 4361, 41, 770, 40, 4363,
-    41, 770, 40, 4364, 41, 770, 40, 4366, 41, 770, 40, 4367, 41, 770, 40,
-    4368, 41, 770, 40, 4369, 41, 770, 40, 4370, 41, 1026, 40, 4352, 4449, 41,
-    1026, 40, 4354, 4449, 41, 1026, 40, 4355, 4449, 41, 1026, 40, 4357, 4449,
-    41, 1026, 40, 4358, 4449, 41, 1026, 40, 4359, 4449, 41, 1026, 40, 4361,
-    4449, 41, 1026, 40, 4363, 4449, 41, 1026, 40, 4364, 4449, 41, 1026, 40,
-    4366, 4449, 41, 1026, 40, 4367, 4449, 41, 1026, 40, 4368, 4449, 41, 1026,
-    40, 4369, 4449, 41, 1026, 40, 4370, 4449, 41, 1026, 40, 4364, 4462, 41,
-    1794, 40, 4363, 4457, 4364, 4453, 4523, 41, 1538, 40, 4363, 4457, 4370,
-    4462, 41, 770, 40, 19968, 41, 770, 40, 20108, 41, 770, 40, 19977, 41,
-    770, 40, 22235, 41, 770, 40, 20116, 41, 770, 40, 20845, 41, 770, 40,
-    19971, 41, 770, 40, 20843, 41, 770, 40, 20061, 41, 770, 40, 21313, 41,
-    770, 40, 26376, 41, 770, 40, 28779, 41, 770, 40, 27700, 41, 770, 40,
-    26408, 41, 770, 40, 37329, 41, 770, 40, 22303, 41, 770, 40, 26085, 41,
-    770, 40, 26666, 41, 770, 40, 26377, 41, 770, 40, 31038, 41, 770, 40,
-    21517, 41, 770, 40, 29305, 41, 770, 40, 36001, 41, 770, 40, 31069, 41,
-    770, 40, 21172, 41, 770, 40, 20195, 41, 770, 40, 21628, 41, 770, 40,
-    23398, 41, 770, 40, 30435, 41, 770, 40, 20225, 41, 770, 40, 36039, 41,
-    770, 40, 21332, 41, 770, 40, 31085, 41, 770, 40, 20241, 41, 770, 40,
-    33258, 41, 770, 40, 33267, 41, 263, 21839, 263, 24188, 263, 25991, 263,
-    31631, 778, 80, 84, 69, 519, 50, 49, 519, 50, 50, 519, 50, 51, 519, 50,
-    52, 519, 50, 53, 519, 50, 54, 519, 50, 55, 519, 50, 56, 519, 50, 57, 519,
-    51, 48, 519, 51, 49, 519, 51, 50, 519, 51, 51, 519, 51, 52, 519, 51, 53,
-    263, 4352, 263, 4354, 263, 4355, 263, 4357, 263, 4358, 263, 4359, 263,
-    4361, 263, 4363, 263, 4364, 263, 4366, 263, 4367, 263, 4368, 263, 4369,
-    263, 4370, 519, 4352, 4449, 519, 4354, 4449, 519, 4355, 4449, 519, 4357,
-    4449, 519, 4358, 4449, 519, 4359, 4449, 519, 4361, 4449, 519, 4363, 4449,
-    519, 4364, 4449, 519, 4366, 4449, 519, 4367, 4449, 519, 4368, 4449, 519,
-    4369, 4449, 519, 4370, 4449, 1287, 4366, 4449, 4535, 4352, 4457, 1031,
-    4364, 4462, 4363, 4468, 519, 4363, 4462, 263, 19968, 263, 20108, 263,
-    19977, 263, 22235, 263, 20116, 263, 20845, 263, 19971, 263, 20843, 263,
-    20061, 263, 21313, 263, 26376, 263, 28779, 263, 27700, 263, 26408, 263,
-    37329, 263, 22303, 263, 26085, 263, 26666, 263, 26377, 263, 31038, 263,
-    21517, 263, 29305, 263, 36001, 263, 31069, 263, 21172, 263, 31192, 263,
-    30007, 263, 22899, 263, 36969, 263, 20778, 263, 21360, 263, 27880, 263,
-    38917, 263, 20241, 263, 20889, 263, 27491, 263, 19978, 263, 20013, 263,
-    19979, 263, 24038, 263, 21491, 263, 21307, 263, 23447, 263, 23398, 263,
-    30435, 263, 20225, 263, 36039, 263, 21332, 263, 22812, 519, 51, 54, 519,
-    51, 55, 519, 51, 56, 519, 51, 57, 519, 52, 48, 519, 52, 49, 519, 52, 50,
-    519, 52, 51, 519, 52, 52, 519, 52, 53, 519, 52, 54, 519, 52, 55, 519, 52,
-    56, 519, 52, 57, 519, 53, 48, 514, 49, 26376, 514, 50, 26376, 514, 51,
-    26376, 514, 52, 26376, 514, 53, 26376, 514, 54, 26376, 514, 55, 26376,
-    514, 56, 26376, 514, 57, 26376, 770, 49, 48, 26376, 770, 49, 49, 26376,
-    770, 49, 50, 26376, 522, 72, 103, 778, 101, 114, 103, 522, 101, 86, 778,
-    76, 84, 68, 263, 12450, 263, 12452, 263, 12454, 263, 12456, 263, 12458,
-    263, 12459, 263, 12461, 263, 12463, 263, 12465, 263, 12467, 263, 12469,
-    263, 12471, 263, 12473, 263, 12475, 263, 12477, 263, 12479, 263, 12481,
-    263, 12484, 263, 12486, 263, 12488, 263, 12490, 263, 12491, 263, 12492,
-    263, 12493, 263, 12494, 263, 12495, 263, 12498, 263, 12501, 263, 12504,
-    263, 12507, 263, 12510, 263, 12511, 263, 12512, 263, 12513, 263, 12514,
-    263, 12516, 263, 12518, 263, 12520, 263, 12521, 263, 12522, 263, 12523,
-    263, 12524, 263, 12525, 263, 12527, 263, 12528, 263, 12529, 263, 12530,
-    1034, 12450, 12497, 12540, 12488, 1034, 12450, 12523, 12501, 12449, 1034,
-    12450, 12531, 12506, 12450, 778, 12450, 12540, 12523, 1034, 12452, 12491,
-    12531, 12464, 778, 12452, 12531, 12481, 778, 12454, 12457, 12531, 1290,
-    12456, 12473, 12463, 12540, 12489, 1034, 12456, 12540, 12459, 12540, 778,
-    12458, 12531, 12473, 778, 12458, 12540, 12512, 778, 12459, 12452, 12522,
-    1034, 12459, 12521, 12483, 12488, 1034, 12459, 12525, 12522, 12540, 778,
-    12460, 12525, 12531, 778, 12460, 12531, 12510, 522, 12462, 12460, 778,
-    12462, 12491, 12540, 1034, 12461, 12517, 12522, 12540, 1034, 12462,
-    12523, 12480, 12540, 522, 12461, 12525, 1290, 12461, 12525, 12464, 12521,
-    12512, 1546, 12461, 12525, 12513, 12540, 12488, 12523, 1290, 12461,
-    12525, 12527, 12483, 12488, 778, 12464, 12521, 12512, 1290, 12464, 12521,
-    12512, 12488, 12531, 1290, 12463, 12523, 12476, 12452, 12525, 1034,
-    12463, 12525, 12540, 12493, 778, 12465, 12540, 12473, 778, 12467, 12523,
-    12490, 778, 12467, 12540, 12509, 1034, 12469, 12452, 12463, 12523, 1290,
-    12469, 12531, 12481, 12540, 12512, 1034, 12471, 12522, 12531, 12464, 778,
-    12475, 12531, 12481, 778, 12475, 12531, 12488, 778, 12480, 12540, 12473,
-    522, 12487, 12471, 522, 12489, 12523, 522, 12488, 12531, 522, 12490,
-    12494, 778, 12494, 12483, 12488, 778, 12495, 12452, 12484, 1290, 12497,
-    12540, 12475, 12531, 12488, 778, 12497, 12540, 12484, 1034, 12496, 12540,
-    12524, 12523, 1290, 12500, 12450, 12473, 12488, 12523, 778, 12500, 12463,
-    12523, 522, 12500, 12467, 522, 12499, 12523, 1290, 12501, 12449, 12521,
-    12483, 12489, 1034, 12501, 12451, 12540, 12488, 1290, 12502, 12483,
-    12471, 12455, 12523, 778, 12501, 12521, 12531, 1290, 12504, 12463, 12479,
-    12540, 12523, 522, 12506, 12477, 778, 12506, 12491, 12498, 778, 12504,
-    12523, 12484, 778, 12506, 12531, 12473, 778, 12506, 12540, 12472, 778,
-    12505, 12540, 12479, 1034, 12509, 12452, 12531, 12488, 778, 12508, 12523,
-    12488, 522, 12507, 12531, 778, 12509, 12531, 12489, 778, 12507, 12540,
-    12523, 778, 12507, 12540, 12531, 1034, 12510, 12452, 12463, 12525, 778,
-    12510, 12452, 12523, 778, 12510, 12483, 12495, 778, 12510, 12523, 12463,
-    1290, 12510, 12531, 12471, 12519, 12531, 1034, 12511, 12463, 12525,
-    12531, 522, 12511, 12522, 1290, 12511, 12522, 12496, 12540, 12523, 522,
-    12513, 12460, 1034, 12513, 12460, 12488, 12531, 1034, 12513, 12540,
-    12488, 12523, 778, 12516, 12540, 12489, 778, 12516, 12540, 12523, 778,
-    12518, 12450, 12531, 1034, 12522, 12483, 12488, 12523, 522, 12522, 12521,
-    778, 12523, 12500, 12540, 1034, 12523, 12540, 12502, 12523, 522, 12524,
-    12512, 1290, 12524, 12531, 12488, 12466, 12531, 778, 12527, 12483, 12488,
-    514, 48, 28857, 514, 49, 28857, 514, 50, 28857, 514, 51, 28857, 514, 52,
-    28857, 514, 53, 28857, 514, 54, 28857, 514, 55, 28857, 514, 56, 28857,
-    514, 57, 28857, 770, 49, 48, 28857, 770, 49, 49, 28857, 770, 49, 50,
-    28857, 770, 49, 51, 28857, 770, 49, 52, 28857, 770, 49, 53, 28857, 770,
-    49, 54, 28857, 770, 49, 55, 28857, 770, 49, 56, 28857, 770, 49, 57,
-    28857, 770, 50, 48, 28857, 770, 50, 49, 28857, 770, 50, 50, 28857, 770,
-    50, 51, 28857, 770, 50, 52, 28857, 778, 104, 80, 97, 522, 100, 97, 522,
-    65, 85, 778, 98, 97, 114, 522, 111, 86, 522, 112, 99, 522, 100, 109, 778,
-    100, 109, 178, 778, 100, 109, 179, 522, 73, 85, 522, 24179, 25104, 522,
-    26157, 21644, 522, 22823, 27491, 522, 26126, 27835, 1034, 26666, 24335,
-    20250, 31038, 522, 112, 65, 522, 110, 65, 522, 956, 65, 522, 109, 65,
-    522, 107, 65, 522, 75, 66, 522, 77, 66, 522, 71, 66, 778, 99, 97, 108,
-    1034, 107, 99, 97, 108, 522, 112, 70, 522, 110, 70, 522, 956, 70, 522,
-    956, 103, 522, 109, 103, 522, 107, 103, 522, 72, 122, 778, 107, 72, 122,
-    778, 77, 72, 122, 778, 71, 72, 122, 778, 84, 72, 122, 522, 956, 8467,
-    522, 109, 8467, 522, 100, 8467, 522, 107, 8467, 522, 102, 109, 522, 110,
-    109, 522, 956, 109, 522, 109, 109, 522, 99, 109, 522, 107, 109, 778, 109,
-    109, 178, 778, 99, 109, 178, 522, 109, 178, 778, 107, 109, 178, 778, 109,
-    109, 179, 778, 99, 109, 179, 522, 109, 179, 778, 107, 109, 179, 778, 109,
-    8725, 115, 1034, 109, 8725, 115, 178, 522, 80, 97, 778, 107, 80, 97, 778,
-    77, 80, 97, 778, 71, 80, 97, 778, 114, 97, 100, 1290, 114, 97, 100, 8725,
-    115, 1546, 114, 97, 100, 8725, 115, 178, 522, 112, 115, 522, 110, 115,
-    522, 956, 115, 522, 109, 115, 522, 112, 86, 522, 110, 86, 522, 956, 86,
-    522, 109, 86, 522, 107, 86, 522, 77, 86, 522, 112, 87, 522, 110, 87, 522,
-    956, 87, 522, 109, 87, 522, 107, 87, 522, 77, 87, 522, 107, 937, 522, 77,
-    937, 1034, 97, 46, 109, 46, 522, 66, 113, 522, 99, 99, 522, 99, 100,
-    1034, 67, 8725, 107, 103, 778, 67, 111, 46, 522, 100, 66, 522, 71, 121,
-    522, 104, 97, 522, 72, 80, 522, 105, 110, 522, 75, 75, 522, 75, 77, 522,
-    107, 116, 522, 108, 109, 522, 108, 110, 778, 108, 111, 103, 522, 108,
-    120, 522, 109, 98, 778, 109, 105, 108, 778, 109, 111, 108, 522, 80, 72,
-    1034, 112, 46, 109, 46, 778, 80, 80, 77, 522, 80, 82, 522, 115, 114, 522,
-    83, 118, 522, 87, 98, 778, 86, 8725, 109, 778, 65, 8725, 109, 514, 49,
-    26085, 514, 50, 26085, 514, 51, 26085, 514, 52, 26085, 514, 53, 26085,
-    514, 54, 26085, 514, 55, 26085, 514, 56, 26085, 514, 57, 26085, 770, 49,
-    48, 26085, 770, 49, 49, 26085, 770, 49, 50, 26085, 770, 49, 51, 26085,
-    770, 49, 52, 26085, 770, 49, 53, 26085, 770, 49, 54, 26085, 770, 49, 55,
-    26085, 770, 49, 56, 26085, 770, 49, 57, 26085, 770, 50, 48, 26085, 770,
-    50, 49, 26085, 770, 50, 50, 26085, 770, 50, 51, 26085, 770, 50, 52,
-    26085, 770, 50, 53, 26085, 770, 50, 54, 26085, 770, 50, 55, 26085, 770,
-    50, 56, 26085, 770, 50, 57, 26085, 770, 51, 48, 26085, 770, 51, 49,
-    26085, 778, 103, 97, 108, 259, 1098, 259, 1100, 259, 42863, 259, 294,
-    259, 339, 259, 42791, 259, 43831, 259, 619, 259, 43858, 256, 35912, 256,
-    26356, 256, 36554, 256, 36040, 256, 28369, 256, 20018, 256, 21477, 256,
-    40860, 256, 40860, 256, 22865, 256, 37329, 256, 21895, 256, 22856, 256,
-    25078, 256, 30313, 256, 32645, 256, 34367, 256, 34746, 256, 35064, 256,
-    37007, 256, 27138, 256, 27931, 256, 28889, 256, 29662, 256, 33853, 256,
-    37226, 256, 39409, 256, 20098, 256, 21365, 256, 27396, 256, 29211, 256,
-    34349, 256, 40478, 256, 23888, 256, 28651, 256, 34253, 256, 35172, 256,
-    25289, 256, 33240, 256, 34847, 256, 24266, 256, 26391, 256, 28010, 256,
-    29436, 256, 37070, 256, 20358, 256, 20919, 256, 21214, 256, 25796, 256,
-    27347, 256, 29200, 256, 30439, 256, 32769, 256, 34310, 256, 34396, 256,
-    36335, 256, 38706, 256, 39791, 256, 40442, 256, 30860, 256, 31103, 256,
-    32160, 256, 33737, 256, 37636, 256, 40575, 256, 35542, 256, 22751, 256,
-    24324, 256, 31840, 256, 32894, 256, 29282, 256, 30922, 256, 36034, 256,
-    38647, 256, 22744, 256, 23650, 256, 27155, 256, 28122, 256, 28431, 256,
-    32047, 256, 32311, 256, 38475, 256, 21202, 256, 32907, 256, 20956, 256,
-    20940, 256, 31260, 256, 32190, 256, 33777, 256, 38517, 256, 35712, 256,
-    25295, 256, 27138, 256, 35582, 256, 20025, 256, 23527, 256, 24594, 256,
-    29575, 256, 30064, 256, 21271, 256, 30971, 256, 20415, 256, 24489, 256,
-    19981, 256, 27852, 256, 25976, 256, 32034, 256, 21443, 256, 22622, 256,
-    30465, 256, 33865, 256, 35498, 256, 27578, 256, 36784, 256, 27784, 256,
-    25342, 256, 33509, 256, 25504, 256, 30053, 256, 20142, 256, 20841, 256,
-    20937, 256, 26753, 256, 31975, 256, 33391, 256, 35538, 256, 37327, 256,
-    21237, 256, 21570, 256, 22899, 256, 24300, 256, 26053, 256, 28670, 256,
-    31018, 256, 38317, 256, 39530, 256, 40599, 256, 40654, 256, 21147, 256,
-    26310, 256, 27511, 256, 36706, 256, 24180, 256, 24976, 256, 25088, 256,
-    25754, 256, 28451, 256, 29001, 256, 29833, 256, 31178, 256, 32244, 256,
-    32879, 256, 36646, 256, 34030, 256, 36899, 256, 37706, 256, 21015, 256,
-    21155, 256, 21693, 256, 28872, 256, 35010, 256, 35498, 256, 24265, 256,
-    24565, 256, 25467, 256, 27566, 256, 31806, 256, 29557, 256, 20196, 256,
-    22265, 256, 23527, 256, 23994, 256, 24604, 256, 29618, 256, 29801, 256,
-    32666, 256, 32838, 256, 37428, 256, 38646, 256, 38728, 256, 38936, 256,
-    20363, 256, 31150, 256, 37300, 256, 38584, 256, 24801, 256, 20102, 256,
-    20698, 256, 23534, 256, 23615, 256, 26009, 256, 27138, 256, 29134, 256,
-    30274, 256, 34044, 256, 36988, 256, 40845, 256, 26248, 256, 38446, 256,
-    21129, 256, 26491, 256, 26611, 256, 27969, 256, 28316, 256, 29705, 256,
-    30041, 256, 30827, 256, 32016, 256, 39006, 256, 20845, 256, 25134, 256,
-    38520, 256, 20523, 256, 23833, 256, 28138, 256, 36650, 256, 24459, 256,
-    24900, 256, 26647, 256, 29575, 256, 38534, 256, 21033, 256, 21519, 256,
-    23653, 256, 26131, 256, 26446, 256, 26792, 256, 27877, 256, 29702, 256,
-    30178, 256, 32633, 256, 35023, 256, 35041, 256, 37324, 256, 38626, 256,
-    21311, 256, 28346, 256, 21533, 256, 29136, 256, 29848, 256, 34298, 256,
-    38563, 256, 40023, 256, 40607, 256, 26519, 256, 28107, 256, 33256, 256,
-    31435, 256, 31520, 256, 31890, 256, 29376, 256, 28825, 256, 35672, 256,
-    20160, 256, 33590, 256, 21050, 256, 20999, 256, 24230, 256, 25299, 256,
-    31958, 256, 23429, 256, 27934, 256, 26292, 256, 36667, 256, 34892, 256,
-    38477, 256, 35211, 256, 24275, 256, 20800, 256, 21952, 256, 22618, 256,
-    26228, 256, 20958, 256, 29482, 256, 30410, 256, 31036, 256, 31070, 256,
-    31077, 256, 31119, 256, 38742, 256, 31934, 256, 32701, 256, 34322, 256,
-    35576, 256, 36920, 256, 37117, 256, 39151, 256, 39164, 256, 39208, 256,
-    40372, 256, 37086, 256, 38583, 256, 20398, 256, 20711, 256, 20813, 256,
-    21193, 256, 21220, 256, 21329, 256, 21917, 256, 22022, 256, 22120, 256,
-    22592, 256, 22696, 256, 23652, 256, 23662, 256, 24724, 256, 24936, 256,
-    24974, 256, 25074, 256, 25935, 256, 26082, 256, 26257, 256, 26757, 256,
-    28023, 256, 28186, 256, 28450, 256, 29038, 256, 29227, 256, 29730, 256,
-    30865, 256, 31038, 256, 31049, 256, 31048, 256, 31056, 256, 31062, 256,
-    31069, 256, 31117, 256, 31118, 256, 31296, 256, 31361, 256, 31680, 256,
-    32244, 256, 32265, 256, 32321, 256, 32626, 256, 32773, 256, 33261, 256,
-    33401, 256, 33401, 256, 33879, 256, 35088, 256, 35222, 256, 35585, 256,
-    35641, 256, 36051, 256, 36104, 256, 36790, 256, 36920, 256, 38627, 256,
-    38911, 256, 38971, 256, 24693, 256, 55376, 57070, 256, 33304, 256, 20006,
-    256, 20917, 256, 20840, 256, 20352, 256, 20805, 256, 20864, 256, 21191,
-    256, 21242, 256, 21917, 256, 21845, 256, 21913, 256, 21986, 256, 22618,
-    256, 22707, 256, 22852, 256, 22868, 256, 23138, 256, 23336, 256, 24274,
-    256, 24281, 256, 24425, 256, 24493, 256, 24792, 256, 24910, 256, 24840,
-    256, 24974, 256, 24928, 256, 25074, 256, 25140, 256, 25540, 256, 25628,
-    256, 25682, 256, 25942, 256, 26228, 256, 26391, 256, 26395, 256, 26454,
-    256, 27513, 256, 27578, 256, 27969, 256, 28379, 256, 28363, 256, 28450,
-    256, 28702, 256, 29038, 256, 30631, 256, 29237, 256, 29359, 256, 29482,
-    256, 29809, 256, 29958, 256, 30011, 256, 30237, 256, 30239, 256, 30410,
-    256, 30427, 256, 30452, 256, 30538, 256, 30528, 256, 30924, 256, 31409,
-    256, 31680, 256, 31867, 256, 32091, 256, 32244, 256, 32574, 256, 32773,
-    256, 33618, 256, 33775, 256, 34681, 256, 35137, 256, 35206, 256, 35222,
-    256, 35519, 256, 35576, 256, 35531, 256, 35585, 256, 35582, 256, 35565,
-    256, 35641, 256, 35722, 256, 36104, 256, 36664, 256, 36978, 256, 37273,
-    256, 37494, 256, 38524, 256, 38627, 256, 38742, 256, 38875, 256, 38911,
-    256, 38923, 256, 38971, 256, 39698, 256, 40860, 256, 55370, 56394, 256,
-    55370, 56388, 256, 55372, 57301, 256, 15261, 256, 16408, 256, 16441, 256,
-    55380, 56905, 256, 55383, 56528, 256, 55391, 57043, 256, 40771, 256,
-    40846, 514, 102, 102, 514, 102, 105, 514, 102, 108, 770, 102, 102, 105,
-    770, 102, 102, 108, 514, 383, 116, 514, 115, 116, 514, 1396, 1398, 514,
-    1396, 1381, 514, 1396, 1387, 514, 1406, 1398, 514, 1396, 1389, 512, 1497,
-    1460, 512, 1522, 1463, 262, 1506, 262, 1488, 262, 1491, 262, 1492, 262,
-    1499, 262, 1500, 262, 1501, 262, 1512, 262, 1514, 262, 43, 512, 1513,
-    1473, 512, 1513, 1474, 512, 64329, 1473, 512, 64329, 1474, 512, 1488,
-    1463, 512, 1488, 1464, 512, 1488, 1468, 512, 1489, 1468, 512, 1490, 1468,
-    512, 1491, 1468, 512, 1492, 1468, 512, 1493, 1468, 512, 1494, 1468, 512,
-    1496, 1468, 512, 1497, 1468, 512, 1498, 1468, 512, 1499, 1468, 512, 1500,
-    1468, 512, 1502, 1468, 512, 1504, 1468, 512, 1505, 1468, 512, 1507, 1468,
-    512, 1508, 1468, 512, 1510, 1468, 512, 1511, 1468, 512, 1512, 1468, 512,
-    1513, 1468, 512, 1514, 1468, 512, 1493, 1465, 512, 1489, 1471, 512, 1499,
-    1471, 512, 1508, 1471, 514, 1488, 1500, 267, 1649, 268, 1649, 267, 1659,
-    268, 1659, 269, 1659, 270, 1659, 267, 1662, 268, 1662, 269, 1662, 270,
-    1662, 267, 1664, 268, 1664, 269, 1664, 270, 1664, 267, 1658, 268, 1658,
-    269, 1658, 270, 1658, 267, 1663, 268, 1663, 269, 1663, 270, 1663, 267,
-    1657, 268, 1657, 269, 1657, 270, 1657, 267, 1700, 268, 1700, 269, 1700,
-    270, 1700, 267, 1702, 268, 1702, 269, 1702, 270, 1702, 267, 1668, 268,
-    1668, 269, 1668, 270, 1668, 267, 1667, 268, 1667, 269, 1667, 270, 1667,
-    267, 1670, 268, 1670, 269, 1670, 270, 1670, 267, 1671, 268, 1671, 269,
-    1671, 270, 1671, 267, 1677, 268, 1677, 267, 1676, 268, 1676, 267, 1678,
-    268, 1678, 267, 1672, 268, 1672, 267, 1688, 268, 1688, 267, 1681, 268,
-    1681, 267, 1705, 268, 1705, 269, 1705, 270, 1705, 267, 1711, 268, 1711,
-    269, 1711, 270, 1711, 267, 1715, 268, 1715, 269, 1715, 270, 1715, 267,
-    1713, 268, 1713, 269, 1713, 270, 1713, 267, 1722, 268, 1722, 267, 1723,
-    268, 1723, 269, 1723, 270, 1723, 267, 1728, 268, 1728, 267, 1729, 268,
-    1729, 269, 1729, 270, 1729, 267, 1726, 268, 1726, 269, 1726, 270, 1726,
-    267, 1746, 268, 1746, 267, 1747, 268, 1747, 267, 1709, 268, 1709, 269,
-    1709, 270, 1709, 267, 1735, 268, 1735, 267, 1734, 268, 1734, 267, 1736,
-    268, 1736, 267, 1655, 267, 1739, 268, 1739, 267, 1733, 268, 1733, 267,
-    1737, 268, 1737, 267, 1744, 268, 1744, 269, 1744, 270, 1744, 269, 1609,
-    270, 1609, 523, 1574, 1575, 524, 1574, 1575, 523, 1574, 1749, 524, 1574,
-    1749, 523, 1574, 1608, 524, 1574, 1608, 523, 1574, 1735, 524, 1574, 1735,
-    523, 1574, 1734, 524, 1574, 1734, 523, 1574, 1736, 524, 1574, 1736, 523,
-    1574, 1744, 524, 1574, 1744, 525, 1574, 1744, 523, 1574, 1609, 524, 1574,
-    1609, 525, 1574, 1609, 267, 1740, 268, 1740, 269, 1740, 270, 1740, 523,
-    1574, 1580, 523, 1574, 1581, 523, 1574, 1605, 523, 1574, 1609, 523, 1574,
-    1610, 523, 1576, 1580, 523, 1576, 1581, 523, 1576, 1582, 523, 1576, 1605,
-    523, 1576, 1609, 523, 1576, 1610, 523, 1578, 1580, 523, 1578, 1581, 523,
-    1578, 1582, 523, 1578, 1605, 523, 1578, 1609, 523, 1578, 1610, 523, 1579,
-    1580, 523, 1579, 1605, 523, 1579, 1609, 523, 1579, 1610, 523, 1580, 1581,
-    523, 1580, 1605, 523, 1581, 1580, 523, 1581, 1605, 523, 1582, 1580, 523,
-    1582, 1581, 523, 1582, 1605, 523, 1587, 1580, 523, 1587, 1581, 523, 1587,
-    1582, 523, 1587, 1605, 523, 1589, 1581, 523, 1589, 1605, 523, 1590, 1580,
-    523, 1590, 1581, 523, 1590, 1582, 523, 1590, 1605, 523, 1591, 1581, 523,
-    1591, 1605, 523, 1592, 1605, 523, 1593, 1580, 523, 1593, 1605, 523, 1594,
-    1580, 523, 1594, 1605, 523, 1601, 1580, 523, 1601, 1581, 523, 1601, 1582,
-    523, 1601, 1605, 523, 1601, 1609, 523, 1601, 1610, 523, 1602, 1581, 523,
-    1602, 1605, 523, 1602, 1609, 523, 1602, 1610, 523, 1603, 1575, 523, 1603,
-    1580, 523, 1603, 1581, 523, 1603, 1582, 523, 1603, 1604, 523, 1603, 1605,
-    523, 1603, 1609, 523, 1603, 1610, 523, 1604, 1580, 523, 1604, 1581, 523,
-    1604, 1582, 523, 1604, 1605, 523, 1604, 1609, 523, 1604, 1610, 523, 1605,
-    1580, 523, 1605, 1581, 523, 1605, 1582, 523, 1605, 1605, 523, 1605, 1609,
-    523, 1605, 1610, 523, 1606, 1580, 523, 1606, 1581, 523, 1606, 1582, 523,
-    1606, 1605, 523, 1606, 1609, 523, 1606, 1610, 523, 1607, 1580, 523, 1607,
-    1605, 523, 1607, 1609, 523, 1607, 1610, 523, 1610, 1580, 523, 1610, 1581,
-    523, 1610, 1582, 523, 1610, 1605, 523, 1610, 1609, 523, 1610, 1610, 523,
-    1584, 1648, 523, 1585, 1648, 523, 1609, 1648, 779, 32, 1612, 1617, 779,
-    32, 1613, 1617, 779, 32, 1614, 1617, 779, 32, 1615, 1617, 779, 32, 1616,
-    1617, 779, 32, 1617, 1648, 524, 1574, 1585, 524, 1574, 1586, 524, 1574,
-    1605, 524, 1574, 1606, 524, 1574, 1609, 524, 1574, 1610, 524, 1576, 1585,
-    524, 1576, 1586, 524, 1576, 1605, 524, 1576, 1606, 524, 1576, 1609, 524,
-    1576, 1610, 524, 1578, 1585, 524, 1578, 1586, 524, 1578, 1605, 524, 1578,
-    1606, 524, 1578, 1609, 524, 1578, 1610, 524, 1579, 1585, 524, 1579, 1586,
-    524, 1579, 1605, 524, 1579, 1606, 524, 1579, 1609, 524, 1579, 1610, 524,
-    1601, 1609, 524, 1601, 1610, 524, 1602, 1609, 524, 1602, 1610, 524, 1603,
-    1575, 524, 1603, 1604, 524, 1603, 1605, 524, 1603, 1609, 524, 1603, 1610,
-    524, 1604, 1605, 524, 1604, 1609, 524, 1604, 1610, 524, 1605, 1575, 524,
-    1605, 1605, 524, 1606, 1585, 524, 1606, 1586, 524, 1606, 1605, 524, 1606,
-    1606, 524, 1606, 1609, 524, 1606, 1610, 524, 1609, 1648, 524, 1610, 1585,
-    524, 1610, 1586, 524, 1610, 1605, 524, 1610, 1606, 524, 1610, 1609, 524,
-    1610, 1610, 525, 1574, 1580, 525, 1574, 1581, 525, 1574, 1582, 525, 1574,
-    1605, 525, 1574, 1607, 525, 1576, 1580, 525, 1576, 1581, 525, 1576, 1582,
-    525, 1576, 1605, 525, 1576, 1607, 525, 1578, 1580, 525, 1578, 1581, 525,
-    1578, 1582, 525, 1578, 1605, 525, 1578, 1607, 525, 1579, 1605, 525, 1580,
-    1581, 525, 1580, 1605, 525, 1581, 1580, 525, 1581, 1605, 525, 1582, 1580,
-    525, 1582, 1605, 525, 1587, 1580, 525, 1587, 1581, 525, 1587, 1582, 525,
-    1587, 1605, 525, 1589, 1581, 525, 1589, 1582, 525, 1589, 1605, 525, 1590,
-    1580, 525, 1590, 1581, 525, 1590, 1582, 525, 1590, 1605, 525, 1591, 1581,
-    525, 1592, 1605, 525, 1593, 1580, 525, 1593, 1605, 525, 1594, 1580, 525,
-    1594, 1605, 525, 1601, 1580, 525, 1601, 1581, 525, 1601, 1582, 525, 1601,
-    1605, 525, 1602, 1581, 525, 1602, 1605, 525, 1603, 1580, 525, 1603, 1581,
-    525, 1603, 1582, 525, 1603, 1604, 525, 1603, 1605, 525, 1604, 1580, 525,
-    1604, 1581, 525, 1604, 1582, 525, 1604, 1605, 525, 1604, 1607, 525, 1605,
-    1580, 525, 1605, 1581, 525, 1605, 1582, 525, 1605, 1605, 525, 1606, 1580,
-    525, 1606, 1581, 525, 1606, 1582, 525, 1606, 1605, 525, 1606, 1607, 525,
-    1607, 1580, 525, 1607, 1605, 525, 1607, 1648, 525, 1610, 1580, 525, 1610,
-    1581, 525, 1610, 1582, 525, 1610, 1605, 525, 1610, 1607, 526, 1574, 1605,
-    526, 1574, 1607, 526, 1576, 1605, 526, 1576, 1607, 526, 1578, 1605, 526,
-    1578, 1607, 526, 1579, 1605, 526, 1579, 1607, 526, 1587, 1605, 526, 1587,
-    1607, 526, 1588, 1605, 526, 1588, 1607, 526, 1603, 1604, 526, 1603, 1605,
-    526, 1604, 1605, 526, 1606, 1605, 526, 1606, 1607, 526, 1610, 1605, 526,
-    1610, 1607, 782, 1600, 1614, 1617, 782, 1600, 1615, 1617, 782, 1600,
-    1616, 1617, 523, 1591, 1609, 523, 1591, 1610, 523, 1593, 1609, 523, 1593,
-    1610, 523, 1594, 1609, 523, 1594, 1610, 523, 1587, 1609, 523, 1587, 1610,
-    523, 1588, 1609, 523, 1588, 1610, 523, 1581, 1609, 523, 1581, 1610, 523,
-    1580, 1609, 523, 1580, 1610, 523, 1582, 1609, 523, 1582, 1610, 523, 1589,
-    1609, 523, 1589, 1610, 523, 1590, 1609, 523, 1590, 1610, 523, 1588, 1580,
-    523, 1588, 1581, 523, 1588, 1582, 523, 1588, 1605, 523, 1588, 1585, 523,
-    1587, 1585, 523, 1589, 1585, 523, 1590, 1585, 524, 1591, 1609, 524, 1591,
-    1610, 524, 1593, 1609, 524, 1593, 1610, 524, 1594, 1609, 524, 1594, 1610,
-    524, 1587, 1609, 524, 1587, 1610, 524, 1588, 1609, 524, 1588, 1610, 524,
-    1581, 1609, 524, 1581, 1610, 524, 1580, 1609, 524, 1580, 1610, 524, 1582,
-    1609, 524, 1582, 1610, 524, 1589, 1609, 524, 1589, 1610, 524, 1590, 1609,
-    524, 1590, 1610, 524, 1588, 1580, 524, 1588, 1581, 524, 1588, 1582, 524,
-    1588, 1605, 524, 1588, 1585, 524, 1587, 1585, 524, 1589, 1585, 524, 1590,
-    1585, 525, 1588, 1580, 525, 1588, 1581, 525, 1588, 1582, 525, 1588, 1605,
-    525, 1587, 1607, 525, 1588, 1607, 525, 1591, 1605, 526, 1587, 1580, 526,
-    1587, 1581, 526, 1587, 1582, 526, 1588, 1580, 526, 1588, 1581, 526, 1588,
-    1582, 526, 1591, 1605, 526, 1592, 1605, 524, 1575, 1611, 523, 1575, 1611,
-    781, 1578, 1580, 1605, 780, 1578, 1581, 1580, 781, 1578, 1581, 1580, 781,
-    1578, 1581, 1605, 781, 1578, 1582, 1605, 781, 1578, 1605, 1580, 781,
-    1578, 1605, 1581, 781, 1578, 1605, 1582, 780, 1580, 1605, 1581, 781,
-    1580, 1605, 1581, 780, 1581, 1605, 1610, 780, 1581, 1605, 1609, 781,
-    1587, 1581, 1580, 781, 1587, 1580, 1581, 780, 1587, 1580, 1609, 780,
-    1587, 1605, 1581, 781, 1587, 1605, 1581, 781, 1587, 1605, 1580, 780,
-    1587, 1605, 1605, 781, 1587, 1605, 1605, 780, 1589, 1581, 1581, 781,
-    1589, 1581, 1581, 780, 1589, 1605, 1605, 780, 1588, 1581, 1605, 781,
-    1588, 1581, 1605, 780, 1588, 1580, 1610, 780, 1588, 1605, 1582, 781,
-    1588, 1605, 1582, 780, 1588, 1605, 1605, 781, 1588, 1605, 1605, 780,
-    1590, 1581, 1609, 780, 1590, 1582, 1605, 781, 1590, 1582, 1605, 780,
-    1591, 1605, 1581, 781, 1591, 1605, 1581, 781, 1591, 1605, 1605, 780,
-    1591, 1605, 1610, 780, 1593, 1580, 1605, 780, 1593, 1605, 1605, 781,
-    1593, 1605, 1605, 780, 1593, 1605, 1609, 780, 1594, 1605, 1605, 780,
-    1594, 1605, 1610, 780, 1594, 1605, 1609, 780, 1601, 1582, 1605, 781,
-    1601, 1582, 1605, 780, 1602, 1605, 1581, 780, 1602, 1605, 1605, 780,
-    1604, 1581, 1605, 780, 1604, 1581, 1610, 780, 1604, 1581, 1609, 781,
-    1604, 1580, 1580, 780, 1604, 1580, 1580, 780, 1604, 1582, 1605, 781,
-    1604, 1582, 1605, 780, 1604, 1605, 1581, 781, 1604, 1605, 1581, 781,
-    1605, 1581, 1580, 781, 1605, 1581, 1605, 780, 1605, 1581, 1610, 781,
-    1605, 1580, 1581, 781, 1605, 1580, 1605, 781, 1605, 1582, 1580, 781,
-    1605, 1582, 1605, 781, 1605, 1580, 1582, 781, 1607, 1605, 1580, 781,
-    1607, 1605, 1605, 781, 1606, 1581, 1605, 780, 1606, 1581, 1609, 780,
-    1606, 1580, 1605, 781, 1606, 1580, 1605, 780, 1606, 1580, 1609, 780,
-    1606, 1605, 1610, 780, 1606, 1605, 1609, 780, 1610, 1605, 1605, 781,
-    1610, 1605, 1605, 780, 1576, 1582, 1610, 780, 1578, 1580, 1610, 780,
-    1578, 1580, 1609, 780, 1578, 1582, 1610, 780, 1578, 1582, 1609, 780,
-    1578, 1605, 1610, 780, 1578, 1605, 1609, 780, 1580, 1605, 1610, 780,
-    1580, 1581, 1609, 780, 1580, 1605, 1609, 780, 1587, 1582, 1609, 780,
-    1589, 1581, 1610, 780, 1588, 1581, 1610, 780, 1590, 1581, 1610, 780,
-    1604, 1580, 1610, 780, 1604, 1605, 1610, 780, 1610, 1581, 1610, 780,
-    1610, 1580, 1610, 780, 1610, 1605, 1610, 780, 1605, 1605, 1610, 780,
-    1602, 1605, 1610, 780, 1606, 1581, 1610, 781, 1602, 1605, 1581, 781,
-    1604, 1581, 1605, 780, 1593, 1605, 1610, 780, 1603, 1605, 1610, 781,
-    1606, 1580, 1581, 780, 1605, 1582, 1610, 781, 1604, 1580, 1605, 780,
-    1603, 1605, 1605, 780, 1604, 1580, 1605, 780, 1606, 1580, 1581, 780,
-    1580, 1581, 1610, 780, 1581, 1580, 1610, 780, 1605, 1580, 1610, 780,
-    1601, 1605, 1610, 780, 1576, 1581, 1610, 781, 1603, 1605, 1605, 781,
-    1593, 1580, 1605, 781, 1589, 1605, 1605, 780, 1587, 1582, 1610, 780,
-    1606, 1580, 1610, 779, 1589, 1604, 1746, 779, 1602, 1604, 1746, 1035,
-    1575, 1604, 1604, 1607, 1035, 1575, 1603, 1576, 1585, 1035, 1605, 1581,
-    1605, 1583, 1035, 1589, 1604, 1593, 1605, 1035, 1585, 1587, 1608, 1604,
-    1035, 1593, 1604, 1610, 1607, 1035, 1608, 1587, 1604, 1605, 779, 1589,
-    1604, 1609, 4619, 1589, 1604, 1609, 32, 1575, 1604, 1604, 1607, 32, 1593,
-    1604, 1610, 1607, 32, 1608, 1587, 1604, 1605, 2059, 1580, 1604, 32, 1580,
-    1604, 1575, 1604, 1607, 1035, 1585, 1740, 1575, 1604, 265, 44, 265,
-    12289, 265, 12290, 265, 58, 265, 59, 265, 33, 265, 63, 265, 12310, 265,
-    12311, 265, 8230, 265, 8229, 265, 8212, 265, 8211, 265, 95, 265, 95, 265,
-    40, 265, 41, 265, 123, 265, 125, 265, 12308, 265, 12309, 265, 12304, 265,
-    12305, 265, 12298, 265, 12299, 265, 12296, 265, 12297, 265, 12300, 265,
-    12301, 265, 12302, 265, 12303, 265, 91, 265, 93, 258, 8254, 258, 8254,
-    258, 8254, 258, 8254, 258, 95, 258, 95, 258, 95, 271, 44, 271, 12289,
-    271, 46, 271, 59, 271, 58, 271, 63, 271, 33, 271, 8212, 271, 40, 271, 41,
-    271, 123, 271, 125, 271, 12308, 271, 12309, 271, 35, 271, 38, 271, 42,
-    271, 43, 271, 45, 271, 60, 271, 62, 271, 61, 271, 92, 271, 36, 271, 37,
-    271, 64, 523, 32, 1611, 526, 1600, 1611, 523, 32, 1612, 523, 32, 1613,
-    523, 32, 1614, 526, 1600, 1614, 523, 32, 1615, 526, 1600, 1615, 523, 32,
-    1616, 526, 1600, 1616, 523, 32, 1617, 526, 1600, 1617, 523, 32, 1618,
-    526, 1600, 1618, 267, 1569, 267, 1570, 268, 1570, 267, 1571, 268, 1571,
-    267, 1572, 268, 1572, 267, 1573, 268, 1573, 267, 1574, 268, 1574, 269,
-    1574, 270, 1574, 267, 1575, 268, 1575, 267, 1576, 268, 1576, 269, 1576,
-    270, 1576, 267, 1577, 268, 1577, 267, 1578, 268, 1578, 269, 1578, 270,
-    1578, 267, 1579, 268, 1579, 269, 1579, 270, 1579, 267, 1580, 268, 1580,
-    269, 1580, 270, 1580, 267, 1581, 268, 1581, 269, 1581, 270, 1581, 267,
-    1582, 268, 1582, 269, 1582, 270, 1582, 267, 1583, 268, 1583, 267, 1584,
-    268, 1584, 267, 1585, 268, 1585, 267, 1586, 268, 1586, 267, 1587, 268,
-    1587, 269, 1587, 270, 1587, 267, 1588, 268, 1588, 269, 1588, 270, 1588,
-    267, 1589, 268, 1589, 269, 1589, 270, 1589, 267, 1590, 268, 1590, 269,
-    1590, 270, 1590, 267, 1591, 268, 1591, 269, 1591, 270, 1591, 267, 1592,
-    268, 1592, 269, 1592, 270, 1592, 267, 1593, 268, 1593, 269, 1593, 270,
-    1593, 267, 1594, 268, 1594, 269, 1594, 270, 1594, 267, 1601, 268, 1601,
-    269, 1601, 270, 1601, 267, 1602, 268, 1602, 269, 1602, 270, 1602, 267,
-    1603, 268, 1603, 269, 1603, 270, 1603, 267, 1604, 268, 1604, 269, 1604,
-    270, 1604, 267, 1605, 268, 1605, 269, 1605, 270, 1605, 267, 1606, 268,
-    1606, 269, 1606, 270, 1606, 267, 1607, 268, 1607, 269, 1607, 270, 1607,
-    267, 1608, 268, 1608, 267, 1609, 268, 1609, 267, 1610, 268, 1610, 269,
-    1610, 270, 1610, 523, 1604, 1570, 524, 1604, 1570, 523, 1604, 1571, 524,
-    1604, 1571, 523, 1604, 1573, 524, 1604, 1573, 523, 1604, 1575, 524, 1604,
-    1575, 264, 33, 264, 34, 264, 35, 264, 36, 264, 37, 264, 38, 264, 39, 264,
-    40, 264, 41, 264, 42, 264, 43, 264, 44, 264, 45, 264, 46, 264, 47, 264,
-    48, 264, 49, 264, 50, 264, 51, 264, 52, 264, 53, 264, 54, 264, 55, 264,
-    56, 264, 57, 264, 58, 264, 59, 264, 60, 264, 61, 264, 62, 264, 63, 264,
-    64, 264, 65, 264, 66, 264, 67, 264, 68, 264, 69, 264, 70, 264, 71, 264,
-    72, 264, 73, 264, 74, 264, 75, 264, 76, 264, 77, 264, 78, 264, 79, 264,
-    80, 264, 81, 264, 82, 264, 83, 264, 84, 264, 85, 264, 86, 264, 87, 264,
-    88, 264, 89, 264, 90, 264, 91, 264, 92, 264, 93, 264, 94, 264, 95, 264,
-    96, 264, 97, 264, 98, 264, 99, 264, 100, 264, 101, 264, 102, 264, 103,
-    264, 104, 264, 105, 264, 106, 264, 107, 264, 108, 264, 109, 264, 110,
-    264, 111, 264, 112, 264, 113, 264, 114, 264, 115, 264, 116, 264, 117,
-    264, 118, 264, 119, 264, 120, 264, 121, 264, 122, 264, 123, 264, 124,
-    264, 125, 264, 126, 264, 10629, 264, 10630, 272, 12290, 272, 12300, 272,
-    12301, 272, 12289, 272, 12539, 272, 12530, 272, 12449, 272, 12451, 272,
-    12453, 272, 12455, 272, 12457, 272, 12515, 272, 12517, 272, 12519, 272,
-    12483, 272, 12540, 272, 12450, 272, 12452, 272, 12454, 272, 12456, 272,
-    12458, 272, 12459, 272, 12461, 272, 12463, 272, 12465, 272, 12467, 272,
-    12469, 272, 12471, 272, 12473, 272, 12475, 272, 12477, 272, 12479, 272,
-    12481, 272, 12484, 272, 12486, 272, 12488, 272, 12490, 272, 12491, 272,
-    12492, 272, 12493, 272, 12494, 272, 12495, 272, 12498, 272, 12501, 272,
-    12504, 272, 12507, 272, 12510, 272, 12511, 272, 12512, 272, 12513, 272,
-    12514, 272, 12516, 272, 12518, 272, 12520, 272, 12521, 272, 12522, 272,
-    12523, 272, 12524, 272, 12525, 272, 12527, 272, 12531, 272, 12441, 272,
-    12442, 272, 12644, 272, 12593, 272, 12594, 272, 12595, 272, 12596, 272,
-    12597, 272, 12598, 272, 12599, 272, 12600, 272, 12601, 272, 12602, 272,
-    12603, 272, 12604, 272, 12605, 272, 12606, 272, 12607, 272, 12608, 272,
-    12609, 272, 12610, 272, 12611, 272, 12612, 272, 12613, 272, 12614, 272,
-    12615, 272, 12616, 272, 12617, 272, 12618, 272, 12619, 272, 12620, 272,
-    12621, 272, 12622, 272, 12623, 272, 12624, 272, 12625, 272, 12626, 272,
-    12627, 272, 12628, 272, 12629, 272, 12630, 272, 12631, 272, 12632, 272,
-    12633, 272, 12634, 272, 12635, 272, 12636, 272, 12637, 272, 12638, 272,
-    12639, 272, 12640, 272, 12641, 272, 12642, 272, 12643, 264, 162, 264,
-    163, 264, 172, 264, 175, 264, 166, 264, 165, 264, 8361, 272, 9474, 272,
-    8592, 272, 8593, 272, 8594, 272, 8595, 272, 9632, 272, 9675, 512, 55300,
-    56473, 55300, 56506, 512, 55300, 56475, 55300, 56506, 512, 55300, 56485,
-    55300, 56506, 512, 55300, 56625, 55300, 56615, 512, 55300, 56626, 55300,
-    56615, 512, 55300, 57159, 55300, 57150, 512, 55300, 57159, 55300, 57175,
-    512, 55301, 56505, 55301, 56506, 512, 55301, 56505, 55301, 56496, 512,
-    55301, 56505, 55301, 56509, 512, 55301, 56760, 55301, 56751, 512, 55301,
-    56761, 55301, 56751, 512, 55348, 56663, 55348, 56677, 512, 55348, 56664,
-    55348, 56677, 512, 55348, 56671, 55348, 56686, 512, 55348, 56671, 55348,
-    56687, 512, 55348, 56671, 55348, 56688, 512, 55348, 56671, 55348, 56689,
-    512, 55348, 56671, 55348, 56690, 512, 55348, 56761, 55348, 56677, 512,
-    55348, 56762, 55348, 56677, 512, 55348, 56763, 55348, 56686, 512, 55348,
-    56764, 55348, 56686, 512, 55348, 56763, 55348, 56687, 512, 55348, 56764,
-    55348, 56687, 262, 65, 262, 66, 262, 67, 262, 68, 262, 69, 262, 70, 262,
-    71, 262, 72, 262, 73, 262, 74, 262, 75, 262, 76, 262, 77, 262, 78, 262,
-    79, 262, 80, 262, 81, 262, 82, 262, 83, 262, 84, 262, 85, 262, 86, 262,
-    87, 262, 88, 262, 89, 262, 90, 262, 97, 262, 98, 262, 99, 262, 100, 262,
-    101, 262, 102, 262, 103, 262, 104, 262, 105, 262, 106, 262, 107, 262,
-    108, 262, 109, 262, 110, 262, 111, 262, 112, 262, 113, 262, 114, 262,
-    115, 262, 116, 262, 117, 262, 118, 262, 119, 262, 120, 262, 121, 262,
-    122, 262, 65, 262, 66, 262, 67, 262, 68, 262, 69, 262, 70, 262, 71, 262,
-    72, 262, 73, 262, 74, 262, 75, 262, 76, 262, 77, 262, 78, 262, 79, 262,
-    80, 262, 81, 262, 82, 262, 83, 262, 84, 262, 85, 262, 86, 262, 87, 262,
-    88, 262, 89, 262, 90, 262, 97, 262, 98, 262, 99, 262, 100, 262, 101, 262,
-    102, 262, 103, 262, 105, 262, 106, 262, 107, 262, 108, 262, 109, 262,
-    110, 262, 111, 262, 112, 262, 113, 262, 114, 262, 115, 262, 116, 262,
-    117, 262, 118, 262, 119, 262, 120, 262, 121, 262, 122, 262, 65, 262, 66,
-    262, 67, 262, 68, 262, 69, 262, 70, 262, 71, 262, 72, 262, 73, 262, 74,
-    262, 75, 262, 76, 262, 77, 262, 78, 262, 79, 262, 80, 262, 81, 262, 82,
-    262, 83, 262, 84, 262, 85, 262, 86, 262, 87, 262, 88, 262, 89, 262, 90,
-    262, 97, 262, 98, 262, 99, 262, 100, 262, 101, 262, 102, 262, 103, 262,
-    104, 262, 105, 262, 106, 262, 107, 262, 108, 262, 109, 262, 110, 262,
-    111, 262, 112, 262, 113, 262, 114, 262, 115, 262, 116, 262, 117, 262,
-    118, 262, 119, 262, 120, 262, 121, 262, 122, 262, 65, 262, 67, 262, 68,
-    262, 71, 262, 74, 262, 75, 262, 78, 262, 79, 262, 80, 262, 81, 262, 83,
-    262, 84, 262, 85, 262, 86, 262, 87, 262, 88, 262, 89, 262, 90, 262, 97,
-    262, 98, 262, 99, 262, 100, 262, 102, 262, 104, 262, 105, 262, 106, 262,
-    107, 262, 108, 262, 109, 262, 110, 262, 112, 262, 113, 262, 114, 262,
-    115, 262, 116, 262, 117, 262, 118, 262, 119, 262, 120, 262, 121, 262,
-    122, 262, 65, 262, 66, 262, 67, 262, 68, 262, 69, 262, 70, 262, 71, 262,
-    72, 262, 73, 262, 74, 262, 75, 262, 76, 262, 77, 262, 78, 262, 79, 262,
-    80, 262, 81, 262, 82, 262, 83, 262, 84, 262, 85, 262, 86, 262, 87, 262,
-    88, 262, 89, 262, 90, 262, 97, 262, 98, 262, 99, 262, 100, 262, 101, 262,
-    102, 262, 103, 262, 104, 262, 105, 262, 106, 262, 107, 262, 108, 262,
-    109, 262, 110, 262, 111, 262, 112, 262, 113, 262, 114, 262, 115, 262,
-    116, 262, 117, 262, 118, 262, 119, 262, 120, 262, 121, 262, 122, 262, 65,
-    262, 66, 262, 68, 262, 69, 262, 70, 262, 71, 262, 74, 262, 75, 262, 76,
-    262, 77, 262, 78, 262, 79, 262, 80, 262, 81, 262, 83, 262, 84, 262, 85,
-    262, 86, 262, 87, 262, 88, 262, 89, 262, 97, 262, 98, 262, 99, 262, 100,
-    262, 101, 262, 102, 262, 103, 262, 104, 262, 105, 262, 106, 262, 107,
-    262, 108, 262, 109, 262, 110, 262, 111, 262, 112, 262, 113, 262, 114,
-    262, 115, 262, 116, 262, 117, 262, 118, 262, 119, 262, 120, 262, 121,
-    262, 122, 262, 65, 262, 66, 262, 68, 262, 69, 262, 70, 262, 71, 262, 73,
-    262, 74, 262, 75, 262, 76, 262, 77, 262, 79, 262, 83, 262, 84, 262, 85,
-    262, 86, 262, 87, 262, 88, 262, 89, 262, 97, 262, 98, 262, 99, 262, 100,
-    262, 101, 262, 102, 262, 103, 262, 104, 262, 105, 262, 106, 262, 107,
-    262, 108, 262, 109, 262, 110, 262, 111, 262, 112, 262, 113, 262, 114,
-    262, 115, 262, 116, 262, 117, 262, 118, 262, 119, 262, 120, 262, 121,
-    262, 122, 262, 65, 262, 66, 262, 67, 262, 68, 262, 69, 262, 70, 262, 71,
-    262, 72, 262, 73, 262, 74, 262, 75, 262, 76, 262, 77, 262, 78, 262, 79,
-    262, 80, 262, 81, 262, 82, 262, 83, 262, 84, 262, 85, 262, 86, 262, 87,
-    262, 88, 262, 89, 262, 90, 262, 97, 262, 98, 262, 99, 262, 100, 262, 101,
-    262, 102, 262, 103, 262, 104, 262, 105, 262, 106, 262, 107, 262, 108,
-    262, 109, 262, 110, 262, 111, 262, 112, 262, 113, 262, 114, 262, 115,
-    262, 116, 262, 117, 262, 118, 262, 119, 262, 120, 262, 121, 262, 122,
-    262, 65, 262, 66, 262, 67, 262, 68, 262, 69, 262, 70, 262, 71, 262, 72,
-    262, 73, 262, 74, 262, 75, 262, 76, 262, 77, 262, 78, 262, 79, 262, 80,
-    262, 81, 262, 82, 262, 83, 262, 84, 262, 85, 262, 86, 262, 87, 262, 88,
-    262, 89, 262, 90, 262, 97, 262, 98, 262, 99, 262, 100, 262, 101, 262,
-    102, 262, 103, 262, 104, 262, 105, 262, 106, 262, 107, 262, 108, 262,
-    109, 262, 110, 262, 111, 262, 112, 262, 113, 262, 114, 262, 115, 262,
-    116, 262, 117, 262, 118, 262, 119, 262, 120, 262, 121, 262, 122, 262, 65,
-    262, 66, 262, 67, 262, 68, 262, 69, 262, 70, 262, 71, 262, 72, 262, 73,
-    262, 74, 262, 75, 262, 76, 262, 77, 262, 78, 262, 79, 262, 80, 262, 81,
-    262, 82, 262, 83, 262, 84, 262, 85, 262, 86, 262, 87, 262, 88, 262, 89,
-    262, 90, 262, 97, 262, 98, 262, 99, 262, 100, 262, 101, 262, 102, 262,
-    103, 262, 104, 262, 105, 262, 106, 262, 107, 262, 108, 262, 109, 262,
-    110, 262, 111, 262, 112, 262, 113, 262, 114, 262, 115, 262, 116, 262,
-    117, 262, 118, 262, 119, 262, 120, 262, 121, 262, 122, 262, 65, 262, 66,
-    262, 67, 262, 68, 262, 69, 262, 70, 262, 71, 262, 72, 262, 73, 262, 74,
-    262, 75, 262, 76, 262, 77, 262, 78, 262, 79, 262, 80, 262, 81, 262, 82,
-    262, 83, 262, 84, 262, 85, 262, 86, 262, 87, 262, 88, 262, 89, 262, 90,
-    262, 97, 262, 98, 262, 99, 262, 100, 262, 101, 262, 102, 262, 103, 262,
-    104, 262, 105, 262, 106, 262, 107, 262, 108, 262, 109, 262, 110, 262,
-    111, 262, 112, 262, 113, 262, 114, 262, 115, 262, 116, 262, 117, 262,
-    118, 262, 119, 262, 120, 262, 121, 262, 122, 262, 65, 262, 66, 262, 67,
-    262, 68, 262, 69, 262, 70, 262, 71, 262, 72, 262, 73, 262, 74, 262, 75,
-    262, 76, 262, 77, 262, 78, 262, 79, 262, 80, 262, 81, 262, 82, 262, 83,
-    262, 84, 262, 85, 262, 86, 262, 87, 262, 88, 262, 89, 262, 90, 262, 97,
-    262, 98, 262, 99, 262, 100, 262, 101, 262, 102, 262, 103, 262, 104, 262,
-    105, 262, 106, 262, 107, 262, 108, 262, 109, 262, 110, 262, 111, 262,
-    112, 262, 113, 262, 114, 262, 115, 262, 116, 262, 117, 262, 118, 262,
-    119, 262, 120, 262, 121, 262, 122, 262, 65, 262, 66, 262, 67, 262, 68,
-    262, 69, 262, 70, 262, 71, 262, 72, 262, 73, 262, 74, 262, 75, 262, 76,
-    262, 77, 262, 78, 262, 79, 262, 80, 262, 81, 262, 82, 262, 83, 262, 84,
-    262, 85, 262, 86, 262, 87, 262, 88, 262, 89, 262, 90, 262, 97, 262, 98,
-    262, 99, 262, 100, 262, 101, 262, 102, 262, 103, 262, 104, 262, 105, 262,
-    106, 262, 107, 262, 108, 262, 109, 262, 110, 262, 111, 262, 112, 262,
-    113, 262, 114, 262, 115, 262, 116, 262, 117, 262, 118, 262, 119, 262,
-    120, 262, 121, 262, 122, 262, 305, 262, 567, 262, 913, 262, 914, 262,
-    915, 262, 916, 262, 917, 262, 918, 262, 919, 262, 920, 262, 921, 262,
-    922, 262, 923, 262, 924, 262, 925, 262, 926, 262, 927, 262, 928, 262,
-    929, 262, 1012, 262, 931, 262, 932, 262, 933, 262, 934, 262, 935, 262,
-    936, 262, 937, 262, 8711, 262, 945, 262, 946, 262, 947, 262, 948, 262,
-    949, 262, 950, 262, 951, 262, 952, 262, 953, 262, 954, 262, 955, 262,
-    956, 262, 957, 262, 958, 262, 959, 262, 960, 262, 961, 262, 962, 262,
-    963, 262, 964, 262, 965, 262, 966, 262, 967, 262, 968, 262, 969, 262,
-    8706, 262, 1013, 262, 977, 262, 1008, 262, 981, 262, 1009, 262, 982, 262,
-    913, 262, 914, 262, 915, 262, 916, 262, 917, 262, 918, 262, 919, 262,
-    920, 262, 921, 262, 922, 262, 923, 262, 924, 262, 925, 262, 926, 262,
-    927, 262, 928, 262, 929, 262, 1012, 262, 931, 262, 932, 262, 933, 262,
-    934, 262, 935, 262, 936, 262, 937, 262, 8711, 262, 945, 262, 946, 262,
-    947, 262, 948, 262, 949, 262, 950, 262, 951, 262, 952, 262, 953, 262,
-    954, 262, 955, 262, 956, 262, 957, 262, 958, 262, 959, 262, 960, 262,
-    961, 262, 962, 262, 963, 262, 964, 262, 965, 262, 966, 262, 967, 262,
-    968, 262, 969, 262, 8706, 262, 1013, 262, 977, 262, 1008, 262, 981, 262,
-    1009, 262, 982, 262, 913, 262, 914, 262, 915, 262, 916, 262, 917, 262,
-    918, 262, 919, 262, 920, 262, 921, 262, 922, 262, 923, 262, 924, 262,
-    925, 262, 926, 262, 927, 262, 928, 262, 929, 262, 1012, 262, 931, 262,
-    932, 262, 933, 262, 934, 262, 935, 262, 936, 262, 937, 262, 8711, 262,
-    945, 262, 946, 262, 947, 262, 948, 262, 949, 262, 950, 262, 951, 262,
-    952, 262, 953, 262, 954, 262, 955, 262, 956, 262, 957, 262, 958, 262,
-    959, 262, 960, 262, 961, 262, 962, 262, 963, 262, 964, 262, 965, 262,
-    966, 262, 967, 262, 968, 262, 969, 262, 8706, 262, 1013, 262, 977, 262,
-    1008, 262, 981, 262, 1009, 262, 982, 262, 913, 262, 914, 262, 915, 262,
-    916, 262, 917, 262, 918, 262, 919, 262, 920, 262, 921, 262, 922, 262,
-    923, 262, 924, 262, 925, 262, 926, 262, 927, 262, 928, 262, 929, 262,
-    1012, 262, 931, 262, 932, 262, 933, 262, 934, 262, 935, 262, 936, 262,
-    937, 262, 8711, 262, 945, 262, 946, 262, 947, 262, 948, 262, 949, 262,
-    950, 262, 951, 262, 952, 262, 953, 262, 954, 262, 955, 262, 956, 262,
-    957, 262, 958, 262, 959, 262, 960, 262, 961, 262, 962, 262, 963, 262,
-    964, 262, 965, 262, 966, 262, 967, 262, 968, 262, 969, 262, 8706, 262,
-    1013, 262, 977, 262, 1008, 262, 981, 262, 1009, 262, 982, 262, 913, 262,
-    914, 262, 915, 262, 916, 262, 917, 262, 918, 262, 919, 262, 920, 262,
-    921, 262, 922, 262, 923, 262, 924, 262, 925, 262, 926, 262, 927, 262,
-    928, 262, 929, 262, 1012, 262, 931, 262, 932, 262, 933, 262, 934, 262,
-    935, 262, 936, 262, 937, 262, 8711, 262, 945, 262, 946, 262, 947, 262,
-    948, 262, 949, 262, 950, 262, 951, 262, 952, 262, 953, 262, 954, 262,
-    955, 262, 956, 262, 957, 262, 958, 262, 959, 262, 960, 262, 961, 262,
-    962, 262, 963, 262, 964, 262, 965, 262, 966, 262, 967, 262, 968, 262,
-    969, 262, 8706, 262, 1013, 262, 977, 262, 1008, 262, 981, 262, 1009, 262,
-    982, 262, 988, 262, 989, 262, 48, 262, 49, 262, 50, 262, 51, 262, 52,
-    262, 53, 262, 54, 262, 55, 262, 56, 262, 57, 262, 48, 262, 49, 262, 50,
-    262, 51, 262, 52, 262, 53, 262, 54, 262, 55, 262, 56, 262, 57, 262, 48,
-    262, 49, 262, 50, 262, 51, 262, 52, 262, 53, 262, 54, 262, 55, 262, 56,
-    262, 57, 262, 48, 262, 49, 262, 50, 262, 51, 262, 52, 262, 53, 262, 54,
-    262, 55, 262, 56, 262, 57, 262, 48, 262, 49, 262, 50, 262, 51, 262, 52,
-    262, 53, 262, 54, 262, 55, 262, 56, 262, 57, 262, 1575, 262, 1576, 262,
-    1580, 262, 1583, 262, 1608, 262, 1586, 262, 1581, 262, 1591, 262, 1610,
-    262, 1603, 262, 1604, 262, 1605, 262, 1606, 262, 1587, 262, 1593, 262,
-    1601, 262, 1589, 262, 1602, 262, 1585, 262, 1588, 262, 1578, 262, 1579,
-    262, 1582, 262, 1584, 262, 1590, 262, 1592, 262, 1594, 262, 1646, 262,
-    1722, 262, 1697, 262, 1647, 262, 1576, 262, 1580, 262, 1607, 262, 1581,
-    262, 1610, 262, 1603, 262, 1604, 262, 1605, 262, 1606, 262, 1587, 262,
-    1593, 262, 1601, 262, 1589, 262, 1602, 262, 1588, 262, 1578, 262, 1579,
-    262, 1582, 262, 1590, 262, 1594, 262, 1580, 262, 1581, 262, 1610, 262,
-    1604, 262, 1606, 262, 1587, 262, 1593, 262, 1589, 262, 1602, 262, 1588,
-    262, 1582, 262, 1590, 262, 1594, 262, 1722, 262, 1647, 262, 1576, 262,
-    1580, 262, 1607, 262, 1581, 262, 1591, 262, 1610, 262, 1603, 262, 1605,
-    262, 1606, 262, 1587, 262, 1593, 262, 1601, 262, 1589, 262, 1602, 262,
-    1588, 262, 1578, 262, 1579, 262, 1582, 262, 1590, 262, 1592, 262, 1594,
-    262, 1646, 262, 1697, 262, 1575, 262, 1576, 262, 1580, 262, 1583, 262,
-    1607, 262, 1608, 262, 1586, 262, 1581, 262, 1591, 262, 1610, 262, 1604,
-    262, 1605, 262, 1606, 262, 1587, 262, 1593, 262, 1601, 262, 1589, 262,
-    1602, 262, 1585, 262, 1588, 262, 1578, 262, 1579, 262, 1582, 262, 1584,
-    262, 1590, 262, 1592, 262, 1594, 262, 1576, 262, 1580, 262, 1583, 262,
-    1608, 262, 1586, 262, 1581, 262, 1591, 262, 1610, 262, 1604, 262, 1605,
-    262, 1606, 262, 1587, 262, 1593, 262, 1601, 262, 1589, 262, 1602, 262,
-    1585, 262, 1588, 262, 1578, 262, 1579, 262, 1582, 262, 1584, 262, 1590,
-    262, 1592, 262, 1594, 514, 48, 46, 514, 48, 44, 514, 49, 44, 514, 50, 44,
-    514, 51, 44, 514, 52, 44, 514, 53, 44, 514, 54, 44, 514, 55, 44, 514, 56,
-    44, 514, 57, 44, 770, 40, 65, 41, 770, 40, 66, 41, 770, 40, 67, 41, 770,
-    40, 68, 41, 770, 40, 69, 41, 770, 40, 70, 41, 770, 40, 71, 41, 770, 40,
-    72, 41, 770, 40, 73, 41, 770, 40, 74, 41, 770, 40, 75, 41, 770, 40, 76,
-    41, 770, 40, 77, 41, 770, 40, 78, 41, 770, 40, 79, 41, 770, 40, 80, 41,
-    770, 40, 81, 41, 770, 40, 82, 41, 770, 40, 83, 41, 770, 40, 84, 41, 770,
-    40, 85, 41, 770, 40, 86, 41, 770, 40, 87, 41, 770, 40, 88, 41, 770, 40,
-    89, 41, 770, 40, 90, 41, 770, 12308, 83, 12309, 263, 67, 263, 82, 519,
-    67, 68, 519, 87, 90, 266, 65, 266, 66, 266, 67, 266, 68, 266, 69, 266,
-    70, 266, 71, 266, 72, 266, 73, 266, 74, 266, 75, 266, 76, 266, 77, 266,
-    78, 266, 79, 266, 80, 266, 81, 266, 82, 266, 83, 266, 84, 266, 85, 266,
-    86, 266, 87, 266, 88, 266, 89, 266, 90, 522, 72, 86, 522, 77, 86, 522,
-    83, 68, 522, 83, 83, 778, 80, 80, 86, 522, 87, 67, 515, 77, 67, 515, 77,
-    68, 522, 68, 74, 522, 12411, 12363, 522, 12467, 12467, 266, 12469, 266,
-    25163, 266, 23383, 266, 21452, 266, 12487, 266, 20108, 266, 22810, 266,
-    35299, 266, 22825, 266, 20132, 266, 26144, 266, 28961, 266, 26009, 266,
-    21069, 266, 24460, 266, 20877, 266, 26032, 266, 21021, 266, 32066, 266,
-    29983, 266, 36009, 266, 22768, 266, 21561, 266, 28436, 266, 25237, 266,
-    25429, 266, 19968, 266, 19977, 266, 36938, 266, 24038, 266, 20013, 266,
-    21491, 266, 25351, 266, 36208, 266, 25171, 266, 31105, 266, 31354, 266,
-    21512, 266, 28288, 266, 26377, 266, 26376, 266, 30003, 266, 21106, 266,
-    21942, 266, 37197, 770, 12308, 26412, 12309, 770, 12308, 19977, 12309,
-    770, 12308, 20108, 12309, 770, 12308, 23433, 12309, 770, 12308, 28857,
-    12309, 770, 12308, 25171, 12309, 770, 12308, 30423, 12309, 770, 12308,
-    21213, 12309, 770, 12308, 25943, 12309, 263, 24471, 263, 21487, 256,
-    20029, 256, 20024, 256, 20033, 256, 55360, 56610, 256, 20320, 256, 20398,
-    256, 20411, 256, 20482, 256, 20602, 256, 20633, 256, 20711, 256, 20687,
-    256, 13470, 256, 55361, 56890, 256, 20813, 256, 20820, 256, 20836, 256,
-    20855, 256, 55361, 56604, 256, 13497, 256, 20839, 256, 20877, 256, 55361,
-    56651, 256, 20887, 256, 20900, 256, 20172, 256, 20908, 256, 20917, 256,
-    55396, 56799, 256, 20981, 256, 20995, 256, 13535, 256, 21051, 256, 21062,
-    256, 21106, 256, 21111, 256, 13589, 256, 21191, 256, 21193, 256, 21220,
-    256, 21242, 256, 21253, 256, 21254, 256, 21271, 256, 21321, 256, 21329,
-    256, 21338, 256, 21363, 256, 21373, 256, 21375, 256, 21375, 256, 21375,
-    256, 55362, 56876, 256, 28784, 256, 21450, 256, 21471, 256, 55362, 57187,
-    256, 21483, 256, 21489, 256, 21510, 256, 21662, 256, 21560, 256, 21576,
-    256, 21608, 256, 21666, 256, 21750, 256, 21776, 256, 21843, 256, 21859,
-    256, 21892, 256, 21892, 256, 21913, 256, 21931, 256, 21939, 256, 21954,
-    256, 22294, 256, 22022, 256, 22295, 256, 22097, 256, 22132, 256, 20999,
-    256, 22766, 256, 22478, 256, 22516, 256, 22541, 256, 22411, 256, 22578,
-    256, 22577, 256, 22700, 256, 55365, 56548, 256, 22770, 256, 22775, 256,
-    22790, 256, 22810, 256, 22818, 256, 22882, 256, 55365, 57000, 256, 55365,
-    57066, 256, 23020, 256, 23067, 256, 23079, 256, 23000, 256, 23142, 256,
-    14062, 256, 14076, 256, 23304, 256, 23358, 256, 23358, 256, 55366, 56776,
-    256, 23491, 256, 23512, 256, 23527, 256, 23539, 256, 55366, 57112, 256,
-    23551, 256, 23558, 256, 24403, 256, 23586, 256, 14209, 256, 23648, 256,
-    23662, 256, 23744, 256, 23693, 256, 55367, 56804, 256, 23875, 256, 55367,
-    56806, 256, 23918, 256, 23915, 256, 23932, 256, 24033, 256, 24034, 256,
-    14383, 256, 24061, 256, 24104, 256, 24125, 256, 24169, 256, 14434, 256,
-    55368, 56707, 256, 14460, 256, 24240, 256, 24243, 256, 24246, 256, 24266,
-    256, 55400, 57234, 256, 24318, 256, 55368, 57137, 256, 55368, 57137, 256,
-    33281, 256, 24354, 256, 24354, 256, 14535, 256, 55372, 57016, 256, 55384,
-    56794, 256, 24418, 256, 24427, 256, 14563, 256, 24474, 256, 24525, 256,
-    24535, 256, 24569, 256, 24705, 256, 14650, 256, 14620, 256, 24724, 256,
-    55369, 57044, 256, 24775, 256, 24904, 256, 24908, 256, 24910, 256, 24908,
-    256, 24954, 256, 24974, 256, 25010, 256, 24996, 256, 25007, 256, 25054,
-    256, 25074, 256, 25078, 256, 25104, 256, 25115, 256, 25181, 256, 25265,
-    256, 25300, 256, 25424, 256, 55370, 57100, 256, 25405, 256, 25340, 256,
-    25448, 256, 25475, 256, 25572, 256, 55370, 57329, 256, 25634, 256, 25541,
-    256, 25513, 256, 14894, 256, 25705, 256, 25726, 256, 25757, 256, 25719,
-    256, 14956, 256, 25935, 256, 25964, 256, 55372, 56330, 256, 26083, 256,
-    26360, 256, 26185, 256, 15129, 256, 26257, 256, 15112, 256, 15076, 256,
-    20882, 256, 20885, 256, 26368, 256, 26268, 256, 32941, 256, 17369, 256,
-    26391, 256, 26395, 256, 26401, 256, 26462, 256, 26451, 256, 55372, 57283,
-    256, 15177, 256, 26618, 256, 26501, 256, 26706, 256, 26757, 256, 55373,
-    56429, 256, 26766, 256, 26655, 256, 26900, 256, 15261, 256, 26946, 256,
-    27043, 256, 27114, 256, 27304, 256, 55373, 56995, 256, 27355, 256, 15384,
-    256, 27425, 256, 55374, 56487, 256, 27476, 256, 15438, 256, 27506, 256,
-    27551, 256, 27578, 256, 27579, 256, 55374, 56973, 256, 55367, 56587, 256,
-    55374, 57082, 256, 27726, 256, 55375, 56508, 256, 27839, 256, 27853, 256,
-    27751, 256, 27926, 256, 27966, 256, 28023, 256, 27969, 256, 28009, 256,
-    28024, 256, 28037, 256, 55375, 56606, 256, 27956, 256, 28207, 256, 28270,
-    256, 15667, 256, 28363, 256, 28359, 256, 55375, 57041, 256, 28153, 256,
-    28526, 256, 55375, 57182, 256, 55375, 57230, 256, 28614, 256, 28729, 256,
-    28702, 256, 28699, 256, 15766, 256, 28746, 256, 28797, 256, 28791, 256,
-    28845, 256, 55361, 56613, 256, 28997, 256, 55376, 56931, 256, 29084, 256,
-    55376, 57259, 256, 29224, 256, 29237, 256, 29264, 256, 55377, 56840, 256,
-    29312, 256, 29333, 256, 55377, 57141, 256, 55378, 56340, 256, 29562, 256,
-    29579, 256, 16044, 256, 29605, 256, 16056, 256, 16056, 256, 29767, 256,
-    29788, 256, 29809, 256, 29829, 256, 29898, 256, 16155, 256, 29988, 256,
-    55379, 56374, 256, 30014, 256, 55379, 56466, 256, 30064, 256, 55368,
-    56735, 256, 30224, 256, 55379, 57249, 256, 55379, 57272, 256, 55380,
-    56388, 256, 16380, 256, 16392, 256, 30452, 256, 55380, 56563, 256, 55380,
-    56562, 256, 55380, 56601, 256, 55380, 56627, 256, 30494, 256, 30495, 256,
-    30495, 256, 30538, 256, 16441, 256, 30603, 256, 16454, 256, 16534, 256,
-    55381, 56349, 256, 30798, 256, 30860, 256, 30924, 256, 16611, 256, 55381,
-    56870, 256, 31062, 256, 55381, 56986, 256, 55381, 57029, 256, 31119, 256,
-    31211, 256, 16687, 256, 31296, 256, 31306, 256, 31311, 256, 55382, 56700,
-    256, 55382, 56999, 256, 55382, 56999, 256, 31470, 256, 16898, 256, 55382,
-    57259, 256, 31686, 256, 31689, 256, 16935, 256, 55383, 56448, 256, 31954,
-    256, 17056, 256, 31976, 256, 31971, 256, 32000, 256, 55383, 57222, 256,
-    32099, 256, 17153, 256, 32199, 256, 32258, 256, 32325, 256, 17204, 256,
-    55384, 56872, 256, 55384, 56903, 256, 17241, 256, 55384, 57049, 256,
-    32634, 256, 55384, 57150, 256, 32661, 256, 32762, 256, 32773, 256, 55385,
-    56538, 256, 55385, 56611, 256, 32864, 256, 55385, 56744, 256, 32880, 256,
-    55372, 57183, 256, 17365, 256, 32946, 256, 33027, 256, 17419, 256, 33086,
-    256, 23221, 256, 55385, 57255, 256, 55385, 57269, 256, 55372, 57235, 256,
-    55372, 57244, 256, 33281, 256, 33284, 256, 36766, 256, 17515, 256, 33425,
-    256, 33419, 256, 33437, 256, 21171, 256, 33457, 256, 33459, 256, 33469,
-    256, 33510, 256, 55386, 57148, 256, 33509, 256, 33565, 256, 33635, 256,
-    33709, 256, 33571, 256, 33725, 256, 33767, 256, 33879, 256, 33619, 256,
-    33738, 256, 33740, 256, 33756, 256, 55387, 56374, 256, 55387, 56683, 256,
-    55387, 56533, 256, 17707, 256, 34033, 256, 34035, 256, 34070, 256, 55388,
-    57290, 256, 34148, 256, 55387, 57132, 256, 17757, 256, 17761, 256, 55387,
-    57265, 256, 55388, 56530, 256, 17771, 256, 34384, 256, 34396, 256, 34407,
-    256, 34409, 256, 34473, 256, 34440, 256, 34574, 256, 34530, 256, 34681,
-    256, 34600, 256, 34667, 256, 34694, 256, 17879, 256, 34785, 256, 34817,
-    256, 17913, 256, 34912, 256, 34915, 256, 55389, 56935, 256, 35031, 256,
-    35038, 256, 17973, 256, 35066, 256, 13499, 256, 55390, 56494, 256, 55390,
-    56678, 256, 18110, 256, 18119, 256, 35488, 256, 35565, 256, 35722, 256,
-    35925, 256, 55391, 56488, 256, 36011, 256, 36033, 256, 36123, 256, 36215,
-    256, 55391, 57135, 256, 55362, 56324, 256, 36299, 256, 36284, 256, 36336,
-    256, 55362, 56542, 256, 36564, 256, 36664, 256, 55393, 56786, 256, 55393,
-    56813, 256, 37012, 256, 37105, 256, 37137, 256, 55393, 57134, 256, 37147,
-    256, 37432, 256, 37591, 256, 37592, 256, 37500, 256, 37881, 256, 37909,
-    256, 55394, 57338, 256, 38283, 256, 18837, 256, 38327, 256, 55395, 56695,
-    256, 18918, 256, 38595, 256, 23986, 256, 38691, 256, 55396, 56645, 256,
-    55396, 56858, 256, 19054, 256, 19062, 256, 38880, 256, 55397, 56330, 256,
-    19122, 256, 55397, 56470, 256, 38923, 256, 38923, 256, 38953, 256, 55397,
-    56758, 256, 39138, 256, 19251, 256, 39209, 256, 39335, 256, 39362, 256,
-    39422, 256, 19406, 256, 55398, 57136, 256, 39698, 256, 40000, 256, 40189,
-    256, 19662, 256, 19693, 256, 40295, 256, 55400, 56526, 256, 19704, 256,
-    55400, 56581, 256, 55400, 56846, 256, 55400, 56977, 256, 40635, 256,
-    19798, 256, 40697, 256, 40702, 256, 40709, 256, 40719, 256, 40726, 256,
-    40763, 256, 55401, 56832,
-};
-
-/* index tables for the decomposition data */
-#define DECOMP_SHIFT1 6
-#define DECOMP_SHIFT2 4
-static const unsigned char decomp_index0[] = {
-    0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 13, 14, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 15, 16, 5, 5, 5, 5, 17, 18,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 19, 20,
-    5, 5, 5, 5, 5, 21, 22, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    23, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-};
-
-static const unsigned short decomp_index1[] = {
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
-    14, 0, 0, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 0, 0, 0, 0, 0, 0, 0,
-    25, 0, 26, 27, 0, 0, 0, 0, 0, 28, 0, 0, 29, 30, 31, 32, 33, 34, 35, 0,
-    36, 37, 38, 0, 39, 0, 40, 0, 41, 0, 0, 0, 0, 42, 43, 44, 45, 0, 0, 0, 0,
-    0, 0, 0, 0, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 48, 0, 0, 0,
-    0, 49, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 51, 52, 0, 53, 0, 0, 0, 0,
-    0, 0, 54, 55, 0, 0, 0, 0, 0, 56, 0, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 58, 59, 0, 0, 0, 60, 0, 0, 61, 0, 0, 0, 0, 0, 0, 0, 62, 0, 0, 0,
-    0, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 65, 0,
-    0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 0, 67, 0, 68, 0, 0, 69, 0, 0, 0, 70,
-    71, 72, 73, 74, 75, 76, 77, 0, 0, 0, 0, 0, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 81, 0,
-    82, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 84, 85, 86, 87, 88, 89, 0, 90, 91, 92, 0, 0, 0, 0,
-    93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108,
-    109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122,
-    123, 124, 125, 126, 127, 128, 129, 130, 0, 131, 132, 133, 134, 0, 0, 0,
-    0, 0, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 0, 146, 0,
-    0, 0, 147, 0, 148, 149, 150, 0, 151, 152, 153, 0, 154, 0, 0, 0, 155, 0,
-    0, 0, 156, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 157,
-    158, 159, 160, 161, 162, 163, 164, 165, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 166, 0,
-    0, 0, 0, 0, 0, 167, 0, 0, 0, 0, 0, 168, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 169, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 170, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    171, 0, 0, 0, 0, 0, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181,
-    182, 183, 184, 185, 186, 0, 0, 187, 0, 0, 188, 189, 190, 191, 192, 0,
-    193, 194, 195, 196, 197, 0, 198, 0, 0, 0, 199, 200, 201, 202, 203, 204,
-    205, 0, 0, 0, 0, 0, 0, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215,
-    216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229,
-    230, 231, 232, 233, 234, 235, 236, 237, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 238, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 239, 0, 0,
-    0, 0, 0, 0, 0, 240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 241, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 242, 243, 244, 245, 246, 247,
-    248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261,
-    262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 0, 0, 272, 273, 274,
-    275, 276, 277, 278, 279, 280, 281, 282, 283, 0, 284, 285, 286, 287, 288,
-    289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302,
-    303, 304, 305, 306, 0, 307, 308, 309, 310, 311, 312, 313, 314, 0, 0, 315,
-    0, 316, 0, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328,
-    329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342,
-    343, 344, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 345, 346, 0, 0, 0, 0, 0, 0, 0,
-    347, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 348, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 349, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 350, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 351, 352, 0, 0, 0, 0, 353, 354, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
-    365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378,
-    379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392,
-    393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406,
-    407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 431, 432, 433, 434, 435, 0, 436, 0,
-    0, 437, 0, 0, 0, 0, 0, 0, 438, 439, 440, 441, 442, 443, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 444, 445,
-    446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459,
-    460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473,
-    474, 475, 476, 477, 0, 0, 0, 0, 0, 0, 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 unsigned short decomp_index2[] = {
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
-    3, 0, 6, 0, 0, 0, 0, 8, 0, 0, 11, 13, 15, 18, 0, 0, 20, 23, 25, 0, 27,
-    31, 35, 0, 39, 42, 45, 48, 51, 54, 0, 57, 60, 63, 66, 69, 72, 75, 78, 81,
-    0, 84, 87, 90, 93, 96, 99, 0, 0, 102, 105, 108, 111, 114, 0, 0, 117, 120,
-    123, 126, 129, 132, 0, 135, 138, 141, 144, 147, 150, 153, 156, 159, 0,
-    162, 165, 168, 171, 174, 177, 0, 0, 180, 183, 186, 189, 192, 0, 195, 198,
-    201, 204, 207, 210, 213, 216, 219, 222, 225, 228, 231, 234, 237, 240,
-    243, 0, 0, 246, 249, 252, 255, 258, 261, 264, 267, 270, 273, 276, 279,
-    282, 285, 288, 291, 294, 297, 300, 303, 0, 0, 306, 309, 312, 315, 318,
-    321, 324, 327, 330, 0, 333, 336, 339, 342, 345, 348, 0, 351, 354, 357,
-    360, 363, 366, 369, 372, 0, 0, 375, 378, 381, 384, 387, 390, 393, 0, 0,
-    396, 399, 402, 405, 408, 411, 0, 0, 414, 417, 420, 423, 426, 429, 432,
-    435, 438, 441, 444, 447, 450, 453, 456, 459, 462, 465, 0, 0, 468, 471,
-    474, 477, 480, 483, 486, 489, 492, 495, 498, 501, 504, 507, 510, 513,
-    516, 519, 522, 525, 528, 531, 534, 537, 539, 542, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 545, 548, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 551, 554, 557, 560, 563, 566, 569, 572, 575, 578, 581, 584, 587,
-    590, 593, 596, 599, 602, 605, 608, 611, 614, 617, 620, 623, 0, 626, 629,
-    632, 635, 638, 641, 0, 0, 644, 647, 650, 653, 656, 659, 662, 665, 668,
-    671, 674, 677, 680, 683, 686, 689, 0, 0, 692, 695, 698, 701, 704, 707,
-    710, 713, 716, 719, 722, 725, 728, 731, 734, 737, 740, 743, 746, 749,
-    752, 755, 758, 761, 764, 767, 770, 773, 776, 779, 782, 785, 788, 791,
-    794, 797, 0, 0, 800, 803, 0, 0, 0, 0, 0, 0, 806, 809, 812, 815, 818, 821,
-    824, 827, 830, 833, 836, 839, 842, 845, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 848, 850, 852, 854, 856, 858, 860, 862, 864, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 866, 869, 872, 875, 878, 881, 0, 0, 884, 886, 888,
-    890, 892, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 894, 896, 0, 898, 900, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 903, 0, 0, 0, 0, 0, 905, 0, 0, 0,
-    908, 0, 0, 0, 0, 0, 910, 913, 916, 919, 921, 924, 927, 0, 930, 0, 933,
-    936, 939, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 942, 945, 948, 951, 954, 957, 960, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 963, 966, 969, 972, 975,
-    0, 978, 980, 982, 984, 987, 990, 992, 0, 0, 0, 0, 0, 0, 0, 0, 0, 994,
-    996, 998, 0, 1000, 1002, 0, 0, 0, 1004, 0, 0, 0, 0, 0, 0, 1006, 1009, 0,
-    1012, 0, 0, 0, 1015, 0, 0, 0, 0, 1018, 1021, 1024, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 1027, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1030, 0, 0,
-    0, 0, 0, 0, 1033, 1036, 0, 1039, 0, 0, 0, 1042, 0, 0, 0, 0, 1045, 1048,
-    1051, 0, 0, 0, 0, 0, 0, 0, 1054, 1057, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1060,
-    1063, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1066, 1069, 1072, 1075, 0,
-    0, 1078, 1081, 0, 0, 1084, 1087, 1090, 1093, 1096, 1099, 0, 0, 1102,
-    1105, 1108, 1111, 1114, 1117, 0, 0, 1120, 1123, 1126, 1129, 1132, 1135,
-    1138, 1141, 1144, 1147, 1150, 1153, 0, 0, 1156, 1159, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 1162, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1165, 1168,
-    1171, 1174, 1177, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1180, 1183,
-    1186, 1189, 0, 0, 0, 0, 0, 0, 0, 1192, 0, 1195, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 1198, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 1201, 0, 0, 0, 0, 0, 0, 0, 1204, 0, 0, 1207, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1210, 1213, 1216,
-    1219, 1222, 1225, 1228, 1231, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1234,
-    1237, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1240, 1243, 0, 1246,
-    0, 0, 0, 1249, 0, 0, 1252, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 1255, 1258, 1261, 0, 0, 1264, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1267,
-    0, 0, 1270, 1273, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1276,
-    1279, 0, 0, 0, 0, 0, 0, 1282, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 1285, 1288, 1291, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    1294, 0, 0, 0, 0, 0, 0, 0, 1297, 0, 0, 0, 0, 0, 0, 1300, 1303, 0, 1306,
-    1309, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1312, 1315, 1318, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1321, 0, 1324, 1327, 1330, 0, 0, 0, 0,
-    1333, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1336, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1339, 1342, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1345, 0, 0, 0, 0, 0, 0, 1347, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 1350, 0, 0, 0, 0, 1353, 0, 0, 0, 0, 1356, 0, 0,
-    0, 0, 1359, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1362, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 1365, 0, 1368, 1371, 1374, 1377, 1380, 0, 0, 0, 0, 0, 0, 0,
-    1383, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1386, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 1389, 0, 0, 0, 0, 1392, 0, 0, 0, 0, 1395, 0, 0, 0, 0,
-    1398, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1401, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 1404, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 1407, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1409, 0, 1412, 0, 1415, 0,
-    1418, 0, 1421, 0, 0, 0, 1424, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1427, 0, 1430, 0, 0, 1433, 1436, 0, 1439,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    1442, 1444, 1446, 0, 1448, 1450, 1452, 1454, 1456, 1458, 1460, 1462,
-    1464, 1466, 1468, 0, 1470, 1472, 1474, 1476, 1478, 1480, 1482, 1484,
-    1486, 1488, 1490, 1492, 1494, 1496, 1498, 1500, 1502, 1504, 0, 1506,
-    1508, 1510, 1512, 1514, 1516, 1518, 1520, 1522, 1524, 1526, 1528, 1530,
-    1532, 1534, 1536, 1538, 1540, 1542, 1544, 1546, 1548, 1550, 1552, 1554,
-    1556, 1558, 1560, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1562, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1564, 1566, 1568, 1570,
-    1572, 1574, 1576, 1578, 1580, 1582, 1584, 1586, 1588, 1590, 1592, 1594,
-    1596, 1598, 1600, 1602, 1604, 1606, 1608, 1610, 1612, 1614, 1616, 1618,
-    1620, 1622, 1624, 1626, 1628, 1630, 1632, 1634, 1636, 1638, 1641, 1644,
-    1647, 1650, 1653, 1656, 1659, 1662, 1665, 1668, 1671, 1674, 1677, 1680,
-    1683, 1686, 1689, 1692, 1695, 1698, 1701, 1704, 1707, 1710, 1713, 1716,
-    1719, 1722, 1725, 1728, 1731, 1734, 1737, 1740, 1743, 1746, 1749, 1752,
-    1755, 1758, 1761, 1764, 1767, 1770, 1773, 1776, 1779, 1782, 1785, 1788,
-    1791, 1794, 1797, 1800, 1803, 1806, 1809, 1812, 1815, 1818, 1821, 1824,
-    1827, 1830, 1833, 1836, 1839, 1842, 1845, 1848, 1851, 1854, 1857, 1860,
-    1863, 1866, 1869, 1872, 1875, 1878, 1881, 1884, 1887, 1890, 1893, 1896,
-    1899, 1902, 1905, 1908, 1911, 1914, 1917, 1920, 1923, 1926, 1929, 1932,
-    1935, 1938, 1941, 1944, 1947, 1950, 1953, 1956, 1959, 1962, 1965, 1968,
-    1971, 1974, 1977, 1980, 1983, 1986, 1989, 1992, 1995, 1998, 2001, 2004,
-    2007, 2010, 2013, 2016, 2019, 2022, 2025, 2028, 2031, 2034, 2037, 2040,
-    2043, 2046, 2049, 2052, 2055, 2058, 2061, 2064, 2067, 2070, 2073, 2076,
-    2079, 2082, 2085, 2088, 2091, 2094, 2097, 2100, 2103, 0, 0, 0, 0, 2106,
-    2109, 2112, 2115, 2118, 2121, 2124, 2127, 2130, 2133, 2136, 2139, 2142,
-    2145, 2148, 2151, 2154, 2157, 2160, 2163, 2166, 2169, 2172, 2175, 2178,
-    2181, 2184, 2187, 2190, 2193, 2196, 2199, 2202, 2205, 2208, 2211, 2214,
-    2217, 2220, 2223, 2226, 2229, 2232, 2235, 2238, 2241, 2244, 2247, 2250,
-    2253, 2256, 2259, 2262, 2265, 2268, 2271, 2274, 2277, 2280, 2283, 2286,
-    2289, 2292, 2295, 2298, 2301, 2304, 2307, 2310, 2313, 2316, 2319, 2322,
-    2325, 2328, 2331, 2334, 2337, 2340, 2343, 2346, 2349, 2352, 2355, 2358,
-    2361, 2364, 2367, 2370, 2373, 0, 0, 0, 0, 0, 0, 2376, 2379, 2382, 2385,
-    2388, 2391, 2394, 2397, 2400, 2403, 2406, 2409, 2412, 2415, 2418, 2421,
-    2424, 2427, 2430, 2433, 2436, 2439, 0, 0, 2442, 2445, 2448, 2451, 2454,
-    2457, 0, 0, 2460, 2463, 2466, 2469, 2472, 2475, 2478, 2481, 2484, 2487,
-    2490, 2493, 2496, 2499, 2502, 2505, 2508, 2511, 2514, 2517, 2520, 2523,
-    2526, 2529, 2532, 2535, 2538, 2541, 2544, 2547, 2550, 2553, 2556, 2559,
-    2562, 2565, 2568, 2571, 0, 0, 2574, 2577, 2580, 2583, 2586, 2589, 0, 0,
-    2592, 2595, 2598, 2601, 2604, 2607, 2610, 2613, 0, 2616, 0, 2619, 0,
-    2622, 0, 2625, 2628, 2631, 2634, 2637, 2640, 2643, 2646, 2649, 2652,
-    2655, 2658, 2661, 2664, 2667, 2670, 2673, 2676, 2679, 2681, 2684, 2686,
-    2689, 2691, 2694, 2696, 2699, 2701, 2704, 2706, 2709, 0, 0, 2711, 2714,
-    2717, 2720, 2723, 2726, 2729, 2732, 2735, 2738, 2741, 2744, 2747, 2750,
-    2753, 2756, 2759, 2762, 2765, 2768, 2771, 2774, 2777, 2780, 2783, 2786,
-    2789, 2792, 2795, 2798, 2801, 2804, 2807, 2810, 2813, 2816, 2819, 2822,
-    2825, 2828, 2831, 2834, 2837, 2840, 2843, 2846, 2849, 2852, 2855, 2858,
-    2861, 2864, 2867, 0, 2870, 2873, 2876, 2879, 2882, 2885, 2887, 2890,
-    2893, 2895, 2898, 2901, 2904, 2907, 2910, 0, 2913, 2916, 2919, 2922,
-    2924, 2927, 2929, 2932, 2935, 2938, 2941, 2944, 2947, 2950, 0, 0, 2952,
-    2955, 2958, 2961, 2964, 2967, 0, 2969, 2972, 2975, 2978, 2981, 2984,
-    2987, 2989, 2992, 2995, 2998, 3001, 3004, 3007, 3010, 3012, 3015, 3018,
-    3020, 0, 0, 3022, 3025, 3028, 0, 3031, 3034, 3037, 3040, 3042, 3045,
-    3047, 3050, 3052, 0, 3055, 3057, 3059, 3061, 3063, 3065, 3067, 3069,
-    3071, 3073, 3075, 0, 0, 0, 0, 0, 0, 3077, 0, 0, 0, 0, 0, 3079, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 3082, 3084, 3087, 0, 0, 0, 0, 0, 0, 0, 0,
-    3091, 0, 0, 0, 3093, 3096, 0, 3100, 3103, 0, 0, 0, 0, 3107, 0, 3110, 0,
-    0, 0, 0, 0, 0, 0, 0, 3113, 3116, 3119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 3122, 0, 0, 0, 0, 0, 0, 0, 3127, 3129, 3131, 0, 0, 3133, 3135,
-    3137, 3139, 3141, 3143, 3145, 3147, 3149, 3151, 3153, 3155, 3157, 3159,
-    3161, 3163, 3165, 3167, 3169, 3171, 3173, 3175, 3177, 3179, 3181, 3183,
-    3185, 0, 3187, 3189, 3191, 3193, 3195, 3197, 3199, 3201, 3203, 3205,
-    3207, 3209, 3211, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3213, 0, 0, 0, 0, 0,
-    0, 0, 3216, 3220, 3224, 3226, 0, 3229, 3233, 3237, 0, 3239, 3242, 3244,
-    3246, 3248, 3250, 3252, 3254, 3256, 3258, 3260, 0, 3262, 3264, 0, 0,
-    3267, 3269, 3271, 3273, 3275, 0, 0, 3277, 3280, 3284, 0, 3287, 0, 3289,
-    0, 3291, 0, 3293, 3295, 3297, 3299, 0, 3301, 3303, 3305, 0, 3307, 3309,
-    3311, 3313, 3315, 3317, 3319, 0, 3321, 3325, 3327, 3329, 3331, 3333, 0,
-    0, 0, 0, 3335, 3337, 3339, 3341, 3343, 0, 0, 0, 0, 0, 0, 3345, 3349,
-    3353, 3358, 3362, 3366, 3370, 3374, 3378, 3382, 3386, 3390, 3394, 3398,
-    3402, 3406, 3409, 3411, 3414, 3418, 3421, 3423, 3426, 3430, 3435, 3438,
-    3440, 3443, 3447, 3449, 3451, 3453, 3455, 3457, 3460, 3464, 3467, 3469,
-    3472, 3476, 3481, 3484, 3486, 3489, 3493, 3495, 3497, 3499, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 3501, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    3505, 3508, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3511,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3514, 3517, 3520, 0, 0, 0, 0,
-    3523, 0, 0, 0, 0, 3526, 0, 0, 3529, 0, 0, 0, 0, 0, 0, 0, 3532, 0, 3535,
-    0, 0, 0, 0, 0, 3538, 3541, 0, 3545, 3548, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 3552, 0, 0, 3555, 0, 0, 3558, 0, 3561, 0, 0, 0, 0, 0,
-    0, 3564, 0, 3567, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3570, 3573, 3576, 3579,
-    3582, 0, 0, 3585, 3588, 0, 0, 3591, 3594, 0, 0, 0, 0, 0, 0, 3597, 3600,
-    0, 0, 3603, 3606, 0, 0, 3609, 3612, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 3615, 3618, 3621, 3624, 3627, 3630, 3633, 3636, 0, 0,
-    0, 0, 0, 0, 3639, 3642, 3645, 3648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    3651, 3653, 0, 0, 0, 0, 0, 3655, 3657, 3659, 3661, 3663, 3665, 3667,
-    3669, 3671, 3673, 3676, 3679, 3682, 3685, 3688, 3691, 3694, 3697, 3700,
-    3703, 3706, 3710, 3714, 3718, 3722, 3726, 3730, 3734, 3738, 3742, 3747,
-    3752, 3757, 3762, 3767, 3772, 3777, 3782, 3787, 3792, 3797, 3800, 3803,
-    3806, 3809, 3812, 3815, 3818, 3821, 3824, 3828, 3832, 3836, 3840, 3844,
-    3848, 3852, 3856, 3860, 3864, 3868, 3872, 3876, 3880, 3884, 3888, 3892,
-    3896, 3900, 3904, 3908, 3912, 3916, 3920, 3924, 3928, 3932, 3936, 3940,
-    3944, 3948, 3952, 3956, 3960, 3964, 3968, 3972, 3974, 3976, 3978, 3980,
-    3982, 3984, 3986, 3988, 3990, 3992, 3994, 3996, 3998, 4000, 4002, 4004,
-    4006, 4008, 4010, 4012, 4014, 4016, 4018, 4020, 4022, 4024, 4026, 4028,
-    4030, 4032, 4034, 4036, 4038, 4040, 4042, 4044, 4046, 4048, 4050, 4052,
-    4054, 4056, 4058, 4060, 4062, 4064, 4066, 4068, 4070, 4072, 4074, 4076,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4078, 0, 0, 0, 0, 0,
-    0, 0, 4083, 4087, 4090, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 4094, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4097,
-    4099, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4101, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4103, 0, 0, 0, 4105, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 4107, 4109, 4111, 4113, 4115, 4117, 4119, 4121,
-    4123, 4125, 4127, 4129, 4131, 4133, 4135, 4137, 4139, 4141, 4143, 4145,
-    4147, 4149, 4151, 4153, 4155, 4157, 4159, 4161, 4163, 4165, 4167, 4169,
-    4171, 4173, 4175, 4177, 4179, 4181, 4183, 4185, 4187, 4189, 4191, 4193,
-    4195, 4197, 4199, 4201, 4203, 4205, 4207, 4209, 4211, 4213, 4215, 4217,
-    4219, 4221, 4223, 4225, 4227, 4229, 4231, 4233, 4235, 4237, 4239, 4241,
-    4243, 4245, 4247, 4249, 4251, 4253, 4255, 4257, 4259, 4261, 4263, 4265,
-    4267, 4269, 4271, 4273, 4275, 4277, 4279, 4281, 4283, 4285, 4287, 4289,
-    4291, 4293, 4295, 4297, 4299, 4301, 4303, 4305, 4307, 4309, 4311, 4313,
-    4315, 4317, 4319, 4321, 4323, 4325, 4327, 4329, 4331, 4333, 4335, 4337,
-    4339, 4341, 4343, 4345, 4347, 4349, 4351, 4353, 4355, 4357, 4359, 4361,
-    4363, 4365, 4367, 4369, 4371, 4373, 4375, 4377, 4379, 4381, 4383, 4385,
-    4387, 4389, 4391, 4393, 4395, 4397, 4399, 4401, 4403, 4405, 4407, 4409,
-    4411, 4413, 4415, 4417, 4419, 4421, 4423, 4425, 4427, 4429, 4431, 4433,
-    4435, 4437, 4439, 4441, 4443, 4445, 4447, 4449, 4451, 4453, 4455, 4457,
-    4459, 4461, 4463, 4465, 4467, 4469, 4471, 4473, 4475, 4477, 4479, 4481,
-    4483, 4485, 4487, 4489, 4491, 4493, 4495, 4497, 4499, 4501, 4503, 4505,
-    4507, 4509, 4511, 4513, 4515, 4517, 4519, 4521, 4523, 4525, 4527, 4529,
-    4531, 4533, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4535, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4537, 0, 4539, 4541, 4543, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4545, 0, 4548, 0, 4551, 0,
-    4554, 0, 4557, 0, 4560, 0, 4563, 0, 4566, 0, 4569, 0, 4572, 0, 4575, 0,
-    4578, 0, 0, 4581, 0, 4584, 0, 4587, 0, 0, 0, 0, 0, 0, 4590, 4593, 0,
-    4596, 4599, 0, 4602, 4605, 0, 4608, 4611, 0, 4614, 4617, 0, 0, 0, 0, 0,
-    0, 4620, 0, 0, 0, 0, 0, 0, 4623, 4626, 0, 4629, 4632, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 4635, 0, 4638, 0, 4641, 0, 4644, 0, 4647, 0, 4650, 0,
-    4653, 0, 4656, 0, 4659, 0, 4662, 0, 4665, 0, 4668, 0, 0, 4671, 0, 4674,
-    0, 4677, 0, 0, 0, 0, 0, 0, 4680, 4683, 0, 4686, 4689, 0, 4692, 4695, 0,
-    4698, 4701, 0, 4704, 4707, 0, 0, 0, 0, 0, 0, 4710, 0, 0, 4713, 4716,
-    4719, 4722, 0, 0, 0, 4725, 4728, 0, 4731, 4733, 4735, 4737, 4739, 4741,
-    4743, 4745, 4747, 4749, 4751, 4753, 4755, 4757, 4759, 4761, 4763, 4765,
-    4767, 4769, 4771, 4773, 4775, 4777, 4779, 4781, 4783, 4785, 4787, 4789,
-    4791, 4793, 4795, 4797, 4799, 4801, 4803, 4805, 4807, 4809, 4811, 4813,
-    4815, 4817, 4819, 4821, 4823, 4825, 4827, 4829, 4831, 4833, 4835, 4837,
-    4839, 4841, 4843, 4845, 4847, 4849, 4851, 4853, 4855, 4857, 4859, 4861,
-    4863, 4865, 4867, 4869, 4871, 4873, 4875, 4877, 4879, 4881, 4883, 4885,
-    4887, 4889, 4891, 4893, 4895, 4897, 4899, 4901, 4903, 4905, 4907, 4909,
-    4911, 4913, 4915, 4917, 0, 0, 0, 4919, 4921, 4923, 4925, 4927, 4929,
-    4931, 4933, 4935, 4937, 4939, 4941, 4943, 4945, 4947, 4951, 4955, 4959,
-    4963, 4967, 4971, 4975, 4979, 4983, 4987, 4991, 4995, 4999, 5003, 5008,
-    5013, 5018, 5023, 5028, 5033, 5038, 5043, 5048, 5053, 5058, 5063, 5068,
-    5073, 5078, 5086, 0, 5093, 5097, 5101, 5105, 5109, 5113, 5117, 5121,
-    5125, 5129, 5133, 5137, 5141, 5145, 5149, 5153, 5157, 5161, 5165, 5169,
-    5173, 5177, 5181, 5185, 5189, 5193, 5197, 5201, 5205, 5209, 5213, 5217,
-    5221, 5225, 5229, 5233, 5237, 5239, 5241, 5243, 0, 0, 0, 0, 0, 0, 0, 0,
-    5245, 5249, 5252, 5255, 5258, 5261, 5264, 5267, 5270, 5273, 5276, 5279,
-    5282, 5285, 5288, 5291, 5294, 5296, 5298, 5300, 5302, 5304, 5306, 5308,
-    5310, 5312, 5314, 5316, 5318, 5320, 5322, 5325, 5328, 5331, 5334, 5337,
-    5340, 5343, 5346, 5349, 5352, 5355, 5358, 5361, 5364, 5370, 5375, 0,
-    5378, 5380, 5382, 5384, 5386, 5388, 5390, 5392, 5394, 5396, 5398, 5400,
-    5402, 5404, 5406, 5408, 5410, 5412, 5414, 5416, 5418, 5420, 5422, 5424,
-    5426, 5428, 5430, 5432, 5434, 5436, 5438, 5440, 5442, 5444, 5446, 5448,
-    5450, 5452, 5454, 5456, 5458, 5460, 5462, 5464, 5466, 5468, 5470, 5472,
-    5474, 5476, 5479, 5482, 5485, 5488, 5491, 5494, 5497, 5500, 5503, 5506,
-    5509, 5512, 5515, 5518, 5521, 5524, 5527, 5530, 5533, 5536, 5539, 5542,
-    5545, 5548, 5552, 5556, 5560, 5563, 5567, 5570, 5574, 5576, 5578, 5580,
-    5582, 5584, 5586, 5588, 5590, 5592, 5594, 5596, 5598, 5600, 5602, 5604,
-    5606, 5608, 5610, 5612, 5614, 5616, 5618, 5620, 5622, 5624, 5626, 5628,
-    5630, 5632, 5634, 5636, 5638, 5640, 5642, 5644, 5646, 5648, 5650, 5652,
-    5654, 5656, 5658, 5660, 5662, 5664, 5666, 0, 5668, 5673, 5678, 5683,
-    5687, 5692, 5696, 5700, 5706, 5711, 5715, 5719, 5723, 5728, 5733, 5737,
-    5741, 5744, 5748, 5753, 5758, 5761, 5767, 5774, 5780, 5784, 5790, 5796,
-    5801, 5805, 5809, 5813, 5818, 5824, 5829, 5833, 5837, 5841, 5844, 5847,
-    5850, 5853, 5857, 5861, 5867, 5871, 5876, 5882, 5886, 5889, 5892, 5898,
-    5903, 5909, 5913, 5919, 5922, 5926, 5930, 5934, 5938, 5942, 5947, 5951,
-    5954, 5958, 5962, 5966, 5971, 5975, 5979, 5983, 5989, 5994, 5997, 6003,
-    6006, 6011, 6016, 6020, 6024, 6028, 6033, 6036, 6040, 6045, 6048, 6054,
-    6058, 6061, 6064, 6067, 6070, 6073, 6076, 6079, 6082, 6085, 6088, 6092,
-    6096, 6100, 6104, 6108, 6112, 6116, 6120, 6124, 6128, 6132, 6136, 6140,
-    6144, 6148, 6152, 6155, 6158, 6162, 6165, 6168, 6171, 6175, 6179, 6182,
-    6185, 6188, 6191, 6194, 6199, 6202, 6205, 6208, 6211, 6214, 6217, 6220,
-    6223, 6227, 6232, 6235, 6238, 6241, 6244, 6247, 6250, 6253, 6257, 6261,
-    6265, 6269, 6272, 6275, 6278, 6281, 6284, 6287, 6290, 6293, 6296, 6299,
-    6303, 6307, 6310, 6314, 6318, 6322, 6325, 6329, 6333, 6338, 6341, 6345,
-    6349, 6353, 6357, 6363, 6370, 6373, 6376, 6379, 6382, 6385, 6388, 6391,
-    6394, 6397, 6400, 6403, 6406, 6409, 6412, 6415, 6418, 6421, 6424, 6429,
-    6432, 6435, 6438, 6443, 6447, 6450, 6453, 6456, 6459, 6462, 6465, 6468,
-    6471, 6474, 6477, 6481, 6484, 6487, 6491, 6495, 6498, 6503, 6507, 6510,
-    6513, 6516, 6519, 6523, 6527, 6530, 6533, 6536, 6539, 6542, 6545, 6548,
-    6551, 6554, 6558, 6562, 6566, 6570, 6574, 6578, 6582, 6586, 6590, 6594,
-    6598, 6602, 6606, 6610, 6614, 6618, 6622, 6626, 6630, 6634, 6638, 6642,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6646, 6648, 0, 0, 6650, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6652, 6654, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6656, 6658, 6660,
-    6662, 6664, 6666, 6668, 6670, 6672, 6674, 6676, 6678, 6680, 6682, 6684,
-    6686, 6688, 6690, 6692, 6694, 6696, 6698, 6700, 6702, 6704, 6706, 6708,
-    6710, 6712, 6714, 6716, 6718, 6720, 6722, 6724, 6726, 6728, 6730, 6732,
-    6734, 6736, 6738, 6740, 6742, 6744, 6746, 6748, 6750, 6752, 6754, 6756,
-    6758, 6760, 6762, 6764, 6766, 6768, 6770, 6772, 6774, 6776, 6778, 6780,
-    6782, 6784, 6786, 6788, 6790, 6792, 6794, 6796, 6798, 6800, 6802, 6804,
-    6806, 6808, 6810, 6812, 6814, 6816, 6818, 6820, 6822, 6824, 6826, 6828,
-    6830, 6832, 6834, 6836, 6838, 6840, 6842, 6844, 6846, 6848, 6850, 6852,
-    6854, 6856, 6858, 6860, 6862, 6864, 6866, 6868, 6870, 6872, 6874, 6876,
-    6878, 6880, 6882, 6884, 6886, 6888, 6890, 6892, 6894, 6896, 6898, 6900,
-    6902, 6904, 6906, 6908, 6910, 6912, 6914, 6916, 6918, 6920, 6922, 6924,
-    6926, 6928, 6930, 6932, 6934, 6936, 6938, 6940, 6942, 6944, 6946, 6948,
-    6950, 6952, 6954, 6956, 6958, 6960, 6962, 6964, 6966, 6968, 6970, 6972,
-    6974, 6976, 6978, 6980, 6982, 6984, 6986, 6988, 6990, 6992, 6994, 6996,
-    6998, 7000, 7002, 7004, 7006, 7008, 7010, 7012, 7014, 7016, 7018, 7020,
-    7022, 7024, 7026, 7028, 7030, 7032, 7034, 7036, 7038, 7040, 7042, 7044,
-    7046, 7048, 7050, 7052, 7054, 7056, 7058, 7060, 7062, 7064, 7066, 7068,
-    7070, 7072, 7074, 7076, 7078, 7080, 7082, 7084, 7086, 7088, 7090, 7092,
-    7094, 7096, 7098, 7100, 7102, 7104, 7106, 7108, 7110, 7112, 7114, 7116,
-    7118, 7120, 7122, 7124, 7126, 7128, 7130, 7132, 7134, 7136, 7138, 7140,
-    7142, 7144, 7146, 7148, 7150, 7152, 7154, 7156, 7158, 7160, 7162, 7164,
-    7166, 7168, 7170, 7172, 7174, 7176, 7178, 7180, 7182, 7184, 7186, 7188,
-    7190, 7192, 7194, 7196, 7198, 7200, 7202, 0, 0, 7204, 0, 7206, 0, 0,
-    7208, 7210, 7212, 7214, 7216, 7218, 7220, 7222, 7224, 7226, 0, 7228, 0,
-    7230, 0, 0, 7232, 7234, 0, 0, 0, 7236, 7238, 7240, 7242, 7244, 7246,
-    7248, 7250, 7252, 7254, 7256, 7258, 7260, 7262, 7264, 7266, 7268, 7270,
-    7272, 7274, 7276, 7278, 7280, 7282, 7284, 7286, 7288, 7290, 7292, 7294,
-    7296, 7298, 7300, 7302, 7304, 7306, 7308, 7310, 7312, 7314, 7316, 7318,
-    7320, 7322, 7324, 7326, 7328, 7330, 7332, 7334, 7336, 7338, 7340, 7342,
-    7344, 7346, 7348, 7350, 7352, 7354, 7356, 7358, 7360, 7362, 7364, 7366,
-    7368, 7371, 0, 0, 7373, 7375, 7377, 7379, 7381, 7383, 7385, 7387, 7389,
-    7391, 7393, 7395, 7397, 7399, 7401, 7403, 7405, 7407, 7409, 7411, 7413,
-    7415, 7417, 7419, 7421, 7423, 7425, 7427, 7429, 7431, 7433, 7435, 7437,
-    7439, 7441, 7443, 7445, 7447, 7449, 7451, 7453, 7455, 7457, 7459, 7461,
-    7463, 7465, 7467, 7469, 7471, 7473, 7475, 7477, 7479, 7481, 7483, 7485,
-    7487, 7489, 7491, 7493, 7495, 7497, 7499, 7501, 7503, 7505, 7507, 7509,
-    7511, 7513, 7515, 7517, 7519, 7521, 7523, 7525, 7527, 7529, 7531, 7533,
-    7535, 7537, 7539, 7541, 7543, 7545, 7547, 7549, 7551, 7553, 7555, 7557,
-    7559, 7561, 7563, 7566, 7569, 7572, 7574, 7576, 7578, 7581, 7584, 7587,
-    7589, 0, 0, 0, 0, 0, 0, 7591, 7594, 7597, 7600, 7604, 7608, 7611, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7614, 7617, 7620, 7623, 7626, 0, 0, 0, 0,
-    0, 7629, 0, 7632, 7635, 7637, 7639, 7641, 7643, 7645, 7647, 7649, 7651,
-    7653, 7655, 7658, 7661, 7664, 7667, 7670, 7673, 7676, 7679, 7682, 7685,
-    7688, 7691, 0, 7694, 7697, 7700, 7703, 7706, 0, 7709, 0, 7712, 7715, 0,
-    7718, 7721, 0, 7724, 7727, 7730, 7733, 7736, 7739, 7742, 7745, 7748,
-    7751, 7754, 7756, 7758, 7760, 7762, 7764, 7766, 7768, 7770, 7772, 7774,
-    7776, 7778, 7780, 7782, 7784, 7786, 7788, 7790, 7792, 7794, 7796, 7798,
-    7800, 7802, 7804, 7806, 7808, 7810, 7812, 7814, 7816, 7818, 7820, 7822,
-    7824, 7826, 7828, 7830, 7832, 7834, 7836, 7838, 7840, 7842, 7844, 7846,
-    7848, 7850, 7852, 7854, 7856, 7858, 7860, 7862, 7864, 7866, 7868, 7870,
-    7872, 7874, 7876, 7878, 7880, 7882, 7884, 7886, 7888, 7890, 7892, 7894,
-    7896, 7898, 7900, 7902, 7904, 7906, 7908, 7910, 7912, 7914, 7916, 7918,
-    7920, 7922, 7924, 7926, 7928, 7930, 7932, 7934, 7936, 7938, 7940, 7942,
-    7944, 7946, 7948, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    7950, 7952, 7954, 7956, 7958, 7960, 7962, 7964, 7966, 7968, 7970, 7972,
-    7974, 7976, 7978, 7980, 7982, 7984, 7986, 7988, 7990, 7992, 7994, 7996,
-    7999, 8002, 8005, 8008, 8011, 8014, 8017, 8020, 8023, 8026, 8029, 8032,
-    8035, 8038, 8041, 8044, 8047, 8050, 8052, 8054, 8056, 8058, 8061, 8064,
-    8067, 8070, 8073, 8076, 8079, 8082, 8085, 8088, 8091, 8094, 8097, 8100,
-    8103, 8106, 8109, 8112, 8115, 8118, 8121, 8124, 8127, 8130, 8133, 8136,
-    8139, 8142, 8145, 8148, 8151, 8154, 8157, 8160, 8163, 8166, 8169, 8172,
-    8175, 8178, 8181, 8184, 8187, 8190, 8193, 8196, 8199, 8202, 8205, 8208,
-    8211, 8214, 8217, 8220, 8223, 8226, 8229, 8232, 8235, 8238, 8241, 8244,
-    8247, 8250, 8253, 8256, 8259, 8262, 8265, 8268, 8271, 8274, 8277, 8280,
-    8283, 8286, 8289, 8292, 8295, 8298, 8301, 8304, 8307, 8310, 8313, 8316,
-    8319, 8322, 8325, 8328, 8331, 8334, 8337, 8340, 8344, 8348, 8352, 8356,
-    8360, 8364, 8367, 8370, 8373, 8376, 8379, 8382, 8385, 8388, 8391, 8394,
-    8397, 8400, 8403, 8406, 8409, 8412, 8415, 8418, 8421, 8424, 8427, 8430,
-    8433, 8436, 8439, 8442, 8445, 8448, 8451, 8454, 8457, 8460, 8463, 8466,
-    8469, 8472, 8475, 8478, 8481, 8484, 8487, 8490, 8493, 8496, 8499, 8502,
-    8505, 8508, 8511, 8514, 8517, 8520, 8523, 8526, 8529, 8532, 8535, 8538,
-    8541, 8544, 8547, 8550, 8553, 8556, 8559, 8562, 8565, 8568, 8571, 8574,
-    8577, 8580, 8583, 8586, 8589, 8592, 8595, 8598, 8601, 8604, 8607, 8610,
-    8613, 8616, 8619, 8622, 8625, 8628, 8631, 8634, 8637, 8640, 8643, 8646,
-    8649, 8652, 8655, 8658, 8661, 8664, 8667, 8670, 8673, 8676, 8679, 8682,
-    8685, 8688, 8691, 8694, 8697, 8700, 8703, 8706, 8709, 8712, 8715, 8718,
-    8721, 8724, 8727, 8730, 8733, 8736, 8739, 8742, 8745, 8748, 8751, 8754,
-    8757, 8760, 8763, 8766, 8769, 8772, 8775, 8778, 8781, 8784, 8787, 8790,
-    8794, 8798, 8802, 8805, 8808, 8811, 8814, 8817, 8820, 8823, 8826, 8829,
-    8832, 8835, 8838, 8841, 8844, 8847, 8850, 8853, 8856, 8859, 8862, 8865,
-    8868, 8871, 8874, 8877, 8880, 8883, 8886, 8889, 8892, 8895, 8898, 8901,
-    8904, 8907, 8910, 8913, 8916, 8919, 8922, 8925, 8928, 8931, 8934, 8937,
-    8940, 8943, 8946, 8949, 8952, 8955, 8958, 8961, 8964, 8967, 8970, 8973,
-    8976, 8979, 8982, 8985, 8988, 8991, 8994, 8997, 9000, 9003, 9006, 9009,
-    9012, 9015, 9018, 0, 0, 9021, 9025, 9029, 9033, 9037, 9041, 9045, 9049,
-    9053, 9057, 9061, 9065, 9069, 9073, 9077, 9081, 9085, 9089, 9093, 9097,
-    9101, 9105, 9109, 9113, 9117, 9121, 9125, 9129, 9133, 9137, 9141, 9145,
-    9149, 9153, 9157, 9161, 9165, 9169, 9173, 9177, 9181, 9185, 9189, 9193,
-    9197, 9201, 9205, 9209, 9213, 9217, 9221, 9225, 9229, 9233, 9237, 9241,
-    9245, 9249, 9253, 9257, 9261, 9265, 9269, 9273, 0, 0, 9277, 9281, 9285,
-    9289, 9293, 9297, 9301, 9305, 9309, 9313, 9317, 9321, 9325, 9329, 9333,
-    9337, 9341, 9345, 9349, 9353, 9357, 9361, 9365, 9369, 9373, 9377, 9381,
-    9385, 9389, 9393, 9397, 9401, 9405, 9409, 9413, 9417, 9421, 9425, 9429,
-    9433, 9437, 9441, 9445, 9449, 9453, 9457, 9461, 9465, 9469, 9473, 9477,
-    9481, 9485, 9489, 0, 0, 0, 0, 0, 0, 0, 0, 9493, 9497, 9501, 9506, 9511,
-    9516, 9521, 9526, 9531, 9536, 9540, 9559, 9568, 0, 0, 0, 9573, 9575,
-    9577, 9579, 9581, 9583, 9585, 9587, 9589, 9591, 0, 0, 0, 0, 0, 0, 9593,
-    9595, 9597, 9599, 9601, 9603, 9605, 9607, 9609, 9611, 9613, 9615, 9617,
-    9619, 9621, 9623, 9625, 9627, 9629, 9631, 9633, 0, 0, 9635, 9637, 9639,
-    9641, 9643, 9645, 9647, 9649, 9651, 9653, 9655, 9657, 0, 9659, 9661,
-    9663, 9665, 9667, 9669, 9671, 9673, 9675, 9677, 9679, 9681, 9683, 9685,
-    9687, 9689, 9691, 9693, 9695, 0, 9697, 9699, 9701, 9703, 0, 0, 0, 0,
-    9705, 9708, 9711, 0, 9714, 0, 9717, 9720, 9723, 9726, 9729, 9732, 9735,
-    9738, 9741, 9744, 9747, 9749, 9751, 9753, 9755, 9757, 9759, 9761, 9763,
-    9765, 9767, 9769, 9771, 9773, 9775, 9777, 9779, 9781, 9783, 9785, 9787,
-    9789, 9791, 9793, 9795, 9797, 9799, 9801, 9803, 9805, 9807, 9809, 9811,
-    9813, 9815, 9817, 9819, 9821, 9823, 9825, 9827, 9829, 9831, 9833, 9835,
-    9837, 9839, 9841, 9843, 9845, 9847, 9849, 9851, 9853, 9855, 9857, 9859,
-    9861, 9863, 9865, 9867, 9869, 9871, 9873, 9875, 9877, 9879, 9881, 9883,
-    9885, 9887, 9889, 9891, 9893, 9895, 9897, 9899, 9901, 9903, 9905, 9907,
-    9909, 9911, 9913, 9915, 9917, 9919, 9921, 9923, 9925, 9927, 9929, 9931,
-    9933, 9935, 9937, 9939, 9941, 9943, 9945, 9947, 9949, 9951, 9953, 9955,
-    9957, 9959, 9961, 9963, 9965, 9967, 9969, 9971, 9973, 9975, 9977, 9979,
-    9981, 9984, 9987, 9990, 9993, 9996, 9999, 10002, 0, 0, 0, 0, 10005,
-    10007, 10009, 10011, 10013, 10015, 10017, 10019, 10021, 10023, 10025,
-    10027, 10029, 10031, 10033, 10035, 10037, 10039, 10041, 10043, 10045,
-    10047, 10049, 10051, 10053, 10055, 10057, 10059, 10061, 10063, 10065,
-    10067, 10069, 10071, 10073, 10075, 10077, 10079, 10081, 10083, 10085,
-    10087, 10089, 10091, 10093, 10095, 10097, 10099, 10101, 10103, 10105,
-    10107, 10109, 10111, 10113, 10115, 10117, 10119, 10121, 10123, 10125,
-    10127, 10129, 10131, 10133, 10135, 10137, 10139, 10141, 10143, 10145,
-    10147, 10149, 10151, 10153, 10155, 10157, 10159, 10161, 10163, 10165,
-    10167, 10169, 10171, 10173, 10175, 10177, 10179, 10181, 10183, 10185,
-    10187, 10189, 10191, 10193, 10195, 10197, 10199, 10201, 10203, 10205,
-    10207, 10209, 10211, 10213, 10215, 10217, 10219, 10221, 10223, 10225,
-    10227, 10229, 10231, 10233, 10235, 10237, 10239, 10241, 10243, 10245,
-    10247, 10249, 10251, 10253, 10255, 10257, 10259, 10261, 10263, 10265,
-    10267, 10269, 10271, 10273, 10275, 10277, 10279, 10281, 10283, 10285,
-    10287, 10289, 10291, 10293, 10295, 10297, 10299, 10301, 10303, 10305,
-    10307, 10309, 10311, 10313, 10315, 10317, 10319, 10321, 10323, 10325,
-    10327, 10329, 10331, 10333, 10335, 10337, 10339, 10341, 10343, 10345,
-    10347, 10349, 10351, 10353, 10355, 10357, 10359, 10361, 10363, 10365,
-    10367, 10369, 10371, 10373, 10375, 10377, 10379, 10381, 10383, 0, 0, 0,
-    10385, 10387, 10389, 10391, 10393, 10395, 0, 0, 10397, 10399, 10401,
-    10403, 10405, 10407, 0, 0, 10409, 10411, 10413, 10415, 10417, 10419, 0,
-    0, 10421, 10423, 10425, 0, 0, 0, 10427, 10429, 10431, 10433, 10435,
-    10437, 10439, 0, 10441, 10443, 10445, 10447, 10449, 10451, 10453, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 10455, 0, 10460, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 10465, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    10470, 10475, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10480, 10485, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10490, 10495, 0, 10500, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 10505, 10510, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 10515, 10520, 10525, 10530, 10535, 10540, 10545, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10550, 10555, 10560,
-    10565, 10570, 10575, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10580,
-    10582, 10584, 10586, 10588, 10590, 10592, 10594, 10596, 10598, 10600,
-    10602, 10604, 10606, 10608, 10610, 10612, 10614, 10616, 10618, 10620,
-    10622, 10624, 10626, 10628, 10630, 10632, 10634, 10636, 10638, 10640,
-    10642, 10644, 10646, 10648, 10650, 10652, 10654, 10656, 10658, 10660,
-    10662, 10664, 10666, 10668, 10670, 10672, 10674, 10676, 10678, 10680,
-    10682, 10684, 10686, 10688, 10690, 10692, 10694, 10696, 10698, 10700,
-    10702, 10704, 10706, 10708, 10710, 10712, 10714, 10716, 10718, 10720,
-    10722, 10724, 10726, 10728, 10730, 10732, 10734, 10736, 10738, 10740,
-    10742, 10744, 10746, 10748, 0, 10750, 10752, 10754, 10756, 10758, 10760,
-    10762, 10764, 10766, 10768, 10770, 10772, 10774, 10776, 10778, 10780,
-    10782, 10784, 10786, 10788, 10790, 10792, 10794, 10796, 10798, 10800,
-    10802, 10804, 10806, 10808, 10810, 10812, 10814, 10816, 10818, 10820,
-    10822, 10824, 10826, 10828, 10830, 10832, 10834, 10836, 10838, 10840,
-    10842, 10844, 10846, 10848, 10850, 10852, 10854, 10856, 10858, 10860,
-    10862, 10864, 10866, 10868, 10870, 10872, 10874, 10876, 10878, 10880,
-    10882, 10884, 10886, 10888, 10890, 0, 10892, 10894, 0, 0, 10896, 0, 0,
-    10898, 10900, 0, 0, 10902, 10904, 10906, 10908, 0, 10910, 10912, 10914,
-    10916, 10918, 10920, 10922, 10924, 10926, 10928, 10930, 10932, 0, 10934,
-    0, 10936, 10938, 10940, 10942, 10944, 10946, 10948, 0, 10950, 10952,
-    10954, 10956, 10958, 10960, 10962, 10964, 10966, 10968, 10970, 10972,
-    10974, 10976, 10978, 10980, 10982, 10984, 10986, 10988, 10990, 10992,
-    10994, 10996, 10998, 11000, 11002, 11004, 11006, 11008, 11010, 11012,
-    11014, 11016, 11018, 11020, 11022, 11024, 11026, 11028, 11030, 11032,
-    11034, 11036, 11038, 11040, 11042, 11044, 11046, 11048, 11050, 11052,
-    11054, 11056, 11058, 11060, 11062, 11064, 11066, 11068, 11070, 11072,
-    11074, 11076, 11078, 0, 11080, 11082, 11084, 11086, 0, 0, 11088, 11090,
-    11092, 11094, 11096, 11098, 11100, 11102, 0, 11104, 11106, 11108, 11110,
-    11112, 11114, 11116, 0, 11118, 11120, 11122, 11124, 11126, 11128, 11130,
-    11132, 11134, 11136, 11138, 11140, 11142, 11144, 11146, 11148, 11150,
-    11152, 11154, 11156, 11158, 11160, 11162, 11164, 11166, 11168, 11170,
-    11172, 0, 11174, 11176, 11178, 11180, 0, 11182, 11184, 11186, 11188,
-    11190, 0, 11192, 0, 0, 0, 11194, 11196, 11198, 11200, 11202, 11204,
-    11206, 0, 11208, 11210, 11212, 11214, 11216, 11218, 11220, 11222, 11224,
-    11226, 11228, 11230, 11232, 11234, 11236, 11238, 11240, 11242, 11244,
-    11246, 11248, 11250, 11252, 11254, 11256, 11258, 11260, 11262, 11264,
-    11266, 11268, 11270, 11272, 11274, 11276, 11278, 11280, 11282, 11284,
-    11286, 11288, 11290, 11292, 11294, 11296, 11298, 11300, 11302, 11304,
-    11306, 11308, 11310, 11312, 11314, 11316, 11318, 11320, 11322, 11324,
-    11326, 11328, 11330, 11332, 11334, 11336, 11338, 11340, 11342, 11344,
-    11346, 11348, 11350, 11352, 11354, 11356, 11358, 11360, 11362, 11364,
-    11366, 11368, 11370, 11372, 11374, 11376, 11378, 11380, 11382, 11384,
-    11386, 11388, 11390, 11392, 11394, 11396, 11398, 11400, 11402, 11404,
-    11406, 11408, 11410, 11412, 11414, 11416, 11418, 11420, 11422, 11424,
-    11426, 11428, 11430, 11432, 11434, 11436, 11438, 11440, 11442, 11444,
-    11446, 11448, 11450, 11452, 11454, 11456, 11458, 11460, 11462, 11464,
-    11466, 11468, 11470, 11472, 11474, 11476, 11478, 11480, 11482, 11484,
-    11486, 11488, 11490, 11492, 11494, 11496, 11498, 11500, 11502, 11504,
-    11506, 11508, 11510, 11512, 11514, 11516, 11518, 11520, 11522, 11524,
-    11526, 11528, 11530, 11532, 11534, 11536, 11538, 11540, 11542, 11544,
-    11546, 11548, 11550, 11552, 11554, 11556, 11558, 11560, 11562, 11564,
-    11566, 11568, 11570, 11572, 11574, 11576, 11578, 11580, 11582, 11584,
-    11586, 11588, 11590, 11592, 11594, 11596, 11598, 11600, 11602, 11604,
-    11606, 11608, 11610, 11612, 11614, 11616, 11618, 11620, 11622, 11624,
-    11626, 11628, 11630, 11632, 11634, 11636, 11638, 11640, 11642, 11644,
-    11646, 11648, 11650, 11652, 11654, 11656, 11658, 11660, 11662, 11664,
-    11666, 11668, 11670, 11672, 11674, 11676, 11678, 11680, 11682, 11684,
-    11686, 11688, 11690, 11692, 11694, 11696, 11698, 11700, 11702, 11704,
-    11706, 11708, 11710, 11712, 11714, 11716, 11718, 11720, 11722, 11724,
-    11726, 11728, 11730, 11732, 11734, 11736, 11738, 11740, 11742, 11744,
-    11746, 11748, 11750, 11752, 11754, 11756, 11758, 11760, 11762, 11764,
-    11766, 11768, 11770, 11772, 11774, 11776, 11778, 11780, 11782, 11784,
-    11786, 11788, 11790, 11792, 11794, 11796, 11798, 11800, 11802, 11804,
-    11806, 11808, 11810, 11812, 11814, 11816, 11818, 11820, 11822, 11824,
-    11826, 11828, 11830, 11832, 11834, 11836, 11838, 11840, 11842, 11844,
-    11846, 11848, 11850, 11852, 11854, 11856, 11858, 11860, 11862, 11864,
-    11866, 11868, 11870, 11872, 11874, 11876, 11878, 11880, 11882, 11884,
-    11886, 0, 0, 11888, 11890, 11892, 11894, 11896, 11898, 11900, 11902,
-    11904, 11906, 11908, 11910, 11912, 11914, 11916, 11918, 11920, 11922,
-    11924, 11926, 11928, 11930, 11932, 11934, 11936, 11938, 11940, 11942,
-    11944, 11946, 11948, 11950, 11952, 11954, 11956, 11958, 11960, 11962,
-    11964, 11966, 11968, 11970, 11972, 11974, 11976, 11978, 11980, 11982,
-    11984, 11986, 11988, 11990, 11992, 11994, 11996, 11998, 12000, 12002,
-    12004, 12006, 12008, 12010, 12012, 12014, 12016, 12018, 12020, 12022,
-    12024, 12026, 12028, 12030, 12032, 12034, 12036, 12038, 12040, 12042,
-    12044, 12046, 12048, 12050, 12052, 12054, 12056, 12058, 12060, 12062,
-    12064, 12066, 12068, 12070, 12072, 12074, 12076, 12078, 12080, 12082,
-    12084, 12086, 12088, 12090, 12092, 12094, 12096, 12098, 12100, 12102,
-    12104, 12106, 12108, 12110, 12112, 12114, 12116, 12118, 12120, 12122,
-    12124, 12126, 12128, 12130, 12132, 12134, 12136, 12138, 12140, 12142,
-    12144, 12146, 12148, 12150, 12152, 12154, 12156, 12158, 12160, 12162,
-    12164, 12166, 12168, 12170, 12172, 12174, 12176, 12178, 12180, 12182,
-    12184, 12186, 12188, 12190, 12192, 12194, 12196, 12198, 12200, 12202,
-    12204, 12206, 12208, 12210, 12212, 12214, 12216, 12218, 12220, 12222,
-    12224, 12226, 12228, 12230, 12232, 12234, 12236, 12238, 12240, 12242,
-    12244, 12246, 12248, 12250, 12252, 12254, 12256, 12258, 12260, 12262,
-    12264, 12266, 12268, 12270, 12272, 12274, 12276, 12278, 12280, 12282,
-    12284, 12286, 12288, 12290, 12292, 12294, 12296, 12298, 12300, 12302,
-    12304, 12306, 12308, 12310, 12312, 12314, 12316, 12318, 12320, 12322,
-    12324, 12326, 12328, 12330, 12332, 12334, 12336, 12338, 12340, 12342,
-    12344, 12346, 12348, 12350, 12352, 12354, 12356, 12358, 12360, 12362,
-    12364, 12366, 12368, 12370, 12372, 12374, 12376, 12378, 12380, 12382,
-    12384, 12386, 12388, 12390, 12392, 12394, 12396, 12398, 12400, 12402,
-    12404, 12406, 12408, 12410, 12412, 12414, 12416, 12418, 12420, 12422,
-    12424, 12426, 12428, 12430, 12432, 12434, 12436, 12438, 12440, 12442,
-    12444, 12446, 12448, 12450, 12452, 12454, 12456, 12458, 12460, 12462,
-    12464, 12466, 12468, 12470, 0, 0, 12472, 12474, 12476, 12478, 12480,
-    12482, 12484, 12486, 12488, 12490, 12492, 12494, 12496, 12498, 12500,
-    12502, 12504, 12506, 12508, 12510, 12512, 12514, 12516, 12518, 12520,
-    12522, 12524, 12526, 12528, 12530, 12532, 12534, 12536, 12538, 12540,
-    12542, 12544, 12546, 12548, 12550, 12552, 12554, 12556, 12558, 12560,
-    12562, 12564, 12566, 12568, 12570, 12572, 12574, 12576, 12578, 0, 12580,
-    12582, 12584, 12586, 12588, 12590, 12592, 12594, 12596, 12598, 12600,
-    12602, 12604, 12606, 12608, 12610, 12612, 12614, 12616, 12618, 12620,
-    12622, 12624, 12626, 12628, 12630, 12632, 0, 12634, 12636, 0, 12638, 0,
-    0, 12640, 0, 12642, 12644, 12646, 12648, 12650, 12652, 12654, 12656,
-    12658, 12660, 0, 12662, 12664, 12666, 12668, 0, 12670, 0, 12672, 0, 0, 0,
-    0, 0, 0, 12674, 0, 0, 0, 0, 12676, 0, 12678, 0, 12680, 0, 12682, 12684,
-    12686, 0, 12688, 12690, 0, 12692, 0, 0, 12694, 0, 12696, 0, 12698, 0,
-    12700, 0, 12702, 0, 12704, 12706, 0, 12708, 0, 0, 12710, 12712, 12714,
-    12716, 0, 12718, 12720, 12722, 12724, 12726, 12728, 12730, 0, 12732,
-    12734, 12736, 12738, 0, 12740, 12742, 12744, 12746, 0, 12748, 0, 12750,
-    12752, 12754, 12756, 12758, 12760, 12762, 12764, 12766, 12768, 0, 12770,
-    12772, 12774, 12776, 12778, 12780, 12782, 12784, 12786, 12788, 12790,
-    12792, 12794, 12796, 12798, 12800, 12802, 0, 0, 0, 0, 0, 12804, 12806,
-    12808, 0, 12810, 12812, 12814, 12816, 12818, 0, 12820, 12822, 12824,
-    12826, 12828, 12830, 12832, 12834, 12836, 12838, 12840, 12842, 12844,
-    12846, 12848, 12850, 12852, 0, 0, 0, 0, 12854, 12857, 12860, 12863,
-    12866, 12869, 12872, 12875, 12878, 12881, 12884, 0, 0, 0, 0, 0, 12887,
-    12891, 12895, 12899, 12903, 12907, 12911, 12915, 12919, 12923, 12927,
-    12931, 12935, 12939, 12943, 12947, 12951, 12955, 12959, 12963, 12967,
-    12971, 12975, 12979, 12983, 12987, 12991, 12995, 12997, 12999, 13002, 0,
-    13005, 13007, 13009, 13011, 13013, 13015, 13017, 13019, 13021, 13023,
-    13025, 13027, 13029, 13031, 13033, 13035, 13037, 13039, 13041, 13043,
-    13045, 13047, 13049, 13051, 13053, 13055, 13057, 13060, 13063, 13066,
-    13069, 13073, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13076, 13079, 0, 0, 0, 0,
-    13082, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13085, 13088, 13091,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13093, 13095, 13097, 13099, 13101,
-    13103, 13105, 13107, 13109, 13111, 13113, 13115, 13117, 13119, 13121,
-    13123, 13125, 13127, 13129, 13131, 13133, 13135, 13137, 13139, 13141,
-    13143, 13145, 13147, 13149, 13151, 13153, 13155, 13157, 13159, 13161,
-    13163, 13165, 13167, 13169, 13171, 13173, 13175, 13177, 13179, 0, 0, 0,
-    0, 13181, 13185, 13189, 13193, 13197, 13201, 13205, 13209, 13213, 0, 0,
-    0, 0, 0, 0, 0, 13217, 13219, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    13221, 13223, 13225, 13227, 13230, 13232, 13234, 13236, 13238, 13240,
-    13242, 13244, 13246, 13248, 13251, 13253, 13255, 13257, 13259, 13262,
-    13264, 13266, 13268, 13271, 13273, 13275, 13277, 13279, 13281, 13284,
-    13286, 13288, 13290, 13292, 13294, 13296, 13298, 13300, 13302, 13304,
-    13306, 13308, 13310, 13312, 13314, 13316, 13318, 13320, 13322, 13324,
-    13326, 13328, 13330, 13333, 13335, 13337, 13339, 13342, 13344, 13346,
-    13348, 13350, 13352, 13354, 13356, 13358, 13360, 13362, 13364, 13366,
-    13368, 13370, 13372, 13374, 13376, 13378, 13380, 13382, 13384, 13386,
-    13388, 13390, 13392, 13394, 13396, 13398, 13400, 13402, 13404, 13406,
-    13409, 13411, 13413, 13415, 13417, 13419, 13421, 13424, 13427, 13429,
-    13431, 13433, 13435, 13437, 13439, 13441, 13443, 13445, 13447, 13450,
-    13452, 13454, 13456, 13458, 13461, 13463, 13465, 13467, 13469, 13471,
-    13473, 13475, 13477, 13479, 13482, 13484, 13487, 13489, 13491, 13493,
-    13495, 13497, 13499, 13501, 13503, 13505, 13507, 13509, 13512, 13514,
-    13516, 13518, 13520, 13522, 13525, 13527, 13530, 13533, 13535, 13537,
-    13539, 13541, 13544, 13547, 13549, 13551, 13553, 13555, 13557, 13559,
-    13561, 13563, 13565, 13567, 13569, 13572, 13574, 13576, 13578, 13580,
-    13582, 13584, 13586, 13588, 13590, 13592, 13594, 13596, 13598, 13600,
-    13602, 13604, 13606, 13608, 13610, 13613, 13615, 13617, 13619, 13621,
-    13623, 13626, 13628, 13630, 13632, 13634, 13636, 13638, 13640, 13642,
-    13644, 13646, 13648, 13651, 13653, 13655, 13657, 13659, 13661, 13663,
-    13665, 13667, 13669, 13671, 13673, 13675, 13677, 13679, 13681, 13683,
-    13685, 13687, 13690, 13692, 13694, 13696, 13698, 13700, 13703, 13705,
-    13707, 13709, 13711, 13713, 13715, 13717, 13719, 13722, 13724, 13726,
-    13728, 13731, 13733, 13735, 13737, 13739, 13741, 13743, 13746, 13749,
-    13752, 13754, 13757, 13759, 13761, 13763, 13765, 13767, 13769, 13771,
-    13773, 13775, 13777, 13780, 13782, 13784, 13786, 13788, 13790, 13792,
-    13795, 13797, 13799, 13802, 13805, 13807, 13809, 13811, 13813, 13815,
-    13817, 13819, 13821, 13823, 13826, 13828, 13831, 13833, 13836, 13838,
-    13840, 13842, 13845, 13847, 13849, 13852, 13855, 13857, 13859, 13861,
-    13863, 13865, 13867, 13869, 13871, 13873, 13875, 13877, 13879, 13881,
-    13884, 13886, 13889, 13891, 13894, 13896, 13899, 13902, 13905, 13907,
-    13909, 13911, 13914, 13917, 13920, 13923, 13925, 13927, 13929, 13931,
-    13933, 13935, 13937, 13939, 13942, 13944, 13946, 13948, 13950, 13953,
-    13955, 13958, 13961, 13963, 13965, 13967, 13969, 13971, 13973, 13976,
-    13979, 13982, 13984, 13986, 13989, 13991, 13993, 13995, 13998, 14000,
-    14002, 14004, 14006, 14008, 14011, 14013, 14015, 14017, 14019, 14021,
-    14023, 14026, 14029, 14031, 14034, 14036, 14039, 14041, 14043, 14045,
-    14048, 14051, 14053, 14056, 14058, 14061, 14063, 14065, 14067, 14069,
-    14071, 14073, 14076, 14079, 14082, 14085, 14087, 14089, 14091, 14093,
-    14095, 14097, 14099, 14101, 14103, 14105, 14107, 14109, 14112, 14114,
-    14116, 14118, 14120, 14122, 14124, 14126, 14128, 14130, 14132, 14134,
-    14136, 14139, 14142, 14145, 14147, 14149, 14151, 14153, 14156, 14158,
-    14161, 14163, 14165, 14168, 14171, 14173, 14175, 14177, 14179, 14181,
-    14183, 14185, 14187, 14189, 14191, 14193, 14195, 14197, 14199, 14201,
-    14203, 14205, 14207, 14209, 14212, 14214, 14216, 14218, 14220, 14222,
-    14225, 14228, 14230, 14232, 14234, 14236, 14238, 14240, 14243, 14245,
-    14247, 14249, 14251, 14254, 14257, 14259, 14261, 14263, 14266, 14268,
-    14270, 14273, 14276, 14278, 14280, 14282, 14285, 14287, 14289, 14291,
-    14293, 14295, 14297, 14299, 14302, 14304, 14306, 14308, 14311, 14313,
-    14315, 14317, 14319, 14322, 14325, 14327, 14329, 14331, 14334, 14336,
-    14339, 14341, 14343, 14345, 14348, 14350, 14352, 14354, 14356, 14358,
-    14360, 14362, 14365, 14367, 14369, 14371, 14373, 14375, 14377, 14380,
-    14382, 14385, 14388, 14391, 14393, 14395, 14397, 14399, 14401, 14403,
-    14405, 14407, 0, 0,
-};
-
-/* NFC pairs */
-#define COMP_SHIFT1 2
-#define COMP_SHIFT2 1
-static const unsigned short comp_index0[] = {
-    0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 4,
-    5, 6, 7, 0, 0, 0, 0, 8, 0, 9, 10, 0, 0, 0, 11, 12, 13, 14, 0, 0, 0, 0, 0,
-    15, 16, 17, 0, 0, 0, 0, 18, 19, 20, 21, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0,
-    23, 24, 25, 26, 0, 0, 0, 0, 27, 28, 29, 30, 0, 0, 0, 0, 31, 32, 33, 34,
-    0, 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 36, 0, 37, 38, 39, 0, 0, 0, 40, 41, 42,
-    43, 0, 0, 0, 0, 44, 45, 46, 0, 0, 0, 0, 0, 47, 48, 49, 50, 0, 0, 0, 51,
-    52, 53, 54, 0, 0, 0, 0, 55, 56, 0, 0, 0, 0, 0, 0, 57, 58, 59, 60, 0, 0,
-    0, 0, 61, 62, 63, 0, 0, 0, 0, 0, 64, 65, 66, 67, 0, 0, 0, 68, 69, 70, 71,
-    0, 0, 0, 0, 72, 0, 73, 0, 0, 0, 0, 0, 74, 0, 75, 0, 0, 0, 0, 0, 76, 0, 0,
-    0, 0, 0, 0, 77, 78, 79, 0, 0, 0, 0, 0, 80, 81, 82, 83, 0, 0, 0, 0, 84,
-    85, 86, 0, 0, 0, 0, 0, 87, 88, 0, 89, 0, 0, 0, 90, 91, 0, 92, 0, 0, 0, 0,
-    0, 93, 94, 95, 0, 0, 0, 0, 96, 97, 98, 99, 0, 0, 0, 0, 100, 0, 0, 0, 0,
-    0, 0, 101, 102, 0, 103, 0, 0, 0, 0, 104, 105, 106, 107, 0, 0, 0, 0, 108,
-    109, 110, 111, 0, 0, 0, 0, 112, 113, 0, 0, 0, 0, 0, 114, 115, 116, 117,
-    0, 0, 0, 0, 118, 119, 120, 121, 0, 0, 0, 0, 122, 0, 123, 0, 0, 0, 0, 124,
-    125, 126, 127, 128, 0, 0, 0, 129, 130, 131, 132, 0, 0, 0, 0, 133, 134, 0,
-    0, 0, 0, 0, 0, 135, 136, 137, 138, 0, 0, 0, 139, 140, 141, 142, 0, 0, 0,
-    0, 0, 143, 144, 145, 0, 0, 0, 0, 146, 147, 148, 149, 0, 0, 0, 0, 150, 0,
-    151, 0, 0, 0, 0, 152, 153, 154, 0, 0, 0, 0, 0, 0, 155, 0, 0, 0, 0, 0, 0,
-    156, 157, 158, 0, 0, 0, 0, 0, 159, 160, 161, 162, 0, 0, 0, 163, 0, 0, 0,
-    164, 0, 0, 0, 165, 166, 0, 0, 0, 0, 0, 0, 167, 0, 0, 0, 0, 0, 0, 0, 168,
-    0, 0, 0, 0, 0, 0, 169, 170, 0, 0, 0, 0, 0, 0, 171, 0, 0, 0, 0, 0, 0, 0,
-    172, 173, 0, 0, 0, 0, 0, 0, 174, 0, 0, 0, 0, 0, 0, 175, 176, 0, 0, 0, 0,
-    0, 0, 177, 178, 0, 0, 0, 0, 0, 0, 179, 0, 0, 0, 0, 0, 0, 0, 180, 0, 0, 0,
-    0, 0, 0, 181, 182, 183, 0, 0, 0, 0, 0, 184, 185, 0, 0, 0, 0, 0, 0, 186,
-    0, 0, 0, 0, 0, 0, 0, 187, 0, 0, 0, 0, 0, 0, 188, 189, 0, 0, 0, 0, 0, 0,
-    190, 0, 0, 0, 0, 0, 0, 0, 191, 192, 0, 0, 0, 0, 0, 0, 193, 0, 0, 0, 0, 0,
-    0, 194, 195, 0, 0, 0, 0, 0, 0, 196, 197, 0, 0, 0, 0, 0, 0, 198, 0, 0, 0,
-    0, 0, 0, 0, 199, 0, 0, 0, 0, 0, 0, 200, 201, 202, 0, 0, 0, 0, 0, 203,
-    204, 0, 0, 0, 0, 0, 0, 205, 206, 0, 0, 0, 0, 0, 0, 207, 0, 0, 0, 0, 0, 0,
-    208, 0, 0, 0, 0, 0, 0, 0, 209, 0, 0, 0, 0, 0, 0, 0, 210, 0, 0, 0, 0, 0,
-    0, 0, 211, 0, 0, 0, 0, 0, 0, 0, 212, 0, 0, 0, 0, 0, 0, 0, 213, 0, 0, 0,
-    0, 0, 0, 0, 214, 0, 0, 0, 0, 0, 0, 215, 0, 0, 0, 0, 0, 0, 216, 0, 0, 0,
-    0, 0, 0, 0, 0, 217, 0, 0, 0, 0, 0, 0, 0, 218, 0, 0, 0, 0, 0, 0, 219, 0,
-    0, 0, 0, 0, 0, 220, 221, 222, 0, 0, 0, 0, 0, 223, 224, 225, 0, 0, 0, 0,
-    0, 226, 227, 228, 0, 0, 0, 0, 0, 229, 230, 231, 0, 0, 0, 0, 0, 0, 232, 0,
-    0, 0, 0, 0, 0, 233, 0, 0, 0, 0, 0, 0, 234, 0, 0, 0, 0, 0, 0, 0, 235, 0,
-    0, 0, 0, 0, 0, 0, 236, 0, 0, 0, 0, 0, 0, 0, 237, 0, 0, 0, 0, 0, 0, 238,
-    0, 0, 0, 0, 0, 0, 0, 239, 0, 0, 0, 0, 0, 0, 0, 240, 0, 0, 0, 0, 0, 0, 0,
-    241, 0, 0, 0, 0, 0, 0, 242, 0, 243, 244, 0, 0, 0, 0, 245, 246, 0, 0, 0,
-    0, 0, 247, 0, 248, 0, 249, 0, 0, 0, 250, 251, 252, 0, 0, 0, 0, 0, 253, 0,
-    254, 0, 0, 0, 0, 0, 0, 255, 0, 0, 0, 0, 0, 256, 257, 258, 0, 0, 0, 0, 0,
-    259, 0, 260, 0, 261, 0, 0, 0, 0, 0, 0, 262, 0, 0, 0, 0, 0, 0, 0, 263, 0,
-    0, 0, 264, 265, 266, 0, 267, 0, 0, 0, 268, 0, 269, 0, 0, 0, 0, 0, 270, 0,
-    271, 272, 0, 0, 0, 0, 273, 274, 0, 275, 0, 0, 0, 276, 0, 277, 0, 0, 0, 0,
-    0, 0, 0, 278, 0, 0, 0, 0, 0, 279, 280, 281, 282, 0, 0, 0, 0, 283, 284, 0,
-    285, 0, 0, 0, 286, 0, 0, 0, 287, 0, 0, 0, 288, 0, 0, 0, 289, 0, 0, 0, 0,
-    0, 0, 290, 0, 0, 0, 0, 291, 0, 0, 0, 0, 0, 0, 0, 292, 0, 0, 0, 0, 0, 0,
-    0, 293, 0, 0, 0, 0, 0, 0, 294, 0, 0, 0, 0, 0, 0, 0, 295, 0, 0, 0, 0, 0,
-    0, 0, 296, 0, 0, 0, 0, 0, 0, 0, 297, 0, 0, 0, 0, 0, 0, 298, 299, 0, 0, 0,
-    0, 0, 0, 300, 0, 0, 0, 0, 0, 0, 0, 301, 0, 0, 0, 0, 0, 0, 0, 302, 0, 0,
-    0, 0, 0, 0, 0, 303, 0, 0, 0, 0, 0, 0, 304, 0, 0, 0, 0, 0, 0, 0, 305, 0,
-    0, 0, 0, 0, 0, 0, 306, 0, 0, 0, 0, 0, 0, 307, 0, 0, 0, 0, 0, 0, 0, 308,
-    0, 0, 0, 0, 0, 0, 0, 309, 0, 0, 0, 0, 0, 0, 0, 310, 0, 0, 0, 0, 0, 0,
-    311, 312, 0, 0, 0, 0, 0, 0, 313, 0, 0, 0, 0, 0, 0, 0, 314, 0, 0, 0, 0, 0,
-    0, 0, 315, 0, 0, 0, 0, 0, 0, 0, 316, 0, 0, 0, 0, 0, 0, 317, 0, 0, 0, 0,
-    0, 0, 0, 318, 0, 0, 0, 0, 0, 0, 0, 319, 0, 0, 0, 0, 0, 0, 0, 320, 0, 0,
-    0, 0, 0, 0, 0, 321, 0, 0, 0, 0, 0, 0, 322, 0, 0, 0, 0, 0, 0, 0, 323, 0,
-    0, 0, 0, 0, 0, 0, 324, 0, 0, 0, 0, 0, 0, 325, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 326, 0, 0, 0, 0, 0, 0, 0, 327, 0, 0, 0, 0, 0, 0, 0, 328, 0, 0, 0, 0,
-    0, 0, 329, 0, 0, 0, 0, 0, 0, 0, 330, 0, 0, 0, 0, 0, 0, 0, 331, 0, 0, 0,
-    0, 0, 0, 0, 332, 0, 0, 0, 0, 0, 0, 0, 333, 0, 0, 0, 0, 0, 0, 334, 0, 0,
-    0, 0, 0, 0, 0, 335, 0, 0, 0, 0, 0, 0, 0, 336, 337, 0, 0, 0, 0, 0, 0, 0,
-    338, 0, 0, 0, 0, 0, 0, 339, 0, 0, 0, 0, 0, 0, 0, 340, 0, 0, 0, 0, 0, 0,
-    0, 341, 0, 0, 0, 0, 0, 0, 0, 342, 0, 0, 0, 0, 0, 0, 0, 343, 0, 0, 0, 0,
-    0, 0, 344, 0, 0, 0, 0, 0, 0, 0, 345, 346, 0, 0, 0, 0, 0, 0, 347, 0, 0, 0,
-    0, 0, 0, 0, 348, 0, 0, 0, 0, 0, 0, 0, 349, 0, 0, 0, 0, 0, 0, 0, 350, 0,
-    0, 0, 0, 0, 0, 0, 351, 0, 0, 0, 0, 0, 0, 0, 352, 0, 0, 0, 0, 0, 0, 353,
-    0, 0, 0, 0, 0, 0, 0, 354, 0, 0, 0, 0, 0, 0, 0, 355, 0, 0, 0, 0, 0, 0, 0,
-    356, 0, 0, 0, 0, 0, 0, 357, 0, 0, 0, 0, 0, 0, 0, 358, 0, 0, 0, 0, 0, 0,
-    0, 359, 0, 0, 0, 0, 0, 0, 0, 360, 0, 0, 0, 0, 0, 0, 361, 0, 362, 0, 0, 0,
-    0, 0, 0, 0, 363, 0, 0, 0, 0, 0, 0, 0, 364, 0, 0, 0, 0, 0, 0, 0, 365, 0,
-    0, 0, 0, 0, 0, 0, 366, 0, 0, 0, 0, 0, 0, 367, 0, 0, 0, 0, 0, 0, 0, 368,
-    0, 0, 0, 0, 0, 0, 369, 370, 0, 0, 0, 0, 0, 0, 371, 0, 0, 0, 0, 0, 0, 0,
-    372, 0, 0, 0, 0, 0, 0, 0, 373, 0, 0, 0, 0, 0, 0, 374, 0, 0, 0, 0, 0, 0,
-    0, 375, 0, 0, 376, 0, 0, 0, 0, 377, 0, 0, 378, 0, 0, 0, 0, 0, 0, 0, 379,
-    0, 0, 0, 0, 0, 0, 0, 380, 0, 0, 0, 0, 0, 0, 381, 0, 0, 0, 0, 0, 0, 0,
-    382, 0, 0, 0, 0, 0, 0, 0, 383, 0, 0, 0, 0, 0, 0, 0, 384, 0, 0, 0, 385, 0,
-    0, 386, 0, 0, 0, 0, 387, 0, 0, 388, 0, 0, 0, 0, 0, 0, 0, 389, 0, 0, 0, 0,
-    0, 0, 0, 390, 0, 0, 0, 0, 0, 0, 391, 0, 0, 0, 0, 0, 0, 0, 392, 0, 0, 0,
-    0, 0, 0, 0, 393, 0, 0, 0, 0, 0, 0, 0, 394, 0, 0, 0, 395, 0, 0, 0, 0, 0,
-    0, 0, 396, 0, 0, 0, 0, 0, 0, 397, 0, 0, 0, 0, 0, 0, 0, 398, 0, 0, 0, 0,
-    0, 0, 0, 399, 0, 0, 400, 0, 0, 0, 0, 401, 0, 0, 402, 0, 0, 0, 0, 0, 0, 0,
-    403, 0, 0, 0, 0, 0, 0, 0, 404, 0, 0, 0, 0, 0, 0, 405, 0, 0, 0, 0, 0, 0,
-    0, 406, 0, 0, 0, 0, 0, 0, 0, 407, 0, 0, 0, 0, 0, 0, 0, 408, 0, 0, 0, 409,
-    0, 0, 410, 0, 0, 0, 0, 411, 0, 0, 412, 0, 0, 0, 0, 0, 0, 0, 413, 0, 0, 0,
-    0, 0, 0, 0, 414, 0, 0, 0, 0, 0, 0, 415, 0, 0, 0, 0, 0, 0, 0, 416, 0, 0,
-    0, 0, 0, 0, 0, 417, 0, 0, 0, 0, 0, 0, 0, 418, 0, 0, 0, 419, 0, 0, 420, 0,
-    0, 0, 0, 421, 0, 0, 422, 0, 0, 0, 423, 0, 0, 0, 424, 0, 0, 0, 425, 0, 0,
-    0, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 428, 0, 0, 0, 0, 0, 0, 429, 0,
-    0, 0, 0, 0, 0, 0, 430, 0, 0, 0, 0, 0, 0, 0, 431, 0, 0, 432, 0, 0, 0, 0,
-    433, 0, 0, 434, 0, 0, 0, 435, 0, 0, 0, 436, 0, 0, 0, 437, 0, 0, 0, 438,
-    0, 0, 0, 439, 0, 0, 440, 0, 0, 0, 0, 0, 0, 0, 441, 0, 0, 0, 0, 0, 0, 0,
-    442, 0, 0, 0, 0, 0, 0, 0, 443, 0, 0, 0, 0, 0, 0, 444, 0, 0, 0, 0, 0, 0,
-    0, 445, 0, 0, 0, 0, 0, 0, 0, 446, 0, 0, 0, 447, 0, 0, 0, 448, 0, 0, 0,
-    449, 0, 0, 450, 0, 0, 0, 0, 0, 0, 0, 451, 0, 0, 0, 0, 0, 0, 0, 452, 0, 0,
-    0, 0, 0, 0, 0, 453, 0, 0, 0, 0, 0, 0, 454, 0, 0, 0, 0, 0, 0, 0, 455, 0,
-    0, 0, 0, 0, 0, 0, 456, 0, 0, 0, 0, 0, 0, 0, 457, 0, 0, 0, 0, 0, 0, 458,
-    0, 0, 0, 0, 0, 0, 0, 459, 0, 0, 0, 0, 0, 0, 0, 460, 0, 0, 0, 461, 0, 0,
-    0, 462, 0, 0, 0, 0, 0, 0, 463, 0, 0, 0, 0, 0, 0, 0, 464, 0, 0, 0, 465, 0,
-    0, 0, 466, 0, 0, 0, 0, 0, 0, 467, 0, 0, 0, 0, 0, 0, 0, 468, 0, 0, 0, 0,
-    0, 0, 0, 469, 0, 0, 0, 0, 0, 0, 0, 470, 0, 0, 0, 0, 0, 0, 471, 0, 0, 0,
-    0, 0, 0, 0, 472, 0, 0, 0, 0, 0, 0, 0, 473, 0, 0, 0, 0, 0, 0, 0, 474, 0,
-    0, 0, 0, 0, 0, 475, 0, 0, 0, 0, 0, 0, 0, 476, 0, 0, 0, 0, 0, 0, 0, 477,
-    0, 0, 0, 0, 0, 0, 0, 478, 0, 0, 0, 0, 0, 0, 479, 0, 0, 0, 0, 0, 0, 0,
-    480, 0, 0, 0, 0, 0, 0, 0, 481, 0, 0, 0, 0, 0, 0, 0, 482, 0, 0, 0, 0, 0,
-    0, 483, 0, 0, 0, 0, 0, 0, 0, 484, 0, 0, 0, 0, 0, 0, 0, 485, 0, 0, 0, 0,
-    0, 0, 0, 486, 0, 0, 0, 0, 0, 0, 487, 0, 0, 0, 0, 0, 0, 0, 488, 0, 0, 0,
-    0, 0, 0, 0, 489, 0, 0, 0, 0, 0, 0, 0, 490, 0, 0, 0, 0, 0, 0, 491, 0, 0,
-    0, 0, 0, 0, 0, 492, 0, 0, 0, 0, 0, 0, 0, 493, 0, 0, 0, 0, 0, 0, 0, 494,
-    0, 0, 0, 0, 0, 0, 495, 0, 0, 0, 0, 0, 0, 0, 496, 0, 0, 0, 0, 0, 0, 0,
-    497, 0, 0, 0, 0, 0, 0, 0, 498, 0, 0, 0, 0, 0, 0, 499, 0, 0, 0, 0, 0, 0,
-    0, 500, 0, 0, 0, 0, 0, 0, 0, 501, 0, 0, 0, 0, 0, 0, 0, 502, 0, 0, 0, 0,
-    0, 0, 503, 0, 0, 0, 0, 0, 0, 0, 504, 0, 0, 0, 0, 0, 0, 0, 505, 0, 0, 0,
-    0, 0, 0, 0, 506, 0, 0, 0, 0, 0, 0, 507, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    508, 0, 0, 0, 0, 0, 0, 0, 509, 0, 0, 0, 0, 0, 0, 0, 510, 0, 0, 0, 0, 0,
-    0, 0, 511, 0, 0, 0, 0, 0, 0, 512, 0, 0, 0, 0, 0, 0, 0, 513, 0, 0, 0, 0,
-    0, 0, 0, 514, 0, 0, 0, 0, 0, 0, 0, 515, 0, 0, 0, 0, 0, 0, 516, 0, 0, 0,
-    0, 0, 0, 0, 517, 0, 0, 0, 0, 0, 0, 0, 518, 0, 0, 0, 0, 0, 0, 0, 519, 0,
-    0, 0, 0, 0, 0, 520, 0, 0, 0, 0, 0, 0, 0, 521, 0, 0, 0, 0, 0, 0, 0, 522,
-    0, 0, 0, 0, 0, 0, 0, 523, 0, 0, 0, 0, 0, 0, 524, 0, 0, 0, 0, 0, 0, 0,
-    525, 0, 0, 0, 0, 0, 0, 0, 526, 0, 0, 0, 0, 0, 0, 0, 527, 0, 0, 0, 0, 0,
-    0, 528, 0, 0, 0, 0, 0, 0, 0, 529, 0, 0, 0, 0, 0, 0, 0, 530, 0, 0, 0, 0,
-    0, 0, 0, 531, 0, 0, 0, 0, 0, 0, 532, 0, 0, 0, 0, 0, 0, 0, 533, 0, 0, 0,
-    0, 0, 0, 0, 534, 0, 0, 0, 0, 0, 0, 0, 535, 0, 0, 0, 0, 0, 0, 536, 0, 0,
-    0, 0, 0, 0, 0, 537, 0, 0, 0, 0, 0, 0, 0, 538, 0, 0, 0, 0, 0, 0, 0, 539,
-    0, 0, 0, 0, 0, 0, 540, 0, 0, 0, 0, 0, 0, 0, 541, 0, 0, 0, 0, 0, 0, 0,
-    542, 0, 0, 0, 0, 0, 0, 0, 543, 0, 0, 0, 0, 0, 0, 544, 0, 0, 0, 0, 0, 0,
-    0, 545, 0, 0, 0, 0, 0, 0, 0, 546, 0, 0, 0, 0, 0, 0, 0, 547, 0, 0, 0, 0,
-    0, 0, 548, 0, 0, 0, 0, 0, 0, 0, 549, 0, 0, 0, 0, 0, 0, 0, 550, 0, 0, 0,
-    0, 0, 0, 0, 551, 0, 0, 0, 0, 0, 0, 552, 0, 0, 0, 0, 0, 0, 0, 553, 0, 0,
-    0, 0, 0, 0, 0, 554, 0, 0, 0, 0, 0, 0, 0, 555, 0, 0, 0, 0, 0, 0, 0, 556,
-    0, 0, 0, 0, 0, 0, 557, 0, 0, 0, 0, 0, 0, 0, 558, 0, 0, 0, 0, 0, 0, 0,
-    559, 0, 0, 0, 0, 0, 0, 0, 560, 0, 0, 0, 0, 0, 0, 0, 561, 0, 0, 0, 0, 0,
-    0, 0, 562, 0, 0, 0, 0, 0, 0, 0, 563, 0, 0, 0, 0, 0, 0, 564,
-};
-
-static const unsigned short comp_index1[] = {
-    0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 3, 0, 4, 5, 6, 7, 8, 9, 10,
-    0, 11, 12, 0, 13, 0, 0, 0, 0, 0, 0, 14, 15, 0, 0, 0, 0, 16, 0, 0, 0, 0,
-    0, 17, 18, 0, 19, 0, 20, 0, 0, 0, 0, 21, 0, 0, 0, 22, 0, 23, 0, 0, 24, 0,
-    25, 26, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 0, 35, 0, 36, 37, 38, 0, 0,
-    0, 0, 0, 39, 0, 0, 0, 40, 41, 42, 43, 0, 44, 0, 0, 0, 0, 45, 0, 0, 0, 0,
-    0, 46, 0, 47, 0, 48, 0, 0, 49, 0, 50, 0, 51, 0, 0, 52, 53, 54, 55, 56,
-    57, 58, 0, 59, 0, 0, 60, 61, 0, 0, 0, 62, 0, 0, 0, 0, 0, 63, 64, 0, 0,
-    65, 0, 66, 0, 0, 67, 0, 0, 0, 0, 0, 68, 0, 0, 0, 0, 69, 0, 0, 70, 0, 71,
-    72, 0, 73, 0, 74, 0, 0, 75, 0, 0, 0, 0, 76, 0, 0, 77, 78, 0, 79, 0, 80,
-    0, 0, 81, 0, 82, 83, 0, 84, 0, 0, 0, 0, 0, 85, 86, 87, 88, 89, 90, 91, 0,
-    92, 0, 0, 93, 0, 0, 0, 94, 0, 0, 95, 0, 0, 0, 96, 0, 0, 97, 0, 98, 99, 0,
-    100, 0, 101, 0, 0, 102, 0, 103, 104, 0, 105, 0, 106, 0, 0, 107, 0, 108,
-    0, 0, 0, 109, 0, 110, 0, 0, 111, 0, 112, 113, 0, 114, 0, 0, 0, 0, 0, 115,
-    116, 117, 118, 119, 120, 121, 0, 122, 123, 0, 124, 125, 0, 0, 0, 126, 0,
-    0, 127, 0, 0, 128, 129, 0, 130, 131, 0, 0, 0, 0, 0, 132, 0, 0, 0, 133,
-    134, 135, 136, 137, 0, 0, 0, 138, 0, 0, 139, 140, 0, 141, 0, 142, 0, 0,
-    143, 0, 0, 0, 0, 144, 0, 145, 146, 147, 148, 149, 150, 151, 0, 152, 153,
-    0, 154, 0, 0, 155, 0, 0, 0, 0, 156, 157, 0, 0, 0, 0, 0, 158, 159, 0, 160,
-    0, 161, 162, 0, 0, 0, 163, 0, 164, 0, 0, 165, 0, 166, 167, 0, 168, 0,
-    169, 170, 171, 172, 173, 174, 175, 0, 176, 0, 177, 178, 179, 0, 0, 0, 0,
-    0, 180, 0, 0, 0, 181, 182, 183, 184, 0, 185, 186, 0, 0, 0, 0, 0, 187, 0,
-    188, 0, 189, 0, 0, 190, 0, 191, 0, 192, 193, 0, 194, 195, 196, 197, 198,
-    199, 200, 0, 201, 0, 0, 202, 203, 0, 0, 0, 204, 0, 0, 0, 205, 0, 0, 0, 0,
-    0, 206, 0, 0, 0, 0, 207, 0, 0, 208, 0, 209, 0, 0, 210, 0, 211, 0, 0, 0,
-    0, 212, 0, 0, 213, 0, 214, 215, 0, 216, 0, 217, 0, 0, 218, 219, 0, 0, 0,
-    0, 0, 0, 220, 221, 0, 222, 0, 223, 0, 0, 224, 0, 225, 226, 0, 227, 0, 0,
-    0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 0, 235, 0, 0, 236, 0, 0, 0,
-    237, 0, 0, 238, 0, 0, 0, 239, 0, 0, 240, 0, 241, 242, 0, 243, 0, 244, 0,
-    0, 245, 0, 0, 0, 0, 0, 246, 247, 0, 248, 0, 249, 0, 0, 250, 0, 251, 0, 0,
-    0, 252, 0, 253, 0, 0, 254, 0, 255, 256, 0, 257, 0, 258, 259, 260, 261,
-    262, 263, 264, 0, 265, 266, 0, 267, 268, 0, 0, 0, 269, 0, 0, 270, 0, 0,
-    0, 0, 0, 0, 271, 272, 0, 273, 274, 0, 0, 0, 275, 0, 276, 0, 0, 0, 277,
-    278, 279, 280, 281, 0, 0, 0, 282, 0, 0, 283, 284, 0, 285, 0, 286, 0, 0,
-    287, 0, 0, 0, 0, 288, 0, 0, 0, 0, 0, 289, 0, 290, 0, 0, 0, 0, 291, 292,
-    0, 0, 293, 0, 0, 0, 0, 294, 295, 0, 0, 0, 0, 0, 0, 296, 0, 297, 0, 0, 0,
-    0, 298, 0, 0, 299, 300, 0, 0, 301, 0, 0, 302, 0, 0, 0, 0, 0, 0, 303, 304,
-    0, 0, 305, 0, 0, 306, 0, 307, 308, 0, 0, 0, 0, 0, 309, 310, 0, 0, 0, 0,
-    0, 0, 311, 0, 312, 0, 0, 313, 0, 0, 0, 0, 0, 314, 315, 0, 0, 316, 0, 0,
-    0, 0, 317, 318, 0, 0, 0, 0, 0, 0, 319, 0, 320, 0, 0, 0, 0, 321, 0, 0,
-    322, 323, 0, 0, 324, 0, 0, 325, 0, 0, 0, 0, 0, 0, 326, 327, 0, 0, 328, 0,
-    0, 329, 0, 330, 331, 0, 0, 0, 0, 0, 332, 333, 0, 0, 0, 0, 0, 0, 334, 0,
-    335, 0, 0, 336, 0, 0, 0, 0, 0, 337, 338, 0, 0, 339, 0, 0, 340, 341, 0, 0,
-    342, 0, 0, 343, 0, 0, 0, 0, 0, 0, 344, 0, 0, 345, 0, 0, 346, 0, 0, 0, 0,
-    0, 347, 0, 0, 348, 0, 0, 349, 0, 0, 350, 0, 0, 0, 351, 0, 0, 0, 0, 0, 0,
-    352, 0, 353, 0, 0, 354, 0, 0, 0, 0, 0, 0, 355, 0, 0, 0, 356, 357, 0, 0,
-    358, 0, 0, 0, 359, 0, 0, 360, 361, 0, 0, 362, 0, 0, 0, 363, 0, 0, 364,
-    365, 0, 0, 366, 0, 0, 0, 367, 0, 0, 368, 369, 0, 0, 370, 0, 0, 0, 371, 0,
-    0, 0, 372, 0, 0, 0, 373, 0, 0, 0, 0, 0, 0, 374, 0, 0, 375, 0, 0, 376, 0,
-    0, 377, 0, 0, 0, 0, 0, 0, 378, 0, 0, 379, 0, 0, 380, 0, 0, 0, 0, 0, 381,
-    0, 382, 0, 383, 384, 0, 0, 0, 0, 0, 0, 385, 386, 0, 0, 0, 0, 0, 0, 387,
-    0, 0, 0, 388, 0, 0, 389, 0, 0, 390, 0, 0, 0, 0, 391, 0, 392, 393, 0, 0,
-    0, 394, 0, 0, 0, 395, 0, 0, 396, 0, 0, 0, 0, 0, 0, 397, 0, 0, 0, 398, 0,
-    399, 400, 0, 0, 0, 401, 0, 0, 0, 402, 0, 0, 403, 0, 0, 404, 0, 0, 0, 0,
-    0, 0, 405, 0, 0, 406, 0, 0, 0, 0, 407, 0, 408, 0, 0, 0, 0, 409, 0, 0,
-    410, 0, 0, 0, 0, 411, 0, 0, 412, 0, 0, 0, 413, 0, 0, 414, 0, 0, 0, 0, 0,
-    0, 415, 416, 0, 417, 418, 0, 0, 0, 419, 0, 0, 420, 0, 0, 0, 0, 421, 0, 0,
-    422, 0, 0, 423, 0, 0, 0, 424, 0, 425, 426, 0, 0, 0, 427, 0, 0, 0, 0, 0,
-    0, 428, 429, 0, 0, 0, 0, 0, 0, 430, 0, 0, 431, 0, 0, 0, 0, 432, 0, 433,
-    0, 0, 0, 0, 434, 0, 435, 0, 0, 0, 0, 0, 0, 436, 437, 0, 0, 438, 0, 0,
-    439, 0, 440, 441, 0, 0, 0, 442, 0, 0, 443, 0, 444, 445, 0, 446, 447, 0,
-    0, 448, 0, 0, 0, 449, 0, 450, 451, 0, 0, 0, 452, 0, 0, 0, 0, 0, 453, 0,
-    454, 455, 0, 456, 457, 0, 0, 0, 0, 0, 0, 458, 0, 0, 459, 0, 460, 461, 0,
-    0, 0, 462, 0, 0, 463, 0, 464, 465, 0, 466, 467, 0, 0, 468, 0, 0, 0, 469,
-    0, 470, 471, 0, 0, 0, 472, 0, 0, 0, 0, 0, 473, 0, 474, 475, 0, 476, 477,
-    0, 0, 0, 0, 0, 0, 478, 0, 0, 479, 0, 0, 480, 0, 0, 0, 0, 0, 481, 0, 0,
-    482, 0, 0, 0, 483, 0, 0, 484, 0, 0, 485, 0, 0, 0, 0, 0, 0, 486, 0, 0,
-    487, 488, 0, 489, 0, 0, 490, 0, 0, 0, 0, 0, 0, 491, 0, 0, 492, 0, 0, 493,
-    0, 0, 0, 494, 0, 0, 495, 0, 0, 0, 0, 0, 0, 496, 0, 0, 0, 497, 0, 0, 0,
-    498, 499, 0, 0, 0, 500, 0, 0, 0, 0, 0, 501, 502, 0, 503, 0, 0, 0, 504, 0,
-    0, 0, 505, 0, 0, 506, 507, 0, 0, 0, 0, 0, 508, 0, 0, 0, 509, 510, 0, 0,
-    0, 0, 0, 511, 0, 0, 0, 512, 513, 0, 514, 0, 0, 0, 0, 515, 0, 0, 516, 0,
-    0, 517, 0, 0, 0, 0, 0, 0, 518, 0, 0, 519, 0, 0, 520, 0, 0, 521, 0, 0, 0,
-    0, 0, 0, 522, 0, 0, 523, 0, 0, 524, 0, 0, 525, 0, 0, 0, 0, 0, 0, 526, 0,
-    0, 0, 527, 0, 0, 528, 0, 0, 529, 0, 0, 530, 0, 0, 0, 531, 0, 0, 0, 0, 0,
-    0, 532, 533, 534, 0, 0, 0, 0, 0, 535, 536, 0, 0, 0, 0, 0, 537, 0, 0, 538,
-    0, 0, 539, 0, 0, 0, 0, 0, 0, 540, 0, 541, 0, 0, 0, 0, 0, 542, 543, 0, 0,
-    0, 0, 0, 544, 0, 0, 545, 0, 0, 546, 0, 0, 0, 0, 0, 0, 547, 0, 0, 548, 0,
-    0, 549, 0, 0, 550, 0, 0, 0, 0, 551, 0, 0, 0, 0, 0, 552, 553, 0, 0, 0, 0,
-    0, 554, 0, 0, 555, 0, 0, 556, 0, 0, 0, 0, 0, 0, 557, 0, 0, 558, 0, 0,
-    559, 0, 0, 560, 0, 0, 0, 0, 561, 0, 0, 562, 0, 0, 0, 0, 0, 0, 563, 0, 0,
-    564, 0, 0, 565, 0, 0, 0, 0, 0, 566, 567, 0, 0, 0, 0, 0, 568, 0, 0, 569,
-    0, 0, 570, 0, 0, 0, 0, 0, 0, 571, 0, 0, 572, 0, 0, 573, 0, 0, 574, 0, 0,
-    0, 0, 575, 0, 0, 0, 0, 0, 576, 577, 0, 0, 0, 0, 0, 578, 0, 0, 579, 0, 0,
-    580, 0, 0, 0, 0, 0, 0, 581, 0, 0, 582, 0, 0, 583, 0, 0, 584, 0, 0, 0, 0,
-    585, 0, 0, 0, 0, 0, 586, 587, 0, 0, 0, 0, 0, 588, 0, 0, 0, 0, 589, 0,
-    590, 0, 0, 0, 0, 591, 0, 592, 0, 0, 0, 0, 593, 0, 0, 594, 0, 0, 0, 0, 0,
-    0, 595, 0, 0, 596, 0, 0, 597, 0, 0, 0, 0, 0, 598, 599, 0, 0, 0, 0, 0,
-    600, 0, 0, 0, 0, 601, 0, 602, 0, 0, 0, 0, 603, 0, 604, 0, 0, 0, 0, 605,
-    0, 0, 0, 0, 0, 606, 0, 0, 607, 0, 0, 608, 0, 0, 609, 0, 0, 0, 0, 0, 0,
-    610, 0, 0, 611, 0, 0, 612, 0, 0, 0, 0, 613, 0, 614, 0, 0, 0, 0, 615, 0,
-    0, 0, 0, 0, 616, 0, 0, 617, 0, 0, 618, 0, 0, 619, 0, 0, 0, 0, 0, 0, 620,
-    0, 0, 621, 0, 0, 622, 0, 0, 623, 0, 0, 0, 0, 0, 0, 624, 0, 0, 625, 0, 0,
-    626, 0, 0, 0, 0, 627, 0, 628, 0, 0, 0, 0, 0, 0, 629, 0, 0, 630, 0, 0, 0,
-    0, 631, 0, 632, 0, 0, 0, 0, 0, 633, 0, 0, 634, 0, 0, 635, 0, 0, 636, 0,
-    0, 0, 0, 0, 0, 637, 0, 0, 638, 0, 0, 639, 0, 0, 640, 0, 0, 0, 0, 0, 0,
-    641, 0, 0, 642, 0, 0, 643, 0, 0, 644, 0, 0, 0, 0, 0, 0, 645, 0, 0, 646,
-    0, 0, 647, 0, 0, 648, 0, 0, 0, 0, 0, 0, 649, 0, 0, 650, 0, 0, 651, 0, 0,
-    652, 0, 0, 0, 0, 0, 0, 653, 0, 0, 654, 0, 0, 655, 0, 0, 656, 0, 0, 0, 0,
-    0, 0, 657, 0, 0, 658, 0, 0, 659, 0, 0, 660, 0, 0, 0, 0, 0, 0, 661, 0, 0,
-    662, 0, 0, 663, 0, 0, 664, 0, 0, 0, 0, 0, 0, 665, 0, 0, 666, 0, 0, 667,
-    0, 0, 668, 0, 0, 0, 0, 0, 0, 669, 0, 0, 670, 0, 0, 671, 0, 0, 672, 0, 0,
-    0, 0, 0, 0, 673, 0, 0, 0, 674, 0, 0, 675, 0, 0, 676, 0, 0, 677, 0, 0, 0,
-    0, 0, 0, 678, 0, 0, 679, 0, 0, 680, 0, 0, 681, 0, 0, 0, 0, 0, 0, 682, 0,
-    0, 683, 0, 0, 684, 0, 0, 685, 0, 0, 0, 0, 0, 0, 686, 0, 0, 687, 0, 0,
-    688, 0, 0, 689, 0, 0, 0, 0, 0, 0, 690, 0, 0, 691, 0, 0, 692, 0, 0, 693,
-    0, 0, 0, 0, 0, 0, 694, 0, 0, 695, 0, 0, 696, 0, 0, 697, 0, 0, 0, 0, 0, 0,
-    698, 0, 0, 699, 0, 0, 700, 0, 0, 701, 0, 0, 0, 0, 0, 0, 702, 0, 0, 703,
-    0, 0, 704, 0, 0, 705, 0, 0, 0, 0, 0, 0, 706, 0, 0, 707, 0, 0, 708, 0, 0,
-    709, 0, 0, 0, 0, 0, 0, 710, 0, 0, 711, 0, 0, 712, 0, 0, 713, 0, 0, 0, 0,
-    0, 0, 714, 0, 0, 715, 0, 0, 716, 0, 0, 717, 0, 0, 0, 0, 0, 0, 718, 0, 0,
-    719, 0, 0, 720, 0, 0, 721, 0, 0, 0, 722, 0, 0, 0, 0, 0, 0, 723, 0, 0,
-    724, 0, 0, 725, 0, 0, 726, 0, 0, 0, 727, 0, 0, 0, 728, 729, 0, 0, 730, 0,
-    0, 0, 0, 0, 0, 731,
-};
-
-static const unsigned int comp_data[] = {
-    0, 0, 0, 8814, 0, 8800, 0, 8815, 192, 193, 194, 195, 256, 258, 550, 196,
-    7842, 197, 0, 461, 512, 514, 0, 7840, 0, 7680, 260, 0, 7682, 0, 0, 7684,
-    7686, 0, 0, 262, 264, 0, 266, 0, 0, 268, 0, 199, 7690, 0, 0, 270, 0,
-    7692, 0, 7696, 0, 7698, 7694, 0, 200, 201, 202, 7868, 274, 276, 278, 203,
-    7866, 0, 0, 282, 516, 518, 0, 7864, 0, 552, 280, 7704, 0, 7706, 7710, 0,
-    0, 500, 284, 0, 7712, 286, 288, 0, 0, 486, 0, 290, 292, 0, 7714, 7718, 0,
-    542, 0, 7716, 0, 7720, 7722, 0, 204, 205, 206, 296, 298, 300, 304, 207,
-    7880, 0, 0, 463, 520, 522, 0, 7882, 302, 0, 0, 7724, 308, 0, 0, 7728, 0,
-    488, 0, 7730, 0, 310, 7732, 0, 0, 313, 0, 317, 0, 7734, 0, 315, 0, 7740,
-    7738, 0, 0, 7742, 7744, 0, 0, 7746, 504, 323, 0, 209, 7748, 0, 0, 327, 0,
-    7750, 0, 325, 0, 7754, 7752, 0, 210, 211, 212, 213, 332, 334, 558, 214,
-    7886, 0, 336, 465, 524, 526, 416, 7884, 490, 0, 0, 7764, 7766, 0, 0, 340,
-    7768, 0, 0, 344, 528, 530, 0, 7770, 0, 342, 7774, 0, 0, 346, 348, 0,
-    7776, 0, 0, 352, 0, 7778, 536, 350, 7786, 0, 0, 356, 0, 7788, 538, 354,
-    0, 7792, 7790, 0, 217, 218, 219, 360, 362, 364, 0, 220, 7910, 366, 368,
-    467, 532, 534, 431, 7908, 7794, 0, 370, 7798, 0, 7796, 0, 7804, 0, 7806,
-    7808, 7810, 372, 0, 7814, 7812, 0, 7816, 7818, 7820, 7922, 221, 374,
-    7928, 562, 0, 7822, 376, 7926, 0, 0, 7924, 0, 377, 7824, 0, 379, 0, 0,
-    381, 0, 7826, 7828, 0, 224, 225, 226, 227, 257, 259, 551, 228, 7843, 229,
-    0, 462, 513, 515, 0, 7841, 0, 7681, 261, 0, 7683, 0, 0, 7685, 7687, 0, 0,
-    263, 265, 0, 267, 0, 0, 269, 0, 231, 7691, 0, 0, 271, 0, 7693, 0, 7697,
-    0, 7699, 7695, 0, 232, 233, 234, 7869, 275, 277, 279, 235, 7867, 0, 0,
-    283, 517, 519, 0, 7865, 0, 553, 281, 7705, 0, 7707, 7711, 0, 0, 501, 285,
-    0, 7713, 287, 289, 0, 0, 487, 0, 291, 293, 0, 7715, 7719, 0, 543, 0,
-    7717, 0, 7721, 7723, 0, 7830, 0, 236, 237, 238, 297, 299, 301, 0, 239,
-    7881, 0, 0, 464, 521, 523, 0, 7883, 303, 0, 0, 7725, 309, 0, 0, 496, 0,
-    7729, 0, 489, 0, 7731, 0, 311, 7733, 0, 0, 314, 0, 318, 0, 7735, 0, 316,
-    0, 7741, 7739, 0, 0, 7743, 7745, 0, 0, 7747, 505, 324, 0, 241, 7749, 0,
-    0, 328, 0, 7751, 0, 326, 0, 7755, 7753, 0, 242, 243, 244, 245, 333, 335,
-    559, 246, 7887, 0, 337, 466, 525, 527, 417, 7885, 491, 0, 0, 7765, 7767,
-    0, 0, 341, 7769, 0, 0, 345, 529, 531, 0, 7771, 0, 343, 7775, 0, 0, 347,
-    349, 0, 7777, 0, 0, 353, 0, 7779, 537, 351, 7787, 7831, 0, 357, 0, 7789,
-    539, 355, 0, 7793, 7791, 0, 249, 250, 251, 361, 363, 365, 0, 252, 7911,
-    367, 369, 468, 533, 535, 432, 7909, 7795, 0, 371, 7799, 0, 7797, 0, 7805,
-    0, 7807, 7809, 7811, 373, 0, 7815, 7813, 0, 7832, 0, 7817, 7819, 7821,
-    7923, 253, 375, 7929, 563, 0, 7823, 255, 7927, 7833, 0, 7925, 0, 378,
-    7825, 0, 380, 0, 0, 382, 0, 7827, 7829, 0, 8173, 901, 8129, 0, 7846,
-    7844, 0, 7850, 7848, 0, 478, 0, 0, 506, 0, 508, 482, 0, 0, 7688, 7872,
-    7870, 0, 7876, 7874, 0, 0, 7726, 7890, 7888, 0, 7894, 7892, 0, 0, 7756,
-    556, 0, 0, 7758, 554, 0, 0, 510, 475, 471, 469, 0, 0, 473, 7847, 7845, 0,
-    7851, 7849, 0, 479, 0, 0, 507, 0, 509, 483, 0, 0, 7689, 7873, 7871, 0,
-    7877, 7875, 0, 0, 7727, 7891, 7889, 0, 7895, 7893, 0, 0, 7757, 557, 0, 0,
-    7759, 555, 0, 0, 511, 476, 472, 470, 0, 0, 474, 7856, 7854, 0, 7860,
-    7858, 0, 7857, 7855, 0, 7861, 7859, 0, 7700, 7702, 7701, 7703, 7760,
-    7762, 7761, 7763, 7780, 0, 7781, 0, 7782, 0, 7783, 0, 0, 7800, 0, 7801,
-    0, 7802, 0, 7803, 7835, 0, 7900, 7898, 0, 7904, 7902, 0, 0, 7906, 7901,
-    7899, 0, 7905, 7903, 0, 0, 7907, 7914, 7912, 0, 7918, 7916, 0, 0, 7920,
-    7915, 7913, 0, 7919, 7917, 0, 0, 7921, 0, 494, 492, 0, 493, 0, 480, 0,
-    481, 0, 0, 7708, 0, 7709, 560, 0, 561, 0, 0, 495, 8122, 902, 8121, 8120,
-    7944, 7945, 0, 8124, 8136, 904, 7960, 7961, 8138, 905, 7976, 7977, 0,
-    8140, 8154, 906, 8153, 8152, 0, 938, 7992, 7993, 8184, 908, 8008, 8009,
-    0, 8172, 8170, 910, 8169, 8168, 0, 939, 0, 8025, 8186, 911, 8040, 8041,
-    0, 8188, 0, 8116, 0, 8132, 8048, 940, 8113, 8112, 7936, 7937, 8118, 8115,
-    8050, 941, 7952, 7953, 8052, 942, 7968, 7969, 8134, 8131, 8054, 943,
-    8145, 8144, 0, 970, 7984, 7985, 8150, 0, 8056, 972, 8000, 8001, 8164,
-    8165, 8058, 973, 8161, 8160, 0, 971, 8016, 8017, 8166, 0, 8060, 974,
-    8032, 8033, 8182, 8179, 8146, 912, 8151, 0, 8162, 944, 8167, 0, 0, 8180,
-    0, 979, 0, 980, 0, 1031, 0, 1232, 0, 1234, 0, 1027, 1024, 0, 0, 1238, 0,
-    1025, 0, 1217, 0, 1244, 0, 1246, 1037, 0, 1250, 1049, 0, 1252, 0, 1036,
-    0, 1254, 1262, 1038, 0, 1264, 1266, 0, 0, 1268, 0, 1272, 0, 1260, 0,
-    1233, 0, 1235, 0, 1107, 1104, 0, 0, 1239, 0, 1105, 0, 1218, 0, 1245, 0,
-    1247, 1117, 0, 1251, 1081, 0, 1253, 0, 1116, 0, 1255, 1263, 1118, 0,
-    1265, 1267, 0, 0, 1269, 0, 1273, 0, 1261, 0, 1111, 1142, 0, 1143, 0, 0,
-    1242, 0, 1243, 0, 1258, 0, 1259, 1570, 1571, 1573, 0, 0, 1572, 0, 1574,
-    0, 1730, 0, 1747, 0, 1728, 0, 2345, 0, 2353, 0, 2356, 2507, 2508, 2891,
-    2888, 2892, 0, 2964, 0, 0, 3018, 3020, 0, 0, 3019, 0, 3144, 0, 3264,
-    3274, 3271, 3272, 0, 0, 3275, 0, 3402, 3404, 0, 0, 3403, 0, 3546, 3548,
-    3550, 0, 3549, 4134, 0, 0, 6918, 0, 6920, 0, 6922, 0, 6924, 0, 6926, 0,
-    6930, 0, 6971, 0, 6973, 0, 6976, 0, 6977, 0, 6979, 7736, 0, 7737, 0,
-    7772, 0, 7773, 0, 7784, 0, 7785, 0, 7852, 0, 0, 7862, 7853, 0, 0, 7863,
-    7878, 0, 7879, 0, 7896, 0, 7897, 0, 7938, 7940, 7942, 8064, 7939, 7941,
-    7943, 8065, 0, 8066, 0, 8067, 0, 8068, 0, 8069, 0, 8070, 0, 8071, 7946,
-    7948, 7950, 8072, 7947, 7949, 7951, 8073, 0, 8074, 0, 8075, 0, 8076, 0,
-    8077, 0, 8078, 0, 8079, 7954, 7956, 7955, 7957, 7962, 7964, 7963, 7965,
-    7970, 7972, 7974, 8080, 7971, 7973, 7975, 8081, 0, 8082, 0, 8083, 0,
-    8084, 0, 8085, 0, 8086, 0, 8087, 7978, 7980, 7982, 8088, 7979, 7981,
-    7983, 8089, 0, 8090, 0, 8091, 0, 8092, 0, 8093, 0, 8094, 0, 8095, 7986,
-    7988, 7990, 0, 7987, 7989, 7991, 0, 7994, 7996, 7998, 0, 7995, 7997,
-    7999, 0, 8002, 8004, 8003, 8005, 8010, 8012, 8011, 8013, 8018, 8020,
-    8022, 0, 8019, 8021, 8023, 0, 8027, 8029, 8031, 0, 8034, 8036, 8038,
-    8096, 8035, 8037, 8039, 8097, 0, 8098, 0, 8099, 0, 8100, 0, 8101, 0,
-    8102, 0, 8103, 8042, 8044, 8046, 8104, 8043, 8045, 8047, 8105, 0, 8106,
-    0, 8107, 0, 8108, 0, 8109, 0, 8110, 0, 8111, 0, 8114, 0, 8130, 0, 8178,
-    0, 8119, 8141, 8142, 8143, 0, 0, 8135, 0, 8183, 8157, 8158, 8159, 0, 0,
-    8602, 0, 8603, 0, 8622, 0, 8653, 0, 8655, 0, 8654, 0, 8708, 0, 8713, 0,
-    8716, 0, 8740, 0, 8742, 0, 8769, 0, 8772, 0, 8775, 0, 8777, 0, 8813, 0,
-    8802, 0, 8816, 0, 8817, 0, 8820, 0, 8821, 0, 8824, 0, 8825, 0, 8832, 0,
-    8833, 0, 8928, 0, 8929, 0, 8836, 0, 8837, 0, 8840, 0, 8841, 0, 8930, 0,
-    8931, 0, 8876, 0, 8877, 0, 8878, 0, 8879, 0, 8938, 0, 8939, 0, 8940, 0,
-    8941, 12436, 0, 12364, 0, 12366, 0, 12368, 0, 12370, 0, 12372, 0, 12374,
-    0, 12376, 0, 12378, 0, 12380, 0, 12382, 0, 12384, 0, 12386, 0, 12389, 0,
-    12391, 0, 12393, 0, 12400, 12401, 12403, 12404, 12406, 12407, 12409,
-    12410, 12412, 12413, 12446, 0, 12532, 0, 12460, 0, 12462, 0, 12464, 0,
-    12466, 0, 12468, 0, 12470, 0, 12472, 0, 12474, 0, 12476, 0, 12478, 0,
-    12480, 0, 12482, 0, 12485, 0, 12487, 0, 12489, 0, 12496, 12497, 12499,
-    12500, 12502, 12503, 12505, 12506, 12508, 12509, 12535, 0, 12536, 0,
-    12537, 0, 12538, 0, 12542, 0, 69786, 0, 69788, 0, 69803, 0, 0, 69934, 0,
-    69935, 70475, 70476, 70844, 70843, 70846, 0, 0, 71098, 0, 71099,
-};
-
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-unicode-private.hh	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-unicode-private.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -108,7 +108,7 @@
     /* XXX This hack belongs to the Myanmar shaper. */
     if (unlikely (unicode == 0x1037u)) unicode = 0x103Au;
 
-    /* XXX This hack belongs to the SEA shaper (for Tai Tham):
+    /* XXX This hack belongs to the USE shaper (for Tai Tham):
      * Reorder SAKOT to ensure it comes after any tone marks. */
     if (unlikely (unicode == 0x1A60u)) return 254;
 
@@ -126,7 +126,7 @@
   {
     /* U+180B..180D MONGOLIAN FREE VARIATION SELECTORs are handled in the
      * Arabic shaper.  No need to match them here. */
-    return unlikely (hb_in_ranges (unicode,
+    return unlikely (hb_in_ranges<hb_codepoint_t> (unicode,
                                    0xFE00u, 0xFE0Fu, /* VARIATION SELECTOR-1..16 */
                                    0xE0100u, 0xE01EFu));  /* VARIATION SELECTOR-17..256 */
   }
@@ -137,6 +137,7 @@
    * we do NOT want to hide them, as the way Uniscribe has implemented them
    * is with regular spacing glyphs, and that's the way fonts are made to work.
    * As such, we make exceptions for those four.
+   * Also ignoring U+1BCA0..1BCA3. https://github.com/behdad/harfbuzz/issues/503
    *
    * Unicode 7.0:
    * $ grep '; Default_Ignorable_Code_Point ' DerivedCoreProperties.txt | sed 's/;.*#/#/'
@@ -179,13 +180,13 @@
         case 0x00: return unlikely (ch == 0x00ADu);
         case 0x03: return unlikely (ch == 0x034Fu);
         case 0x06: return unlikely (ch == 0x061Cu);
-        case 0x17: return hb_in_range (ch, 0x17B4u, 0x17B5u);
-        case 0x18: return hb_in_range (ch, 0x180Bu, 0x180Eu);
-        case 0x20: return hb_in_ranges (ch, 0x200Bu, 0x200Fu,
+        case 0x17: return hb_in_range<hb_codepoint_t> (ch, 0x17B4u, 0x17B5u);
+        case 0x18: return hb_in_range<hb_codepoint_t> (ch, 0x180Bu, 0x180Eu);
+        case 0x20: return hb_in_ranges<hb_codepoint_t> (ch, 0x200Bu, 0x200Fu,
                                             0x202Au, 0x202Eu,
                                             0x2060u, 0x206Fu);
-        case 0xFE: return hb_in_range (ch, 0xFE00u, 0xFE0Fu) || ch == 0xFEFFu;
-        case 0xFF: return hb_in_range (ch, 0xFFF0u, 0xFFF8u);
+        case 0xFE: return hb_in_range<hb_codepoint_t> (ch, 0xFE00u, 0xFE0Fu) || ch == 0xFEFFu;
+        case 0xFF: return hb_in_range<hb_codepoint_t> (ch, 0xFFF0u, 0xFFF8u);
         default: return false;
       }
     }
@@ -193,9 +194,8 @@
     {
       /* Other planes */
       switch (plane) {
-        case 0x01: return hb_in_ranges (ch, 0x1BCA0u, 0x1BCA3u,
-                                            0x1D173u, 0x1D17Au);
-        case 0x0E: return hb_in_range (ch, 0xE0000u, 0xE0FFFu);
+        case 0x01: return hb_in_range<hb_codepoint_t> (ch, 0x1D173u, 0x1D17Au);
+        case 0x0E: return hb_in_range<hb_codepoint_t> (ch, 0xE0000u, 0xE0FFFu);
         default: return false;
       }
     }
@@ -346,23 +346,24 @@
 #define HB_MODIFIED_COMBINING_CLASS_CCC122 122 /* mai * */
 
 /* Tibetan
- * Modify U+0F74 (ccc=132) to reorder before ccc=130 marks.
+ *
+ * In case of multiple vowel-signs, use u first (but after achung)
+ * this allows Dzongkha multi-vowel shortcuts to render correctly
  */
 #define HB_MODIFIED_COMBINING_CLASS_CCC129 129 /* sign aa */
-#define HB_MODIFIED_COMBINING_CLASS_CCC130 130 /* sign i */
-#define HB_MODIFIED_COMBINING_CLASS_CCC132 128 /* sign u */
-
+#define HB_MODIFIED_COMBINING_CLASS_CCC130 132 /* sign i */
+#define HB_MODIFIED_COMBINING_CLASS_CCC132 131 /* sign u */
 
 /* Misc */
 
 #define HB_UNICODE_GENERAL_CATEGORY_IS_MARK(gen_cat) \
-        (FLAG_SAFE (gen_cat) & \
+        (FLAG_UNSAFE (gen_cat) & \
          (FLAG (HB_UNICODE_GENERAL_CATEGORY_SPACING_MARK) | \
           FLAG (HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK) | \
           FLAG (HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK)))
 
 #define HB_UNICODE_GENERAL_CATEGORY_IS_NON_ENCLOSING_MARK_OR_MODIFIER_SYMBOL(gen_cat) \
-        (FLAG_SAFE (gen_cat) & \
+        (FLAG_UNSAFE (gen_cat) & \
          (FLAG (HB_UNICODE_GENERAL_CATEGORY_SPACING_MARK) | \
           FLAG (HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK) | \
           FLAG (HB_UNICODE_GENERAL_CATEGORY_MODIFIER_SYMBOL)))
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-unicode.cc	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-unicode.cc	Wed Dec 13 10:25:38 2017 -0800
@@ -154,7 +154,7 @@
  * hb_unicode_funcs_create: (Xconstructor)
  * @parent: (nullable):
  *
- * 
+ *
  *
  * Return value: (transfer full):
  *
@@ -188,7 +188,7 @@
 const hb_unicode_funcs_t _hb_unicode_funcs_nil = {
   HB_OBJECT_HEADER_STATIC,
 
-  NULL, /* parent */
+  nullptr, /* parent */
   true, /* immutable */
   {
 #define HB_UNICODE_FUNC_IMPLEMENT(name) hb_unicode_##name##_nil,
@@ -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
  **/
@@ -365,7 +365,7 @@
   } else {                                                                      \
     ufuncs->func.name = ufuncs->parent->func.name;                              \
     ufuncs->user_data.name = ufuncs->parent->user_data.name;                    \
-    ufuncs->destroy.name = NULL;                                                \
+    ufuncs->destroy.name = nullptr;                                             \
   }                                                                             \
 }
 
@@ -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/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-utf-private.hh	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-utf-private.hh	Wed Dec 13 10:25:38 2017 -0800
@@ -48,7 +48,7 @@
 
     if (c > 0x7Fu)
     {
-      if (hb_in_range (c, 0xC2u, 0xDFu)) /* Two-byte */
+      if (hb_in_range<hb_codepoint_t> (c, 0xC2u, 0xDFu)) /* Two-byte */
       {
         unsigned int t1;
         if (likely (text < end &&
@@ -60,7 +60,7 @@
         else
           goto error;
       }
-      else if (hb_in_range (c, 0xE0u, 0xEFu)) /* Three-byte */
+      else if (hb_in_range<hb_codepoint_t> (c, 0xE0u, 0xEFu)) /* Three-byte */
       {
         unsigned int t1, t2;
         if (likely (1 < end - text &&
@@ -68,14 +68,14 @@
                     (t2 = text[1] - 0x80u) <= 0x3Fu))
         {
           c = ((c&0xFu)<<12) | (t1<<6) | t2;
-          if (unlikely (c < 0x0800u || hb_in_range (c, 0xD800u, 0xDFFFu)))
+          if (unlikely (c < 0x0800u || hb_in_range<hb_codepoint_t> (c, 0xD800u, 0xDFFFu)))
             goto error;
           text += 2;
         }
         else
           goto error;
       }
-      else if (hb_in_range (c, 0xF0u, 0xF4u)) /* Four-byte */
+      else if (hb_in_range<hb_codepoint_t> (c, 0xF0u, 0xF4u)) /* Four-byte */
       {
         unsigned int t1, t2, t3;
         if (likely (2 < end - text &&
@@ -84,7 +84,7 @@
                     (t3 = text[2] - 0x80u) <= 0x3Fu))
         {
           c = ((c&0x7u)<<18) | (t1<<12) | (t2<<6) | t3;
-          if (unlikely (!hb_in_range (c, 0x10000u, 0x10FFFFu)))
+          if (unlikely (!hb_in_range<hb_codepoint_t> (c, 0x10000u, 0x10FFFFu)))
             goto error;
           text += 3;
         }
@@ -140,7 +140,7 @@
   {
     hb_codepoint_t c = *text++;
 
-    if (likely (!hb_in_range (c, 0xD800u, 0xDFFFu)))
+    if (likely (!hb_in_range<hb_codepoint_t> (c, 0xD800u, 0xDFFFu)))
     {
       *unicode = c;
       return text;
@@ -150,7 +150,7 @@
     {
       /* High-surrogate in c */
       hb_codepoint_t l = *text;
-      if (likely (hb_in_range (l, 0xDC00u, 0xDFFFu)))
+      if (likely (hb_in_range<hb_codepoint_t> (l, 0xDC00u, 0xDFFFu)))
       {
         /* Low-surrogate in l */
         *unicode = (c << 10) + l - ((0xD800u << 10) - 0x10000u + 0xDC00u);
@@ -172,7 +172,7 @@
   {
     hb_codepoint_t c = *--text;
 
-    if (likely (!hb_in_range (c, 0xD800u, 0xDFFFu)))
+    if (likely (!hb_in_range<hb_codepoint_t> (c, 0xD800u, 0xDFFFu)))
     {
       *unicode = c;
       return text;
@@ -182,7 +182,7 @@
     {
       /* Low-surrogate in c */
       hb_codepoint_t h = text[-1];
-      if (likely (hb_in_range (h, 0xD800u, 0xDBFFu)))
+      if (likely (hb_in_range<hb_codepoint_t> (h, 0xD800u, 0xDBFFu)))
       {
         /* High-surrogate in h */
         *unicode = (h << 10) + c - ((0xD800u << 10) - 0x10000u + 0xDC00u);
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-version.h	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-version.h	Wed Dec 13 10:25:38 2017 -0800
@@ -37,10 +37,10 @@
 
 
 #define HB_VERSION_MAJOR 1
-#define HB_VERSION_MINOR 4
+#define HB_VERSION_MINOR 7
 #define HB_VERSION_MICRO 1
 
-#define HB_VERSION_STRING "1.4.1"
+#define HB_VERSION_STRING "1.7.1"
 
 #define HB_VERSION_ATLEAST(major,minor,micro) \
         ((major)*10000+(minor)*100+(micro) <= \
--- a/src/java.desktop/share/native/libsplashscreen/libpng/CHANGES	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libsplashscreen/libpng/CHANGES	Wed Dec 13 10:25:38 2017 -0800
@@ -833,7 +833,7 @@
   Removed the new PNG_CREATED_READ_STRUCT and PNG_CREATED_WRITE_STRUCT modes
     which are no longer used.
   Eliminated the three new members of png_text when PNG_LEGACY_SUPPORTED is
-    defined or when neither PNG_READ_iTXt_SUPPORTED nor PNG_WRITE_iTXT_SUPPORTED
+    defined or when neither PNG_READ_iTXt_SUPPORTED nor PNG_WRITE_iTXt_SUPPORTED
     is defined.
   Made PNG_NO_READ|WRITE_iTXt the default setting, to avoid memory
     overrun when old applications fill the info_ptr->text structure directly.
@@ -4053,7 +4053,7 @@
     (in fact this is harmless, but the PNG data produced may be sub-optimal).
 
 Version 1.6.0beta17 [March 10, 2012]
-  Fixed PNG_LIBPNG_BUILD_BASE_TYPE definition. 
+  Fixed PNG_LIBPNG_BUILD_BASE_TYPE definition.
   Reject all iCCP chunks after the first, even if the first one is invalid.
   Deflate/inflate was reworked to move common zlib calls into single
     functions [rw]util.c.  A new shared keyword check routine was also added
@@ -4963,7 +4963,7 @@
   Changed "if defined(__ARM_NEON__)" to
     "if (defined(__ARM_NEON__) || defined(__ARM_NEON))" (James Wu).
   Fixed clang no-warning builds: png_digit was defined but never used.
-    
+
 Version 1.6.13beta02 [July 21, 2014]
   Fixed an incorrect separator ("/" should be "\") in scripts/makefile.vcwin32
     (bug report from Wolfgang S. Kechel).  Bug was introduced in libpng-1.6.11.
@@ -5454,7 +5454,7 @@
 Version 1.6.21beta02 [December 14, 2015]
   Moved png_check_keyword() from pngwutil.c to pngset.c
   Removed LE/BE dependencies in pngvalid, to 'fix' the current problem
-    in the BigEndian tests by not testing it, making the BE code the same 
+    in the BigEndian tests by not testing it, making the BE code the same
     as the LE version.
   Fixes to pngvalid for various reduced build configurations (eliminate unused
     statics) and a fix for the case in rgb_to_gray when the digitize option
@@ -5518,7 +5518,7 @@
   Added a common-law trademark notice and export control information
     to the LICENSE file, png.h, and the man page.
   Restored "& 0xff" in png_save_uint_16() and png_save_uint_32() that
-    were accidentally removed from libpng-1.6.17. 
+    were accidentally removed from libpng-1.6.17.
   Changed PNG_INFO_cHNK and PNG_FREE_cHNK from 0xnnnn to 0xnnnnU in png.h
     (Robert C. Seacord).
   Removed dubious "#if INT_MAX" test from png.h that was added to
@@ -5761,7 +5761,9 @@
     if built with zlib-1.2.8.1.
 
 Version 1.6.27rc01 [December 27, 2016]
-  Control ADLER32 checking with new PNG_IGNORE_ADLER32 option.
+  Control ADLER32 checking with new PNG_IGNORE_ADLER32 option. Fixes
+    an endless loop when handling erroneous ADLER32 checksums; bug
+    introduced in libpng-1.6.26.
   Removed the use of a macro containing the pre-processor 'defined'
     operator.  It is unclear whether this is valid; a macro that
     "generates" 'defined' is not permitted, but the use of the word
@@ -5794,6 +5796,251 @@
 Version 1.6.28 [January 5, 2017]
   No changes.
 
+Version 1.6.29beta01 [January 12, 2017]
+  Readded "include(GNUInstallDirs)" to CMakeLists.txt (Gianfranco Costamagna).
+  Moved SSE2 optimization code into the main libpng source directory.
+    Configure libpng with "configure --enable-intel-sse" or compile
+    libpng with "-DPNG_INTEL_SSE" in CPPFLAGS to enable it.
+  Simplified conditional compilation in pngvalid.c, for AIX (Michael Felt).
+
+Version 1.6.29beta02 [February 22, 2017]
+  Avoid conditional directives that break statements in pngrutil.c (Romero
+    Malaquias)
+  The contrib/examples/pngtopng.c recovery code was in the wrong "if"
+    branches; the comments were correct.
+  Added code for PowerPC VSX optimisation (Vadim Barkov).
+
+Version 1.6.29beta03 [March 1, 2017]
+  Avoid potential overflow of shift operations in png_do_expand() (Aaron Boxer).
+  Change test ZLIB_VERNUM >= 0x1281 to ZLIB_VERNUM >= 0x1290 in pngrutil.c
+    because Solaris 11 distributes zlib-1.2.8.f that is older than 1.2.8.1,
+    as suggested in zlib FAQ, item 24.
+  Suppress clang warnings about implicit sign changes in png.c
+
+Version 1.6.29 [March 16, 2017]
+  No changes.
+
+Version 1.6.30beta01 [April 1, 2017]
+  Added missing "$(CPPFLAGS)" to the compile line for c.pic.o in
+    makefile.linux and makefile.solaris-x86 (Cosmin).
+  Revised documentation of png_get_error_ptr() in the libpng manual.
+  Silence clang -Wcomma and const drop warnings (Viktor Szakats).
+  Update Sourceforge URLs in documentation (https instead of http).
+
+Version 1.6.30beta02 [April 22, 2017]
+  Document need to check for integer overflow when allocating a pixel
+    buffer for multiple rows in contrib/gregbook, contrib/pngminus,
+    example.c, and in the manual (suggested by Jaeseung Choi). This
+    is similar to the bug reported against pngquant in CVE-2016-5735.
+  Removed reference to the obsolete PNG_SAFE_LIMITS macro in the documentation.
+
+Version 1.6.30beta03 [May 22, 2017]
+  Check for integer overflow in contrib/visupng and contrib/tools/genpng.
+  Do not double evaluate CMAKE_SYSTEM_PROCESSOR in CMakeLists.txt.
+  Test CMAKE_HOST_WIN32 instead of WIN32 in CMakeLists.txt.
+  Fix some URL in documentation.
+
+Version 1.6.30beta04 [June 7, 2017]
+  Avoid writing an empty IDAT when the last IDAT exactly fills the
+    compression buffer (bug report by Brian Baird). This bug was
+    introduced in libpng-1.6.0.
+
+Version 1.6.30rc01 [June 14, 2017]
+  No changes.
+
+Version 1.6.30rc02 [June 25, 2017]
+  Update copyright year in pnglibconf.h, make ltmain.sh executable.
+  Add a reference to the libpng.download site in README.
+
+Version 1.6.30 [June 28, 2017]
+  No changes.
+
+Version 1.6.31beta01 [July 5, 2017]
+  Guard the definition of _POSIX_SOURCE in pngpriv.h (AIX already defines it;
+    bug report by Michael Felt).
+  Revised pngpriv.h to work around failure to compile arm/filter_neon.S
+    ("typedef" directive is unrecognized by the assembler). The problem
+    was introduced in libpng-1.6.30beta01.
+  Added "Requires: zlib" to libpng.pc.in (Pieter Neerincx).
+  Added special case for FreeBSD in arm/filter_neon.S (Maya Rashish).
+
+Version 1.6.31beta02 [July 8, 2017]
+  Added instructions for disabling hardware optimizations in INSTALL.
+  Added "--enable-hardware-optimizations" configuration flag to enable
+    or disable all hardware optimizations with one flag.
+
+Version 1.6.31beta03 [July 9, 2017]
+  Updated CMakeLists.txt to add INTEL_SSE and MIPS_MSA platforms.
+  Changed "int" to "png_size_t" in intel/filter_sse2.c to prevent
+    possible integer overflow (Bug report by John Bowler).
+  Quieted "declaration after statement" warnings in intel/filter_sse2.c.
+  Added scripts/makefile-linux-opt, which has hardware optimizations enabled.
+
+Version 1.6.31beta04 [July 11, 2017]
+  Removed one of the GCC-7.1.0 'strict-overflow' warnings that result when
+    integers appear on both sides of a compare.  Worked around the others by
+    forcing the strict-overflow setting in the relevant functions to a level
+    where they are not reported (John Bowler).
+  Changed "FALL THROUGH" comments to "FALLTHROUGH" because GCC doesn't like
+    the space.
+  Worked around some C-style casts from (void*) because g++ 5.4.0 objects
+    to them.
+  Increased the buffer size for 'sprint' to pass the gcc 7.1.0 'sprint
+    overflow' check that is on by default with -Wall -Wextra.
+
+Version 1.6.31beta05 [July 13, 2017]
+  Added eXIf chunk support.
+
+Version 1.6.31beta06 [July 17, 2017]
+  Added a minimal eXIf chunk (with Orientation and FocalLengthIn35mmFilm
+    tags) to pngtest.png.
+
+Version 1.6.31beta07 [July 18, 2017]
+  Revised the eXIf chunk in pngtest.png to fix "Bad IFD1 Directory" warning.
+
+Version 1.6.31rc01 [July 19, 2017]
+  No changes.
+
+Version 1.6.31rc02 [July 25, 2017]
+  Fixed typo in example.c (png_free_image should be png_image_free) (Bug
+    report by John Smith)
+
+Version 1.6.31 [July 27, 2017]
+  No changes.
+
+Version 1.6.32beta01 [July 31, 2017]
+  Avoid possible NULL dereference in png_handle_eXIf when benign_errors
+    are allowed. Avoid leaking the input buffer "eXIf_buf".
+  Eliminated png_ptr->num_exif member from pngstruct.h and added num_exif
+    to arguments for png_get_eXIf() and png_set_eXIf().
+  Added calls to png_handle_eXIf(() in pngread.c and png_write_eXIf() in
+    pngwrite.c, and made various other fixes to png_write_eXIf().
+  Changed name of png_get_eXIF and png_set_eXIf() to png_get_eXIf_1() and
+    png_set_eXIf_1(), respectively, to avoid breaking API compatibility
+    with libpng-1.6.31.
+
+Version 1.6.32beta02 [August 1, 2017]
+  Updated contrib/libtests/pngunknown.c with eXIf chunk.
+
+Version 1.6.32beta03 [August 2, 2017]
+  Initialized btoa[] in pngstest.c
+  Stop memory leak when returning from png_handle_eXIf() with an error
+    (Bug report from the OSS-fuzz project).
+
+Version 1.6.32beta04 [August 2, 2017]
+  Replaced local eXIf_buf with info_ptr-eXIf_buf in png_handle_eXIf().
+  Update libpng.3 and libpng-manual.txt about eXIf functions.
+
+Version 1.6.32beta05 [August 2, 2017]
+  Restored png_get_eXIf() and png_set_eXIf() to maintain API compatability.
+
+Version 1.6.32beta06 [August 2, 2017]
+  Removed png_get_eXIf_1() and png_set_eXIf_1().
+
+Version 1.6.32beta07 [August 3, 2017]
+  Check length of all chunks except IDAT against user limit to fix an
+    OSS-fuzz issue (Fixes CVE-2017-12652).
+
+Version 1.6.32beta08 [August 3, 2017]
+  Check length of IDAT against maximum possible IDAT size, accounting
+    for height, rowbytes, interlacing and zlib/deflate overhead.
+  Restored png_get_eXIf_1() and png_set_eXIf_1(), because strlen(eXIf_buf)
+    does not work (the eXIf chunk data can contain zeroes).
+
+Version 1.6.32beta09 [August 3, 2017]
+  Require cmake-2.8.8 in CMakeLists.txt. Revised symlink creation,
+    no longer using deprecated cmake LOCATION feature (Clifford Yapp).
+  Fixed five-byte error in the calculation of IDAT maximum possible size.
+
+Version 1.6.32beta10 [August 5, 2017]
+  Moved chunk-length check into a png_check_chunk_length() private
+    function (Suggested by Max Stepin).
+  Moved bad pngs from tests to contrib/libtests/crashers
+  Moved testing of bad pngs into a separate tests/pngtest-badpngs script
+  Added the --xfail (expected FAIL) option to pngtest.c. It writes XFAIL
+    in the output but PASS for the libpng test.
+  Require cmake-3.0.2 in CMakeLists.txt (Clifford Yapp).
+  Fix "const" declaration info_ptr argument to png_get_eXIf_1() and the
+    num_exif argument to png_get_eXIf_1() (Github Issue 171).
+
+Version 1.6.32beta11 [August 7, 2017]
+  Added "eXIf" to "chunks_to_ignore[]" in png_set_keep_unknown_chunks().
+  Added huge_IDAT.png and empty_ancillary_chunks.png to testpngs/crashers.
+  Make pngtest --strict, --relax, --xfail options imply -m (multiple).
+  Removed unused chunk_name parameter from png_check_chunk_length().
+  Relocated setting free_me for eXIf data, to stop an OSS-fuzz leak.
+  Initialize profile_header[] in png_handle_iCCP() to fix OSS-fuzz issue.
+  Initialize png_ptr->row_buf[0] to 255 in png_read_row() to fix OSS-fuzz UMR.
+  Attempt to fix a UMR in png_set_text_2() to fix OSS-fuzz issue.
+  Increase minimum zlib stream from 9 to 14 in png_handle_iCCP(), to account
+    for the minimum 'deflate' stream, and relocate the test to a point
+    after the keyword has been read.
+  Check that the eXIf chunk has at least 2 bytes and begins with "II" or "MM".
+
+Version 1.6.32rc01 [August 18, 2017]
+  Added a set of "huge_xxxx_chunk.png" files to contrib/testpngs/crashers,
+    one for each known chunk type, with length = 2GB-1.
+  Check for 0 return from png_get_rowbytes() and added some (size_t) typecasts
+    in contrib/pngminus/*.c to stop some Coverity issues (162705, 162706,
+    and 162707).
+  Renamed chunks in contrib/testpngs/crashers to avoid having files whose
+    names differ only in case; this causes problems with some platforms
+    (github issue #172).
+
+Version 1.6.32rc02 [August 22, 2017]
+  Added contrib/oss-fuzz directory which contains files used by the oss-fuzz
+    project (https://github.com/google/oss-fuzz/tree/master/projects/libpng).
+
+Version 1.6.32 [August 24, 2017]
+  No changes.
+
+Version 1.6.33beta01 [August 28, 2017]
+  Added PNGMINUS_UNUSED macro to contrib/pngminus/p*.c and added missing
+    parenthesis in contrib/pngminus/pnm2png.c (bug report by Christian Hesse).
+  Fixed off-by-one error in png_do_check_palette_indexes() (Bug report
+    by Mick P., Source Forge Issue #269).
+
+Version 1.6.33beta02 [September 3, 2017]
+  Initialize png_handler.row_ptr in contrib/oss-fuzz/libpng_read_fuzzer.cc
+    to fix shortlived oss-fuzz issue 3234.
+  Compute a larger limit on IDAT because some applications write a deflate
+    buffer for each row (Bug report by Andrew Church).
+  Use current date (DATE) instead of release-date (RDATE) in last
+    changed date of contrib/oss-fuzz files.
+  Enabled ARM support in CMakeLists.txt (Bernd Kuhls).
+
+Version 1.6.33beta03 [September 14, 2017]
+  Fixed incorrect typecast of some arguments to png_malloc() and
+    png_calloc() that were png_uint_32 instead of png_alloc_size_t
+    (Bug report by "irwir" in Github libpng issue #175).
+  Use pnglibconf.h.prebuilt when building for ANDROID with cmake (Github
+    issue 162, by rcdailey).
+
+Version 1.6.33rc01 [September 20, 2017]
+  Initialize memory allocated by png_inflate to zero, using memset, to
+    stop an oss-fuzz "use of uninitialized value" detection in png_set_text_2()
+    due to truncated iTXt or zTXt chunk.
+  Initialize memory allocated by png_read_buffer to zero, using memset, to
+    stop an oss-fuzz "use of uninitialized value" detection in
+    png_icc_check_tag_table() due to truncated iCCP chunk.
+  Removed a redundant test (suggested by "irwir" in Github issue #180).
+
+Version 1.6.33rc02 [September 23, 2017]
+  Added an interlaced version of each file in contrib/pngsuite.
+  Relocate new memset() call in pngrutil.c.
+  Removed more redundant tests (suggested by "irwir" in Github issue #180).
+  Add support for loading images with associated alpha in the Simplified
+    API (Samuel Williams).
+
+Version 1.6.33 [September 28, 2017]
+  Revert contrib/oss-fuzz/libpng_read_fuzzer.cc to libpng-1.6.32 state.
+  Initialize png_handler.row_ptr in contrib/oss-fuzz/libpng_read_fuzzer.cc
+  Add end_info structure and png_read_end() to the libpng fuzzer.
+
+Version 1.6.34 [September 29, 2017]
+  Removed contrib/pngsuite/i*.png; some of these were incorrect and caused
+    test failures.
+
 Send comments/corrections/commendations to png-mng-implement at lists.sf.net
 (subscription required; visit
 https://lists.sourceforge.net/lists/listinfo/png-mng-implement
--- a/src/java.desktop/share/native/libsplashscreen/libpng/LICENSE	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libsplashscreen/libpng/LICENSE	Wed Dec 13 10:25:38 2017 -0800
@@ -10,7 +10,7 @@
 
 This code is released under the libpng license.
 
-libpng versions 1.0.7, July 1, 2000 through 1.6.28, January 5, 2017 are
+libpng versions 1.0.7, July 1, 2000 through 1.6.34, September 29, 2017 are
 Copyright (c) 2000-2002, 2004, 2006-2017 Glenn Randers-Pehrson, are
 derived from libpng-1.0.6, and are distributed according to the same
 disclaimer and license as libpng-1.0.6 with the following individuals
@@ -23,6 +23,8 @@
    Gilles Vollant
    James Yu
    Mandar Sahastrabuddhe
+   Google Inc.
+   Vadim Barkov
 
 and with the following additions to the disclaimer:
 
@@ -128,4 +130,4 @@
 
 Glenn Randers-Pehrson
 glennrp at users.sourceforge.net
-January 5, 2017
+September 29, 2017
--- a/src/java.desktop/share/native/libsplashscreen/libpng/README	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libsplashscreen/libpng/README	Wed Dec 13 10:25:38 2017 -0800
@@ -1,4 +1,4 @@
-README for libpng version 1.6.28 - January 5, 2017 (shared library 16.0)
+README for libpng version 1.6.34 - September 29, 2017 (shared library 16.0)
 See the note about version numbers near the top of png.h
 
 See INSTALL for instructions on how to install libpng.
@@ -23,7 +23,7 @@
 png_uint_32, which will affect shared-library applications that use
 this function.
 
-To avoid problems with changes to the internals of png info_struct,
+To avoid problems with changes to the internals of the png info_struct,
 new APIs have been made available in 0.95 to avoid direct application
 access to info_ptr.  These functions are the png_set_<chunk> and
 png_get_<chunk> functions.  These functions should be used when
@@ -88,11 +88,11 @@
 
 You may also want a copy of the PNG specification.  It is available
 as an RFC, a W3C Recommendation, and an ISO/IEC Standard.  You can find
-these at http://www.libpng.org/pub/png/documents/
+these at http://www.libpng.org/pub/png/pngdocs.html .
 
-This code is currently being archived at libpng.sf.net in the
-[DOWNLOAD] area, and at ftp://ftp.simplesystems.org.  If you can't find it
-in any of those places, e-mail me, and I'll help you find it.
+This code is currently being archived at libpng.sourceforge.io in the
+[DOWNLOAD] area, and at http://libpng.download/src .  If you
+can't find it in any of those places, e-mail me, and I'll help you find it.
 
 I am not a lawyer, but I believe that the Export Control Classification
 Number (ECCN) for libpng is EAR99, which means not subject to export
@@ -179,14 +179,16 @@
       pngwtran.c    =>  Write data transformations
       pngwutil.c    =>  Write utility functions
       arm           =>  Contains optimized code for the ARM platform
+      powerpc       =>  Contains optimized code for the PowerPC platform
       contrib       =>  Contributions
        arm-neon         =>  Optimized code for ARM-NEON platform
+       powerpc-vsx      =>  Optimized code for POWERPC-VSX platform
        examples         =>  Example programs
        gregbook         =>  source code for PNG reading and writing, from
                             Greg Roelofs' "PNG: The Definitive Guide",
                             O'Reilly, 1999
-       intel            =>  Optimized code for INTEL-SSE2 platform
        libtests         =>  Test programs
+       mips-msa         =>  Optimized code for MIPS-MSA platform
        pngminim         =>  Minimal decoder, encoder, and progressive decoder
                             programs demonstrating use of pngusr.dfa
        pngminus         =>  Simple pnm2png and png2pnm programs
@@ -194,6 +196,8 @@
        testpngs
        tools            =>  Various tools
        visupng          =>  Contains a MSVC workspace for VisualPng
+      intel             =>  Optimized code for INTEL-SSE2 platform
+      mips              =>  Optimized code for MIPS platform
       projects      =>  Contains project files and workspaces for
                         building a DLL
        owatcom          =>  Contains a WATCOM project for building libpng
--- a/src/java.desktop/share/native/libsplashscreen/libpng/png.c	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libsplashscreen/libpng/png.c	Wed Dec 13 10:25:38 2017 -0800
@@ -29,7 +29,7 @@
  * However, the following notice accompanied the original version of this
  * file and, per its terms, should not be removed:
  *
- * Last changed in libpng 1.6.28 [January 5, 2017]
+ * Last changed in libpng 1.6.33 [September 28, 2017]
  * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@@ -42,7 +42,27 @@
 #include "pngpriv.h"
 
 /* Generate a compiler error if there is an old png.h in the search path. */
-typedef png_libpng_version_1_6_28 Your_png_h_is_not_version_1_6_28;
+typedef png_libpng_version_1_6_34 Your_png_h_is_not_version_1_6_34;
+
+#ifdef __GNUC__
+/* The version tests may need to be added to, but the problem warning has
+ * consistently been fixed in GCC versions which obtain wide-spread release.
+ * The problem is that many versions of GCC rearrange comparison expressions in
+ * the optimizer in such a way that the results of the comparison will change
+ * if signed integer overflow occurs.  Such comparisons are not permitted in
+ * ANSI C90, however GCC isn't clever enough to work out that that do not occur
+ * below in png_ascii_from_fp and png_muldiv, so it produces a warning with
+ * -Wextra.  Unfortunately this is highly dependent on the optimizer and the
+ * machine architecture so the warning comes and goes unpredictably and is
+ * impossible to "fix", even were that a good idea.
+ */
+#if __GNUC__ == 7 && __GNUC_MINOR__ == 1
+#define GCC_STRICT_OVERFLOW 1
+#endif /* GNU 7.1.x */
+#endif /* GNU */
+#ifndef GCC_STRICT_OVERFLOW
+#define GCC_STRICT_OVERFLOW 0
+#endif
 
 /* Tells libpng that we have already handled the first "num_bytes" bytes
  * of the PNG file signature.  If the PNG data is embedded into another
@@ -623,6 +643,26 @@
    }
 #endif
 
+#ifdef PNG_eXIf_SUPPORTED
+   /* Free any eXIf entry */
+   if (((mask & PNG_FREE_EXIF) & info_ptr->free_me) != 0)
+   {
+# ifdef PNG_READ_eXIf_SUPPORTED
+      if (info_ptr->eXIf_buf)
+      {
+         png_free(png_ptr, info_ptr->eXIf_buf);
+         info_ptr->eXIf_buf = NULL;
+      }
+# endif
+      if (info_ptr->exif)
+      {
+         png_free(png_ptr, info_ptr->exif);
+         info_ptr->exif = NULL;
+      }
+      info_ptr->valid &= ~PNG_INFO_eXIf;
+   }
+#endif
+
 #ifdef PNG_hIST_SUPPORTED
    /* Free any hIST entry */
    if (((mask & PNG_FREE_HIST) & info_ptr->free_me) != 0)
@@ -804,14 +844,14 @@
 #else
 #  ifdef __STDC__
    return PNG_STRING_NEWLINE \
-      "libpng version 1.6.28 - January 5, 2017" PNG_STRING_NEWLINE \
+      "libpng version 1.6.34 - September 29, 2017" PNG_STRING_NEWLINE \
       "Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson" \
       PNG_STRING_NEWLINE \
       "Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
       "Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
       PNG_STRING_NEWLINE;
 #  else
-   return "libpng version 1.6.28 - January 5, 2017\
+   return "libpng version 1.6.34 - September 29, 2017\
       Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson\
       Copyright (c) 1996-1997 Andreas Dilger\
       Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.";
@@ -1901,12 +1941,12 @@
     */
    if (intent < 0 || intent >= PNG_sRGB_INTENT_LAST)
       return png_icc_profile_error(png_ptr, colorspace, "sRGB",
-          (unsigned)intent, "invalid sRGB rendering intent");
+          (png_alloc_size_t)intent, "invalid sRGB rendering intent");
 
    if ((colorspace->flags & PNG_COLORSPACE_HAVE_INTENT) != 0 &&
        colorspace->rendering_intent != intent)
       return png_icc_profile_error(png_ptr, colorspace, "sRGB",
-         (unsigned)intent, "inconsistent rendering intents");
+         (png_alloc_size_t)intent, "inconsistent rendering intents");
 
    if ((colorspace->flags & PNG_COLORSPACE_FROM_sRGB) != 0)
    {
@@ -1967,7 +2007,6 @@
    if (profile_length < 132)
       return png_icc_profile_error(png_ptr, colorspace, name, profile_length,
           "too short");
-
    return 1;
 }
 
@@ -2212,15 +2251,6 @@
        * being in range.  All defined tag types have an 8 byte header - a 4 byte
        * type signature then 0.
        */
-      if ((tag_start & 3) != 0)
-      {
-         /* CNHP730S.icc shipped with Microsoft Windows 64 violates this, it is
-          * only a warning here because libpng does not care about the
-          * alignment.
-          */
-         (void)png_icc_profile_error(png_ptr, NULL, name, tag_id,
-             "ICC profile tag start not a multiple of 4");
-      }
 
       /* This is a hard error; potentially it can cause read outside the
        * profile.
@@ -2228,6 +2258,16 @@
       if (tag_start > profile_length || tag_length > profile_length - tag_start)
          return png_icc_profile_error(png_ptr, colorspace, name, tag_id,
              "ICC profile tag outside profile");
+
+      if ((tag_start & 3) != 0)
+      {
+         /* CNHP730S.icc shipped with Microsoft Windows 64 violates this; it is
+          * only a warning here because libpng does not care about the
+          * alignment.
+          */
+         (void)png_icc_profile_error(png_ptr, NULL, name, tag_id,
+             "ICC profile tag start not a multiple of 4");
+      }
    }
 
    return 1; /* success, maybe with warnings */
@@ -2860,7 +2900,7 @@
    if (power < 0)
    {
       if (power < DBL_MIN_10_EXP) return 0;
-      recip = 1, power = -power;
+      recip = 1; power = -power;
    }
 
    if (power > 0)
@@ -2885,6 +2925,14 @@
 /* Function to format a floating point value in ASCII with a given
  * precision.
  */
+#if GCC_STRICT_OVERFLOW
+#pragma GCC diagnostic push
+/* The problem arises below with exp_b10, which can never overflow because it
+ * comes, originally, from frexp and is therefore limited to a range which is
+ * typically +/-710 (log2(DBL_MAX)/log2(DBL_MIN)).
+ */
+#pragma GCC diagnostic warning "-Wstrict-overflow=2"
+#endif /* GCC_STRICT_OVERFLOW */
 void /* PRIVATE */
 png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
     double fp, unsigned int precision)
@@ -2938,7 +2986,9 @@
             double test = png_pow10(exp_b10+1);
 
             if (test <= DBL_MAX)
-               ++exp_b10, base = test;
+            {
+               ++exp_b10; base = test;
+            }
 
             else
                break;
@@ -2952,7 +3002,10 @@
           * test on DBL_MAX above.
           */
          fp /= base;
-         while (fp >= 1) fp /= 10, ++exp_b10;
+         while (fp >= 1)
+         {
+            fp /= 10; ++exp_b10;
+         }
 
          /* Because of the code above fp may, at this point, be
           * less than .1, this is ok because the code below can
@@ -2969,7 +3022,7 @@
              */
             if (exp_b10 < 0 && exp_b10 > -3) /* PLUS 3 TOTAL 4 */
             {
-               czero = (unsigned int)(-exp_b10); /* PLUS 2 digits: TOTAL 3 */
+               czero = 0U-exp_b10; /* PLUS 2 digits: TOTAL 3 */
                exp_b10 = 0;      /* Dot added below before first output. */
             }
             else
@@ -3003,7 +3056,7 @@
                      /* Rounding up to 10, handle that here. */
                      if (czero > 0)
                      {
-                        --czero, d = 1;
+                        --czero; d = 1;
                         if (cdigits == 0) --clead;
                      }
                      else
@@ -3017,7 +3070,7 @@
 
                            else if (ch == 46)
                            {
-                              ch = *--ascii, ++size;
+                              ch = *--ascii; ++size;
                               /* Advance exp_b10 to '1', so that the
                                * decimal point happens after the
                                * previous digit.
@@ -3044,7 +3097,9 @@
                               int ch = *--ascii;
 
                               if (ch == 46)
-                                 ++size, exp_b10 = 1;
+                              {
+                                 ++size; exp_b10 = 1;
+                              }
 
                               /* Else lost a leading zero, so 'exp_b10' is
                                * still ok at (-1)
@@ -3080,21 +3135,26 @@
                       */
                      if (exp_b10 != (-1))
                      {
-                        if (exp_b10 == 0) *ascii++ = 46, --size;
+                        if (exp_b10 == 0)
+                        {
+                           *ascii++ = 46; --size;
+                        }
                         /* PLUS 1: TOTAL 4 */
                         --exp_b10;
                      }
-                     *ascii++ = 48, --czero;
+                     *ascii++ = 48; --czero;
                   }
 
                   if (exp_b10 != (-1))
                   {
                      if (exp_b10 == 0)
-                        *ascii++ = 46, --size; /* counted above */
+                     {
+                        *ascii++ = 46; --size; /* counted above */
+                     }
 
                      --exp_b10;
                   }
-                  *ascii++ = (char)(48 + (int)d), ++cdigits;
+                  *ascii++ = (char)(48 + (int)d); ++cdigits;
                }
             }
             while (cdigits+czero < precision+clead && fp > DBL_MIN);
@@ -3103,7 +3163,7 @@
 
             /* Check for an exponent, if we don't need one we are
              * done and just need to terminate the string.  At
-             * this point exp_b10==(-1) is effectively if flag - it got
+             * this point exp_b10==(-1) is effectively a flag - it got
              * to '-1' because of the decrement after outputting
              * the decimal point above (the exponent required is
              * *not* -1!)
@@ -3117,7 +3177,7 @@
                 * zeros were *not* output, so this doesn't increase
                 * the output count.
                 */
-               while (--exp_b10 >= 0) *ascii++ = 48;
+               while (exp_b10-- > 0) *ascii++ = 48;
 
                *ascii = 0;
 
@@ -3135,7 +3195,7 @@
              */
             size -= cdigits;
 
-            *ascii++ = 69, --size;    /* 'E': PLUS 1 TOTAL 2+precision */
+            *ascii++ = 69; --size;    /* 'E': PLUS 1 TOTAL 2+precision */
 
             /* The following use of an unsigned temporary avoids ambiguities in
              * the signed arithmetic on exp_b10 and permits GCC at least to do
@@ -3146,12 +3206,12 @@
 
                if (exp_b10 < 0)
                {
-                  *ascii++ = 45, --size; /* '-': PLUS 1 TOTAL 3+precision */
-                  uexp_b10 = (unsigned int)(-exp_b10);
+                  *ascii++ = 45; --size; /* '-': PLUS 1 TOTAL 3+precision */
+                  uexp_b10 = 0U-exp_b10;
                }
 
                else
-                  uexp_b10 = (unsigned int)exp_b10;
+                  uexp_b10 = 0U+exp_b10;
 
                cdigits = 0;
 
@@ -3194,6 +3254,9 @@
    /* Here on buffer too small. */
    png_error(png_ptr, "ASCII conversion buffer too small");
 }
+#if GCC_STRICT_OVERFLOW
+#pragma GCC diagnostic pop
+#endif /* GCC_STRICT_OVERFLOW */
 
 #  endif /* FLOATING_POINT */
 
@@ -3213,7 +3276,9 @@
 
       /* Avoid overflow here on the minimum integer. */
       if (fp < 0)
-         *ascii++ = 45, num = (png_uint_32)(-fp);
+      {
+         *ascii++ = 45; num = (png_uint_32)(-fp);
+      }
       else
          num = (png_uint_32)fp;
 
@@ -3251,7 +3316,10 @@
                 * then ndigits digits to first:
                 */
                i = 5;
-               while (ndigits < i) *ascii++ = 48, --i;
+               while (ndigits < i)
+               {
+                  *ascii++ = 48; --i;
+               }
                while (ndigits >= first) *ascii++ = digits[--ndigits];
                /* Don't output the trailing zeros! */
             }
@@ -3302,6 +3370,15 @@
  * the nearest .00001).  Overflow and divide by zero are signalled in
  * the result, a boolean - true on success, false on overflow.
  */
+#if GCC_STRICT_OVERFLOW /* from above */
+/* It is not obvious which comparison below gets optimized in such a way that
+ * signed overflow would change the result; looking through the code does not
+ * reveal any tests which have the form GCC complains about, so presumably the
+ * optimizer is moving an add or subtract into the 'if' somewhere.
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic warning "-Wstrict-overflow=2"
+#endif /* GCC_STRICT_OVERFLOW */
 int
 png_muldiv(png_fixed_point_p res, png_fixed_point a, png_int_32 times,
     png_int_32 divisor)
@@ -3416,6 +3493,9 @@
 
    return 0;
 }
+#if GCC_STRICT_OVERFLOW
+#pragma GCC diagnostic pop
+#endif /* GCC_STRICT_OVERFLOW */
 #endif /* READ_GAMMA || INCH_CONVERSIONS */
 
 #if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_INCH_CONVERSIONS_SUPPORTED)
@@ -3709,7 +3789,7 @@
  * of getting this accuracy in practice.
  *
  * To deal with this the following exp() function works out the exponent of the
- * frational part of the logarithm by using an accurate 32-bit value from the
+ * fractional part of the logarithm by using an accurate 32-bit value from the
  * top four fractional bits then multiplying in the remaining bits.
  */
 static const png_uint_32
@@ -4288,13 +4368,13 @@
    if (png_ptr != NULL && option >= 0 && option < PNG_OPTION_NEXT &&
       (option & 1) == 0)
    {
-      png_uint_32 mask = 3 << option;
-      png_uint_32 setting = (2 + (onoff != 0)) << option;
+      png_uint_32 mask = 3U << option;
+      png_uint_32 setting = (2U + (onoff != 0)) << option;
       png_uint_32 current = png_ptr->options;
 
       png_ptr->options = (png_uint_32)(((current & ~mask) | setting) & 0xff);
 
-      return (current & mask) >> option;
+      return (int)(current & mask) >> option;
    }
 
    return PNG_OPTION_INVALID;
@@ -4306,7 +4386,7 @@
    defined(PNG_SIMPLIFIED_WRITE_SUPPORTED)
 /* sRGB conversion tables; these are machine generated with the code in
  * contrib/tools/makesRGB.c.  The actual sRGB transfer curve defined in the
- * specification (see the article at http://en.wikipedia.org/wiki/SRGB)
+ * specification (see the article at https://en.wikipedia.org/wiki/SRGB)
  * is used, not the gamma=1/2.2 approximation use elsewhere in libpng.
  * The sRGB to linear table is exact (to the nearest 16-bit linear fraction).
  * The inverse (linear to sRGB) table has accuracies as follows:
--- a/src/java.desktop/share/native/libsplashscreen/libpng/png.h	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libsplashscreen/libpng/png.h	Wed Dec 13 10:25:38 2017 -0800
@@ -29,7 +29,7 @@
  * However, the following notice accompanied the original version of this
  * file and, per its terms, should not be removed:
  *
- * libpng version 1.6.28, January 5, 2017
+ * libpng version 1.6.34, September 29, 2017
  *
  * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@@ -40,7 +40,7 @@
  * Authors and maintainers:
  *   libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
  *   libpng versions 0.89, June 1996, through 0.96, May 1997: Andreas Dilger
- *   libpng versions 0.97, January 1998, through 1.6.28, January 5, 2017:
+ *   libpng versions 0.97, January 1998, through 1.6.34, September 29, 2017:
  *     Glenn Randers-Pehrson.
  *   See also "Contributing Authors", below.
  */
@@ -53,7 +53,7 @@
  *
  * This code is released under the libpng license.
  *
- * libpng versions 1.0.7, July 1, 2000 through 1.6.28, January 5, 2017 are
+ * libpng versions 1.0.7, July 1, 2000 through 1.6.34, September 29, 2017 are
  * Copyright (c) 2000-2002, 2004, 2006-2017 Glenn Randers-Pehrson, are
  * derived from libpng-1.0.6, and are distributed according to the same
  * disclaimer and license as libpng-1.0.6 with the following individuals
@@ -66,6 +66,8 @@
  *    Gilles Vollant
  *    James Yu
  *    Mandar Sahastrabuddhe
+ *    Google Inc.
+ *    Vadim Barkov
  *
  * and with the following additions to the disclaimer:
  *
@@ -235,11 +237,11 @@
  *    ...
  *    1.0.19                  10    10019  10.so.0.19[.0]
  *    ...
- *    1.2.57                  13    10257  12.so.0.57[.0]
+ *    1.2.59                  13    10257  12.so.0.59[.0]
  *    ...
- *    1.5.28                  15    10527  15.so.15.28[.0]
+ *    1.5.30                  15    10527  15.so.15.30[.0]
  *    ...
- *    1.6.28                  16    10628  16.so.16.28[.0]
+ *    1.6.34                  16    10633  16.so.16.34[.0]
  *
  *    Henceforth the source version will match the shared-library major
  *    and minor numbers; the shared-library major version number will be
@@ -260,20 +262,20 @@
  *
  * See libpng.txt or libpng.3 for more information.  The PNG specification
  * is available as a W3C Recommendation and as an ISO Specification,
- * <http://www.w3.org/TR/2003/REC-PNG-20031110/
+ * <https://www.w3.org/TR/2003/REC-PNG-20031110/
  */
 
 /*
  * Y2K compliance in libpng:
  * =========================
  *
- *    January 5, 2017
+ *    September 29, 2017
  *
  *    Since the PNG Development group is an ad-hoc body, we can't make
  *    an official declaration.
  *
  *    This is your unofficial assurance that libpng from version 0.71 and
- *    upward through 1.6.28 are Y2K compliant.  It is my belief that
+ *    upward through 1.6.34 are Y2K compliant.  It is my belief that
  *    earlier versions were also Y2K compliant.
  *
  *    Libpng only has two year fields.  One is a 2-byte unsigned integer
@@ -335,8 +337,8 @@
  */
 
 /* Version information for png.h - this should match the version in png.c */
-#define PNG_LIBPNG_VER_STRING "1.6.28"
-#define PNG_HEADER_VERSION_STRING " libpng version 1.6.28 - January 5, 2017\n"
+#define PNG_LIBPNG_VER_STRING "1.6.34"
+#define PNG_HEADER_VERSION_STRING " libpng version 1.6.34 - September 29, 2017\n"
 
 #define PNG_LIBPNG_VER_SONUM   16
 #define PNG_LIBPNG_VER_DLLNUM  16
@@ -344,7 +346,7 @@
 /* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
 #define PNG_LIBPNG_VER_MAJOR   1
 #define PNG_LIBPNG_VER_MINOR   6
-#define PNG_LIBPNG_VER_RELEASE 28
+#define PNG_LIBPNG_VER_RELEASE 34
 
 /* This should match the numeric part of the final component of
  * PNG_LIBPNG_VER_STRING, omitting any leading zero:
@@ -375,7 +377,7 @@
  * version 1.0.0 was mis-numbered 100 instead of 10000).  From
  * version 1.0.1 it's    xxyyzz, where x=major, y=minor, z=release
  */
-#define PNG_LIBPNG_VER 10628 /* 1.6.28 */
+#define PNG_LIBPNG_VER 10634 /* 1.6.34 */
 
 /* Library configuration: these options cannot be changed after
  * the library has been built.
@@ -485,7 +487,7 @@
 /* This triggers a compiler error in png.c, if png.c and png.h
  * do not agree upon the version number.
  */
-typedef char* png_libpng_version_1_6_28;
+typedef char* png_libpng_version_1_6_34;
 
 /* Basic control structions.  Read libpng-manual.txt or libpng.3 for more info.
  *
@@ -802,6 +804,7 @@
 #define PNG_INFO_sPLT 0x2000U  /* ESR, 1.0.6 */
 #define PNG_INFO_sCAL 0x4000U  /* ESR, 1.0.6 */
 #define PNG_INFO_IDAT 0x8000U  /* ESR, 1.0.6 */
+#define PNG_INFO_eXIf 0x10000U /* GR-P, 1.6.31 */
 
 /* This is used for the transformation routines, as some of them
  * change these values for the row.  It also should enable using
@@ -1814,7 +1817,8 @@
 #define PNG_FREE_PLTE 0x1000U
 #define PNG_FREE_TRNS 0x2000U
 #define PNG_FREE_TEXT 0x4000U
-#define PNG_FREE_ALL  0x7fffU
+#define PNG_FREE_EXIF 0x8000U /* Added at libpng-1.6.31 */
+#define PNG_FREE_ALL  0xffffU
 #define PNG_FREE_MUL  0x4220U /* PNG_FREE_SPLT|PNG_FREE_TEXT|PNG_FREE_UNKN */
 
 #ifdef PNG_USER_MEM_SUPPORTED
@@ -2033,6 +2037,18 @@
     png_fixed_point int_blue_Z))
 #endif
 
+#ifdef PNG_eXIf_SUPPORTED
+PNG_EXPORT(246, png_uint_32, png_get_eXIf, (png_const_structrp png_ptr,
+    png_inforp info_ptr, png_bytep *exif));
+PNG_EXPORT(247, void, png_set_eXIf, (png_const_structrp png_ptr,
+    png_inforp info_ptr, const png_bytep exif));
+
+PNG_EXPORT(248, png_uint_32, png_get_eXIf_1, (png_const_structrp png_ptr,
+    png_const_inforp info_ptr, png_uint_32 *num_exif, png_bytep *exif));
+PNG_EXPORT(249, void, png_set_eXIf_1, (png_const_structrp png_ptr,
+    png_inforp info_ptr, const png_uint_32 num_exif, const png_bytep exif));
+#endif
+
 #ifdef PNG_gAMA_SUPPORTED
 PNG_FP_EXPORT(137, png_uint_32, png_get_gAMA, (png_const_structrp png_ptr,
     png_const_inforp info_ptr, double *file_gamma))
@@ -2051,9 +2067,6 @@
 #ifdef PNG_hIST_SUPPORTED
 PNG_EXPORT(141, png_uint_32, png_get_hIST, (png_const_structrp png_ptr,
     png_inforp info_ptr, png_uint_16p *hist));
-#endif
-
-#ifdef PNG_hIST_SUPPORTED
 PNG_EXPORT(142, void, png_set_hIST, (png_const_structrp png_ptr,
     png_inforp info_ptr, png_const_uint_16p hist));
 #endif
@@ -2779,7 +2792,7 @@
  *
  * When the simplified API needs to convert between sRGB and linear colorspaces,
  * the actual sRGB transfer curve defined in the sRGB specification (see the
- * article at http://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2
+ * article at https://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2
  * approximation used elsewhere in libpng.
  *
  * When an alpha channel is present it is expected to denote pixel coverage
@@ -2834,6 +2847,8 @@
 #  define PNG_FORMAT_FLAG_AFIRST 0x20U /* alpha channel comes first */
 #endif
 
+#define PNG_FORMAT_FLAG_ASSOCIATED_ALPHA 0x40U /* alpha channel is associated */
+
 /* Commonly used formats have predefined macros.
  *
  * First the single byte (sRGB) formats:
@@ -3252,7 +3267,10 @@
 #  define PNG_MIPS_MSA   6 /* HARDWARE: MIPS Msa SIMD instructions supported */
 #endif
 #define PNG_IGNORE_ADLER32 8
-#define PNG_OPTION_NEXT  10 /* Next option - numbers must be even */
+#ifdef PNG_POWERPC_VSX_API_SUPPORTED
+#  define PNG_POWERPC_VSX   10 /* HARDWARE: PowerPC VSX SIMD instructions supported */
+#endif
+#define PNG_OPTION_NEXT  12 /* Next option - numbers must be even */
 
 /* Return values: NOTE: there are four values and 'off' is *not* zero */
 #define PNG_OPTION_UNSET   0 /* Unset - defaults to off */
@@ -3276,7 +3294,7 @@
  * one to use is one more than this.)
  */
 #ifdef PNG_EXPORT_LAST_ORDINAL
-  PNG_EXPORT_LAST_ORDINAL(245);
+  PNG_EXPORT_LAST_ORDINAL(249);
 #endif
 
 #ifdef __cplusplus
--- a/src/java.desktop/share/native/libsplashscreen/libpng/pngconf.h	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libsplashscreen/libpng/pngconf.h	Wed Dec 13 10:25:38 2017 -0800
@@ -29,7 +29,7 @@
  * However, the following notice accompanied the original version of this
  * file and, per its terms, should not be removed:
  *
- * libpng version 1.6.28, January 5, 2017
+ * libpng version 1.6.34, September 29, 2017
  *
  * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
--- a/src/java.desktop/share/native/libsplashscreen/libpng/pngerror.c	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libsplashscreen/libpng/pngerror.c	Wed Dec 13 10:25:38 2017 -0800
@@ -29,8 +29,8 @@
  * However, the following notice accompanied the original version of this
  * file and, per its terms, should not be removed:
  *
- * Last changed in libpng 1.6.26 [October 20, 2016]
- * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.31 [July 27, 2017]
+ * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  *
@@ -191,7 +191,7 @@
          case PNG_NUMBER_FORMAT_02u:
             /* Expects at least 2 digits. */
             mincount = 2;
-            /* FALL THROUGH */
+            /* FALLTHROUGH */
 
          case PNG_NUMBER_FORMAT_u:
             *--end = digits[number % 10];
@@ -201,7 +201,7 @@
          case PNG_NUMBER_FORMAT_02x:
             /* This format expects at least two digits */
             mincount = 2;
-            /* FALL THROUGH */
+            /* FALLTHROUGH */
 
          case PNG_NUMBER_FORMAT_x:
             *--end = digits[number & 0xf];
--- a/src/java.desktop/share/native/libsplashscreen/libpng/pngget.c	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libsplashscreen/libpng/pngget.c	Wed Dec 13 10:25:38 2017 -0800
@@ -28,9 +28,9 @@
  * License version 2 only, as published by the Free Software Foundation.
  * However, the following notice accompanied the original version of this
  * file and, per its terms, should not be removed:
-
- * Last changed in libpng 1.6.26 [October 20, 2016]
- * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
+ *
+ * Last changed in libpng 1.6.32 [August 24, 2017]
+ * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  *
@@ -801,6 +801,35 @@
 }
 #endif
 
+#ifdef PNG_eXIf_SUPPORTED
+png_uint_32 PNGAPI
+png_get_eXIf(png_const_structrp png_ptr, png_inforp info_ptr,
+    png_bytep *exif)
+{
+  png_warning(png_ptr, "png_get_eXIf does not work; use png_get_eXIf_1");
+  PNG_UNUSED(info_ptr)
+  PNG_UNUSED(exif)
+  return 0;
+}
+
+png_uint_32 PNGAPI
+png_get_eXIf_1(png_const_structrp png_ptr, png_const_inforp info_ptr,
+    png_uint_32 *num_exif, png_bytep *exif)
+{
+   png_debug1(1, "in %s retrieval function", "eXIf");
+
+   if (png_ptr != NULL && info_ptr != NULL &&
+       (info_ptr->valid & PNG_INFO_eXIf) != 0 && exif != NULL)
+   {
+      *num_exif = info_ptr->num_exif;
+      *exif = info_ptr->exif;
+      return (PNG_INFO_eXIf);
+   }
+
+   return (0);
+}
+#endif
+
 #ifdef PNG_hIST_SUPPORTED
 png_uint_32 PNGAPI
 png_get_hIST(png_const_structrp png_ptr, png_inforp info_ptr,
--- a/src/java.desktop/share/native/libsplashscreen/libpng/pnginfo.h	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libsplashscreen/libpng/pnginfo.h	Wed Dec 13 10:25:38 2017 -0800
@@ -213,6 +213,14 @@
    png_byte phys_unit_type; /* resolution type (see PNG_RESOLUTION_ below) */
 #endif
 
+#ifdef PNG_eXIf_SUPPORTED
+   int num_exif;  /* Added at libpng-1.6.31 */
+   png_bytep exif;
+# ifdef PNG_READ_eXIf_SUPPORTED
+   png_bytep eXIf_buf;  /* Added at libpng-1.6.32 */
+# endif
+#endif
+
 #ifdef PNG_hIST_SUPPORTED
    /* The hIST chunk contains the relative frequency or importance of the
     * various palette entries, so that a viewer can intelligently select a
--- a/src/java.desktop/share/native/libsplashscreen/libpng/pnglibconf.h	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libsplashscreen/libpng/pnglibconf.h	Wed Dec 13 10:25:38 2017 -0800
@@ -1,6 +1,11 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file and, per its terms, should not be removed:
+ *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this
@@ -33,9 +38,9 @@
  * file and, per its terms, should not be removed:
  */
 
-/* libpng version 1.6.28, January 5, 2017 */
+/* libpng version 1.6.34, September 29, 2017 */
 
-/* Copyright (c) 1998-2016 Glenn Randers-Pehrson */
+/* Copyright (c) 1998-2017 Glenn Randers-Pehrson */
 
 /* This code is released under the libpng license. */
 /* For conditions of distribution and use, see the disclaimer */
--- a/src/java.desktop/share/native/libsplashscreen/libpng/pngpread.c	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libsplashscreen/libpng/pngpread.c	Wed Dec 13 10:25:38 2017 -0800
@@ -29,8 +29,8 @@
  * However, the following notice accompanied the original version of this
  * file and, per its terms, should not be removed:
  *
- * Last changed in libpng 1.6.24 [August 4, 2016]
- * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.32 [August 24, 2017]
+ * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  *
@@ -217,6 +217,7 @@
       png_crc_read(png_ptr, chunk_tag, 4);
       png_ptr->chunk_name = PNG_CHUNK_FROM_STRING(chunk_tag);
       png_check_chunk_name(png_ptr, png_ptr->chunk_name);
+      png_check_chunk_length(png_ptr, png_ptr->push_length);
       png_ptr->mode |= PNG_HAVE_CHUNK_HEADER;
    }
 
--- a/src/java.desktop/share/native/libsplashscreen/libpng/pngpriv.h	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libsplashscreen/libpng/pngpriv.h	Wed Dec 13 10:25:38 2017 -0800
@@ -29,8 +29,8 @@
  * However, the following notice accompanied the original version of this
  * file and, per its terms, should not be removed:
  *
- * Last changed in libpng 1.6.26 [October 20, 2016]
- * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.32 [August 24, 2017]
+ * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  *
@@ -63,7 +63,9 @@
  * Windows/Visual Studio) there is no effect; the OS specific tests below are
  * still required (as of 2011-05-02.)
  */
-#define _POSIX_SOURCE 1 /* Just the POSIX 1003.1 and C89 APIs */
+#ifndef _POSIX_SOURCE
+# define _POSIX_SOURCE 1 /* Just the POSIX 1003.1 and C89 APIs */
+#endif
 
 #ifndef PNG_VERSION_INFO_ONLY
 /* Standard library headers not required by png.h: */
@@ -218,6 +220,50 @@
 #  endif
 #endif
 
+#ifndef PNG_POWERPC_VSX_OPT
+#  if defined(__PPC64__) && defined(__ALTIVEC__) && defined(__VSX__)
+#     define PNG_POWERPC_VSX_OPT 2
+#  else
+#     define PNG_POWERPC_VSX_OPT 0
+#  endif
+#endif
+
+#ifndef PNG_INTEL_SSE_OPT
+#   ifdef PNG_INTEL_SSE
+      /* Only check for SSE if the build configuration has been modified to
+       * enable SSE optimizations.  This means that these optimizations will
+       * be off by default.  See contrib/intel for more details.
+       */
+#     if defined(__SSE4_1__) || defined(__AVX__) || defined(__SSSE3__) || \
+       defined(__SSE2__) || defined(_M_X64) || defined(_M_AMD64) || \
+       (defined(_M_IX86_FP) && _M_IX86_FP >= 2)
+#         define PNG_INTEL_SSE_OPT 1
+#      endif
+#   endif
+#endif
+
+#if PNG_INTEL_SSE_OPT > 0
+#   ifndef PNG_INTEL_SSE_IMPLEMENTATION
+#      if defined(__SSE4_1__) || defined(__AVX__)
+          /* We are not actually using AVX, but checking for AVX is the best
+             way we can detect SSE4.1 and SSSE3 on MSVC.
+          */
+#         define PNG_INTEL_SSE_IMPLEMENTATION 3
+#      elif defined(__SSSE3__)
+#         define PNG_INTEL_SSE_IMPLEMENTATION 2
+#      elif defined(__SSE2__) || defined(_M_X64) || defined(_M_AMD64) || \
+       (defined(_M_IX86_FP) && _M_IX86_FP >= 2)
+#         define PNG_INTEL_SSE_IMPLEMENTATION 1
+#      else
+#         define PNG_INTEL_SSE_IMPLEMENTATION 0
+#      endif
+#   endif
+
+#   if PNG_INTEL_SSE_IMPLEMENTATION > 0
+#      define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_sse2
+#   endif
+#endif
+
 #if PNG_MIPS_MSA_OPT > 0
 #  define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_msa
 #  ifndef PNG_MIPS_MSA_IMPLEMENTATION
@@ -238,6 +284,11 @@
 #  endif
 #endif /* PNG_MIPS_MSA_OPT > 0 */
 
+#if PNG_POWERPC_VSX_OPT > 0
+#  define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_vsx
+#  define PNG_POWERPC_VSX_IMPLEMENTATION 1
+#endif
+
 
 /* Is this a build of a DLL where compilation of the object modules requires
  * different preprocessor settings to those required for a simple library?  If
@@ -431,6 +482,21 @@
 #  define png_fixed_error(s1,s2) png_err(s1)
 #endif
 
+/* Some fixed point APIs are still required even if not exported because
+ * they get used by the corresponding floating point APIs.  This magic
+ * deals with this:
+ */
+#ifdef PNG_FIXED_POINT_SUPPORTED
+#  define PNGFAPI PNGAPI
+#else
+#  define PNGFAPI /* PRIVATE */
+#endif
+
+#ifndef PNG_VERSION_INFO_ONLY
+/* Other defines specific to compilers can go here.  Try to keep
+ * them inside an appropriate ifdef/endif pair for portability.
+ */
+
 /* C allows up-casts from (void*) to any pointer and (const void*) to any
  * pointer to a const object.  C++ regards this as a type error and requires an
  * explicit, static, cast and provides the static_cast<> rune to ensure that
@@ -445,25 +511,20 @@
    static_cast<type>(static_cast<const void*>(value))
 #else
 #  define png_voidcast(type, value) (value)
-#  define png_constcast(type, value) ((type)(value))
+#  ifdef _WIN64
+#     ifdef __GNUC__
+         typedef unsigned long long png_ptruint;
+#     else
+         typedef unsigned __int64 png_ptruint;
+#     endif
+#  else
+      typedef unsigned long png_ptruint;
+#  endif
+#  define png_constcast(type, value) ((type)(png_ptruint)(const void*)(value))
 #  define png_aligncast(type, value) ((void*)(value))
 #  define png_aligncastconst(type, value) ((const void*)(value))
 #endif /* __cplusplus */
 
-/* Some fixed point APIs are still required even if not exported because
- * they get used by the corresponding floating point APIs.  This magic
- * deals with this:
- */
-#ifdef PNG_FIXED_POINT_SUPPORTED
-#  define PNGFAPI PNGAPI
-#else
-#  define PNGFAPI /* PRIVATE */
-#endif
-
-#ifndef PNG_VERSION_INFO_ONLY
-/* Other defines specific to compilers can go here.  Try to keep
- * them inside an appropriate ifdef/endif pair for portability.
- */
 #if defined(PNG_FLOATING_POINT_SUPPORTED) ||\
     defined(PNG_FLOATING_ARITHMETIC_SUPPORTED)
    /* png.c requires the following ANSI-C constants if the conversion of
@@ -809,6 +870,7 @@
 #define png_PLTE PNG_U32( 80,  76,  84,  69)
 #define png_bKGD PNG_U32( 98,  75,  71,  68)
 #define png_cHRM PNG_U32( 99,  72,  82,  77)
+#define png_eXIf PNG_U32(101,  88,  73, 102) /* registered July 2017 */
 #define png_fRAc PNG_U32(102,  82,  65,  99) /* registered, not defined */
 #define png_gAMA PNG_U32(103,  65,  77,  65)
 #define png_gIFg PNG_U32(103,  73,  70, 103)
@@ -1109,6 +1171,11 @@
     int intent),PNG_EMPTY);
 #endif
 
+#ifdef PNG_WRITE_eXIf_SUPPORTED
+PNG_INTERNAL_FUNCTION(void,png_write_eXIf,(png_structrp png_ptr,
+    png_bytep exif, int num_exif),PNG_EMPTY);
+#endif
+
 #ifdef PNG_WRITE_iCCP_SUPPORTED
 PNG_INTERNAL_FUNCTION(void,png_write_iCCP,(png_structrp png_ptr,
    png_const_charp name, png_const_bytep profile), PNG_EMPTY);
@@ -1284,6 +1351,38 @@
     row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
 #endif
 
+#if PNG_POWERPC_VSX_OPT > 0
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_up_vsx,(png_row_infop row_info,
+    png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_vsx,(png_row_infop
+    row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub4_vsx,(png_row_infop
+    row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg3_vsx,(png_row_infop
+    row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg4_vsx,(png_row_infop
+    row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_vsx,(png_row_infop
+    row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_vsx,(png_row_infop
+    row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+#endif
+
+#if PNG_INTEL_SSE_IMPLEMENTATION > 0
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_sse2,(png_row_infop
+    row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub4_sse2,(png_row_infop
+    row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg3_sse2,(png_row_infop
+    row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg4_sse2,(png_row_infop
+    row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_sse2,(png_row_infop
+    row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_sse2,(png_row_infop
+    row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+#endif
+
 /* Choose the best filter to use and filter the row data */
 PNG_INTERNAL_FUNCTION(void,png_write_find_filter,(png_structrp png_ptr,
     png_row_infop row_info),PNG_EMPTY);
@@ -1376,6 +1475,11 @@
     png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
 #endif
 
+#ifdef PNG_READ_eXIf_SUPPORTED
+PNG_INTERNAL_FUNCTION(void,png_handle_eXIf,(png_structrp png_ptr,
+    png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
+#endif
+
 #ifdef PNG_READ_gAMA_SUPPORTED
 PNG_INTERNAL_FUNCTION(void,png_handle_gAMA,(png_structrp png_ptr,
     png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
@@ -1451,8 +1555,11 @@
     png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
 #endif
 
-PNG_INTERNAL_FUNCTION(void,png_check_chunk_name,(png_structrp png_ptr,
-    png_uint_32 chunk_name),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_check_chunk_name,(png_const_structrp png_ptr,
+    const png_uint_32 chunk_name),PNG_EMPTY);
+
+PNG_INTERNAL_FUNCTION(void,png_check_chunk_length,(png_const_structrp png_ptr,
+    const png_uint_32 chunk_length),PNG_EMPTY);
 
 PNG_INTERNAL_FUNCTION(void,png_handle_unknown,(png_structrp png_ptr,
     png_inforp info_ptr, png_uint_32 length, int keep),PNG_EMPTY);
@@ -2019,6 +2126,11 @@
 PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_msa,
    (png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
 #endif
+
+#  if PNG_INTEL_SSE_IMPLEMENTATION > 0
+PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_sse2,
+   (png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
+#  endif
 #endif
 
 PNG_INTERNAL_FUNCTION(png_uint_32, png_check_keyword, (png_structrp png_ptr,
--- a/src/java.desktop/share/native/libsplashscreen/libpng/pngread.c	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libsplashscreen/libpng/pngread.c	Wed Dec 13 10:25:38 2017 -0800
@@ -29,8 +29,8 @@
  * However, the following notice accompanied the original version of this
  * file and, per its terms, should not be removed:
  *
- * Last changed in libpng 1.6.26 [October 20, 2016]
- * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.33 [September 28, 2017]
+ * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  *
@@ -203,6 +203,11 @@
          png_handle_cHRM(png_ptr, info_ptr, length);
 #endif
 
+#ifdef PNG_READ_eXIf_SUPPORTED
+      else if (chunk_name == png_eXIf)
+         png_handle_eXIf(png_ptr, info_ptr, length);
+#endif
+
 #ifdef PNG_READ_gAMA_SUPPORTED
       else if (chunk_name == png_gAMA)
          png_handle_gAMA(png_ptr, info_ptr, length);
@@ -562,6 +567,7 @@
       png_error(png_ptr, "Invalid attempt to read row data");
 
    /* Fill the row with IDAT data: */
+   png_ptr->row_buf[0]=255; /* to force error if no data was found */
    png_read_IDAT_data(png_ptr, png_ptr->row_buf, row_info.rowbytes + 1);
 
    if (png_ptr->row_buf[0] > PNG_FILTER_VALUE_NONE)
@@ -870,6 +876,11 @@
          png_handle_cHRM(png_ptr, info_ptr, length);
 #endif
 
+#ifdef PNG_READ_eXIf_SUPPORTED
+      else if (chunk_name == png_eXIf)
+         png_handle_eXIf(png_ptr, info_ptr, length);
+#endif
+
 #ifdef PNG_READ_gAMA_SUPPORTED
       else if (chunk_name == png_gAMA)
          png_handle_gAMA(png_ptr, info_ptr, length);
@@ -1911,7 +1922,7 @@
          {
             case 4:
                entry[afirst ? 0 : 3] = (png_uint_16)alpha;
-               /* FALL THROUGH */
+               /* FALLTHROUGH */
 
             case 3:
                if (alpha < 65535)
@@ -1933,7 +1944,7 @@
 
             case 2:
                entry[1 ^ afirst] = (png_uint_16)alpha;
-               /* FALL THROUGH */
+               /* FALLTHROUGH */
 
             case 1:
                if (alpha < 65535)
@@ -1962,6 +1973,7 @@
          {
             case 4:
                entry[afirst ? 0 : 3] = (png_byte)alpha;
+               /* FALLTHROUGH */
             case 3:
                entry[afirst + (2 ^ bgr)] = (png_byte)blue;
                entry[afirst + 1] = (png_byte)green;
@@ -1970,6 +1982,7 @@
 
             case 2:
                entry[1 ^ afirst] = (png_byte)alpha;
+               /* FALLTHROUGH */
             case 1:
                entry[afirst] = (png_byte)green;
                break;
@@ -2889,7 +2902,7 @@
       case P_sRGB:
          /* Change to 8-bit sRGB */
          png_set_alpha_mode_fixed(png_ptr, PNG_ALPHA_PNG, PNG_GAMMA_sRGB);
-         /* FALL THROUGH */
+         /* FALLTHROUGH */
 
       case P_FILE:
          if (png_ptr->bit_depth > 8)
@@ -3207,8 +3220,7 @@
             image->colormap_entries == 244 /* 216 + 1 + 27 */)
             break;
 
-         /* goto bad_output; */
-         /* FALL THROUGH */
+         goto bad_output;
 
       default:
       bad_output:
@@ -3776,6 +3788,12 @@
          output_gamma = PNG_DEFAULT_sRGB;
       }
 
+      if ((change & PNG_FORMAT_FLAG_ASSOCIATED_ALPHA) != 0)
+      {
+         mode = PNG_ALPHA_OPTIMIZED;
+         change &= ~PNG_FORMAT_FLAG_ASSOCIATED_ALPHA;
+      }
+
       /* If 'do_local_background' is set check for the presence of gamma
        * correction; this is part of the work-round for the libpng bug
        * described above.
@@ -4001,6 +4019,10 @@
       else if (do_local_compose != 0) /* internal error */
          png_error(png_ptr, "png_image_read: alpha channel lost");
 
+      if ((format & PNG_FORMAT_FLAG_ASSOCIATED_ALPHA) != 0) {
+         info_format |= PNG_FORMAT_FLAG_ASSOCIATED_ALPHA;
+      }
+
       if (info_ptr->bit_depth == 16)
          info_format |= PNG_FORMAT_FLAG_LINEAR;
 
--- a/src/java.desktop/share/native/libsplashscreen/libpng/pngrtran.c	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libsplashscreen/libpng/pngrtran.c	Wed Dec 13 10:25:38 2017 -0800
@@ -29,8 +29,8 @@
  * However, the following notice accompanied the original version of this
  * file and, per its terms, should not be removed:
  *
- * Last changed in libpng 1.6.24 [August 4, 2016]
- * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.33 [September 28, 2017]
+ * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  *
@@ -77,6 +77,7 @@
       case PNG_CRC_WARN_DISCARD:    /* Not a valid action for critical data */
          png_warning(png_ptr,
              "Can't discard critical data on CRC error");
+         /* FALLTHROUGH */
       case PNG_CRC_ERROR_QUIT:                                /* Error/quit */
 
       case PNG_CRC_DEFAULT:
@@ -457,7 +458,7 @@
       int i;
 
       png_ptr->quantize_index = (png_bytep)png_malloc(png_ptr,
-          (png_uint_32)((png_uint_32)num_palette * (sizeof (png_byte))));
+          (png_alloc_size_t)((png_uint_32)num_palette * (sizeof (png_byte))));
       for (i = 0; i < num_palette; i++)
          png_ptr->quantize_index[i] = (png_byte)i;
    }
@@ -474,7 +475,7 @@
 
          /* Initialize an array to sort colors */
          png_ptr->quantize_sort = (png_bytep)png_malloc(png_ptr,
-             (png_uint_32)((png_uint_32)num_palette * (sizeof (png_byte))));
+             (png_alloc_size_t)((png_uint_32)num_palette * (sizeof (png_byte))));
 
          /* Initialize the quantize_sort array */
          for (i = 0; i < num_palette; i++)
@@ -608,9 +609,11 @@
 
          /* Initialize palette index arrays */
          png_ptr->index_to_palette = (png_bytep)png_malloc(png_ptr,
-             (png_uint_32)((png_uint_32)num_palette * (sizeof (png_byte))));
+             (png_alloc_size_t)((png_uint_32)num_palette *
+             (sizeof (png_byte))));
          png_ptr->palette_to_index = (png_bytep)png_malloc(png_ptr,
-             (png_uint_32)((png_uint_32)num_palette * (sizeof (png_byte))));
+             (png_alloc_size_t)((png_uint_32)num_palette *
+             (sizeof (png_byte))));
 
          /* Initialize the sort array */
          for (i = 0; i < num_palette; i++)
@@ -619,7 +622,7 @@
             png_ptr->palette_to_index[i] = (png_byte)i;
          }
 
-         hash = (png_dsortpp)png_calloc(png_ptr, (png_uint_32)(769 *
+         hash = (png_dsortpp)png_calloc(png_ptr, (png_alloc_size_t)(769 *
              (sizeof (png_dsortp))));
 
          num_new_palette = num_palette;
@@ -650,7 +653,7 @@
                   {
 
                      t = (png_dsortp)png_malloc_warn(png_ptr,
-                         (png_uint_32)(sizeof (png_dsort)));
+                         (png_alloc_size_t)(sizeof (png_dsort)));
 
                      if (t == NULL)
                          break;
@@ -775,9 +778,9 @@
       png_size_t num_entries = ((png_size_t)1 << total_bits);
 
       png_ptr->palette_lookup = (png_bytep)png_calloc(png_ptr,
-          (png_uint_32)(num_entries * (sizeof (png_byte))));
-
-      distance = (png_bytep)png_malloc(png_ptr, (png_uint_32)(num_entries *
+          (png_alloc_size_t)(num_entries * (sizeof (png_byte))));
+
+      distance = (png_bytep)png_malloc(png_ptr, (png_alloc_size_t)(num_entries *
           (sizeof (png_byte))));
 
       memset(distance, 0xff, num_entries * (sizeof (png_byte)));
@@ -1281,7 +1284,7 @@
             default:
 
             case 8:
-               /* FALL THROUGH (Already 8 bits) */
+               /* FALLTHROUGH */ /*  (Already 8 bits) */
 
             case 16:
                /* Already a full 16 bits */
@@ -2962,7 +2965,7 @@
  * using the equation given in Poynton's ColorFAQ of 1998-01-04 at
  * <http://www.inforamp.net/~poynton/>  (THIS LINK IS DEAD June 2008 but
  * versions dated 1998 through November 2002 have been archived at
- * http://web.archive.org/web/20000816232553/http://www.inforamp.net/
+ * https://web.archive.org/web/20000816232553/www.inforamp.net/
  * ~poynton/notes/colour_and_gamma/ColorFAQ.txt )
  * Charles Poynton poynton at poynton.com
  *
@@ -4330,7 +4333,7 @@
             if (num_trans > 0)
             {
                sp = row + (png_size_t)row_width - 1;
-               dp = row + (png_size_t)(row_width << 2) - 1;
+               dp = row + ((png_size_t)row_width << 2) - 1;
 
                for (i = 0; i < row_width; i++)
                {
@@ -4491,7 +4494,7 @@
             {
                gray = gray & 0xff;
                sp = row + (png_size_t)row_width - 1;
-               dp = row + (png_size_t)(row_width << 1) - 1;
+               dp = row + ((png_size_t)row_width << 1) - 1;
 
                for (i = 0; i < row_width; i++)
                {
@@ -4547,7 +4550,7 @@
             png_byte green = (png_byte)(trans_color->green & 0xff);
             png_byte blue = (png_byte)(trans_color->blue & 0xff);
             sp = row + (png_size_t)row_info->rowbytes - 1;
-            dp = row + (png_size_t)(row_width << 2) - 1;
+            dp = row + ((png_size_t)row_width << 2) - 1;
             for (i = 0; i < row_width; i++)
             {
                if (*(sp - 2) == red && *(sp - 1) == green && *(sp) == blue)
@@ -4570,7 +4573,7 @@
             png_byte green_low = (png_byte)(trans_color->green & 0xff);
             png_byte blue_low = (png_byte)(trans_color->blue & 0xff);
             sp = row + row_info->rowbytes - 1;
-            dp = row + (png_size_t)(row_width << 3) - 1;
+            dp = row + ((png_size_t)row_width << 3) - 1;
             for (i = 0; i < row_width; i++)
             {
                if (*(sp - 5) == red_high &&
@@ -4629,7 +4632,9 @@
       png_byte *sp = row + row_info->rowbytes; /* source, last byte + 1 */
       png_byte *dp = sp + row_info->rowbytes;  /* destination, end + 1 */
       while (dp > sp)
-         dp[-2] = dp[-1] = *--sp, dp -= 2;
+      {
+         dp[-2] = dp[-1] = *--sp; dp -= 2;
+      }
 
       row_info->rowbytes *= 2;
       row_info->bit_depth = 16;
--- a/src/java.desktop/share/native/libsplashscreen/libpng/pngrutil.c	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libsplashscreen/libpng/pngrutil.c	Wed Dec 13 10:25:38 2017 -0800
@@ -29,8 +29,8 @@
  * However, the following notice accompanied the original version of this
  * file and, per its terms, should not be removed:
  *
- * Last changed in libpng 1.6.27 [January 5, 2017]
- * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.33 [September 28, 2017]
+ * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  *
@@ -209,6 +209,9 @@
    /* Check to see if chunk name is valid. */
    png_check_chunk_name(png_ptr, png_ptr->chunk_name);
 
+   /* Check for too-large chunk length */
+   png_check_chunk_length(png_ptr, length);
+
 #ifdef PNG_IO_STATE_SUPPORTED
    png_ptr->io_state = PNG_IO_READING | PNG_IO_CHUNK_DATA;
 #endif
@@ -339,6 +342,7 @@
 
       if (buffer != NULL)
       {
+         memset(buffer, 0, new_size); /* just in case */
          png_ptr->read_buffer = buffer;
          png_ptr->read_buffer_size = new_size;
       }
@@ -446,7 +450,7 @@
             png_ptr->flags |= PNG_FLAG_ZSTREAM_INITIALIZED;
       }
 
-#if ZLIB_VERNUM >= 0x1281 && \
+#if ZLIB_VERNUM >= 0x1290 && \
    defined(PNG_SET_OPTION_SUPPORTED) && defined(PNG_IGNORE_ADLER32)
       if (((png_ptr->options >> PNG_IGNORE_ADLER32) & 3) == PNG_OPTION_ON)
          /* Turn off validation of the ADLER32 checksum in IDAT chunks */
@@ -698,6 +702,8 @@
 
                if (text != NULL)
                {
+                  memset(text, 0, buffer_size);
+
                   ret = png_inflate(png_ptr, png_ptr->chunk_name, 1/*finish*/,
                       png_ptr->read_buffer + prefix_size, &lzsize,
                       text + prefix_size, newlength);
@@ -761,9 +767,7 @@
             {
                /* inflateReset failed, store the error message */
                png_zstream_error(png_ptr, ret);
-
-               if (ret == Z_STREAM_END)
-                  ret = PNG_UNEXPECTED_ZLIB_RETURN;
+               ret = PNG_UNEXPECTED_ZLIB_RETURN;
             }
          }
 
@@ -1405,11 +1409,13 @@
     * chunk is just ignored, so does not invalidate the color space.  An
     * alternative is to set the 'invalid' flags at the start of this routine
     * and only clear them in they were not set before and all the tests pass.
-    * The minimum 'deflate' stream is assumed to be just the 2 byte header and
-    * 4 byte checksum.  The keyword must be at least one character and there is
-    * a terminator (0) byte and the compression method.
     */
-   if (length < 9)
+
+   /* The keyword must be at least one character and there is a
+    * terminator (0) byte and the compression method byte, and the
+    * 'zlib' datastream is at least 11 bytes.
+    */
+   if (length < 14)
    {
       png_crc_finish(png_ptr, length);
       png_chunk_benign_error(png_ptr, "too short");
@@ -1441,6 +1447,16 @@
       png_crc_read(png_ptr, (png_bytep)keyword, read_length);
       length -= read_length;
 
+      /* The minimum 'zlib' stream is assumed to be just the 2 byte header,
+       * 5 bytes minimum 'deflate' stream, and the 4 byte checksum.
+       */
+      if (length < 11)
+      {
+         png_crc_finish(png_ptr, length);
+         png_chunk_benign_error(png_ptr, "too short");
+         return;
+      }
+
       keyword_length = 0;
       while (keyword_length < 80 && keyword_length < read_length &&
          keyword[keyword_length] != 0)
@@ -1459,7 +1475,7 @@
 
             if (png_inflate_claim(png_ptr, png_iCCP) == Z_OK)
             {
-               Byte profile_header[132];
+               Byte profile_header[132]={0};
                Byte local_buffer[PNG_INFLATE_BUF_SIZE];
                png_alloc_size_t size = (sizeof profile_header);
 
@@ -1489,7 +1505,7 @@
                         /* Now read the tag table; a variable size buffer is
                          * needed at this point, allocate one for the whole
                          * profile.  The header check has already validated
-                         * that none of these stuff will overflow.
+                         * that none of this stuff will overflow.
                          */
                         const png_uint_32 tag_count = png_get_uint_32(
                             profile_header+128);
@@ -1596,19 +1612,11 @@
                                        return;
                                     }
                                  }
-
-                                 else if (size > 0)
-                                    errmsg = "truncated";
-
-#ifndef __COVERITY__
-                                 else
+                                 if (errmsg == NULL)
                                     errmsg = png_ptr->zstream.msg;
-#endif
                               }
-
                               /* else png_icc_check_tag_table output an error */
                            }
-
                            else /* profile truncated */
                               errmsg = png_ptr->zstream.msg;
                         }
@@ -2037,6 +2045,69 @@
 }
 #endif
 
+#ifdef PNG_READ_eXIf_SUPPORTED
+void /* PRIVATE */
+png_handle_eXIf(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
+{
+   unsigned int i;
+
+   png_debug(1, "in png_handle_eXIf");
+
+   if ((png_ptr->mode & PNG_HAVE_IHDR) == 0)
+      png_chunk_error(png_ptr, "missing IHDR");
+
+   if (length < 2)
+   {
+      png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "too short");
+      return;
+   }
+
+   else if (info_ptr == NULL || (info_ptr->valid & PNG_INFO_eXIf) != 0)
+   {
+      png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "duplicate");
+      return;
+   }
+
+   info_ptr->free_me |= PNG_FREE_EXIF;
+
+   info_ptr->eXIf_buf = png_voidcast(png_bytep,
+             png_malloc_warn(png_ptr, length));
+
+   if (info_ptr->eXIf_buf == NULL)
+   {
+      png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "out of memory");
+      return;
+   }
+
+   for (i = 0; i < length; i++)
+   {
+      png_byte buf[1];
+      png_crc_read(png_ptr, buf, 1);
+      info_ptr->eXIf_buf[i] = buf[0];
+      if (i == 1 && buf[0] != 'M' && buf[0] != 'I'
+                 && info_ptr->eXIf_buf[0] != buf[0])
+      {
+         png_crc_finish(png_ptr, length);
+         png_chunk_benign_error(png_ptr, "incorrect byte-order specifier");
+         png_free(png_ptr, info_ptr->eXIf_buf);
+         info_ptr->eXIf_buf = NULL;
+         return;
+      }
+   }
+
+   if (png_crc_finish(png_ptr, 0) != 0)
+      return;
+
+   png_set_eXIf_1(png_ptr, info_ptr, length, info_ptr->eXIf_buf);
+
+   png_free(png_ptr, info_ptr->eXIf_buf);
+   info_ptr->eXIf_buf = NULL;
+}
+#endif
+
 #ifdef PNG_READ_hIST_SUPPORTED
 void /* PRIVATE */
 png_handle_hIST(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
@@ -2565,6 +2636,9 @@
    if ((png_ptr->mode & PNG_HAVE_IDAT) != 0)
       png_ptr->mode |= PNG_AFTER_IDAT;
 
+   /* Note, "length" is sufficient here; we won't be adding
+    * a null terminator later.
+    */
    buffer = png_read_buffer(png_ptr, length, 2/*silent*/);
 
    if (buffer == NULL)
@@ -2611,23 +2685,28 @@
       {
          png_text text;
 
-         /* It worked; png_ptr->read_buffer now looks like a tEXt chunk except
-          * for the extra compression type byte and the fact that it isn't
-          * necessarily '\0' terminated.
-          */
-         buffer = png_ptr->read_buffer;
-         buffer[uncompressed_length+(keyword_length+2)] = 0;
-
-         text.compression = PNG_TEXT_COMPRESSION_zTXt;
-         text.key = (png_charp)buffer;
-         text.text = (png_charp)(buffer + keyword_length+2);
-         text.text_length = uncompressed_length;
-         text.itxt_length = 0;
-         text.lang = NULL;
-         text.lang_key = NULL;
-
-         if (png_set_text_2(png_ptr, info_ptr, &text, 1) != 0)
-            errmsg = "insufficient memory";
+         if (png_ptr->read_buffer == NULL)
+           errmsg="Read failure in png_handle_zTXt";
+         else
+         {
+            /* It worked; png_ptr->read_buffer now looks like a tEXt chunk
+             * except for the extra compression type byte and the fact that
+             * it isn't necessarily '\0' terminated.
+             */
+            buffer = png_ptr->read_buffer;
+            buffer[uncompressed_length+(keyword_length+2)] = 0;
+
+            text.compression = PNG_TEXT_COMPRESSION_zTXt;
+            text.key = (png_charp)buffer;
+            text.text = (png_charp)(buffer + keyword_length+2);
+            text.text_length = uncompressed_length;
+            text.itxt_length = 0;
+            text.lang = NULL;
+            text.lang_key = NULL;
+
+            if (png_set_text_2(png_ptr, info_ptr, &text, 1) != 0)
+               errmsg = "insufficient memory";
+         }
       }
 
       else
@@ -3003,7 +3082,7 @@
          case 2:
             png_ptr->user_chunk_cache_max = 1;
             png_chunk_benign_error(png_ptr, "no space in chunk cache");
-            /* FALL THROUGH */
+            /* FALLTHROUGH */
          case 1:
             /* NOTE: prior to 1.6.0 this case resulted in an unknown critical
              * chunk being skipped, now there will be a hard error below.
@@ -3012,7 +3091,7 @@
 
          default: /* not at limit */
             --(png_ptr->user_chunk_cache_max);
-            /* FALL THROUGH */
+            /* FALLTHROUGH */
          case 0: /* no limit */
 #  endif /* USER_LIMITS */
             /* Here when the limit isn't reached or when limits are compiled
@@ -3063,20 +3142,58 @@
  */
 
 void /* PRIVATE */
-png_check_chunk_name(png_structrp png_ptr, png_uint_32 chunk_name)
+png_check_chunk_name(png_const_structrp png_ptr, const png_uint_32 chunk_name)
 {
    int i;
+   png_uint_32 cn=chunk_name;
 
    png_debug(1, "in png_check_chunk_name");
 
    for (i=1; i<=4; ++i)
    {
-      int c = chunk_name & 0xff;
+      int c = cn & 0xff;
 
       if (c < 65 || c > 122 || (c > 90 && c < 97))
          png_chunk_error(png_ptr, "invalid chunk type");
 
-      chunk_name >>= 8;
+      cn >>= 8;
+   }
+}
+
+void /* PRIVATE */
+png_check_chunk_length(png_const_structrp png_ptr, const png_uint_32 length)
+{
+   png_alloc_size_t limit = PNG_UINT_31_MAX;
+
+# ifdef PNG_SET_USER_LIMITS_SUPPORTED
+   if (png_ptr->user_chunk_malloc_max > 0 &&
+       png_ptr->user_chunk_malloc_max < limit)
+      limit = png_ptr->user_chunk_malloc_max;
+# elif PNG_USER_CHUNK_MALLOC_MAX > 0
+   if (PNG_USER_CHUNK_MALLOC_MAX < limit)
+      limit = PNG_USER_CHUNK_MALLOC_MAX;
+# endif
+   if (png_ptr->chunk_name == png_IDAT)
+   {
+      png_alloc_size_t idat_limit = PNG_UINT_31_MAX;
+      size_t row_factor =
+         (png_ptr->width * png_ptr->channels * (png_ptr->bit_depth > 8? 2: 1)
+          + 1 + (png_ptr->interlaced? 6: 0));
+      if (png_ptr->height > PNG_UINT_32_MAX/row_factor)
+         idat_limit=PNG_UINT_31_MAX;
+      else
+         idat_limit = png_ptr->height * row_factor;
+      row_factor = row_factor > 32566? 32566 : row_factor;
+      idat_limit += 6 + 5*(idat_limit/row_factor+1); /* zlib+deflate overhead */
+      idat_limit=idat_limit < PNG_UINT_31_MAX? idat_limit : PNG_UINT_31_MAX;
+      limit = limit < idat_limit? idat_limit : limit;
+   }
+
+   if (length > limit)
+   {
+      png_debug2(0," length = %lu, limit = %lu",
+         (unsigned long)length,(unsigned long)limit);
+      png_chunk_error(png_ptr, "chunk data is too large");
    }
 }
 
@@ -3405,7 +3522,7 @@
                 */
                do
                {
-                  dp[0] = sp[0], dp[1] = sp[1];
+                  dp[0] = sp[0]; dp[1] = sp[1];
 
                   if (row_width <= bytes_to_jump)
                      return;
@@ -3426,7 +3543,7 @@
                 */
                for (;;)
                {
-                  dp[0] = sp[0], dp[1] = sp[1], dp[2] = sp[2];
+                  dp[0] = sp[0]; dp[1] = sp[1]; dp[2] = sp[2];
 
                   if (row_width <= bytes_to_jump)
                      return;
@@ -3915,7 +4032,10 @@
       /* Find the best predictor, the least of pa, pb, pc favoring the earlier
        * ones in the case of a tie.
        */
-      if (pb < pa) pa = pb, a = b;
+      if (pb < pa)
+      {
+         pa = pb; a = b;
+      }
       if (pc < pa) a = c;
 
       /* Calculate the current pixel in a, and move the previous row pixel to c
@@ -3967,7 +4087,10 @@
       pc = (p + pc) < 0 ? -(p + pc) : p + pc;
 #endif
 
-      if (pb < pa) pa = pb, a = b;
+      if (pb < pa)
+      {
+         pa = pb; a = b;
+      }
       if (pc < pa) a = c;
 
       a += *row;
--- a/src/java.desktop/share/native/libsplashscreen/libpng/pngset.c	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libsplashscreen/libpng/pngset.c	Wed Dec 13 10:25:38 2017 -0800
@@ -29,8 +29,8 @@
  * However, the following notice accompanied the original version of this
  * file and, per its terms, should not be removed:
  *
- * Last changed in libpng 1.6.26 [October 20, 2016]
- * Copyright (c) 1998-2016 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.32 [August 24, 2017]
+ * Copyright (c) 1998-2017 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  *
@@ -162,6 +162,53 @@
 
 #endif /* cHRM */
 
+#ifdef PNG_eXIf_SUPPORTED
+void PNGAPI
+png_set_eXIf(png_const_structrp png_ptr, png_inforp info_ptr,
+    const png_bytep eXIf_buf)
+{
+  png_warning(png_ptr, "png_set_eXIf does not work; use png_set_eXIf_1");
+  PNG_UNUSED(info_ptr)
+  PNG_UNUSED(eXIf_buf)
+}
+
+void PNGAPI
+png_set_eXIf_1(png_const_structrp png_ptr, png_inforp info_ptr,
+    const png_uint_32 num_exif, const png_bytep eXIf_buf)
+{
+   int i;
+
+   png_debug1(1, "in %s storage function", "eXIf");
+
+   if (png_ptr == NULL || info_ptr == NULL)
+      return;
+
+   if (info_ptr->exif)
+   {
+      png_free(png_ptr, info_ptr->exif);
+      info_ptr->exif = NULL;
+   }
+
+   info_ptr->num_exif = num_exif;
+
+   info_ptr->exif = png_voidcast(png_bytep, png_malloc_warn(png_ptr,
+       info_ptr->num_exif));
+
+   if (info_ptr->exif == NULL)
+   {
+      png_warning(png_ptr, "Insufficient memory for eXIf chunk data");
+      return;
+   }
+
+   info_ptr->free_me |= PNG_FREE_EXIF;
+
+   for (i = 0; i < (int) info_ptr->num_exif; i++)
+      info_ptr->exif[i] = eXIf_buf[i];
+
+   info_ptr->valid |= PNG_INFO_eXIf;
+}
+#endif /* eXIf */
+
 #ifdef PNG_gAMA_SUPPORTED
 void PNGFAPI
 png_set_gAMA_fixed(png_const_structrp png_ptr, png_inforp info_ptr,
@@ -1130,8 +1177,9 @@
       info_ptr->valid |= PNG_INFO_sPLT;
       ++(info_ptr->splt_palettes_num);
       ++np;
+      ++entries;
    }
-   while (++entries, --nentries);
+   while (--nentries);
 
    if (nentries > 0)
       png_chunk_report(png_ptr, "sPLT out of memory", PNG_CHUNK_WRITE_ERROR);
@@ -1382,6 +1430,7 @@
       static PNG_CONST png_byte chunks_to_ignore[] = {
          98,  75,  71,  68, '\0',  /* bKGD */
          99,  72,  82,  77, '\0',  /* cHRM */
+        101,  88,  73, 102, '\0',  /* eXIf */
         103,  65,  77,  65, '\0',  /* gAMA */
         104,  73,  83,  84, '\0',  /* hIST */
         105,  67,  67,  80, '\0',  /* iCCP */
@@ -1724,14 +1773,16 @@
       png_byte ch = (png_byte)*key++;
 
       if ((ch > 32 && ch <= 126) || (ch >= 161 /*&& ch <= 255*/))
-         *new_key++ = ch, ++key_len, space = 0;
+      {
+         *new_key++ = ch; ++key_len; space = 0;
+      }
 
       else if (space == 0)
       {
          /* A space or an invalid character when one wasn't seen immediately
           * before; output just a space.
           */
-         *new_key++ = 32, ++key_len, space = 1;
+         *new_key++ = 32; ++key_len; space = 1;
 
          /* If the character was not a space then it is invalid. */
          if (ch != 32)
@@ -1744,7 +1795,7 @@
 
    if (key_len > 0 && space != 0) /* trailing space */
    {
-      --key_len, --new_key;
+      --key_len; --new_key;
       if (bad_character == 0)
          bad_character = 32;
    }
--- a/src/java.desktop/share/native/libsplashscreen/libpng/pngstruct.h	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libsplashscreen/libpng/pngstruct.h	Wed Dec 13 10:25:38 2017 -0800
@@ -29,7 +29,7 @@
  * However, the following notice accompanied the original version of this
  * file and, per its terms, should not be removed:
  *
- * Last changed in libpng 1.6.28 [January 5, 2017]
+ * Last changed in libpng 1.6.32 [August 24, 2017]
  * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
--- a/src/java.desktop/share/native/libsplashscreen/libpng/pngtrans.c	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/share/native/libsplashscreen/libpng/pngtrans.c	Wed Dec 13 10:25:38 2017 -0800
@@ -29,8 +29,8 @@
  * However, the following notice accompanied the original version of this
  * file and, per its terms, should not be removed:
  *
- * Last changed in libpng 1.6.26 [October 20, 2016]
- * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.33 [September 28, 2017]
+ * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  *
@@ -542,11 +542,15 @@
          if (at_start != 0) /* Skip initial filler */
             ++sp;
          else          /* Skip initial channel and, for sp, the filler */
-            sp += 2, ++dp;
+         {
+            sp += 2; ++dp;
+         }
 
          /* For a 1 pixel wide image there is nothing to do */
          while (sp < ep)
-            *dp++ = *sp, sp += 2;
+         {
+            *dp++ = *sp; sp += 2;
+         }
 
          row_info->pixel_depth = 8;
       }
@@ -556,10 +560,14 @@
          if (at_start != 0) /* Skip initial filler */
             sp += 2;
          else          /* Skip initial channel and, for sp, the filler */
-            sp += 4, dp += 2;
+         {
+            sp += 4; dp += 2;
+         }
 
          while (sp < ep)
-            *dp++ = *sp++, *dp++ = *sp, sp += 3;
+         {
+            *dp++ = *sp++; *dp++ = *sp; sp += 3;
+         }
 
          row_info->pixel_depth = 16;
       }
@@ -582,11 +590,15 @@
          if (at_start != 0) /* Skip initial filler */
             ++sp;
          else          /* Skip initial channels and, for sp, the filler */
-            sp += 4, dp += 3;
+         {
+            sp += 4; dp += 3;
+         }
 
          /* Note that the loop adds 3 to dp and 4 to sp each time. */
          while (sp < ep)
-            *dp++ = *sp++, *dp++ = *sp++, *dp++ = *sp, sp += 2;
+         {
+            *dp++ = *sp++; *dp++ = *sp++; *dp++ = *sp; sp += 2;
+         }
 
          row_info->pixel_depth = 24;
       }
@@ -596,14 +608,16 @@
          if (at_start != 0) /* Skip initial filler */
             sp += 2;
          else          /* Skip initial channels and, for sp, the filler */
-            sp += 8, dp += 6;
+         {
+            sp += 8; dp += 6;
+         }
 
          while (sp < ep)
          {
             /* Copy 6 bytes, skip 2 */
-            *dp++ = *sp++, *dp++ = *sp++;
-            *dp++ = *sp++, *dp++ = *sp++;
-            *dp++ = *sp++, *dp++ = *sp, sp += 3;
+            *dp++ = *sp++; *dp++ = *sp++;
+            *dp++ = *sp++; *dp++ = *sp++;
+            *dp++ = *sp++; *dp++ = *sp; sp += 3;
          }
 
          row_info->pixel_depth = 48;
@@ -623,7 +637,7 @@
       return; /* The filler channel has gone already */
 
    /* Fix the rowbytes value. */
-   row_info->rowbytes = (unsigned int)(dp-row);
+   row_info->rowbytes = (png_size_t)(dp-row);
 }
 #endif
 
@@ -722,7 +736,7 @@
        * forms produced on either GCC or MSVC.
        */
       int padding = PNG_PADBITS(row_info->pixel_depth, row_info->width);
-      png_bytep rp = png_ptr->row_buf + row_info->rowbytes;
+      png_bytep rp = png_ptr->row_buf + row_info->rowbytes - 1;
 
       switch (row_info->bit_depth)
       {
--- a/src/java.desktop/unix/classes/sun/awt/windows/ThemeReader.java	Wed Dec 13 16:16:17 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,109 +0,0 @@
-/*
- * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.awt.windows;
-
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Insets;
-import java.awt.Point;
-
-
-/**
- * This is a stubbed out placeholder class, intended to allow building
- * WindowsLookAndFeel on Unix. This class is never actually called on
- * Unix, and will be deleted when WindowsLookAndFeel is no longer built
- * on Unix.
- *
- * @author Leif Samuelsson
- */
-public final class ThemeReader {
-
-    public static boolean isThemed() {
-        return false;
-    }
-
-    public static boolean isXPStyleEnabled() {
-        return false;
-    }
-
-    public static void paintBackground(int[] buffer, String widget,
-           int part, int state, int x, int y, int w, int h, int stride) {
-    }
-
-    public static Insets getThemeMargins(String widget, int part, int state, int marginType) {
-        return null;
-    }
-
-    public static boolean isThemePartDefined(String widget, int part, int state) {
-        return false;
-    }
-
-    public static Color getColor(String widget, int part, int state, int property) {
-        return null;
-    }
-
-    public static int getInt(String widget, int part, int state, int property) {
-        return 0;
-    }
-
-    public static int getEnum(String widget, int part, int state, int property) {
-        return 0;
-    }
-
-    public static boolean getBoolean(String widget, int part, int state, int property) {
-        return false;
-    }
-
-    public static boolean getSysBoolean(String widget, int property) {
-        return false;
-    }
-
-    public static Point getPoint(String widget, int part, int state, int property) {
-        return null;
-    }
-
-    public static Dimension getPosition(String widget, int part, int state, int property) {
-        return null;
-    }
-
-    public static Dimension getPartSize(String widget, int part, int state) {
-        return null;
-    }
-
-    public static long getThemeTransitionDuration(String widget, int part,
-                                       int stateFrom, int stateTo, int propId) {
-        return 0;
-    }
-
-    public static boolean isGetThemeTransitionDurationDefined() {
-        return false;
-    }
-
-    public static Insets getThemeBackgroundContentMargins(String widget,
-                    int part, int state, int boundingWidth, int boundingHeight) {
-        return null;
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/AnimationController.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,436 @@
+/*
+ * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import java.security.AccessController;
+import sun.security.action.GetBooleanAction;
+
+import java.util.*;
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeEvent;
+import java.awt.*;
+import java.awt.event.*;
+import javax.swing.*;
+
+
+import com.sun.java.swing.plaf.windows.TMSchema.State;
+import static com.sun.java.swing.plaf.windows.TMSchema.State.*;
+import com.sun.java.swing.plaf.windows.TMSchema.Part;
+import com.sun.java.swing.plaf.windows.TMSchema.Prop;
+import com.sun.java.swing.plaf.windows.XPStyle.Skin;
+
+import sun.awt.AppContext;
+
+/**
+ * A class to help mimic Vista theme animations.  The only kind of
+ * animation it handles for now is 'transition' animation (this seems
+ * to be the only animation which Vista theme can do). This is when
+ * one picture fadein over another one in some period of time.
+ * According to
+ * https://connect.microsoft.com/feedback/ViewFeedback.aspx?FeedbackID=86852&SiteID=4
+ * The animations are all linear.
+ *
+ * This class has a number of responsibilities.
+ * <ul>
+ *   <li> It trigger rapaint for the UI components involved in the animation
+ *   <li> It tracks the animation state for every UI component involved in the
+ *        animation and paints {@code Skin} in new {@code State} over the
+ *        {@code Skin} in last {@code State} using
+ *        {@code AlphaComposite.SrcOver.derive(alpha)} where {code alpha}
+ *        depends on the state of animation
+ * </ul>
+ *
+ * @author Igor Kushnirskiy
+ */
+class AnimationController implements ActionListener, PropertyChangeListener {
+
+    private static final boolean VISTA_ANIMATION_DISABLED =
+        AccessController.doPrivileged(new GetBooleanAction("swing.disablevistaanimation"));
+
+
+    private static final Object ANIMATION_CONTROLLER_KEY =
+        new StringBuilder("ANIMATION_CONTROLLER_KEY");
+
+    private final Map<JComponent, Map<Part, AnimationState>> animationStateMap =
+            new WeakHashMap<JComponent, Map<Part, AnimationState>>();
+
+    //this timer is used to cause repaint on animated components
+    //30 repaints per second should give smooth animation affect
+    private final javax.swing.Timer timer =
+        new javax.swing.Timer(1000/30, this);
+
+    private static synchronized AnimationController getAnimationController() {
+        AppContext appContext = AppContext.getAppContext();
+        Object obj = appContext.get(ANIMATION_CONTROLLER_KEY);
+        if (obj == null) {
+            obj = new AnimationController();
+            appContext.put(ANIMATION_CONTROLLER_KEY, obj);
+        }
+        return (AnimationController) obj;
+    }
+
+    private AnimationController() {
+        timer.setRepeats(true);
+        timer.setCoalesce(true);
+        //we need to dispose the controller on l&f change
+        UIManager.addPropertyChangeListener(this);
+    }
+
+    private static void triggerAnimation(JComponent c,
+                           Part part, State newState) {
+        if (c instanceof javax.swing.JTabbedPane
+            || part == Part.TP_BUTTON) {
+            //idk: we can not handle tabs animation because
+            //the same (component,part) is used to handle all the tabs
+            //and we can not track the states
+            //Vista theme might have transition duration for toolbar buttons
+            //but native application does not seem to animate them
+            return;
+        }
+        AnimationController controller =
+            AnimationController.getAnimationController();
+        State oldState = controller.getState(c, part);
+        if (oldState != newState) {
+            controller.putState(c, part, newState);
+            if (newState == State.DEFAULTED) {
+                // it seems for DEFAULTED button state Vista does animation from
+                // HOT
+                oldState = State.HOT;
+            }
+            if (oldState != null) {
+                long duration;
+                if (newState == State.DEFAULTED) {
+                    //Only button might have DEFAULTED state
+                    //idk: do not know how to get the value from Vista
+                    //one second seems plausible value
+                    duration = 1000;
+                } else {
+                    XPStyle xp = XPStyle.getXP();
+                    duration = (xp != null)
+                               ? xp.getThemeTransitionDuration(
+                                       c, part,
+                                       normalizeState(oldState),
+                                       normalizeState(newState),
+                                       Prop.TRANSITIONDURATIONS)
+                               : 1000;
+                }
+                controller.startAnimation(c, part, oldState, newState, duration);
+            }
+        }
+    }
+
+    // for scrollbar up, down, left and right button pictures are
+    // defined by states.  It seems that theme has duration defined
+    // only for up button states thus we doing this translation here.
+    private static State normalizeState(State state) {
+        State rv;
+        switch (state) {
+        case DOWNPRESSED:
+            /* falls through */
+        case LEFTPRESSED:
+            /* falls through */
+        case RIGHTPRESSED:
+            rv = UPPRESSED;
+            break;
+
+        case DOWNDISABLED:
+            /* falls through */
+        case LEFTDISABLED:
+            /* falls through */
+        case RIGHTDISABLED:
+            rv = UPDISABLED;
+            break;
+
+        case DOWNHOT:
+            /* falls through */
+        case LEFTHOT:
+            /* falls through */
+        case RIGHTHOT:
+            rv = UPHOT;
+            break;
+
+        case DOWNNORMAL:
+            /* falls through */
+        case LEFTNORMAL:
+            /* falls through */
+        case RIGHTNORMAL:
+            rv = UPNORMAL;
+            break;
+
+        default :
+            rv = state;
+            break;
+        }
+        return rv;
+    }
+
+    private synchronized State getState(JComponent component, Part part) {
+        State rv = null;
+        Object tmpObject =
+            component.getClientProperty(PartUIClientPropertyKey.getKey(part));
+        if (tmpObject instanceof State) {
+            rv = (State) tmpObject;
+        }
+        return rv;
+    }
+
+    private synchronized void putState(JComponent component, Part part,
+                                       State state) {
+        component.putClientProperty(PartUIClientPropertyKey.getKey(part),
+                                    state);
+    }
+
+    private synchronized void startAnimation(JComponent component,
+                                     Part part,
+                                     State startState,
+                                     State endState,
+                                     long millis) {
+        boolean isForwardAndReverse = false;
+        if (endState == State.DEFAULTED) {
+            isForwardAndReverse = true;
+        }
+        Map<Part, AnimationState> map = animationStateMap.get(component);
+        if (millis <= 0) {
+            if (map != null) {
+                map.remove(part);
+                if (map.size() == 0) {
+                    animationStateMap.remove(component);
+                }
+            }
+            return;
+        }
+        if (map == null) {
+            map = new EnumMap<Part, AnimationState>(Part.class);
+            animationStateMap.put(component, map);
+        }
+        map.put(part,
+                new AnimationState(startState, millis, isForwardAndReverse));
+        if (! timer.isRunning()) {
+            timer.start();
+        }
+    }
+
+    static void paintSkin(JComponent component, Skin skin,
+                      Graphics g, int dx, int dy, int dw, int dh, State state) {
+        if (VISTA_ANIMATION_DISABLED) {
+            skin.paintSkinRaw(g, dx, dy, dw, dh, state);
+            return;
+        }
+        triggerAnimation(component, skin.part, state);
+        AnimationController controller = getAnimationController();
+        synchronized (controller) {
+            AnimationState animationState = null;
+            Map<Part, AnimationState> map =
+                controller.animationStateMap.get(component);
+            if (map != null) {
+                animationState = map.get(skin.part);
+            }
+            if (animationState != null) {
+                animationState.paintSkin(skin, g, dx, dy, dw, dh, state);
+            } else {
+                skin.paintSkinRaw(g, dx, dy, dw, dh, state);
+            }
+        }
+    }
+
+    public synchronized void propertyChange(PropertyChangeEvent e) {
+        if ("lookAndFeel" == e.getPropertyName()
+            && ! (e.getNewValue() instanceof WindowsLookAndFeel) ) {
+            dispose();
+        }
+    }
+
+    public synchronized void actionPerformed(ActionEvent e) {
+        java.util.List<JComponent> componentsToRemove = null;
+        java.util.List<Part> partsToRemove = null;
+        for (JComponent component : animationStateMap.keySet()) {
+            component.repaint();
+            if (partsToRemove != null) {
+                partsToRemove.clear();
+            }
+            Map<Part, AnimationState> map = animationStateMap.get(component);
+            if (! component.isShowing()
+                  || map == null
+                  || map.size() == 0) {
+                if (componentsToRemove == null) {
+                    componentsToRemove = new ArrayList<JComponent>();
+                }
+                componentsToRemove.add(component);
+                continue;
+            }
+            for (Part part : map.keySet()) {
+                if (map.get(part).isDone()) {
+                    if (partsToRemove == null) {
+                        partsToRemove = new ArrayList<Part>();
+                    }
+                    partsToRemove.add(part);
+                }
+            }
+            if (partsToRemove != null) {
+                if (partsToRemove.size() == map.size()) {
+                    //animation is done for the component
+                    if (componentsToRemove == null) {
+                        componentsToRemove = new ArrayList<JComponent>();
+                    }
+                    componentsToRemove.add(component);
+                } else {
+                    for (Part part : partsToRemove) {
+                        map.remove(part);
+                    }
+                }
+            }
+        }
+        if (componentsToRemove != null) {
+            for (JComponent component : componentsToRemove) {
+                animationStateMap.remove(component);
+            }
+        }
+        if (animationStateMap.size() == 0) {
+            timer.stop();
+        }
+    }
+
+    private synchronized void dispose() {
+        timer.stop();
+        UIManager.removePropertyChangeListener(this);
+        synchronized (AnimationController.class) {
+            AppContext.getAppContext()
+                .put(ANIMATION_CONTROLLER_KEY, null);
+        }
+    }
+
+    private static class AnimationState {
+        private final State startState;
+
+        //animation duration in nanoseconds
+        private final long duration;
+
+        //animatin start time in nanoseconds
+        private long startTime;
+
+        //direction the alpha value is changing
+        //forward  - from 0 to 1
+        //!forward - from 1 to 0
+        private boolean isForward = true;
+
+        //if isForwardAndReverse the animation continually goes
+        //forward and reverse. alpha value is changing from 0 to 1 then
+        //from 1 to 0 and so forth
+        private boolean isForwardAndReverse;
+
+        private float progress;
+
+        AnimationState(final State startState,
+                       final long milliseconds,
+                       boolean isForwardAndReverse) {
+            assert startState != null && milliseconds > 0;
+            assert SwingUtilities.isEventDispatchThread();
+
+            this.startState = startState;
+            this.duration = milliseconds * 1000000;
+            this.startTime = System.nanoTime();
+            this.isForwardAndReverse = isForwardAndReverse;
+            progress = 0f;
+        }
+        private void updateProgress() {
+            assert SwingUtilities.isEventDispatchThread();
+
+            if (isDone()) {
+                return;
+            }
+            long currentTime = System.nanoTime();
+
+            progress = ((float) (currentTime - startTime))
+                / duration;
+            progress = Math.max(progress, 0); //in case time was reset
+            if (progress >= 1) {
+                progress = 1;
+                if (isForwardAndReverse) {
+                    startTime = currentTime;
+                    progress = 0;
+                    isForward = ! isForward;
+                }
+            }
+        }
+        void paintSkin(Skin skin, Graphics _g,
+                       int dx, int dy, int dw, int dh, State state) {
+            assert SwingUtilities.isEventDispatchThread();
+
+            updateProgress();
+            if (! isDone()) {
+                Graphics2D g = (Graphics2D) _g.create();
+                if (skin.haveToSwitchStates()) {
+                    skin.paintSkinRaw(g, dx, dy, dw, dh, state);
+                    g.setComposite(AlphaComposite.SrcOver.derive(1 - progress));
+                    skin.paintSkinRaw(g, dx, dy, dw, dh, startState);
+                } else {
+                    skin.paintSkinRaw(g, dx, dy, dw, dh, startState);
+                    float alpha;
+                    if (isForward) {
+                        alpha = progress;
+                    } else {
+                        alpha = 1 - progress;
+                    }
+                    g.setComposite(AlphaComposite.SrcOver.derive(alpha));
+                    skin.paintSkinRaw(g, dx, dy, dw, dh, state);
+                }
+                g.dispose();
+            } else {
+                skin.paintSkinRaw(_g, dx, dy, dw, dh, state);
+                skin.switchStates(false);
+            }
+        }
+        boolean isDone() {
+            assert SwingUtilities.isEventDispatchThread();
+
+            return  progress >= 1;
+        }
+    }
+
+    private static class PartUIClientPropertyKey
+          implements UIClientPropertyKey {
+
+        private static final Map<Part, PartUIClientPropertyKey> map =
+            new EnumMap<Part, PartUIClientPropertyKey>(Part.class);
+
+        static synchronized PartUIClientPropertyKey getKey(Part part) {
+            PartUIClientPropertyKey rv = map.get(part);
+            if (rv == null) {
+                rv = new PartUIClientPropertyKey(part);
+                map.put(part, rv);
+            }
+            return rv;
+        }
+
+        private final Part part;
+        private PartUIClientPropertyKey(Part part) {
+            this.part  = part;
+        }
+        public String toString() {
+            return part.toString();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/TMSchema.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,577 @@
+/*
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * <p>These classes are designed to be used while the
+ * corresponding <code>LookAndFeel</code> class has been installed
+ * (<code>UIManager.setLookAndFeel(new <i>XXX</i>LookAndFeel())</code>).
+ * Using them while a different <code>LookAndFeel</code> is installed
+ * may produce unexpected results, including exceptions.
+ * Additionally, changing the <code>LookAndFeel</code>
+ * maintained by the <code>UIManager</code> without updating the
+ * corresponding <code>ComponentUI</code> of any
+ * <code>JComponent</code>s may also produce unexpected results,
+ * such as the wrong colors showing up, and is generally not
+ * encouraged.
+ *
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import java.awt.*;
+import java.util.*;
+
+import javax.swing.*;
+
+import sun.awt.windows.ThemeReader;
+
+/**
+ * Implements Windows Parts and their States and Properties for the Windows Look and Feel.
+ *
+ * See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/userex/topics/partsandstates.asp
+ * See tmschema.h (or vssym32.h & vsstyle.h for MS Vista)
+ *
+ * @author Leif Samuelsson
+ */
+class TMSchema {
+
+    /**
+     * An enumeration of the various Windows controls (also known as
+     * components, or top-level parts)
+     */
+    public static enum Control {
+        BUTTON,
+        COMBOBOX,
+        EDIT,
+        HEADER,
+        LISTBOX,
+        LISTVIEW,
+        MENU,
+        PROGRESS,
+        REBAR,
+        SCROLLBAR,
+        SPIN,
+        TAB,
+        TOOLBAR,
+        TRACKBAR,
+        TREEVIEW,
+        WINDOW
+    }
+
+
+    /**
+     * An enumeration of the Windows compoent parts
+     */
+    public static enum Part {
+        MENU (Control.MENU, 0), // Special case, not in native
+        MP_BARBACKGROUND   (Control.MENU, 7),
+        MP_BARITEM         (Control.MENU, 8),
+        MP_POPUPBACKGROUND (Control.MENU, 9),
+        MP_POPUPBORDERS    (Control.MENU, 10),
+        MP_POPUPCHECK      (Control.MENU, 11),
+        MP_POPUPCHECKBACKGROUND (Control.MENU, 12),
+        MP_POPUPGUTTER     (Control.MENU, 13),
+        MP_POPUPITEM       (Control.MENU, 14),
+        MP_POPUPSEPARATOR  (Control.MENU, 15),
+        MP_POPUPSUBMENU    (Control.MENU, 16),
+
+        BP_PUSHBUTTON (Control.BUTTON, 1),
+        BP_RADIOBUTTON(Control.BUTTON, 2),
+        BP_CHECKBOX   (Control.BUTTON, 3),
+        BP_GROUPBOX   (Control.BUTTON, 4),
+
+        CP_COMBOBOX      (Control.COMBOBOX, 0),
+        CP_DROPDOWNBUTTON(Control.COMBOBOX, 1),
+        CP_BACKGROUND    (Control.COMBOBOX, 2),
+        CP_TRANSPARENTBACKGROUND (Control.COMBOBOX, 3),
+        CP_BORDER                (Control.COMBOBOX, 4),
+        CP_READONLY              (Control.COMBOBOX, 5),
+        CP_DROPDOWNBUTTONRIGHT   (Control.COMBOBOX, 6),
+        CP_DROPDOWNBUTTONLEFT    (Control.COMBOBOX, 7),
+        CP_CUEBANNER             (Control.COMBOBOX, 8),
+
+
+        EP_EDIT    (Control.EDIT, 0),
+        EP_EDITTEXT(Control.EDIT, 1),
+
+        HP_HEADERITEM(Control.HEADER,      1),
+        HP_HEADERSORTARROW(Control.HEADER, 4),
+
+        LBP_LISTBOX(Control.LISTBOX, 0),
+
+        LBCP_BORDER_HSCROLL  (Control.LISTBOX, 1),
+        LBCP_BORDER_HVSCROLL (Control.LISTBOX, 2),
+        LBCP_BORDER_NOSCROLL (Control.LISTBOX, 3),
+        LBCP_BORDER_VSCROLL  (Control.LISTBOX, 4),
+        LBCP_ITEM            (Control.LISTBOX, 5),
+
+        LVP_LISTVIEW(Control.LISTVIEW, 0),
+
+        PP_PROGRESS (Control.PROGRESS, 0),
+        PP_BAR      (Control.PROGRESS, 1),
+        PP_BARVERT  (Control.PROGRESS, 2),
+        PP_CHUNK    (Control.PROGRESS, 3),
+        PP_CHUNKVERT(Control.PROGRESS, 4),
+
+        RP_GRIPPER    (Control.REBAR, 1),
+        RP_GRIPPERVERT(Control.REBAR, 2),
+
+        SBP_SCROLLBAR     (Control.SCROLLBAR,  0),
+        SBP_ARROWBTN      (Control.SCROLLBAR,  1),
+        SBP_THUMBBTNHORZ  (Control.SCROLLBAR,  2),
+        SBP_THUMBBTNVERT  (Control.SCROLLBAR,  3),
+        SBP_LOWERTRACKHORZ(Control.SCROLLBAR,  4),
+        SBP_UPPERTRACKHORZ(Control.SCROLLBAR,  5),
+        SBP_LOWERTRACKVERT(Control.SCROLLBAR,  6),
+        SBP_UPPERTRACKVERT(Control.SCROLLBAR,  7),
+        SBP_GRIPPERHORZ   (Control.SCROLLBAR,  8),
+        SBP_GRIPPERVERT   (Control.SCROLLBAR,  9),
+        SBP_SIZEBOX       (Control.SCROLLBAR, 10),
+
+        SPNP_UP  (Control.SPIN, 1),
+        SPNP_DOWN(Control.SPIN, 2),
+
+        TABP_TABITEM         (Control.TAB, 1),
+        TABP_TABITEMLEFTEDGE (Control.TAB, 2),
+        TABP_TABITEMRIGHTEDGE(Control.TAB, 3),
+        TABP_PANE            (Control.TAB, 9),
+
+        TP_TOOLBAR        (Control.TOOLBAR, 0),
+        TP_BUTTON         (Control.TOOLBAR, 1),
+        TP_SEPARATOR      (Control.TOOLBAR, 5),
+        TP_SEPARATORVERT  (Control.TOOLBAR, 6),
+
+        TKP_TRACK      (Control.TRACKBAR,  1),
+        TKP_TRACKVERT  (Control.TRACKBAR,  2),
+        TKP_THUMB      (Control.TRACKBAR,  3),
+        TKP_THUMBBOTTOM(Control.TRACKBAR,  4),
+        TKP_THUMBTOP   (Control.TRACKBAR,  5),
+        TKP_THUMBVERT  (Control.TRACKBAR,  6),
+        TKP_THUMBLEFT  (Control.TRACKBAR,  7),
+        TKP_THUMBRIGHT (Control.TRACKBAR,  8),
+        TKP_TICS       (Control.TRACKBAR,  9),
+        TKP_TICSVERT   (Control.TRACKBAR, 10),
+
+        TVP_TREEVIEW(Control.TREEVIEW, 0),
+        TVP_GLYPH   (Control.TREEVIEW, 2),
+
+        WP_WINDOW          (Control.WINDOW,  0),
+        WP_CAPTION         (Control.WINDOW,  1),
+        WP_MINCAPTION      (Control.WINDOW,  3),
+        WP_MAXCAPTION      (Control.WINDOW,  5),
+        WP_FRAMELEFT       (Control.WINDOW,  7),
+        WP_FRAMERIGHT      (Control.WINDOW,  8),
+        WP_FRAMEBOTTOM     (Control.WINDOW,  9),
+        WP_SYSBUTTON       (Control.WINDOW, 13),
+        WP_MDISYSBUTTON    (Control.WINDOW, 14),
+        WP_MINBUTTON       (Control.WINDOW, 15),
+        WP_MDIMINBUTTON    (Control.WINDOW, 16),
+        WP_MAXBUTTON       (Control.WINDOW, 17),
+        WP_CLOSEBUTTON     (Control.WINDOW, 18),
+        WP_MDICLOSEBUTTON  (Control.WINDOW, 20),
+        WP_RESTOREBUTTON   (Control.WINDOW, 21),
+        WP_MDIRESTOREBUTTON(Control.WINDOW, 22);
+
+        private final Control control;
+        private final int value;
+
+        private Part(Control control, int value) {
+            this.control = control;
+            this.value = value;
+        }
+
+        public int getValue() {
+            return value;
+        }
+
+        public String getControlName(Component component) {
+            String str = "";
+            if (component instanceof JComponent) {
+                JComponent c = (JComponent)component;
+                String subAppName = (String)c.getClientProperty("XPStyle.subAppName");
+                if (subAppName != null) {
+                    str = subAppName + "::";
+                }
+            }
+            return str + control.toString();
+        }
+
+        public String toString() {
+            return control.toString()+"."+name();
+        }
+    }
+
+
+    /**
+     * An enumeration of the possible component states
+     */
+    public static enum State {
+        ACTIVE,
+        ASSIST,
+        BITMAP,
+        CHECKED,
+        CHECKEDDISABLED,
+        CHECKEDHOT,
+        CHECKEDNORMAL,
+        CHECKEDPRESSED,
+        CHECKMARKNORMAL,
+        CHECKMARKDISABLED,
+        BULLETNORMAL,
+        BULLETDISABLED,
+        CLOSED,
+        DEFAULTED,
+        DISABLED,
+        DISABLEDHOT,
+        DISABLEDPUSHED,
+        DOWNDISABLED,
+        DOWNHOT,
+        DOWNNORMAL,
+        DOWNPRESSED,
+        FOCUSED,
+        HOT,
+        HOTCHECKED,
+        ICONHOT,
+        ICONNORMAL,
+        ICONPRESSED,
+        ICONSORTEDHOT,
+        ICONSORTEDNORMAL,
+        ICONSORTEDPRESSED,
+        INACTIVE,
+        INACTIVENORMAL,         // See note 1
+        INACTIVEHOT,            // See note 1
+        INACTIVEPUSHED,         // See note 1
+        INACTIVEDISABLED,       // See note 1
+        LEFTDISABLED,
+        LEFTHOT,
+        LEFTNORMAL,
+        LEFTPRESSED,
+        MIXEDDISABLED,
+        MIXEDHOT,
+        MIXEDNORMAL,
+        MIXEDPRESSED,
+        NORMAL,
+        PRESSED,
+        OPENED,
+        PUSHED,
+        READONLY,
+        RIGHTDISABLED,
+        RIGHTHOT,
+        RIGHTNORMAL,
+        RIGHTPRESSED,
+        SELECTED,
+        UNCHECKEDDISABLED,
+        UNCHECKEDHOT,
+        UNCHECKEDNORMAL,
+        UNCHECKEDPRESSED,
+        UPDISABLED,
+        UPHOT,
+        UPNORMAL,
+        UPPRESSED,
+        HOVER,
+        UPHOVER,
+        DOWNHOVER,
+        LEFTHOVER,
+        RIGHTHOVER,
+        SORTEDDOWN,
+        SORTEDHOT,
+        SORTEDNORMAL,
+        SORTEDPRESSED,
+        SORTEDUP;
+
+
+        /**
+         * A map of allowed states for each Part
+         */
+        private static EnumMap<Part, State[]> stateMap;
+
+        private static synchronized void initStates() {
+            stateMap = new EnumMap<Part, State[]>(Part.class);
+
+            stateMap.put(Part.EP_EDITTEXT,
+                       new State[] {
+                        NORMAL, HOT, SELECTED, DISABLED, FOCUSED, READONLY, ASSIST
+            });
+
+            stateMap.put(Part.BP_PUSHBUTTON,
+                       new State[] { NORMAL, HOT, PRESSED, DISABLED, DEFAULTED });
+
+            stateMap.put(Part.BP_RADIOBUTTON,
+                       new State[] {
+                        UNCHECKEDNORMAL, UNCHECKEDHOT, UNCHECKEDPRESSED, UNCHECKEDDISABLED,
+                        CHECKEDNORMAL,   CHECKEDHOT,   CHECKEDPRESSED,   CHECKEDDISABLED
+            });
+
+            stateMap.put(Part.BP_CHECKBOX,
+                       new State[] {
+                        UNCHECKEDNORMAL, UNCHECKEDHOT, UNCHECKEDPRESSED, UNCHECKEDDISABLED,
+                        CHECKEDNORMAL,   CHECKEDHOT,   CHECKEDPRESSED,   CHECKEDDISABLED,
+                        MIXEDNORMAL,     MIXEDHOT,     MIXEDPRESSED,     MIXEDDISABLED
+            });
+
+            State[] comboBoxStates = new State[] { NORMAL, HOT, PRESSED, DISABLED };
+            stateMap.put(Part.CP_COMBOBOX, comboBoxStates);
+            stateMap.put(Part.CP_DROPDOWNBUTTON, comboBoxStates);
+            stateMap.put(Part.CP_BACKGROUND, comboBoxStates);
+            stateMap.put(Part.CP_TRANSPARENTBACKGROUND, comboBoxStates);
+            stateMap.put(Part.CP_BORDER, comboBoxStates);
+            stateMap.put(Part.CP_READONLY, comboBoxStates);
+            stateMap.put(Part.CP_DROPDOWNBUTTONRIGHT, comboBoxStates);
+            stateMap.put(Part.CP_DROPDOWNBUTTONLEFT, comboBoxStates);
+            stateMap.put(Part.CP_CUEBANNER, comboBoxStates);
+
+            stateMap.put(Part.HP_HEADERITEM, new State[] { NORMAL, HOT, PRESSED,
+                          SORTEDNORMAL, SORTEDHOT, SORTEDPRESSED,
+                          ICONNORMAL, ICONHOT, ICONPRESSED,
+                          ICONSORTEDNORMAL, ICONSORTEDHOT, ICONSORTEDPRESSED });
+
+            stateMap.put(Part.HP_HEADERSORTARROW,
+                         new State[] {SORTEDDOWN, SORTEDUP});
+
+            State[] listBoxStates = new State[] { NORMAL, PRESSED, HOT, DISABLED};
+            stateMap.put(Part.LBCP_BORDER_HSCROLL, listBoxStates);
+            stateMap.put(Part.LBCP_BORDER_HVSCROLL, listBoxStates);
+            stateMap.put(Part.LBCP_BORDER_NOSCROLL, listBoxStates);
+            stateMap.put(Part.LBCP_BORDER_VSCROLL, listBoxStates);
+
+            State[] scrollBarStates = new State[] { NORMAL, HOT, PRESSED, DISABLED, HOVER };
+            stateMap.put(Part.SBP_SCROLLBAR,    scrollBarStates);
+            stateMap.put(Part.SBP_THUMBBTNVERT, scrollBarStates);
+            stateMap.put(Part.SBP_THUMBBTNHORZ, scrollBarStates);
+            stateMap.put(Part.SBP_GRIPPERVERT,  scrollBarStates);
+            stateMap.put(Part.SBP_GRIPPERHORZ,  scrollBarStates);
+
+            stateMap.put(Part.SBP_ARROWBTN,
+                       new State[] {
+                UPNORMAL,    UPHOT,     UPPRESSED,    UPDISABLED,
+                DOWNNORMAL,  DOWNHOT,   DOWNPRESSED,  DOWNDISABLED,
+                LEFTNORMAL,  LEFTHOT,   LEFTPRESSED,  LEFTDISABLED,
+                RIGHTNORMAL, RIGHTHOT,  RIGHTPRESSED, RIGHTDISABLED,
+                UPHOVER,     DOWNHOVER, LEFTHOVER,    RIGHTHOVER
+            });
+
+
+            State[] spinnerStates = new State[] { NORMAL, HOT, PRESSED, DISABLED };
+            stateMap.put(Part.SPNP_UP,   spinnerStates);
+            stateMap.put(Part.SPNP_DOWN, spinnerStates);
+
+            stateMap.put(Part.TVP_GLYPH, new State[] { CLOSED, OPENED });
+
+            State[] frameButtonStates = new State[] {
+                        NORMAL,         HOT,         PUSHED,         DISABLED,  // See note 1
+                        INACTIVENORMAL, INACTIVEHOT, INACTIVEPUSHED, INACTIVEDISABLED,
+            };
+            // Note 1: The INACTIVE frame button states apply when the frame
+            //         is inactive. They are not defined in tmschema.h
+
+            // Fix for 6316538: Vista has five frame button states
+            if (ThemeReader.getInt(Control.WINDOW.toString(),
+                                   Part.WP_CLOSEBUTTON.getValue(), 1,
+                                   Prop.IMAGECOUNT.getValue()) == 10) {
+                frameButtonStates = new State[] {
+                        NORMAL,         HOT,         PUSHED,         DISABLED,         null,
+                        INACTIVENORMAL, INACTIVEHOT, INACTIVEPUSHED, INACTIVEDISABLED, null
+                };
+            }
+
+            stateMap.put(Part.WP_MINBUTTON,     frameButtonStates);
+            stateMap.put(Part.WP_MAXBUTTON,     frameButtonStates);
+            stateMap.put(Part.WP_RESTOREBUTTON, frameButtonStates);
+            stateMap.put(Part.WP_CLOSEBUTTON,   frameButtonStates);
+
+            // States for Slider (trackbar)
+            stateMap.put(Part.TKP_TRACK,     new State[] { NORMAL });
+            stateMap.put(Part.TKP_TRACKVERT, new State[] { NORMAL });
+
+            State[] sliderThumbStates =
+                new State[] { NORMAL, HOT, PRESSED, FOCUSED, DISABLED };
+            stateMap.put(Part.TKP_THUMB,       sliderThumbStates);
+            stateMap.put(Part.TKP_THUMBBOTTOM, sliderThumbStates);
+            stateMap.put(Part.TKP_THUMBTOP,    sliderThumbStates);
+            stateMap.put(Part.TKP_THUMBVERT,   sliderThumbStates);
+            stateMap.put(Part.TKP_THUMBRIGHT,  sliderThumbStates);
+
+            // States for Tabs
+            State[] tabStates = new State[] { NORMAL, HOT, SELECTED, DISABLED, FOCUSED };
+            stateMap.put(Part.TABP_TABITEM,          tabStates);
+            stateMap.put(Part.TABP_TABITEMLEFTEDGE,  tabStates);
+            stateMap.put(Part.TABP_TABITEMRIGHTEDGE, tabStates);
+
+
+            stateMap.put(Part.TP_BUTTON,
+                       new State[] {
+                        NORMAL, HOT, PRESSED, DISABLED, CHECKED, HOTCHECKED
+            });
+
+            State[] frameStates = new State[] { ACTIVE, INACTIVE };
+            stateMap.put(Part.WP_WINDOW,      frameStates);
+            stateMap.put(Part.WP_FRAMELEFT,   frameStates);
+            stateMap.put(Part.WP_FRAMERIGHT,  frameStates);
+            stateMap.put(Part.WP_FRAMEBOTTOM, frameStates);
+
+            State[] captionStates = new State[] { ACTIVE, INACTIVE, DISABLED };
+            stateMap.put(Part.WP_CAPTION,    captionStates);
+            stateMap.put(Part.WP_MINCAPTION, captionStates);
+            stateMap.put(Part.WP_MAXCAPTION, captionStates);
+
+            stateMap.put(Part.MP_BARBACKGROUND,
+                         new State[] { ACTIVE, INACTIVE });
+            stateMap.put(Part.MP_BARITEM,
+                         new State[] { NORMAL, HOT, PUSHED,
+                                       DISABLED, DISABLEDHOT, DISABLEDPUSHED });
+            stateMap.put(Part.MP_POPUPCHECK,
+                         new State[] { CHECKMARKNORMAL, CHECKMARKDISABLED,
+                                       BULLETNORMAL, BULLETDISABLED });
+            stateMap.put(Part.MP_POPUPCHECKBACKGROUND,
+                         new State[] { DISABLEDPUSHED, NORMAL, BITMAP });
+            stateMap.put(Part.MP_POPUPITEM,
+                         new State[] { NORMAL, HOT, DISABLED, DISABLEDHOT });
+            stateMap.put(Part.MP_POPUPSUBMENU,
+                         new State[] { NORMAL, DISABLED });
+
+        }
+
+
+        public static synchronized int getValue(Part part, State state) {
+            if (stateMap == null) {
+                initStates();
+            }
+
+            Enum<?>[] states = stateMap.get(part);
+            if (states != null) {
+                for (int i = 0; i < states.length; i++) {
+                    if (state == states[i]) {
+                        return i + 1;
+                    }
+                }
+            }
+
+            if (state == null || state == State.NORMAL) {
+                return 1;
+            }
+
+            return 0;
+        }
+
+    }
+
+
+    /**
+     * An enumeration of the possible component attributes and the
+     * corresponding value type
+     */
+    public static enum Prop {
+        COLOR(Color.class,                204),
+        SIZE(Dimension.class,             207),
+
+        FLATMENUS(Boolean.class,         1001),
+
+        BORDERONLY(Boolean.class,        2203), // only draw the border area of the image
+
+        IMAGECOUNT(Integer.class,        2401), // the number of state images in an imagefile
+        BORDERSIZE(Integer.class,        2403), // the size of the border line for bgtype=BorderFill
+
+        PROGRESSCHUNKSIZE(Integer.class, 2411), // size of progress control chunks
+        PROGRESSSPACESIZE(Integer.class, 2412), // size of progress control spaces
+
+        TEXTSHADOWOFFSET(Point.class,    3402), // where char shadows are drawn, relative to orig. chars
+
+        NORMALSIZE(Dimension.class,      3409), // size of dest rect that exactly source
+
+
+        SIZINGMARGINS ( Insets.class,    3601), // margins used for 9-grid sizing
+        CONTENTMARGINS(Insets.class,     3602), // margins that define where content can be placed
+        CAPTIONMARGINS(Insets.class,     3603), // margins that define where caption text can be placed
+
+        BORDERCOLOR(Color.class,         3801), // color of borders for BorderFill
+        FILLCOLOR  (  Color.class,       3802), // color of bg fill
+        TEXTCOLOR  (  Color.class,       3803), // color text is drawn in
+
+        TEXTSHADOWCOLOR(Color.class,     3818), // color of text shadow
+
+        BGTYPE(Integer.class,            4001), // basic drawing type for each part
+
+        TEXTSHADOWTYPE(Integer.class,    4010), // type of shadow to draw with text
+
+        TRANSITIONDURATIONS(Integer.class, 6000);
+
+        private final Class<?> type;
+        private final int value;
+
+        private Prop(Class<?> type, int value) {
+            this.type     = type;
+            this.value    = value;
+        }
+
+        public int getValue() {
+            return value;
+        }
+
+        public String toString() {
+            return name()+"["+type.getName()+"] = "+value;
+        }
+    }
+
+
+    /**
+     * An enumeration of attribute values for some Props
+     */
+    public static enum TypeEnum {
+        BT_IMAGEFILE (Prop.BGTYPE, "imagefile",  0),
+        BT_BORDERFILL(Prop.BGTYPE, "borderfill", 1),
+
+        TST_NONE(Prop.TEXTSHADOWTYPE, "none", 0),
+        TST_SINGLE(Prop.TEXTSHADOWTYPE, "single", 1),
+        TST_CONTINUOUS(Prop.TEXTSHADOWTYPE, "continuous", 2);
+
+
+        private TypeEnum(Prop prop, String enumName, int value) {
+            this.prop = prop;
+            this.enumName = enumName;
+            this.value = value;
+        }
+
+        private final Prop prop;
+        private final String enumName;
+        private final int value;
+
+        public String toString() {
+            return prop+"="+enumName+"="+value;
+        }
+
+        String getName() {
+            return enumName;
+        }
+
+
+        static TypeEnum getTypeEnum(Prop prop, int enumval) {
+            for (TypeEnum e : TypeEnum.values()) {
+                if (e.prop == prop && e.value == enumval) {
+                    return e;
+                }
+            }
+            return null;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsBorders.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,341 @@
+/*
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import javax.swing.*;
+import javax.swing.border.*;
+import javax.swing.plaf.*;
+import javax.swing.plaf.basic.*;
+
+import java.awt.Component;
+import java.awt.Insets;
+import java.awt.Color;
+import java.awt.Graphics;
+
+import static com.sun.java.swing.plaf.windows.TMSchema.*;
+import static com.sun.java.swing.plaf.windows.XPStyle.Skin;
+
+/**
+ * Factory object that can vend Borders appropriate for the Windows 95 {@literal L & F}.
+ * @author Rich Schiavi
+ */
+
+public class WindowsBorders {
+
+    /**
+     * Returns a  border instance for a Windows Progress Bar
+     * @since 1.4
+     */
+    public static Border getProgressBarBorder() {
+        UIDefaults table = UIManager.getLookAndFeelDefaults();
+        Border progressBarBorder = new BorderUIResource.CompoundBorderUIResource(
+                                         new WindowsBorders.ProgressBarBorder(
+                                              table.getColor("ProgressBar.shadow"),
+                                              table.getColor("ProgressBar.highlight")),
+                                              new EmptyBorder(1,1,1,1)
+                                        );
+        return progressBarBorder;
+    }
+
+    /**
+     * Returns a border instance for a Windows ToolBar
+     *
+     * @return a border used for the toolbar
+     * @since 1.4
+     */
+    public static Border getToolBarBorder() {
+        UIDefaults table = UIManager.getLookAndFeelDefaults();
+        Border toolBarBorder = new WindowsBorders.ToolBarBorder(
+                                        table.getColor("ToolBar.shadow"),
+                                        table.getColor("ToolBar.highlight"));
+        return toolBarBorder;
+    }
+
+    /**
+     * Returns an new instance of a border used to indicate which cell item
+     * has focus.
+     *
+     * @return a border to indicate which cell item has focus
+     * @since 1.4
+     */
+    public static Border getFocusCellHighlightBorder() {
+        return new ComplementDashedBorder();
+    }
+
+    public static Border getTableHeaderBorder() {
+        UIDefaults table = UIManager.getLookAndFeelDefaults();
+        Border tableHeaderBorder = new BorderUIResource.CompoundBorderUIResource(
+                           new BasicBorders.ButtonBorder(
+                                           table.getColor("Table.shadow"),
+                                           table.getColor("Table.darkShadow"),
+                                           table.getColor("Table.light"),
+                                           table.getColor("Table.highlight")),
+                                     new BasicBorders.MarginBorder());
+        return tableHeaderBorder;
+    }
+
+    public static Border getInternalFrameBorder() {
+        UIDefaults table = UIManager.getLookAndFeelDefaults();
+        Border internalFrameBorder = new
+            BorderUIResource.CompoundBorderUIResource(
+                BorderFactory.createBevelBorder(BevelBorder.RAISED,
+                    table.getColor("InternalFrame.borderColor"),
+                    table.getColor("InternalFrame.borderHighlight"),
+                    table.getColor("InternalFrame.borderDarkShadow"),
+                    table.getColor("InternalFrame.borderShadow")),
+                new WindowsBorders.InternalFrameLineBorder(
+                    table.getColor("InternalFrame.activeBorderColor"),
+                    table.getColor("InternalFrame.inactiveBorderColor"),
+                    table.getInt("InternalFrame.borderWidth")));
+
+        return internalFrameBorder;
+    }
+
+    @SuppressWarnings("serial") // Superclass is not serializable across versions
+    public static class ProgressBarBorder extends AbstractBorder implements UIResource {
+        protected Color shadow;
+        protected Color highlight;
+
+        public ProgressBarBorder(Color shadow, Color highlight) {
+            this.highlight = highlight;
+            this.shadow = shadow;
+        }
+
+        public void paintBorder(Component c, Graphics g, int x, int y,
+                                int width, int height) {
+            g.setColor(shadow);
+            g.drawLine(x,y, width-1,y); // draw top
+            g.drawLine(x,y, x,height-1); // draw left
+            g.setColor(highlight);
+            g.drawLine(x,height-1, width-1,height-1); // draw bottom
+            g.drawLine(width-1,y, width-1,height-1); // draw right
+        }
+
+        public Insets getBorderInsets(Component c, Insets insets) {
+            insets.set(1,1,1,1);
+            return insets;
+        }
+    }
+
+    /**
+     * A border for the ToolBar. If the ToolBar is floatable then the handle grip is drawn
+     *
+     * @since 1.4
+     */
+    @SuppressWarnings("serial") // Superclass is not serializable across versions
+    public static class ToolBarBorder extends AbstractBorder implements UIResource, SwingConstants {
+        protected Color shadow;
+        protected Color highlight;
+
+        public ToolBarBorder(Color shadow, Color highlight) {
+            this.highlight = highlight;
+            this.shadow = shadow;
+        }
+
+        public void paintBorder(Component c, Graphics g, int x, int y,
+                                int width, int height) {
+            if (!(c instanceof JToolBar)) {
+                return;
+            }
+            g.translate(x, y);
+
+            XPStyle xp = XPStyle.getXP();
+            if (xp != null) {
+                Border xpBorder = xp.getBorder(c, Part.TP_TOOLBAR);
+                if (xpBorder != null) {
+                    xpBorder.paintBorder(c, g, 0, 0, width, height);
+                }
+            }
+            if (((JToolBar)c).isFloatable()) {
+                boolean vertical = ((JToolBar)c).getOrientation() == VERTICAL;
+
+                if (xp != null) {
+                    Part part = vertical ? Part.RP_GRIPPERVERT : Part.RP_GRIPPER;
+                    Skin skin = xp.getSkin(c, part);
+                    int dx, dy, dw, dh;
+                    if (vertical) {
+                        dx = 0;
+                        dy = 2;
+                        dw = width - 1;
+                        dh = skin.getHeight();
+                    } else {
+                        dw = skin.getWidth();
+                        dh = height - 1;
+                        dx = c.getComponentOrientation().isLeftToRight() ? 2 : (width-dw-2);
+                        dy = 0;
+                    }
+                    skin.paintSkin(g, dx, dy, dw, dh, State.NORMAL);
+
+                } else {
+
+                    if (!vertical) {
+                        if (c.getComponentOrientation().isLeftToRight()) {
+                            g.setColor(shadow);
+                            g.drawLine(4, 3, 4, height - 4);
+                            g.drawLine(4, height - 4, 2, height - 4);
+
+                            g.setColor(highlight);
+                            g.drawLine(2, 3, 3, 3);
+                            g.drawLine(2, 3, 2, height - 5);
+                        } else {
+                            g.setColor(shadow);
+                            g.drawLine(width - 3, 3, width - 3, height - 4);
+                            g.drawLine(width - 4, height - 4, width - 4, height - 4);
+
+                            g.setColor(highlight);
+                            g.drawLine(width - 5, 3, width - 4, 3);
+                            g.drawLine(width - 5, 3, width - 5, height - 5);
+                        }
+                    } else { // Vertical
+                        g.setColor(shadow);
+                        g.drawLine(3, 4, width - 4, 4);
+                        g.drawLine(width - 4, 2, width - 4, 4);
+
+                        g.setColor(highlight);
+                        g.drawLine(3, 2, width - 4, 2);
+                        g.drawLine(3, 2, 3, 3);
+                    }
+                }
+            }
+
+            g.translate(-x, -y);
+        }
+
+        public Insets getBorderInsets(Component c, Insets insets) {
+            insets.set(1,1,1,1);
+            if (!(c instanceof JToolBar)) {
+                return insets;
+            }
+            if (((JToolBar)c).isFloatable()) {
+                int gripInset = (XPStyle.getXP() != null) ? 12 : 9;
+                if (((JToolBar)c).getOrientation() == HORIZONTAL) {
+                    if (c.getComponentOrientation().isLeftToRight()) {
+                        insets.left = gripInset;
+                    } else {
+                        insets.right = gripInset;
+                    }
+                } else {
+                    insets.top = gripInset;
+                }
+            }
+            return insets;
+        }
+    }
+
+    /**
+     * This class is an implementation of a dashed border.
+     * @since 1.4
+     */
+    @SuppressWarnings("serial") // Superclass is not serializable across versions
+    public static class DashedBorder extends LineBorder implements UIResource {
+        public DashedBorder(Color color) {
+            super(color);
+        }
+
+        public DashedBorder(Color color, int thickness)  {
+            super(color, thickness);
+        }
+
+        public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
+            Color oldColor = g.getColor();
+            int i;
+
+            g.setColor(lineColor);
+            for(i = 0; i < thickness; i++)  {
+                BasicGraphicsUtils.drawDashedRect(g, x+i, y+i, width-i-i, height-i-i);
+            }
+            g.setColor(oldColor);
+        }
+    }
+
+    /**
+     * A dashed border that paints itself in the complementary color
+     * of the component's background color.
+     */
+    @SuppressWarnings("serial") // Superclass is not serializable across versions
+    static class ComplementDashedBorder extends LineBorder implements UIResource {
+        private Color origColor;
+        private Color paintColor;
+
+        public ComplementDashedBorder() {
+            super(null);
+        }
+
+        public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
+            Color color = c.getBackground();
+
+            if (origColor != color) {
+                origColor = color;
+                paintColor = new Color(~origColor.getRGB());
+            }
+
+            g.setColor(paintColor);
+            BasicGraphicsUtils.drawDashedRect(g, x, y, width, height);
+        }
+    }
+
+    /**
+     * This class is an implementation of the InternalFrameLine border.
+     * @since 1.4
+     */
+    @SuppressWarnings("serial") // Superclass is not serializable across versions
+    public static class InternalFrameLineBorder extends LineBorder implements
+            UIResource {
+        protected Color activeColor;
+        protected Color inactiveColor;
+
+        public InternalFrameLineBorder(Color activeBorderColor,
+                                       Color inactiveBorderColor,
+                                       int thickness) {
+            super(activeBorderColor, thickness);
+            activeColor = activeBorderColor;
+            inactiveColor = inactiveBorderColor;
+        }
+
+        public void paintBorder(Component c, Graphics g, int x, int y,
+                int width, int height) {
+
+            JInternalFrame jif = null;
+            if (c instanceof JInternalFrame) {
+                jif = (JInternalFrame)c;
+            } else if (c instanceof JInternalFrame.JDesktopIcon) {
+                jif = ((JInternalFrame.JDesktopIcon)c).getInternalFrame();
+            } else {
+                return;
+            }
+
+            if (jif.isSelected()) {
+                // Set the line color so the line border gets the correct
+                // color.
+                lineColor = activeColor;
+                super.paintBorder(c, g, x, y, width, height);
+            } else {
+                lineColor = inactiveColor;
+                super.paintBorder(c, g, x, y, width, height);
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsButtonListener.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+package com.sun.java.swing.plaf.windows;
+
+import java.beans.PropertyChangeEvent;
+
+import javax.swing.*;
+import javax.swing.plaf.basic.*;
+
+/**
+ * Button Listener
+ * <p>
+ * <strong>Warning:</strong>
+ * Serialized objects of this class will not be compatible with
+ * future Swing releases.  The current serialization support is appropriate
+ * for short term storage or RMI between applications running the same
+ * version of Swing.  A future release of Swing will provide support for
+ * long term persistence.
+ *
+ * @author Rich Schiavi
+ */
+public class WindowsButtonListener extends BasicButtonListener {
+    public WindowsButtonListener(AbstractButton b) {
+        super(b);
+    }
+    /*
+     This class is currently not used, but exists in case customers
+     were subclassing it.
+     */
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsButtonUI.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,321 @@
+/*
+ * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import javax.swing.plaf.basic.*;
+import javax.swing.border.*;
+import javax.swing.plaf.*;
+import javax.swing.*;
+
+import java.awt.*;
+
+import static com.sun.java.swing.plaf.windows.TMSchema.*;
+import static com.sun.java.swing.plaf.windows.TMSchema.Part.*;
+import static com.sun.java.swing.plaf.windows.XPStyle.Skin;
+import sun.awt.AppContext;
+
+
+/**
+ * Windows button.
+ * <p>
+ * <strong>Warning:</strong>
+ * Serialized objects of this class will not be compatible with
+ * future Swing releases.  The current serialization support is appropriate
+ * for short term storage or RMI between applications running the same
+ * version of Swing.  A future release of Swing will provide support for
+ * long term persistence.
+ *
+ * @author Jeff Dinkins
+ *
+ */
+public class WindowsButtonUI extends BasicButtonUI
+{
+    protected int dashedRectGapX;
+    protected int dashedRectGapY;
+    protected int dashedRectGapWidth;
+    protected int dashedRectGapHeight;
+
+    protected Color focusColor;
+
+    private boolean defaults_initialized = false;
+
+    private static final Object WINDOWS_BUTTON_UI_KEY = new Object();
+
+    // ********************************
+    //          Create PLAF
+    // ********************************
+    public static ComponentUI createUI(JComponent c) {
+        AppContext appContext = AppContext.getAppContext();
+        WindowsButtonUI windowsButtonUI =
+                (WindowsButtonUI) appContext.get(WINDOWS_BUTTON_UI_KEY);
+        if (windowsButtonUI == null) {
+            windowsButtonUI = new WindowsButtonUI();
+            appContext.put(WINDOWS_BUTTON_UI_KEY, windowsButtonUI);
+        }
+        return windowsButtonUI;
+    }
+
+
+    // ********************************
+    //            Defaults
+    // ********************************
+    protected void installDefaults(AbstractButton b) {
+        super.installDefaults(b);
+        if(!defaults_initialized) {
+            String pp = getPropertyPrefix();
+            dashedRectGapX = UIManager.getInt(pp + "dashedRectGapX");
+            dashedRectGapY = UIManager.getInt(pp + "dashedRectGapY");
+            dashedRectGapWidth = UIManager.getInt(pp + "dashedRectGapWidth");
+            dashedRectGapHeight = UIManager.getInt(pp + "dashedRectGapHeight");
+            focusColor = UIManager.getColor(pp + "focus");
+            defaults_initialized = true;
+        }
+
+        XPStyle xp = XPStyle.getXP();
+        if (xp != null) {
+            b.setBorder(xp.getBorder(b, getXPButtonType(b)));
+            LookAndFeel.installProperty(b, "rolloverEnabled", Boolean.TRUE);
+        }
+    }
+
+    protected void uninstallDefaults(AbstractButton b) {
+        super.uninstallDefaults(b);
+        defaults_initialized = false;
+    }
+
+    protected Color getFocusColor() {
+        return focusColor;
+    }
+
+    // ********************************
+    //         Paint Methods
+    // ********************************
+
+    /**
+     * Overridden method to render the text without the mnemonic
+     */
+    protected void paintText(Graphics g, AbstractButton b, Rectangle textRect, String text) {
+        WindowsGraphicsUtils.paintText(g, b, textRect, text, getTextShiftOffset());
+    }
+
+    protected void paintFocus(Graphics g, AbstractButton b, Rectangle viewRect, Rectangle textRect, Rectangle iconRect){
+
+        // focus painted same color as text on Basic??
+        int width = b.getWidth();
+        int height = b.getHeight();
+        g.setColor(getFocusColor());
+        BasicGraphicsUtils.drawDashedRect(g, dashedRectGapX, dashedRectGapY,
+                                          width - dashedRectGapWidth, height - dashedRectGapHeight);
+    }
+
+    protected void paintButtonPressed(Graphics g, AbstractButton b){
+        setTextShiftOffset();
+    }
+
+    // ********************************
+    //          Layout Methods
+    // ********************************
+    public Dimension getPreferredSize(JComponent c) {
+        Dimension d = super.getPreferredSize(c);
+
+        /* Ensure that the width and height of the button is odd,
+         * to allow for the focus line if focus is painted
+         */
+        AbstractButton b = (AbstractButton)c;
+        if (d != null && b.isFocusPainted()) {
+            if(d.width % 2 == 0) { d.width += 1; }
+            if(d.height % 2 == 0) { d.height += 1; }
+        }
+        return d;
+    }
+
+
+    /* These rectangles/insets are allocated once for all
+     * ButtonUI.paint() calls.  Re-using rectangles rather than
+     * allocating them in each paint call substantially reduced the time
+     * it took paint to run.  Obviously, this method can't be re-entered.
+     */
+    private Rectangle viewRect = new Rectangle();
+
+    public void paint(Graphics g, JComponent c) {
+        if (XPStyle.getXP() != null) {
+            WindowsButtonUI.paintXPButtonBackground(g, c);
+        }
+        super.paint(g, c);
+    }
+
+    static Part getXPButtonType(AbstractButton b) {
+        if(b instanceof JCheckBox) {
+            return Part.BP_CHECKBOX;
+        }
+        if(b instanceof JRadioButton) {
+            return Part.BP_RADIOBUTTON;
+        }
+        boolean toolbar = (b.getParent() instanceof JToolBar);
+        return toolbar ? Part.TP_BUTTON : Part.BP_PUSHBUTTON;
+    }
+
+    static State getXPButtonState(AbstractButton b) {
+        Part part = getXPButtonType(b);
+        ButtonModel model = b.getModel();
+        State state = State.NORMAL;
+        switch (part) {
+        case BP_RADIOBUTTON:
+            /* falls through */
+        case BP_CHECKBOX:
+            if (! model.isEnabled()) {
+                state = (model.isSelected()) ? State.CHECKEDDISABLED
+                    : State.UNCHECKEDDISABLED;
+            } else if (model.isPressed() && model.isArmed()) {
+                state = (model.isSelected()) ? State.CHECKEDPRESSED
+                    : State.UNCHECKEDPRESSED;
+            } else if (model.isRollover()) {
+                state = (model.isSelected()) ? State.CHECKEDHOT
+                    : State.UNCHECKEDHOT;
+            } else {
+                state = (model.isSelected()) ? State.CHECKEDNORMAL
+                    : State.UNCHECKEDNORMAL;
+            }
+            break;
+        case BP_PUSHBUTTON:
+            /* falls through */
+        case TP_BUTTON:
+            boolean toolbar = (b.getParent() instanceof JToolBar);
+            if (toolbar) {
+                if (model.isArmed() && model.isPressed()) {
+                    state = State.PRESSED;
+                } else if (!model.isEnabled()) {
+                    state = State.DISABLED;
+                } else if (model.isSelected() && model.isRollover()) {
+                    state = State.HOTCHECKED;
+                } else if (model.isSelected()) {
+                    state = State.CHECKED;
+                } else if (model.isRollover()) {
+                    state = State.HOT;
+                } else if (b.hasFocus()) {
+                    state = State.HOT;
+                }
+            } else {
+                if ((model.isArmed() && model.isPressed())
+                      || model.isSelected()) {
+                    state = State.PRESSED;
+                } else if (!model.isEnabled()) {
+                    state = State.DISABLED;
+                } else if (model.isRollover() || model.isPressed()) {
+                    state = State.HOT;
+                } else if (b instanceof JButton
+                           && ((JButton)b).isDefaultButton()) {
+                    state = State.DEFAULTED;
+                } else if (b.hasFocus()) {
+                    state = State.HOT;
+                }
+            }
+            break;
+        default :
+            state = State.NORMAL;
+        }
+
+        return state;
+    }
+
+    static void paintXPButtonBackground(Graphics g, JComponent c) {
+        AbstractButton b = (AbstractButton)c;
+
+        XPStyle xp = XPStyle.getXP();
+
+        Part part = getXPButtonType(b);
+
+        if (b.isContentAreaFilled() && b.getBorder() != null
+                && b.isBorderPainted() && xp != null) {
+
+            Skin skin = xp.getSkin(b, part);
+
+            State state = getXPButtonState(b);
+            Dimension d = c.getSize();
+            int dx = 0;
+            int dy = 0;
+            int dw = d.width;
+            int dh = d.height;
+
+            Border border = c.getBorder();
+            Insets insets;
+            if (border != null) {
+                // Note: The border may be compound, containing an outer
+                // opaque border (supplied by the application), plus an
+                // inner transparent margin border. We want to size the
+                // background to fill the transparent part, but stay
+                // inside the opaque part.
+                insets = WindowsButtonUI.getOpaqueInsets(border, c);
+            } else {
+                insets = c.getInsets();
+            }
+            if (insets != null) {
+                dx += insets.left;
+                dy += insets.top;
+                dw -= (insets.left + insets.right);
+                dh -= (insets.top + insets.bottom);
+            }
+            skin.paintSkin(g, dx, dy, dw, dh, state);
+        }
+    }
+
+    /**
+     * returns - b.getBorderInsets(c) if border is opaque
+     *         - null if border is completely non-opaque
+     *         - somewhere inbetween if border is compound and
+     *              outside border is opaque and inside isn't
+     */
+    private static Insets getOpaqueInsets(Border b, Component c) {
+        if (b == null) {
+            return null;
+        }
+        if (b.isBorderOpaque()) {
+            return b.getBorderInsets(c);
+        } else if (b instanceof CompoundBorder) {
+            CompoundBorder cb = (CompoundBorder)b;
+            Insets iOut = getOpaqueInsets(cb.getOutsideBorder(), c);
+            if (iOut != null && iOut.equals(cb.getOutsideBorder().getBorderInsets(c))) {
+                // Outside border is opaque, keep looking
+                Insets iIn = getOpaqueInsets(cb.getInsideBorder(), c);
+                if (iIn == null) {
+                    // Inside is non-opaque, use outside insets
+                    return iOut;
+                } else {
+                    // Found non-opaque somewhere in the inside (which is
+                    // also compound).
+                    return new Insets(iOut.top + iIn.top, iOut.left + iIn.left,
+                                      iOut.bottom + iIn.bottom, iOut.right + iIn.right);
+                }
+            } else {
+                // Outside is either all non-opaque or has non-opaque
+                // border inside another compound border
+                return iOut;
+            }
+        } else {
+            return null;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsCheckBoxMenuItemUI.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import java.awt.*;
+import javax.swing.*;
+import javax.swing.plaf.*;
+import javax.swing.plaf.basic.*;
+
+import com.sun.java.swing.plaf.windows.TMSchema.Part;
+import com.sun.java.swing.plaf.windows.TMSchema.State;
+
+
+/**
+ * Windows check box menu item.
+ * <p>
+ * <strong>Warning:</strong>
+ * Serialized objects of this class will not be compatible with
+ * future Swing releases.  The current serialization support is appropriate
+ * for short term storage or RMI between applications running the same
+ * version of Swing.  A future release of Swing will provide support for
+ * long term persistence.
+ */
+public class WindowsCheckBoxMenuItemUI extends BasicCheckBoxMenuItemUI {
+
+    final WindowsMenuItemUIAccessor accessor =
+        new WindowsMenuItemUIAccessor() {
+
+            public JMenuItem getMenuItem() {
+                return menuItem;
+            }
+
+            public State getState(JMenuItem menuItem) {
+                return WindowsMenuItemUI.getState(this, menuItem);
+            }
+
+            public Part getPart(JMenuItem menuItem) {
+                return WindowsMenuItemUI.getPart(this, menuItem);
+            }
+    };
+    public static ComponentUI createUI(JComponent b) {
+        return new WindowsCheckBoxMenuItemUI();
+    }
+
+    @Override
+    protected  void paintBackground(Graphics g, JMenuItem menuItem,
+            Color bgColor) {
+        if (WindowsMenuItemUI.isVistaPainting()) {
+            WindowsMenuItemUI.paintBackground(accessor, g, menuItem, bgColor);
+            return;
+        }
+        super.paintBackground(g, menuItem, bgColor);
+    }
+    /**
+     * Method which renders the text of the current menu item.
+     *
+     * @param g Graphics context
+     * @param menuItem Current menu item to render
+     * @param textRect Bounding rectangle to render the text.
+     * @param text String to render
+     * @since 1.4
+     */
+    protected void paintText(Graphics g, JMenuItem menuItem,
+                             Rectangle textRect, String text) {
+        if (WindowsMenuItemUI.isVistaPainting()) {
+            WindowsMenuItemUI.paintText(accessor, g, menuItem,
+                                        textRect, text);
+            return;
+        }
+        ButtonModel model = menuItem.getModel();
+        Color oldColor = g.getColor();
+
+        if(model.isEnabled() && model.isArmed()) {
+            g.setColor(selectionForeground); // Uses protected field.
+        }
+
+        WindowsGraphicsUtils.paintText(g, menuItem, textRect, text, 0);
+
+        g.setColor(oldColor);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsCheckBoxUI.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import sun.awt.AppContext;
+
+import javax.swing.plaf.basic.*;
+import javax.swing.*;
+import javax.swing.plaf.*;
+
+import java.awt.*;
+
+/**
+ * Windows check box.
+ * <p>
+ * <strong>Warning:</strong>
+ * Serialized objects of this class will not be compatible with
+ * future Swing releases.  The current serialization support is appropriate
+ * for short term storage or RMI between applications running the same
+ * version of Swing.  A future release of Swing will provide support for
+ * long term persistence.
+ *
+ * @author Jeff Dinkins
+ */
+public class WindowsCheckBoxUI extends WindowsRadioButtonUI
+{
+    // NOTE: MetalCheckBoxUI inherts from MetalRadioButtonUI instead
+    // of BasicCheckBoxUI because we want to pick up all the
+    // painting changes made in MetalRadioButtonUI.
+
+    private static final Object WINDOWS_CHECK_BOX_UI_KEY = new Object();
+
+    private static final String propertyPrefix = "CheckBox" + ".";
+
+    private boolean defaults_initialized = false;
+
+    // ********************************
+    //          Create PLAF
+    // ********************************
+    public static ComponentUI createUI(JComponent c) {
+        AppContext appContext = AppContext.getAppContext();
+        WindowsCheckBoxUI windowsCheckBoxUI =
+                (WindowsCheckBoxUI) appContext.get(WINDOWS_CHECK_BOX_UI_KEY);
+        if (windowsCheckBoxUI == null) {
+            windowsCheckBoxUI = new WindowsCheckBoxUI();
+            appContext.put(WINDOWS_CHECK_BOX_UI_KEY, windowsCheckBoxUI);
+        }
+        return windowsCheckBoxUI;
+    }
+
+
+    public String getPropertyPrefix() {
+        return propertyPrefix;
+    }
+
+    // ********************************
+    //          Defaults
+    // ********************************
+    public void installDefaults(AbstractButton b) {
+        super.installDefaults(b);
+        if(!defaults_initialized) {
+            icon = UIManager.getIcon(getPropertyPrefix() + "icon");
+            defaults_initialized = true;
+        }
+    }
+
+    public void uninstallDefaults(AbstractButton b) {
+        super.uninstallDefaults(b);
+        defaults_initialized = false;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsClassicLookAndFeel.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+/**
+ * Implements the Windows95/98/ME/NT/2000 Look and Feel.
+ * <p>
+ * <strong>Warning:</strong>
+ * Serialized objects of this class will not be compatible with
+ * future Swing releases.  The current serialization support is appropriate
+ * for short term storage or RMI between applications running the same
+ * version of Swing.  A future release of Swing will provide support for
+ * long term persistence.
+ *
+ * @since 1.5
+ */
+@SuppressWarnings("serial") // Superclass is not serializable across versions
+public class WindowsClassicLookAndFeel extends WindowsLookAndFeel {
+    public String getName() {
+        return "Windows Classic";
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsComboBoxUI.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,665 @@
+/*
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeEvent;
+import javax.swing.plaf.basic.*;
+import javax.swing.plaf.*;
+import javax.swing.border.*;
+import javax.swing.*;
+import java.awt.event.*;
+import java.awt.*;
+
+import static com.sun.java.swing.plaf.windows.TMSchema.Part;
+import static com.sun.java.swing.plaf.windows.TMSchema.State;
+import static com.sun.java.swing.plaf.windows.XPStyle.Skin;
+
+import sun.swing.DefaultLookup;
+import sun.swing.StringUIClientPropertyKey;
+
+import com.sun.java.swing.plaf.windows.WindowsBorders.DashedBorder;
+
+/**
+ * Windows combo box.
+ * <p>
+ * <strong>Warning:</strong>
+ * Serialized objects of this class will not be compatible with
+ * future Swing releases.  The current serialization support is appropriate
+ * for short term storage or RMI between applications running the same
+ * version of Swing.  A future release of Swing will provide support for
+ * long term persistence.
+ *
+ * @author Tom Santos
+ * @author Igor Kushnirskiy
+ */
+
+public class WindowsComboBoxUI extends BasicComboBoxUI {
+
+    private static final MouseListener rolloverListener =
+        new MouseAdapter() {
+            private void handleRollover(MouseEvent e, boolean isRollover) {
+                JComboBox<?> comboBox = getComboBox(e);
+                WindowsComboBoxUI comboBoxUI = getWindowsComboBoxUI(e);
+                if (comboBox == null || comboBoxUI == null) {
+                    return;
+                }
+                if (! comboBox.isEditable()) {
+                    //mouse over editable ComboBox does not switch rollover
+                    //for the arrow button
+                    ButtonModel m = null;
+                    if (comboBoxUI.arrowButton != null) {
+                        m = comboBoxUI.arrowButton.getModel();
+                    }
+                    if (m != null ) {
+                        m.setRollover(isRollover);
+                    }
+                }
+                comboBoxUI.isRollover = isRollover;
+                comboBox.repaint();
+            }
+
+            public void mouseEntered(MouseEvent e) {
+                handleRollover(e, true);
+            }
+
+            public void mouseExited(MouseEvent e) {
+                handleRollover(e, false);
+            }
+
+            private JComboBox<?> getComboBox(MouseEvent event) {
+                Object source = event.getSource();
+                JComboBox<?> rv = null;
+                if (source instanceof JComboBox) {
+                    rv = (JComboBox) source;
+                } else if (source instanceof XPComboBoxButton) {
+                    rv = ((XPComboBoxButton) source)
+                        .getWindowsComboBoxUI().comboBox;
+                } else if (source instanceof JTextField &&
+                        ((JTextField) source).getParent() instanceof JComboBox) {
+                    rv = (JComboBox) ((JTextField) source).getParent();
+                }
+                return rv;
+            }
+
+            private WindowsComboBoxUI getWindowsComboBoxUI(MouseEvent event) {
+                JComboBox<?> comboBox = getComboBox(event);
+                WindowsComboBoxUI rv = null;
+                if (comboBox != null
+                    && comboBox.getUI() instanceof WindowsComboBoxUI) {
+                    rv = (WindowsComboBoxUI) comboBox.getUI();
+                }
+                return rv;
+            }
+
+        };
+    private boolean isRollover = false;
+
+    private static final PropertyChangeListener componentOrientationListener =
+        new PropertyChangeListener() {
+            public void propertyChange(PropertyChangeEvent e) {
+                String propertyName = e.getPropertyName();
+                Object source = null;
+                if ("componentOrientation" == propertyName
+                    && (source = e.getSource()) instanceof JComboBox
+                    && ((JComboBox) source).getUI() instanceof
+                      WindowsComboBoxUI) {
+                    JComboBox<?> comboBox = (JComboBox) source;
+                    WindowsComboBoxUI comboBoxUI = (WindowsComboBoxUI) comboBox.getUI();
+                    if (comboBoxUI.arrowButton instanceof XPComboBoxButton) {
+                        ((XPComboBoxButton) comboBoxUI.arrowButton).setPart(
+                                    (comboBox.getComponentOrientation() ==
+                                       ComponentOrientation.RIGHT_TO_LEFT)
+                                    ? Part.CP_DROPDOWNBUTTONLEFT
+                                    : Part.CP_DROPDOWNBUTTONRIGHT);
+                            }
+                        }
+                    }
+                };
+
+    public static ComponentUI createUI(JComponent c) {
+        return new WindowsComboBoxUI();
+    }
+
+    public void installUI( JComponent c ) {
+        super.installUI( c );
+        isRollover = false;
+        comboBox.setRequestFocusEnabled( true );
+        if (XPStyle.getXP() != null && arrowButton != null) {
+            //we can not do it in installListeners because arrowButton
+            //is initialized after installListeners is invoked
+            comboBox.addMouseListener(rolloverListener);
+            arrowButton.addMouseListener(rolloverListener);
+            // set empty border as default to see vista animated border
+            comboBox.setBorder(new EmptyBorder(0,0,0,0));
+        }
+    }
+
+    public void uninstallUI(JComponent c ) {
+        comboBox.removeMouseListener(rolloverListener);
+        if(arrowButton != null) {
+            arrowButton.removeMouseListener(rolloverListener);
+        }
+        super.uninstallUI( c );
+    }
+
+    /**
+     * {@inheritDoc}
+     * @since 1.6
+     */
+    @Override
+    protected void installListeners() {
+        super.installListeners();
+        XPStyle xp = XPStyle.getXP();
+        //button glyph for LTR and RTL combobox might differ
+        if (xp != null
+              && xp.isSkinDefined(comboBox, Part.CP_DROPDOWNBUTTONRIGHT)) {
+            comboBox.addPropertyChangeListener("componentOrientation",
+                                               componentOrientationListener);
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     * @since 1.6
+     */
+    @Override
+    protected void uninstallListeners() {
+        super.uninstallListeners();
+        comboBox.removePropertyChangeListener("componentOrientation",
+                                              componentOrientationListener);
+    }
+
+    /**
+     * {@inheritDoc}
+     * @since 1.6
+     */
+    protected void configureEditor() {
+        super.configureEditor();
+        if (XPStyle.getXP() != null) {
+            editor.addMouseListener(rolloverListener);
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     * @since 1.6
+     */
+    protected void unconfigureEditor() {
+        super.unconfigureEditor();
+        editor.removeMouseListener(rolloverListener);
+    }
+
+    /**
+     * {@inheritDoc}
+     * @since 1.6
+     */
+    public void paint(Graphics g, JComponent c) {
+        if (XPStyle.getXP() != null) {
+            paintXPComboBoxBackground(g, c);
+        }
+        super.paint(g, c);
+    }
+
+    State getXPComboBoxState(JComponent c) {
+        State state = State.NORMAL;
+        if (!c.isEnabled()) {
+            state = State.DISABLED;
+        } else if (isPopupVisible(comboBox)) {
+            state = State.PRESSED;
+        } else if (comboBox.isEditable()
+                && comboBox.getEditor().getEditorComponent().isFocusOwner()) {
+            state = State.PRESSED;
+        } else if (isRollover) {
+            state = State.HOT;
+        }
+        return state;
+    }
+
+    private void paintXPComboBoxBackground(Graphics g, JComponent c) {
+        XPStyle xp = XPStyle.getXP();
+        if (xp == null) {
+            return;
+        }
+        State state = getXPComboBoxState(c);
+        Skin skin = null;
+        if (! comboBox.isEditable()
+              && xp.isSkinDefined(c, Part.CP_READONLY)) {
+            skin = xp.getSkin(c, Part.CP_READONLY);
+        }
+        if (skin == null) {
+            skin = xp.getSkin(c, Part.CP_BORDER);
+        }
+        skin.paintSkin(g, 0, 0, c.getWidth(), c.getHeight(), state);
+    }
+
+    /**
+     * If necessary paints the currently selected item.
+     *
+     * @param g Graphics to paint to
+     * @param bounds Region to paint current value to
+     * @param hasFocus whether or not the JComboBox has focus
+     * @throws NullPointerException if any of the arguments are null.
+     * @since 1.5
+     */
+    public void paintCurrentValue(Graphics g, Rectangle bounds,
+                                  boolean hasFocus) {
+        XPStyle xp = XPStyle.getXP();
+        if ( xp != null) {
+            bounds.x += 2;
+            bounds.y += 2;
+            bounds.width -= 4;
+            bounds.height -= 4;
+        } else {
+            bounds.x += 1;
+            bounds.y += 1;
+            bounds.width -= 2;
+            bounds.height -= 2;
+        }
+        if (! comboBox.isEditable()
+            && xp != null
+            && xp.isSkinDefined(comboBox, Part.CP_READONLY)) {
+            // On vista for READNLY ComboBox
+            // color for currentValue is the same as for any other item
+
+            // mostly copied from javax.swing.plaf.basic.BasicComboBoxUI.paintCurrentValue
+            ListCellRenderer<Object> renderer = comboBox.getRenderer();
+            Component c;
+            if ( hasFocus && !isPopupVisible(comboBox) ) {
+                c = renderer.getListCellRendererComponent(
+                        listBox,
+                        comboBox.getSelectedItem(),
+                        -1,
+                        true,
+                        false );
+            } else {
+                c = renderer.getListCellRendererComponent(
+                        listBox,
+                        comboBox.getSelectedItem(),
+                        -1,
+                        false,
+                        false );
+            }
+            c.setFont(comboBox.getFont());
+            if ( comboBox.isEnabled() ) {
+                c.setForeground(comboBox.getForeground());
+                c.setBackground(comboBox.getBackground());
+            } else {
+                c.setForeground(DefaultLookup.getColor(
+                         comboBox, this, "ComboBox.disabledForeground", null));
+                c.setBackground(DefaultLookup.getColor(
+                         comboBox, this, "ComboBox.disabledBackground", null));
+            }
+            boolean shouldValidate = false;
+            if (c instanceof JPanel)  {
+                shouldValidate = true;
+            }
+            currentValuePane.paintComponent(g, c, comboBox, bounds.x, bounds.y,
+                                            bounds.width, bounds.height, shouldValidate);
+
+        } else {
+            super.paintCurrentValue(g, bounds, hasFocus);
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     * @since 1.6
+     */
+    public void paintCurrentValueBackground(Graphics g, Rectangle bounds,
+                                            boolean hasFocus) {
+        if (XPStyle.getXP() == null) {
+            super.paintCurrentValueBackground(g, bounds, hasFocus);
+        }
+    }
+
+    public Dimension getMinimumSize( JComponent c ) {
+        Dimension d = super.getMinimumSize(c);
+        if (XPStyle.getXP() != null) {
+            d.width += 7;
+            boolean isEditable = false;
+            if (c instanceof JComboBox) {
+                isEditable = ((JComboBox) c).isEditable();
+            }
+            d.height += isEditable ? 4 : 6;
+        } else {
+            d.width += 4;
+            d.height += 2;
+        }
+        return d;
+    }
+
+    /**
+     * Creates a layout manager for managing the components which make up the
+     * combo box.
+     *
+     * @return an instance of a layout manager
+     */
+    protected LayoutManager createLayoutManager() {
+        return new BasicComboBoxUI.ComboBoxLayoutManager() {
+            public void layoutContainer(Container parent) {
+                super.layoutContainer(parent);
+
+                if (XPStyle.getXP() != null && arrowButton != null) {
+                    Dimension d = parent.getSize();
+                    Insets insets = getInsets();
+                    int buttonWidth = arrowButton.getPreferredSize().width;
+                    arrowButton.setBounds(WindowsGraphicsUtils.isLeftToRight((JComboBox)parent)
+                                          ? (d.width - insets.right - buttonWidth)
+                                          : insets.left,
+                                          insets.top,
+                                          buttonWidth, d.height - insets.top - insets.bottom);
+                }
+            }
+        };
+    }
+
+    protected void installKeyboardActions() {
+        super.installKeyboardActions();
+    }
+
+    protected ComboPopup createPopup() {
+        return new WinComboPopUp(comboBox);
+    }
+
+    /**
+     * Creates the default editor that will be used in editable combo boxes.
+     * A default editor will be used only if an editor has not been
+     * explicitly set with <code>setEditor</code>.
+     *
+     * @return a <code>ComboBoxEditor</code> used for the combo box
+     * @see javax.swing.JComboBox#setEditor
+     */
+    protected ComboBoxEditor createEditor() {
+        return new WindowsComboBoxEditor();
+    }
+
+    /**
+     * {@inheritDoc}
+     * @since 1.6
+     */
+    @Override
+    protected ListCellRenderer<Object> createRenderer() {
+        XPStyle xp = XPStyle.getXP();
+        if (xp != null && xp.isSkinDefined(comboBox, Part.CP_READONLY)) {
+            return new WindowsComboBoxRenderer();
+        } else {
+            return super.createRenderer();
+        }
+    }
+
+    /**
+     * Creates an button which will be used as the control to show or hide
+     * the popup portion of the combo box.
+     *
+     * @return a button which represents the popup control
+     */
+    protected JButton createArrowButton() {
+        XPStyle xp = XPStyle.getXP();
+        if (xp != null) {
+            return new XPComboBoxButton(xp);
+        } else {
+            return super.createArrowButton();
+        }
+    }
+
+    @SuppressWarnings("serial") // Superclass is not serializable across versions
+    private class XPComboBoxButton extends XPStyle.GlyphButton {
+        private State prevState = null;
+
+        public XPComboBoxButton(XPStyle xp) {
+            super(comboBox,
+                  (! xp.isSkinDefined(comboBox, Part.CP_DROPDOWNBUTTONRIGHT))
+                   ? Part.CP_DROPDOWNBUTTON
+                   : (comboBox.getComponentOrientation() == ComponentOrientation.RIGHT_TO_LEFT)
+                     ? Part.CP_DROPDOWNBUTTONLEFT
+                     : Part.CP_DROPDOWNBUTTONRIGHT
+                  );
+            setRequestFocusEnabled(false);
+        }
+
+        @Override
+        protected State getState() {
+            State rv;
+
+            getModel().setPressed(comboBox.isPopupVisible());
+
+            rv = super.getState();
+            XPStyle xp = XPStyle.getXP();
+            if (rv != State.DISABLED
+                    && comboBox != null && ! comboBox.isEditable()
+                    && xp != null && xp.isSkinDefined(comboBox,
+                            Part.CP_DROPDOWNBUTTONRIGHT)) {
+                /*
+                 * for non editable ComboBoxes Vista seems to have the
+                 * same glyph for all non DISABLED states
+                 */
+                rv = State.NORMAL;
+            }
+            if (rv == State.NORMAL && (prevState == State.HOT || prevState == State.PRESSED)) {
+                /*
+                 * State NORMAL of combobox button cannot overpaint states HOT or PRESSED
+                 * Therefore HOT state must be painted from alpha 1 to 0 and not as usual that
+                 * NORMAL state is painted from alpha 0 to alpha 1.
+                 */
+                skin.switchStates(true);
+            }
+            if (rv != prevState) {
+                prevState = rv;
+            }
+
+            return rv;
+        }
+
+        public Dimension getPreferredSize() {
+            return new Dimension(17, 21);
+        }
+
+        void setPart(Part part) {
+            setPart(comboBox, part);
+        }
+
+        WindowsComboBoxUI getWindowsComboBoxUI() {
+            return WindowsComboBoxUI.this;
+        }
+    }
+
+
+    /**
+     * Subclassed to add Windows specific Key Bindings.
+     * This class is now obsolete and doesn't do anything.
+     * Only included for backwards API compatibility.
+     * Do not call or override.
+     *
+     * @deprecated As of Java 2 platform v1.4.
+     */
+    @Deprecated
+    @SuppressWarnings("serial") // Superclass is not serializable across versions
+    protected class WindowsComboPopup extends BasicComboPopup {
+
+        public WindowsComboPopup( JComboBox<Object> cBox ) {
+            super( cBox );
+        }
+
+        protected KeyListener createKeyListener() {
+            return new InvocationKeyHandler();
+        }
+
+        protected class InvocationKeyHandler extends BasicComboPopup.InvocationKeyHandler {
+            protected InvocationKeyHandler() {
+                WindowsComboPopup.this.super();
+            }
+        }
+    }
+
+    @SuppressWarnings("serial") // Same-version serialization only
+    protected class WinComboPopUp extends BasicComboPopup {
+        private Skin listBoxBorder = null;
+        private XPStyle xp;
+
+        public WinComboPopUp(JComboBox<Object> combo) {
+            super(combo);
+            xp = XPStyle.getXP();
+            if (xp != null && xp.isSkinDefined(combo, Part.LBCP_BORDER_NOSCROLL)) {
+                this.listBoxBorder = new Skin(combo, Part.LBCP_BORDER_NOSCROLL);
+                this.setBorder(new EmptyBorder(1,1,1,1));
+            }
+        }
+
+        protected KeyListener createKeyListener() {
+            return new InvocationKeyHandler();
+        }
+
+        protected class InvocationKeyHandler extends BasicComboPopup.InvocationKeyHandler {
+            protected InvocationKeyHandler() {
+                WinComboPopUp.this.super();
+            }
+        }
+
+        protected void paintComponent(Graphics g) {
+            super.paintComponent(g);
+            if (this.listBoxBorder != null) {
+                this.listBoxBorder.paintSkinRaw(g, this.getX(), this.getY(),
+                        this.getWidth(), this.getHeight(), State.HOT);
+            }
+        }
+    }
+
+
+    /**
+     * Subclassed to highlight selected item in an editable combo box.
+     */
+    public static class WindowsComboBoxEditor
+        extends BasicComboBoxEditor.UIResource {
+
+        /**
+         * {@inheritDoc}
+         * @since 1.6
+         */
+        protected JTextField createEditorComponent() {
+            JTextField editor = super.createEditorComponent();
+            Border border = (Border)UIManager.get("ComboBox.editorBorder");
+
+            if (border != null) {
+                editor.setBorder(border);
+            }
+            editor.setOpaque(false);
+            return editor;
+        }
+
+        public void setItem(Object item) {
+            super.setItem(item);
+            Object focus = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
+            if ((focus == editor) || (focus == editor.getParent())) {
+                editor.selectAll();
+            }
+        }
+    }
+
+    /**
+     * Subclassed to set opacity {@code false} on the renderer
+     * and to show border for focused cells.
+     */
+    @SuppressWarnings("serial") // Superclass is not serializable across versions
+    private static class WindowsComboBoxRenderer
+          extends BasicComboBoxRenderer.UIResource {
+        private static final Object BORDER_KEY
+            = new StringUIClientPropertyKey("BORDER_KEY");
+        private static final Border NULL_BORDER = new EmptyBorder(0, 0, 0, 0);
+
+        // Create own version of DashedBorder with more space on left side
+        private class WindowsComboBoxDashedBorder extends DashedBorder {
+
+            public WindowsComboBoxDashedBorder(Color color, int thickness) {
+                super(color, thickness);
+            }
+
+            public WindowsComboBoxDashedBorder(Color color) {
+                super(color);
+            }
+
+            @Override
+            public Insets getBorderInsets(Component c, Insets i) {
+                return new Insets(0,2,0,0);
+            }
+        }
+
+        public WindowsComboBoxRenderer() {
+            super();
+
+            // correct space on the left side of text items in the combo popup list
+            Insets i = getBorder().getBorderInsets(this);
+            setBorder(new EmptyBorder(0, 2, 0, i.right));
+        }
+        /**
+         * {@inheritDoc}
+         */
+        @Override
+        public Component getListCellRendererComponent(
+                                                 JList<?> list,
+                                                 Object value,
+                                                 int index,
+                                                 boolean isSelected,
+                                                 boolean cellHasFocus) {
+            Component rv =
+                super.getListCellRendererComponent(list, value, index,
+                                                   isSelected, cellHasFocus);
+            if (rv instanceof JComponent) {
+                JComponent component = (JComponent) rv;
+                if (index == -1 && isSelected) {
+                    Border border = component.getBorder();
+                    Border dashedBorder =
+                        new WindowsComboBoxDashedBorder(list.getForeground());
+                    component.setBorder(dashedBorder);
+                    //store current border in client property if needed
+                    if (component.getClientProperty(BORDER_KEY) == null) {
+                        component.putClientProperty(BORDER_KEY,
+                                       (border == null) ? NULL_BORDER : border);
+                    }
+                } else {
+                    if (component.getBorder() instanceof
+                          WindowsBorders.DashedBorder) {
+                        Object storedBorder = component.getClientProperty(BORDER_KEY);
+                        if (storedBorder instanceof Border) {
+                            component.setBorder(
+                                (storedBorder == NULL_BORDER) ? null
+                                    : (Border) storedBorder);
+                        }
+                        component.putClientProperty(BORDER_KEY, null);
+                    }
+                }
+                if (index == -1) {
+                    component.setOpaque(false);
+                    component.setForeground(list.getForeground());
+                } else {
+                    component.setOpaque(true);
+                }
+            }
+            return rv;
+        }
+
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsDesktopIconUI.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import java.awt.*;
+import javax.swing.plaf.*;
+import javax.swing.plaf.basic.*;
+import javax.swing.*;
+import javax.swing.border.*;
+
+
+
+/**
+ * Windows icon for a minimized window on the desktop.
+ * <p>
+ * <strong>Warning:</strong>
+ * Serialized objects of this class will not be compatible with
+ * future Swing releases.  The current serialization support is appropriate
+ * for short term storage or RMI between applications running the same
+ * version of Swing.  A future release of Swing will provide support for
+ * long term persistence.
+ */
+public class WindowsDesktopIconUI extends BasicDesktopIconUI {
+    private int width;
+
+    public static ComponentUI createUI(JComponent c) {
+        return new WindowsDesktopIconUI();
+    }
+
+    public void installDefaults() {
+        super.installDefaults();
+        width = UIManager.getInt("DesktopIcon.width");
+    }
+
+    public void installUI(JComponent c)   {
+        super.installUI(c);
+
+        c.setOpaque(XPStyle.getXP() == null);
+    }
+
+    // Uninstall the listeners added by the WindowsInternalFrameTitlePane
+    public void uninstallUI(JComponent c) {
+        WindowsInternalFrameTitlePane thePane =
+                                        (WindowsInternalFrameTitlePane)iconPane;
+        super.uninstallUI(c);
+        thePane.uninstallListeners();
+    }
+
+    protected void installComponents() {
+        iconPane = new WindowsInternalFrameTitlePane(frame);
+        desktopIcon.setLayout(new BorderLayout());
+        desktopIcon.add(iconPane, BorderLayout.CENTER);
+
+        if (XPStyle.getXP() != null) {
+            desktopIcon.setBorder(null);
+        }
+    }
+
+    public Dimension getPreferredSize(JComponent c) {
+        // Windows desktop icons can not be resized.  Therefore, we should
+        // always return the minimum size of the desktop icon. See
+        // getMinimumSize(JComponent c).
+        return getMinimumSize(c);
+    }
+
+    /**
+     * Windows desktop icons are restricted to a width of 160 pixels by
+     * default.  This value is retrieved by the DesktopIcon.width property.
+     */
+    public Dimension getMinimumSize(JComponent c) {
+        Dimension dim = super.getMinimumSize(c);
+        dim.width = width;
+        return dim;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsDesktopManager.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+package com.sun.java.swing.plaf.windows;
+
+import javax.swing.DefaultDesktopManager;
+import javax.swing.JInternalFrame;
+import javax.swing.JLayeredPane;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.Dimension;
+import java.beans.PropertyVetoException;
+import java.util.Vector;
+import java.lang.ref.WeakReference;
+
+/**
+ * This class implements a DesktopManager which more closely follows
+ * the MDI model than the DefaultDesktopManager.  Unlike the
+ * DefaultDesktopManager policy, MDI requires that the selected
+ * and activated child frames are the same, and that that frame
+ * always be the top-most window.
+ * <p>
+ * The maximized state is managed by the DesktopManager with MDI,
+ * instead of just being a property of the individual child frame.
+ * This means that if the currently selected window is maximized
+ * and another window is selected, that new window will be maximized.
+ *
+ * @see javax.swing.DefaultDesktopManager
+ * @author Thomas Ball
+ */
+@SuppressWarnings("serial") // JDK-implementation class
+public class WindowsDesktopManager extends DefaultDesktopManager
+        implements java.io.Serializable, javax.swing.plaf.UIResource {
+
+    /* The frame which is currently selected/activated.
+     * We store this value to enforce MDI's single-selection model.
+     */
+    private WeakReference<JInternalFrame> currentFrameRef;
+
+    public void activateFrame(JInternalFrame f) {
+        JInternalFrame currentFrame = currentFrameRef != null ?
+            currentFrameRef.get() : null;
+        try {
+            super.activateFrame(f);
+            if (currentFrame != null && f != currentFrame) {
+                // If the current frame is maximized, transfer that
+                // attribute to the frame being activated.
+                if (!currentFrame.isClosed() && currentFrame.isMaximum() &&
+                    (f.getClientProperty("JInternalFrame.frameType") !=
+                    "optionDialog") ) {
+                    //Special case.  If key binding was used to select next
+                    //frame instead of minimizing the icon via the minimize
+                    //icon.
+                    if (!currentFrame.isIcon()) {
+                        currentFrame.setMaximum(false);
+                        if (f.isMaximizable()) {
+                            if (!f.isMaximum()) {
+                                f.setMaximum(true);
+                            } else if (f.isMaximum() && f.isIcon()) {
+                                f.setIcon(false);
+                            } else {
+                                f.setMaximum(false);
+                            }
+                        }
+                    }
+                }
+                if (currentFrame.isSelected()) {
+                    currentFrame.setSelected(false);
+                }
+            }
+
+            if (!f.isSelected()) {
+                f.setSelected(true);
+            }
+        } catch (PropertyVetoException e) {}
+        if (f != currentFrame) {
+            currentFrameRef = new WeakReference<JInternalFrame>(f);
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsDesktopPaneUI.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import javax.swing.*;
+import javax.swing.plaf.basic.*;
+import javax.swing.plaf.ComponentUI;
+import java.awt.event.*;
+
+/**
+ * Windows desktop pane.
+ * <p>
+ * <strong>Warning:</strong>
+ * Serialized objects of this class will not be compatible with
+ * future Swing releases.  The current serialization support is appropriate
+ * for short term storage or RMI between applications running the same
+ * version of Swing.  A future release of Swing will provide support for
+ * long term persistence.
+ *
+ * @author David Kloba
+ */
+public class WindowsDesktopPaneUI extends BasicDesktopPaneUI
+{
+    public static ComponentUI createUI(JComponent c) {
+        return new WindowsDesktopPaneUI();
+    }
+
+    protected void installDesktopManager() {
+        desktopManager = desktop.getDesktopManager();
+        if(desktopManager == null) {
+            desktopManager = new WindowsDesktopManager();
+            desktop.setDesktopManager(desktopManager);
+        }
+    }
+
+    protected void installDefaults() {
+        super.installDefaults();
+    }
+
+    @SuppressWarnings("deprecation")
+    protected void installKeyboardActions() {
+        super.installKeyboardActions();
+
+        // Request focus if it isn't set.
+        if(!desktop.requestDefaultFocus()) {
+            desktop.requestFocus();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsDesktopProperty.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2001, 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.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import javax.swing.UIManager;
+
+import sun.swing.plaf.DesktopProperty;
+
+/**
+ * Wrapper for a value from the desktop. The value is lazily looked up, and
+ * can be accessed using the <code>UIManager.ActiveValue</code> method
+ * <code>createValue</code>. If the underlying desktop property changes this
+ * will force the UIs to update all known Frames. You can invoke
+ * <code>invalidate</code> to force the value to be fetched again.
+ */
+public class WindowsDesktopProperty extends DesktopProperty {
+
+    /**
+     * Updates the UIs of all the known Frames.
+     */
+    @Override
+    protected final void updateAllUIs() {
+        // Check if the current UI is WindowsLookAndfeel and flush the XP style map.
+        // Note: Change the package test if this class is moved to a different package.
+        Class<?> uiClass = UIManager.getLookAndFeel().getClass();
+        if (uiClass.getPackage().equals(WindowsDesktopProperty.class.getPackage())) {
+            XPStyle.invalidateStyle();
+        }
+        super.updateAllUIs();
+    }
+
+    /**
+     * Creates a WindowsDesktopProperty.
+     *
+     * @param key Key used in looking up desktop value.
+     * @param fallback Value used if desktop property is null.
+     */
+    public WindowsDesktopProperty(String key, Object fallback) {
+        super(key,fallback);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsEditorPaneUI.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import javax.swing.plaf.*;
+import javax.swing.plaf.basic.*;
+import javax.swing.*;
+import javax.swing.text.Caret;
+
+
+/**
+ * Windows rendition of the component.
+ * <p>
+ * <strong>Warning:</strong>
+ * Serialized objects of this class will not be compatible with
+ * future Swing releases.  The current serialization support is appropriate
+ * for short term storage or RMI between applications running the same
+ * version of Swing.  A future release of Swing will provide support for
+ * long term persistence.
+ */
+public class WindowsEditorPaneUI extends BasicEditorPaneUI
+{
+
+    /**
+     * Creates a UI for a JEditorPane.
+     *
+     * @param c the configurable text component
+     * @return the UI
+     */
+    public static ComponentUI createUI(JComponent c) {
+        return new WindowsEditorPaneUI();
+    }
+
+    /**
+     * Creates the object to use for a caret.  By default an
+     * instance of WindowsCaret is created.  This method
+     * can be redefined to provide something else that implements
+     * the InputPosition interface or a subclass of DefaultCaret.
+     *
+     * @return the caret object
+     */
+    protected Caret createCaret() {
+        return new WindowsTextUI.WindowsCaret();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,1325 @@
+/*
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import javax.swing.*;
+import javax.swing.border.*;
+import javax.swing.filechooser.*;
+import javax.swing.event.*;
+import javax.swing.plaf.*;
+import javax.swing.plaf.basic.*;
+import java.awt.*;
+import java.awt.event.*;
+import java.awt.image.BufferedImage;
+import java.beans.*;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.*;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+import sun.awt.shell.ShellFolder;
+import sun.swing.*;
+
+import javax.accessibility.*;
+
+/**
+ * Windows {@literal L&F} implementation of a FileChooser.
+ *
+ * @author Jeff Dinkins
+ */
+public class WindowsFileChooserUI extends BasicFileChooserUI {
+
+    // The following are private because the implementation of the
+    // Windows FileChooser L&F is not complete yet.
+
+    private JPanel centerPanel;
+
+    private JLabel lookInLabel;
+    private JComboBox<File> directoryComboBox;
+    private DirectoryComboBoxModel directoryComboBoxModel;
+    private ActionListener directoryComboBoxAction = new DirectoryComboBoxAction();
+
+    private FilterComboBoxModel filterComboBoxModel;
+
+    private JTextField filenameTextField;
+    private FilePane filePane;
+    private WindowsPlacesBar placesBar;
+
+    private JButton approveButton;
+    private JButton cancelButton;
+
+    private JPanel buttonPanel;
+    private JPanel bottomPanel;
+
+    private JComboBox<FileFilter> filterComboBox;
+
+    private static final Dimension hstrut10 = new Dimension(10, 1);
+
+    private static final Dimension vstrut4  = new Dimension(1, 4);
+    private static final Dimension vstrut6  = new Dimension(1, 6);
+    private static final Dimension vstrut8  = new Dimension(1, 8);
+
+    private static final Insets shrinkwrap = new Insets(0,0,0,0);
+
+    // Preferred and Minimum sizes for the dialog box
+    private static int PREF_WIDTH = 425;
+    private static int PREF_HEIGHT = 245;
+    private static Dimension PREF_SIZE = new Dimension(PREF_WIDTH, PREF_HEIGHT);
+
+    private static int MIN_WIDTH = 425;
+    private static int MIN_HEIGHT = 245;
+
+    private static int LIST_PREF_WIDTH = 444;
+    private static int LIST_PREF_HEIGHT = 138;
+    private static Dimension LIST_PREF_SIZE = new Dimension(LIST_PREF_WIDTH, LIST_PREF_HEIGHT);
+
+    // Labels, mnemonics, and tooltips (oh my!)
+    private int    lookInLabelMnemonic = 0;
+    private String lookInLabelText = null;
+    private String saveInLabelText = null;
+
+    private int    fileNameLabelMnemonic = 0;
+    private String fileNameLabelText = null;
+    private int    folderNameLabelMnemonic = 0;
+    private String folderNameLabelText = null;
+
+    private int    filesOfTypeLabelMnemonic = 0;
+    private String filesOfTypeLabelText = null;
+
+    private String upFolderToolTipText = null;
+    private String upFolderAccessibleName = null;
+
+    private String newFolderToolTipText = null;
+    private String newFolderAccessibleName = null;
+
+    private String viewMenuButtonToolTipText = null;
+    private String viewMenuButtonAccessibleName = null;
+
+    private BasicFileView fileView = new WindowsFileView();
+
+    private JLabel fileNameLabel;
+
+    private void populateFileNameLabel() {
+        if (getFileChooser().getFileSelectionMode() == JFileChooser.DIRECTORIES_ONLY) {
+            fileNameLabel.setText(folderNameLabelText);
+            fileNameLabel.setDisplayedMnemonic(folderNameLabelMnemonic);
+        } else {
+            fileNameLabel.setText(fileNameLabelText);
+            fileNameLabel.setDisplayedMnemonic(fileNameLabelMnemonic);
+        }
+    }
+
+    //
+    // ComponentUI Interface Implementation methods
+    //
+    public static ComponentUI createUI(JComponent c) {
+        return new WindowsFileChooserUI((JFileChooser) c);
+    }
+
+    public WindowsFileChooserUI(JFileChooser filechooser) {
+        super(filechooser);
+    }
+
+    public void installUI(JComponent c) {
+        super.installUI(c);
+    }
+
+    public void uninstallComponents(JFileChooser fc) {
+        fc.removeAll();
+    }
+
+    private class WindowsFileChooserUIAccessor implements FilePane.FileChooserUIAccessor {
+        public JFileChooser getFileChooser() {
+            return WindowsFileChooserUI.this.getFileChooser();
+        }
+
+        public BasicDirectoryModel getModel() {
+            return WindowsFileChooserUI.this.getModel();
+        }
+
+        public JPanel createList() {
+            return WindowsFileChooserUI.this.createList(getFileChooser());
+        }
+
+        public JPanel createDetailsView() {
+            return WindowsFileChooserUI.this.createDetailsView(getFileChooser());
+        }
+
+        public boolean isDirectorySelected() {
+            return WindowsFileChooserUI.this.isDirectorySelected();
+        }
+
+        public File getDirectory() {
+            return WindowsFileChooserUI.this.getDirectory();
+        }
+
+        public Action getChangeToParentDirectoryAction() {
+            return WindowsFileChooserUI.this.getChangeToParentDirectoryAction();
+        }
+
+        public Action getApproveSelectionAction() {
+            return WindowsFileChooserUI.this.getApproveSelectionAction();
+        }
+
+        public Action getNewFolderAction() {
+            return WindowsFileChooserUI.this.getNewFolderAction();
+        }
+
+        public MouseListener createDoubleClickListener(JList<?> list) {
+            return WindowsFileChooserUI.this.createDoubleClickListener(getFileChooser(),
+                                                                       list);
+        }
+
+        public ListSelectionListener createListSelectionListener() {
+            return WindowsFileChooserUI.this.createListSelectionListener(getFileChooser());
+        }
+    }
+
+    public void installComponents(JFileChooser fc) {
+        filePane = new FilePane(new WindowsFileChooserUIAccessor());
+        fc.addPropertyChangeListener(filePane);
+
+        FileSystemView fsv = fc.getFileSystemView();
+
+        fc.setBorder(new EmptyBorder(4, 10, 10, 10));
+        fc.setLayout(new BorderLayout(8, 8));
+
+        updateUseShellFolder();
+
+        // ********************************* //
+        // **** Construct the top panel **** //
+        // ********************************* //
+
+        // Directory manipulation buttons
+        JToolBar topPanel = new JToolBar();
+        topPanel.setFloatable(false);
+        topPanel.putClientProperty("JToolBar.isRollover", Boolean.TRUE);
+
+        // Add the top panel to the fileChooser
+        fc.add(topPanel, BorderLayout.NORTH);
+
+        // ComboBox Label
+        @SuppressWarnings("serial") // anonymous class
+        JLabel tmp1 = new JLabel(lookInLabelText, JLabel.TRAILING) {
+            public Dimension getPreferredSize() {
+                return getMinimumSize();
+            }
+
+            public Dimension getMinimumSize() {
+                Dimension d = super.getPreferredSize();
+                if (placesBar != null) {
+                    d.width = Math.max(d.width, placesBar.getWidth());
+                }
+                return d;
+            }
+        };
+        lookInLabel = tmp1;
+        lookInLabel.setDisplayedMnemonic(lookInLabelMnemonic);
+        lookInLabel.setAlignmentX(JComponent.LEFT_ALIGNMENT);
+        lookInLabel.setAlignmentY(JComponent.CENTER_ALIGNMENT);
+        topPanel.add(lookInLabel);
+        topPanel.add(Box.createRigidArea(new Dimension(8,0)));
+
+        // CurrentDir ComboBox
+        @SuppressWarnings("serial") // anonymous class
+        JComboBox<File> tmp2 = new JComboBox<File>() {
+            public Dimension getMinimumSize() {
+                Dimension d = super.getMinimumSize();
+                d.width = 60;
+                return d;
+            }
+
+            public Dimension getPreferredSize() {
+                Dimension d = super.getPreferredSize();
+                // Must be small enough to not affect total width.
+                d.width = 150;
+                return d;
+            }
+        };
+        directoryComboBox = tmp2;
+        directoryComboBox.putClientProperty( "JComboBox.lightweightKeyboardNavigation", "Lightweight" );
+        lookInLabel.setLabelFor(directoryComboBox);
+        directoryComboBoxModel = createDirectoryComboBoxModel(fc);
+        directoryComboBox.setModel(directoryComboBoxModel);
+        directoryComboBox.addActionListener(directoryComboBoxAction);
+        directoryComboBox.setRenderer(createDirectoryComboBoxRenderer(fc));
+        directoryComboBox.setAlignmentX(JComponent.LEFT_ALIGNMENT);
+        directoryComboBox.setAlignmentY(JComponent.CENTER_ALIGNMENT);
+        directoryComboBox.setMaximumRowCount(8);
+
+        topPanel.add(directoryComboBox);
+        topPanel.add(Box.createRigidArea(hstrut10));
+
+        // Up Button
+        JButton upFolderButton = createToolButton(getChangeToParentDirectoryAction(), upFolderIcon,
+            upFolderToolTipText, upFolderAccessibleName);
+        topPanel.add(upFolderButton);
+
+        // New Directory Button
+        if (!UIManager.getBoolean("FileChooser.readOnly")) {
+            JButton newFolderButton = createToolButton(filePane.getNewFolderAction(), newFolderIcon,
+                newFolderToolTipText, newFolderAccessibleName);
+            topPanel.add(newFolderButton);
+        }
+
+        // View button group
+        ButtonGroup viewButtonGroup = new ButtonGroup();
+
+        // Popup Menu
+        final JPopupMenu viewTypePopupMenu = new JPopupMenu();
+
+        final JRadioButtonMenuItem listViewMenuItem = new JRadioButtonMenuItem(
+                filePane.getViewTypeAction(FilePane.VIEWTYPE_LIST));
+        listViewMenuItem.setSelected(filePane.getViewType() == FilePane.VIEWTYPE_LIST);
+        viewTypePopupMenu.add(listViewMenuItem);
+        viewButtonGroup.add(listViewMenuItem);
+
+        final JRadioButtonMenuItem detailsViewMenuItem = new JRadioButtonMenuItem(
+                filePane.getViewTypeAction(FilePane.VIEWTYPE_DETAILS));
+        detailsViewMenuItem.setSelected(filePane.getViewType() == FilePane.VIEWTYPE_DETAILS);
+        viewTypePopupMenu.add(detailsViewMenuItem);
+        viewButtonGroup.add(detailsViewMenuItem);
+
+        // Create icon for viewMenuButton
+        BufferedImage image = new BufferedImage(viewMenuIcon.getIconWidth() + 7, viewMenuIcon.getIconHeight(),
+                BufferedImage.TYPE_INT_ARGB);
+        Graphics graphics = image.getGraphics();
+        viewMenuIcon.paintIcon(filePane, graphics, 0, 0);
+        int x = image.getWidth() - 5;
+        int y = image.getHeight() / 2 - 1;
+        graphics.setColor(Color.BLACK);
+        graphics.fillPolygon(new int[]{x, x + 5, x + 2}, new int[]{y, y, y + 3}, 3);
+
+        // Details Button
+        final JButton viewMenuButton = createToolButton(null, new ImageIcon(image), viewMenuButtonToolTipText,
+                viewMenuButtonAccessibleName);
+
+        viewMenuButton.addMouseListener(new MouseAdapter() {
+            public void mousePressed(MouseEvent e) {
+                if (SwingUtilities.isLeftMouseButton(e) && !viewMenuButton.isSelected()) {
+                    viewMenuButton.setSelected(true);
+
+                    viewTypePopupMenu.show(viewMenuButton, 0, viewMenuButton.getHeight());
+                }
+            }
+        });
+        viewMenuButton.addKeyListener(new KeyAdapter() {
+            public void keyPressed(KeyEvent e) {
+                // Forbid keyboard actions if the button is not in rollover state
+                if (e.getKeyCode() == KeyEvent.VK_SPACE && viewMenuButton.getModel().isRollover()) {
+                    viewMenuButton.setSelected(true);
+
+                    viewTypePopupMenu.show(viewMenuButton, 0, viewMenuButton.getHeight());
+                }
+            }
+        });
+        viewTypePopupMenu.addPopupMenuListener(new PopupMenuListener() {
+            public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
+            }
+
+            public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
+                SwingUtilities.invokeLater(new Runnable() {
+                    public void run() {
+                        viewMenuButton.setSelected(false);
+                    }
+                });
+            }
+
+            public void popupMenuCanceled(PopupMenuEvent e) {
+            }
+        });
+
+        topPanel.add(viewMenuButton);
+
+        topPanel.add(Box.createRigidArea(new Dimension(80, 0)));
+
+        filePane.addPropertyChangeListener(new PropertyChangeListener() {
+            public void propertyChange(PropertyChangeEvent e) {
+                if ("viewType".equals(e.getPropertyName())) {
+                    switch (filePane.getViewType()) {
+                        case FilePane.VIEWTYPE_LIST:
+                            listViewMenuItem.setSelected(true);
+                            break;
+
+                        case FilePane.VIEWTYPE_DETAILS:
+                            detailsViewMenuItem.setSelected(true);
+                            break;
+                    }
+                }
+            }
+        });
+
+        // ************************************** //
+        // ******* Add the directory pane ******* //
+        // ************************************** //
+        centerPanel = new JPanel(new BorderLayout());
+        centerPanel.add(getAccessoryPanel(), BorderLayout.AFTER_LINE_ENDS);
+        JComponent accessory = fc.getAccessory();
+        if(accessory != null) {
+            getAccessoryPanel().add(accessory);
+        }
+        filePane.setPreferredSize(LIST_PREF_SIZE);
+        centerPanel.add(filePane, BorderLayout.CENTER);
+        fc.add(centerPanel, BorderLayout.CENTER);
+
+        // ********************************** //
+        // **** Construct the bottom panel ** //
+        // ********************************** //
+        getBottomPanel().setLayout(new BoxLayout(getBottomPanel(), BoxLayout.LINE_AXIS));
+
+        // Add the bottom panel to file chooser
+        centerPanel.add(getBottomPanel(), BorderLayout.SOUTH);
+
+        // labels
+        JPanel labelPanel = new JPanel();
+        labelPanel.setLayout(new BoxLayout(labelPanel, BoxLayout.PAGE_AXIS));
+        labelPanel.add(Box.createRigidArea(vstrut4));
+
+        fileNameLabel = new JLabel();
+        populateFileNameLabel();
+        fileNameLabel.setAlignmentY(0);
+        labelPanel.add(fileNameLabel);
+
+        labelPanel.add(Box.createRigidArea(new Dimension(1,12)));
+
+        JLabel ftl = new JLabel(filesOfTypeLabelText);
+        ftl.setDisplayedMnemonic(filesOfTypeLabelMnemonic);
+        labelPanel.add(ftl);
+
+        getBottomPanel().add(labelPanel);
+        getBottomPanel().add(Box.createRigidArea(new Dimension(15, 0)));
+
+        // file entry and filters
+        JPanel fileAndFilterPanel = new JPanel();
+        fileAndFilterPanel.add(Box.createRigidArea(vstrut8));
+        fileAndFilterPanel.setLayout(new BoxLayout(fileAndFilterPanel, BoxLayout.Y_AXIS));
+
+        @SuppressWarnings("serial") // anonymous class
+        JTextField tmp3 = new JTextField(35) {
+            public Dimension getMaximumSize() {
+                return new Dimension(Short.MAX_VALUE, super.getPreferredSize().height);
+            }
+        };
+        filenameTextField = tmp3;
+
+        fileNameLabel.setLabelFor(filenameTextField);
+        filenameTextField.addFocusListener(
+            new FocusAdapter() {
+                public void focusGained(FocusEvent e) {
+                    if (!getFileChooser().isMultiSelectionEnabled()) {
+                        filePane.clearSelection();
+                    }
+                }
+            }
+        );
+
+        if (fc.isMultiSelectionEnabled()) {
+            setFileName(fileNameString(fc.getSelectedFiles()));
+        } else {
+            setFileName(fileNameString(fc.getSelectedFile()));
+        }
+
+        fileAndFilterPanel.add(filenameTextField);
+        fileAndFilterPanel.add(Box.createRigidArea(vstrut8));
+
+        filterComboBoxModel = createFilterComboBoxModel();
+        fc.addPropertyChangeListener(filterComboBoxModel);
+        filterComboBox = new JComboBox<FileFilter>(filterComboBoxModel);
+        ftl.setLabelFor(filterComboBox);
+        filterComboBox.setRenderer(createFilterComboBoxRenderer());
+        fileAndFilterPanel.add(filterComboBox);
+
+        getBottomPanel().add(fileAndFilterPanel);
+        getBottomPanel().add(Box.createRigidArea(new Dimension(30, 0)));
+
+        // buttons
+        getButtonPanel().setLayout(new BoxLayout(getButtonPanel(), BoxLayout.Y_AXIS));
+
+        @SuppressWarnings("serial") // anonymous class
+        JButton tmp4 = new JButton(getApproveButtonText(fc)) {
+            public Dimension getMaximumSize() {
+                return approveButton.getPreferredSize().width > cancelButton.getPreferredSize().width ?
+                       approveButton.getPreferredSize() : cancelButton.getPreferredSize();
+            }
+        };
+        approveButton = tmp4;
+        Insets buttonMargin = approveButton.getMargin();
+        buttonMargin = new InsetsUIResource(buttonMargin.top,    buttonMargin.left  + 5,
+                                            buttonMargin.bottom, buttonMargin.right + 5);
+        approveButton.setMargin(buttonMargin);
+        approveButton.setMnemonic(getApproveButtonMnemonic(fc));
+        approveButton.addActionListener(getApproveSelectionAction());
+        approveButton.setToolTipText(getApproveButtonToolTipText(fc));
+        getButtonPanel().add(Box.createRigidArea(vstrut6));
+        getButtonPanel().add(approveButton);
+        getButtonPanel().add(Box.createRigidArea(vstrut4));
+
+        @SuppressWarnings("serial") // anonymous class
+        JButton tmp5 = new JButton(cancelButtonText) {
+            public Dimension getMaximumSize() {
+                return approveButton.getPreferredSize().width > cancelButton.getPreferredSize().width ?
+                       approveButton.getPreferredSize() : cancelButton.getPreferredSize();
+            }
+        };
+        cancelButton = tmp5;
+        cancelButton.setMargin(buttonMargin);
+        cancelButton.setToolTipText(cancelButtonToolTipText);
+        cancelButton.addActionListener(getCancelSelectionAction());
+        getButtonPanel().add(cancelButton);
+
+        if(fc.getControlButtonsAreShown()) {
+            addControlButtons();
+        }
+    }
+
+    private void updateUseShellFolder() {
+        // Decide whether to use the ShellFolder class to populate shortcut
+        // panel and combobox.
+        JFileChooser fc = getFileChooser();
+
+        if (FilePane.usesShellFolder(fc)) {
+            if (placesBar == null && !UIManager.getBoolean("FileChooser.noPlacesBar")) {
+                placesBar = new WindowsPlacesBar(fc, XPStyle.getXP() != null);
+                fc.add(placesBar, BorderLayout.BEFORE_LINE_BEGINS);
+                fc.addPropertyChangeListener(placesBar);
+            }
+        } else {
+            if (placesBar != null) {
+                fc.remove(placesBar);
+                fc.removePropertyChangeListener(placesBar);
+                placesBar = null;
+            }
+        }
+    }
+
+    protected JPanel getButtonPanel() {
+        if(buttonPanel == null) {
+            buttonPanel = new JPanel();
+        }
+        return buttonPanel;
+    }
+
+    protected JPanel getBottomPanel() {
+        if(bottomPanel == null) {
+            bottomPanel = new JPanel();
+        }
+        return bottomPanel;
+    }
+
+    protected void installStrings(JFileChooser fc) {
+        super.installStrings(fc);
+
+        Locale l = fc.getLocale();
+
+        lookInLabelMnemonic = getMnemonic("FileChooser.lookInLabelMnemonic", l);
+        lookInLabelText = UIManager.getString("FileChooser.lookInLabelText",l);
+        saveInLabelText = UIManager.getString("FileChooser.saveInLabelText",l);
+
+        fileNameLabelMnemonic = getMnemonic("FileChooser.fileNameLabelMnemonic", l);
+        fileNameLabelText = UIManager.getString("FileChooser.fileNameLabelText",l);
+        folderNameLabelMnemonic = getMnemonic("FileChooser.folderNameLabelMnemonic", l);
+        folderNameLabelText = UIManager.getString("FileChooser.folderNameLabelText",l);
+
+        filesOfTypeLabelMnemonic = getMnemonic("FileChooser.filesOfTypeLabelMnemonic", l);
+        filesOfTypeLabelText = UIManager.getString("FileChooser.filesOfTypeLabelText",l);
+
+        upFolderToolTipText =  UIManager.getString("FileChooser.upFolderToolTipText",l);
+        upFolderAccessibleName = UIManager.getString("FileChooser.upFolderAccessibleName",l);
+
+        newFolderToolTipText = UIManager.getString("FileChooser.newFolderToolTipText",l);
+        newFolderAccessibleName = UIManager.getString("FileChooser.newFolderAccessibleName",l);
+
+        viewMenuButtonToolTipText = UIManager.getString("FileChooser.viewMenuButtonToolTipText",l);
+        viewMenuButtonAccessibleName = UIManager.getString("FileChooser.viewMenuButtonAccessibleName",l);
+    }
+
+    private Integer getMnemonic(String key, Locale l) {
+        return SwingUtilities2.getUIDefaultsInt(key, l);
+    }
+
+    protected void installListeners(JFileChooser fc) {
+        super.installListeners(fc);
+        ActionMap actionMap = getActionMap();
+        SwingUtilities.replaceUIActionMap(fc, actionMap);
+    }
+
+    protected ActionMap getActionMap() {
+        return createActionMap();
+    }
+
+    protected ActionMap createActionMap() {
+        ActionMap map = new ActionMapUIResource();
+        FilePane.addActionsToMap(map, filePane.getActions());
+        return map;
+    }
+
+    protected JPanel createList(JFileChooser fc) {
+        return filePane.createList();
+    }
+
+    protected JPanel createDetailsView(JFileChooser fc) {
+        return filePane.createDetailsView();
+    }
+
+    /**
+     * Creates a selection listener for the list of files and directories.
+     *
+     * @param fc a <code>JFileChooser</code>
+     * @return a <code>ListSelectionListener</code>
+     */
+    public ListSelectionListener createListSelectionListener(JFileChooser fc) {
+        return super.createListSelectionListener(fc);
+    }
+
+    // Obsolete class, not used in this version.
+    @SuppressWarnings("serial")
+    protected class WindowsNewFolderAction extends NewFolderAction {
+    }
+
+    // Obsolete class, not used in this version.
+    protected class SingleClickListener extends MouseAdapter {
+    }
+
+    // Obsolete class, not used in this version.
+    @SuppressWarnings("serial") // Superclass is not serializable across versions
+    protected class FileRenderer extends DefaultListCellRenderer  {
+    }
+
+    public void uninstallUI(JComponent c) {
+        // Remove listeners
+        c.removePropertyChangeListener(filterComboBoxModel);
+        c.removePropertyChangeListener(filePane);
+        if (placesBar != null) {
+            c.removePropertyChangeListener(placesBar);
+        }
+        cancelButton.removeActionListener(getCancelSelectionAction());
+        approveButton.removeActionListener(getApproveSelectionAction());
+        filenameTextField.removeActionListener(getApproveSelectionAction());
+
+        if (filePane != null) {
+            filePane.uninstallUI();
+            filePane = null;
+        }
+
+        super.uninstallUI(c);
+    }
+
+    /**
+     * Returns the preferred size of the specified
+     * <code>JFileChooser</code>.
+     * The preferred size is at least as large,
+     * in both height and width,
+     * as the preferred size recommended
+     * by the file chooser's layout manager.
+     *
+     * @param c  a <code>JFileChooser</code>
+     * @return   a <code>Dimension</code> specifying the preferred
+     *           width and height of the file chooser
+     */
+    @Override
+    public Dimension getPreferredSize(JComponent c) {
+        int prefWidth = PREF_SIZE.width;
+        Dimension d = c.getLayout().preferredLayoutSize(c);
+        if (d != null) {
+            return new Dimension(d.width < prefWidth ? prefWidth : d.width,
+                                 d.height < PREF_SIZE.height ? PREF_SIZE.height : d.height);
+        } else {
+            return new Dimension(prefWidth, PREF_SIZE.height);
+        }
+    }
+
+    /**
+     * Returns the minimum size of the <code>JFileChooser</code>.
+     *
+     * @param c  a <code>JFileChooser</code>
+     * @return   a <code>Dimension</code> specifying the minimum
+     *           width and height of the file chooser
+     */
+    @Override
+    public Dimension getMinimumSize(JComponent c) {
+        return new Dimension(MIN_WIDTH, MIN_HEIGHT);
+    }
+
+    /**
+     * Returns the maximum size of the <code>JFileChooser</code>.
+     *
+     * @param c  a <code>JFileChooser</code>
+     * @return   a <code>Dimension</code> specifying the maximum
+     *           width and height of the file chooser
+     */
+    @Override
+    public Dimension getMaximumSize(JComponent c) {
+        return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
+    }
+
+    private String fileNameString(File file) {
+        if (file == null) {
+            return null;
+        } else {
+            JFileChooser fc = getFileChooser();
+            if ((fc.isDirectorySelectionEnabled() && !fc.isFileSelectionEnabled()) ||
+                (fc.isDirectorySelectionEnabled() && fc.isFileSelectionEnabled() && fc.getFileSystemView().isFileSystemRoot(file))){
+                return file.getPath();
+            } else {
+                return file.getName();
+            }
+        }
+    }
+
+    private String fileNameString(File[] files) {
+        StringBuilder buf = new StringBuilder();
+        for (int i = 0; files != null && i < files.length; i++) {
+            if (i > 0) {
+                buf.append(" ");
+            }
+            if (files.length > 1) {
+                buf.append("\"");
+            }
+            buf.append(fileNameString(files[i]));
+            if (files.length > 1) {
+                buf.append("\"");
+            }
+        }
+        return buf.toString();
+    }
+
+    /* The following methods are used by the PropertyChange Listener */
+
+    private void doSelectedFileChanged(PropertyChangeEvent e) {
+        File f = (File) e.getNewValue();
+        JFileChooser fc = getFileChooser();
+        if (f != null
+            && ((fc.isFileSelectionEnabled() && !f.isDirectory())
+                || (f.isDirectory() && fc.isDirectorySelectionEnabled()))) {
+
+            setFileName(fileNameString(f));
+        }
+    }
+
+    private void doSelectedFilesChanged(PropertyChangeEvent e) {
+        File[] files = (File[]) e.getNewValue();
+        JFileChooser fc = getFileChooser();
+        if (files != null
+            && files.length > 0
+            && (files.length > 1 || fc.isDirectorySelectionEnabled() || !files[0].isDirectory())) {
+            setFileName(fileNameString(files));
+        }
+    }
+
+    private void doDirectoryChanged(PropertyChangeEvent e) {
+        JFileChooser fc = getFileChooser();
+        FileSystemView fsv = fc.getFileSystemView();
+
+        clearIconCache();
+        File currentDirectory = fc.getCurrentDirectory();
+        if(currentDirectory != null) {
+            directoryComboBoxModel.addItem(currentDirectory);
+
+            if (fc.isDirectorySelectionEnabled() && !fc.isFileSelectionEnabled()) {
+                if (fsv.isFileSystem(currentDirectory)) {
+                    setFileName(currentDirectory.getPath());
+                } else {
+                    setFileName(null);
+                }
+            }
+        }
+    }
+
+    private void doFilterChanged(PropertyChangeEvent e) {
+        clearIconCache();
+    }
+
+    private void doFileSelectionModeChanged(PropertyChangeEvent e) {
+        if (fileNameLabel != null) {
+            populateFileNameLabel();
+        }
+        clearIconCache();
+
+        JFileChooser fc = getFileChooser();
+        File currentDirectory = fc.getCurrentDirectory();
+        if (currentDirectory != null
+            && fc.isDirectorySelectionEnabled()
+            && !fc.isFileSelectionEnabled()
+            && fc.getFileSystemView().isFileSystem(currentDirectory)) {
+
+            setFileName(currentDirectory.getPath());
+        } else {
+            setFileName(null);
+        }
+    }
+
+    private void doAccessoryChanged(PropertyChangeEvent e) {
+        if(getAccessoryPanel() != null) {
+            if(e.getOldValue() != null) {
+                getAccessoryPanel().remove((JComponent) e.getOldValue());
+            }
+            JComponent accessory = (JComponent) e.getNewValue();
+            if(accessory != null) {
+                getAccessoryPanel().add(accessory, BorderLayout.CENTER);
+            }
+        }
+    }
+
+    private void doApproveButtonTextChanged(PropertyChangeEvent e) {
+        JFileChooser chooser = getFileChooser();
+        approveButton.setText(getApproveButtonText(chooser));
+        approveButton.setToolTipText(getApproveButtonToolTipText(chooser));
+        approveButton.setMnemonic(getApproveButtonMnemonic(chooser));
+    }
+
+    private void doDialogTypeChanged(PropertyChangeEvent e) {
+        JFileChooser chooser = getFileChooser();
+        approveButton.setText(getApproveButtonText(chooser));
+        approveButton.setToolTipText(getApproveButtonToolTipText(chooser));
+        approveButton.setMnemonic(getApproveButtonMnemonic(chooser));
+        if (chooser.getDialogType() == JFileChooser.SAVE_DIALOG) {
+            lookInLabel.setText(saveInLabelText);
+        } else {
+            lookInLabel.setText(lookInLabelText);
+        }
+    }
+
+    private void doApproveButtonMnemonicChanged(PropertyChangeEvent e) {
+        approveButton.setMnemonic(getApproveButtonMnemonic(getFileChooser()));
+    }
+
+    private void doControlButtonsChanged(PropertyChangeEvent e) {
+        if(getFileChooser().getControlButtonsAreShown()) {
+            addControlButtons();
+        } else {
+            removeControlButtons();
+        }
+    }
+
+    /*
+     * Listen for filechooser property changes, such as
+     * the selected file changing, or the type of the dialog changing.
+     */
+    public PropertyChangeListener createPropertyChangeListener(JFileChooser fc) {
+        return new PropertyChangeListener() {
+            public void propertyChange(PropertyChangeEvent e) {
+                String s = e.getPropertyName();
+                if(s.equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) {
+                    doSelectedFileChanged(e);
+                } else if (s.equals(JFileChooser.SELECTED_FILES_CHANGED_PROPERTY)) {
+                    doSelectedFilesChanged(e);
+                } else if(s.equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) {
+                    doDirectoryChanged(e);
+                } else if(s.equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) {
+                    doFilterChanged(e);
+                } else if(s.equals(JFileChooser.FILE_SELECTION_MODE_CHANGED_PROPERTY)) {
+                    doFileSelectionModeChanged(e);
+                } else if(s.equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) {
+                    doAccessoryChanged(e);
+                } else if (s.equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY) ||
+                           s.equals(JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) {
+                    doApproveButtonTextChanged(e);
+                } else if(s.equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY)) {
+                    doDialogTypeChanged(e);
+                } else if(s.equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) {
+                    doApproveButtonMnemonicChanged(e);
+                } else if(s.equals(JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) {
+                    doControlButtonsChanged(e);
+                } else if (s == "FileChooser.useShellFolder") {
+                    updateUseShellFolder();
+                    doDirectoryChanged(e);
+                } else if (s.equals("componentOrientation")) {
+                    ComponentOrientation o = (ComponentOrientation)e.getNewValue();
+                    JFileChooser cc = (JFileChooser)e.getSource();
+                    if (o != e.getOldValue()) {
+                        cc.applyComponentOrientation(o);
+                    }
+                } else if (s.equals("ancestor")) {
+                    if (e.getOldValue() == null && e.getNewValue() != null) {
+                        // Ancestor was added, set initial focus
+                        filenameTextField.selectAll();
+                        filenameTextField.requestFocus();
+                    }
+                }
+            }
+        };
+    }
+
+
+    protected void removeControlButtons() {
+        getBottomPanel().remove(getButtonPanel());
+    }
+
+    protected void addControlButtons() {
+        getBottomPanel().add(getButtonPanel());
+    }
+
+    public void ensureFileIsVisible(JFileChooser fc, File f) {
+        filePane.ensureFileIsVisible(fc, f);
+    }
+
+    public void rescanCurrentDirectory(JFileChooser fc) {
+        filePane.rescanCurrentDirectory();
+    }
+
+    public String getFileName() {
+        if(filenameTextField != null) {
+            return filenameTextField.getText();
+        } else {
+            return null;
+        }
+    }
+
+    public void setFileName(String filename) {
+        if(filenameTextField != null) {
+            filenameTextField.setText(filename);
+        }
+    }
+
+    /**
+     * Property to remember whether a directory is currently selected in the UI.
+     * This is normally called by the UI on a selection event.
+     *
+     * @param directorySelected if a directory is currently selected.
+     * @since 1.4
+     */
+    protected void setDirectorySelected(boolean directorySelected) {
+        super.setDirectorySelected(directorySelected);
+        JFileChooser chooser = getFileChooser();
+        if(directorySelected) {
+            approveButton.setText(directoryOpenButtonText);
+            approveButton.setToolTipText(directoryOpenButtonToolTipText);
+            approveButton.setMnemonic(directoryOpenButtonMnemonic);
+        } else {
+            approveButton.setText(getApproveButtonText(chooser));
+            approveButton.setToolTipText(getApproveButtonToolTipText(chooser));
+            approveButton.setMnemonic(getApproveButtonMnemonic(chooser));
+        }
+    }
+
+    public String getDirectoryName() {
+        // PENDING(jeff) - get the name from the directory combobox
+        return null;
+    }
+
+    public void setDirectoryName(String dirname) {
+        // PENDING(jeff) - set the name in the directory combobox
+    }
+
+    protected DirectoryComboBoxRenderer createDirectoryComboBoxRenderer(JFileChooser fc) {
+        return new DirectoryComboBoxRenderer();
+    }
+
+    @SuppressWarnings("serial") // anonymous class
+    private static JButton createToolButton(Action a, Icon defaultIcon, String toolTipText, String accessibleName) {
+        final JButton result = new JButton(a);
+
+        result.setText(null);
+        result.setIcon(defaultIcon);
+        result.setToolTipText(toolTipText);
+        result.setRequestFocusEnabled(false);
+        result.putClientProperty(AccessibleContext.ACCESSIBLE_NAME_PROPERTY, accessibleName);
+        result.putClientProperty(WindowsLookAndFeel.HI_RES_DISABLED_ICON_CLIENT_KEY, Boolean.TRUE);
+        result.setAlignmentX(JComponent.LEFT_ALIGNMENT);
+        result.setAlignmentY(JComponent.CENTER_ALIGNMENT);
+        result.setMargin(shrinkwrap);
+        result.setFocusPainted(false);
+
+        result.setModel(new DefaultButtonModel() {
+            public void setPressed(boolean b) {
+                // Forbid keyboard actions if the button is not in rollover state
+                if (!b || isRollover()) {
+                    super.setPressed(b);
+                }
+            }
+
+            public void setRollover(boolean b) {
+                if (b && !isRollover()) {
+                    // Reset other buttons
+                    for (Component component : result.getParent().getComponents()) {
+                        if (component instanceof JButton && component != result) {
+                            ((JButton) component).getModel().setRollover(false);
+                        }
+                    }
+                }
+
+                super.setRollover(b);
+            }
+
+            public void setSelected(boolean b) {
+                super.setSelected(b);
+
+                if (b) {
+                    stateMask |= PRESSED | ARMED;
+                } else {
+                    stateMask &= ~(PRESSED | ARMED);
+                }
+            }
+        });
+
+        result.addFocusListener(new FocusAdapter() {
+            public void focusGained(FocusEvent e) {
+                result.getModel().setRollover(true);
+            }
+
+            public void focusLost(FocusEvent e) {
+                result.getModel().setRollover(false);
+            }
+        });
+
+        return result;
+    }
+
+    //
+    // Renderer for DirectoryComboBox
+    //
+    @SuppressWarnings("serial") // Superclass is not serializable across versions
+    class DirectoryComboBoxRenderer extends DefaultListCellRenderer  {
+        IndentIcon ii = new IndentIcon();
+        public Component getListCellRendererComponent(JList<?> list, Object value,
+                                                      int index, boolean isSelected,
+                                                      boolean cellHasFocus) {
+
+            super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
+
+            if (value == null) {
+                setText("");
+                return this;
+            }
+            File directory = (File)value;
+            setText(getFileChooser().getName(directory));
+            Icon icon = getFileChooser().getIcon(directory);
+            ii.icon = icon;
+            ii.depth = directoryComboBoxModel.getDepth(index);
+            setIcon(ii);
+
+            return this;
+        }
+    }
+
+    static final int space = 10;
+    class IndentIcon implements Icon {
+
+        Icon icon = null;
+        int depth = 0;
+
+        public void paintIcon(Component c, Graphics g, int x, int y) {
+            if (c.getComponentOrientation().isLeftToRight()) {
+                icon.paintIcon(c, g, x+depth*space, y);
+            } else {
+                icon.paintIcon(c, g, x, y);
+            }
+        }
+
+        public int getIconWidth() {
+            return icon.getIconWidth() + depth*space;
+        }
+
+        public int getIconHeight() {
+            return icon.getIconHeight();
+        }
+
+    }
+
+    //
+    // DataModel for DirectoryComboxbox
+    //
+    protected DirectoryComboBoxModel createDirectoryComboBoxModel(JFileChooser fc) {
+        return new DirectoryComboBoxModel();
+    }
+
+    /**
+     * Data model for a type-face selection combo-box.
+     */
+    @SuppressWarnings("serial") // Superclass is not serializable across versions
+    protected class DirectoryComboBoxModel extends AbstractListModel<File> implements ComboBoxModel<File> {
+        Vector<File> directories = new Vector<File>();
+        int[] depths = null;
+        File selectedDirectory = null;
+        JFileChooser chooser = getFileChooser();
+        FileSystemView fsv = chooser.getFileSystemView();
+
+        public DirectoryComboBoxModel() {
+            // Add the current directory to the model, and make it the
+            // selectedDirectory
+            File dir = getFileChooser().getCurrentDirectory();
+            if(dir != null) {
+                addItem(dir);
+            }
+        }
+
+        /**
+         * Adds the directory to the model and sets it to be selected,
+         * additionally clears out the previous selected directory and
+         * the paths leading up to it, if any.
+         */
+        private void addItem(File directory) {
+
+            if(directory == null) {
+                return;
+            }
+
+            boolean useShellFolder = FilePane.usesShellFolder(chooser);
+
+            directories.clear();
+
+            File[] baseFolders = (useShellFolder)
+                    ? (File[]) ShellFolder.get("fileChooserComboBoxFolders")
+                    : fsv.getRoots();
+            directories.addAll(Arrays.asList(baseFolders));
+
+            // Get the canonical (full) path. This has the side
+            // benefit of removing extraneous chars from the path,
+            // for example /foo/bar/ becomes /foo/bar
+            File canonical;
+            try {
+                canonical = directory.getCanonicalFile();
+            } catch (IOException e) {
+                // Maybe drive is not ready. Can't abort here.
+                canonical = directory;
+            }
+
+            // create File instances of each directory leading up to the top
+            try {
+                File sf = useShellFolder ? ShellFolder.getShellFolder(canonical)
+                                         : canonical;
+                File f = sf;
+                Vector<File> path = new Vector<File>(10);
+                do {
+                    path.addElement(f);
+                } while ((f = f.getParentFile()) != null);
+
+                int pathCount = path.size();
+                // Insert chain at appropriate place in vector
+                for (int i = 0; i < pathCount; i++) {
+                    f = path.get(i);
+                    if (directories.contains(f)) {
+                        int topIndex = directories.indexOf(f);
+                        for (int j = i-1; j >= 0; j--) {
+                            directories.insertElementAt(path.get(j), topIndex+i-j);
+                        }
+                        break;
+                    }
+                }
+                calculateDepths();
+                setSelectedItem(sf);
+            } catch (FileNotFoundException ex) {
+                calculateDepths();
+            }
+        }
+
+        private void calculateDepths() {
+            depths = new int[directories.size()];
+            for (int i = 0; i < depths.length; i++) {
+                File dir = directories.get(i);
+                File parent = dir.getParentFile();
+                depths[i] = 0;
+                if (parent != null) {
+                    for (int j = i-1; j >= 0; j--) {
+                        if (parent.equals(directories.get(j))) {
+                            depths[i] = depths[j] + 1;
+                            break;
+                        }
+                    }
+                }
+            }
+        }
+
+        public int getDepth(int i) {
+            return (depths != null && i >= 0 && i < depths.length) ? depths[i] : 0;
+        }
+
+        public void setSelectedItem(Object selectedDirectory) {
+            this.selectedDirectory = (File)selectedDirectory;
+            fireContentsChanged(this, -1, -1);
+        }
+
+        public Object getSelectedItem() {
+            return selectedDirectory;
+        }
+
+        public int getSize() {
+            return directories.size();
+        }
+
+        public File getElementAt(int index) {
+            return directories.elementAt(index);
+        }
+    }
+
+    //
+    // Renderer for Types ComboBox
+    //
+    protected FilterComboBoxRenderer createFilterComboBoxRenderer() {
+        return new FilterComboBoxRenderer();
+    }
+
+    /**
+     * Render different type sizes and styles.
+     */
+    @SuppressWarnings("serial") // Superclass is not serializable across versions
+    public class FilterComboBoxRenderer extends DefaultListCellRenderer {
+        public Component getListCellRendererComponent(JList<?> list,
+            Object value, int index, boolean isSelected,
+            boolean cellHasFocus) {
+
+            super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
+
+            if (value != null && value instanceof FileFilter) {
+                setText(((FileFilter)value).getDescription());
+            }
+
+            return this;
+        }
+    }
+
+    //
+    // DataModel for Types Comboxbox
+    //
+    protected FilterComboBoxModel createFilterComboBoxModel() {
+        return new FilterComboBoxModel();
+    }
+
+    /**
+     * Data model for a type-face selection combo-box.
+     */
+    @SuppressWarnings("serial") // Superclass is not serializable across versions
+    protected class FilterComboBoxModel extends AbstractListModel<FileFilter> implements ComboBoxModel<FileFilter>,
+            PropertyChangeListener {
+        protected FileFilter[] filters;
+        protected FilterComboBoxModel() {
+            super();
+            filters = getFileChooser().getChoosableFileFilters();
+        }
+
+        public void propertyChange(PropertyChangeEvent e) {
+            String prop = e.getPropertyName();
+            if(prop == JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) {
+                filters = (FileFilter[]) e.getNewValue();
+                fireContentsChanged(this, -1, -1);
+            } else if (prop == JFileChooser.FILE_FILTER_CHANGED_PROPERTY) {
+                fireContentsChanged(this, -1, -1);
+            }
+        }
+
+        public void setSelectedItem(Object filter) {
+            if(filter != null) {
+                getFileChooser().setFileFilter((FileFilter) filter);
+                fireContentsChanged(this, -1, -1);
+            }
+        }
+
+        public Object getSelectedItem() {
+            // Ensure that the current filter is in the list.
+            // NOTE: we shouldnt' have to do this, since JFileChooser adds
+            // the filter to the choosable filters list when the filter
+            // is set. Lets be paranoid just in case someone overrides
+            // setFileFilter in JFileChooser.
+            FileFilter currentFilter = getFileChooser().getFileFilter();
+            boolean found = false;
+            if(currentFilter != null) {
+                for (FileFilter filter : filters) {
+                    if (filter == currentFilter) {
+                        found = true;
+                    }
+                }
+                if(found == false) {
+                    getFileChooser().addChoosableFileFilter(currentFilter);
+                }
+            }
+            return getFileChooser().getFileFilter();
+        }
+
+        public int getSize() {
+            if(filters != null) {
+                return filters.length;
+            } else {
+                return 0;
+            }
+        }
+
+        public FileFilter getElementAt(int index) {
+            if(index > getSize() - 1) {
+                // This shouldn't happen. Try to recover gracefully.
+                return getFileChooser().getFileFilter();
+            }
+            if(filters != null) {
+                return filters[index];
+            } else {
+                return null;
+            }
+        }
+    }
+
+    public void valueChanged(ListSelectionEvent e) {
+        JFileChooser fc = getFileChooser();
+        File f = fc.getSelectedFile();
+        if (!e.getValueIsAdjusting() && f != null && !getFileChooser().isTraversable(f)) {
+            setFileName(fileNameString(f));
+        }
+    }
+
+    /**
+     * Acts when DirectoryComboBox has changed the selected item.
+     */
+    protected class DirectoryComboBoxAction implements ActionListener {
+
+
+
+
+        public void actionPerformed(ActionEvent e) {
+            File f = (File)directoryComboBox.getSelectedItem();
+            getFileChooser().setCurrentDirectory(f);
+        }
+    }
+
+    protected JButton getApproveButton(JFileChooser fc) {
+        return approveButton;
+    }
+
+    public FileView getFileView(JFileChooser fc) {
+        return fileView;
+    }
+
+    // ***********************
+    // * FileView operations *
+    // ***********************
+    protected class WindowsFileView extends BasicFileView {
+        /* FileView type descriptions */
+
+        public Icon getIcon(File f) {
+            Icon icon = getCachedIcon(f);
+            if (icon != null) {
+                return icon;
+            }
+            if (f != null) {
+                icon = getFileChooser().getFileSystemView().getSystemIcon(f);
+            }
+            if (icon == null) {
+                icon = super.getIcon(f);
+            }
+            cacheIcon(f, icon);
+            return icon;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsGraphicsUtils.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,236 @@
+/*
+ * 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import sun.swing.SwingUtilities2;
+
+import java.awt.*;
+
+import javax.swing.*;
+import javax.swing.plaf.UIResource;
+
+import static com.sun.java.swing.plaf.windows.TMSchema.*;
+
+/**
+ * A collection of static utility methods used for rendering the Windows look
+ * and feel.
+ *
+ * @author Mark Davidson
+ * @since 1.4
+ */
+public class WindowsGraphicsUtils {
+
+    /**
+     * Renders a text String in Windows without the mnemonic.
+     * This is here because the WindowsUI hierarchy doesn't match the Component hierarchy. All
+     * the overriden paintText methods of the ButtonUI delegates will call this static method.
+     *
+     * @param g Graphics context
+     * @param b Current button to render
+     * @param textRect Bounding rectangle to render the text.
+     * @param text String to render
+     */
+    public static void paintText(Graphics g, AbstractButton b,
+                                        Rectangle textRect, String text,
+                                        int textShiftOffset) {
+        FontMetrics fm = SwingUtilities2.getFontMetrics(b, g);
+
+        int mnemIndex = b.getDisplayedMnemonicIndex();
+        // W2K Feature: Check to see if the Underscore should be rendered.
+        if (WindowsLookAndFeel.isMnemonicHidden() == true) {
+            mnemIndex = -1;
+        }
+
+        XPStyle xp = XPStyle.getXP();
+        if (xp != null && !(b instanceof JMenuItem)) {
+            paintXPText(b, g, textRect.x + textShiftOffset,
+                    textRect.y + fm.getAscent() + textShiftOffset,
+                    text, mnemIndex);
+        } else {
+            paintClassicText(b, g, textRect.x + textShiftOffset,
+                    textRect.y + fm.getAscent() + textShiftOffset,
+                    text, mnemIndex);
+        }
+    }
+
+    static void paintClassicText(AbstractButton b, Graphics g, int x, int y,
+                                 String text, int mnemIndex) {
+        ButtonModel model = b.getModel();
+
+        /* Draw the Text */
+        Color color = b.getForeground();
+        if(model.isEnabled()) {
+            /*** paint the text normally */
+            if(!(b instanceof JMenuItem && model.isArmed())
+                && !(b instanceof JMenu && (model.isSelected() || model.isRollover()))) {
+                /* We shall not set foreground color for selected menu or
+                 * armed menuitem. Foreground must be set in appropriate
+                 * Windows* class because these colors passes from
+                 * BasicMenuItemUI as protected fields and we can't
+                 * reach them from this class */
+                g.setColor(b.getForeground());
+            }
+            SwingUtilities2.drawStringUnderlineCharAt(b, g,text, mnemIndex, x, y);
+        } else {        /*** paint the text disabled ***/
+            color = getDisabledTextColor(b);
+            if (color == null) {
+                color = UIManager.getColor("Button.shadow");
+            }
+            Color shadow = UIManager.getColor("Button.disabledShadow");
+            if(model.isArmed()) {
+                color = UIManager.getColor("Button.disabledForeground");
+            } else {
+                if (shadow == null) {
+                    shadow = b.getBackground().darker();
+                }
+                g.setColor(shadow);
+                SwingUtilities2.drawStringUnderlineCharAt(b, g, text, mnemIndex,
+                                                          x + 1, y + 1);
+            }
+            if (color == null) {
+                color = b.getBackground().brighter();
+            }
+            g.setColor(color);
+            SwingUtilities2.drawStringUnderlineCharAt(b, g, text, mnemIndex, x, y);
+        }
+    }
+
+    private static Color getDisabledTextColor(AbstractButton b) {
+        if (b instanceof JCheckBox) {
+            return UIManager.getColor("CheckBox.disabledText");
+        } else if (b instanceof JRadioButton) {
+            return UIManager.getColor("RadioButton.disabledText");
+        } else if (b instanceof JToggleButton) {
+            return  UIManager.getColor("ToggleButton.disabledText");
+        } else if (b instanceof JButton) {
+            return UIManager.getColor("Button.disabledText");
+        }
+        return null;
+    }
+
+    static void paintXPText(AbstractButton b, Graphics g, int x, int y,
+                            String text, int mnemIndex) {
+        Part part = WindowsButtonUI.getXPButtonType(b);
+        State state = WindowsButtonUI.getXPButtonState(b);
+        paintXPText(b, part, state, g, x, y, text, mnemIndex);
+    }
+
+    static void paintXPText(AbstractButton b, Part part, State state,
+            Graphics g, int x, int y, String text, int mnemIndex) {
+        XPStyle xp = XPStyle.getXP();
+        if (xp == null) {
+            return;
+        }
+        Color textColor;
+        if (b.isEnabled()) {
+            textColor = b.getForeground();
+        }
+        else {
+            textColor = getDisabledTextColor(b);
+        }
+
+        if (textColor == null || textColor instanceof UIResource) {
+            textColor = xp.getColor(b, part, state, Prop.TEXTCOLOR, b.getForeground());
+            // to work around an apparent bug in Windows, use the pushbutton
+            // color for disabled toolbar buttons if the disabled color is the
+            // same as the enabled color
+            if (part == Part.TP_BUTTON && state == State.DISABLED) {
+                Color enabledColor = xp.getColor(b, part, State.NORMAL,
+                                     Prop.TEXTCOLOR, b.getForeground());
+                if(textColor.equals(enabledColor)) {
+                    textColor = xp.getColor(b, Part.BP_PUSHBUTTON, state,
+                                Prop.TEXTCOLOR, textColor);
+                }
+            }
+            // only draw shadow if developer hasn't changed the foreground color
+            // and if the current style has text shadows.
+            TypeEnum shadowType = xp.getTypeEnum(b, part,
+                                                 state, Prop.TEXTSHADOWTYPE);
+            if (shadowType == TypeEnum.TST_SINGLE ||
+                        shadowType == TypeEnum.TST_CONTINUOUS) {
+                Color shadowColor = xp.getColor(b, part, state,
+                                                Prop.TEXTSHADOWCOLOR, Color.black);
+                Point offset = xp.getPoint(b, part, state, Prop.TEXTSHADOWOFFSET);
+                if (offset != null) {
+                    g.setColor(shadowColor);
+                    SwingUtilities2.drawStringUnderlineCharAt(b, g, text, mnemIndex,
+                                                              x + offset.x,
+                                                              y + offset.y);
+                }
+            }
+        }
+
+        g.setColor(textColor);
+        SwingUtilities2.drawStringUnderlineCharAt(b, g, text, mnemIndex, x, y);
+    }
+
+    static boolean isLeftToRight(Component c) {
+        return c.getComponentOrientation().isLeftToRight();
+    }
+
+    /*
+     * Repaints all the components with the mnemonics in the given window and
+     * all its owned windows.
+     */
+    static void repaintMnemonicsInWindow(Window w) {
+        if(w == null || !w.isShowing()) {
+            return;
+        }
+
+        Window[] ownedWindows = w.getOwnedWindows();
+        for(int i=0;i<ownedWindows.length;i++) {
+            repaintMnemonicsInWindow(ownedWindows[i]);
+        }
+
+        repaintMnemonicsInContainer(w);
+    }
+
+    /*
+     * Repaints all the components with the mnemonics in container.
+     * Recursively searches for all the subcomponents.
+     */
+    static void repaintMnemonicsInContainer(Container cont) {
+        Component c;
+        for(int i=0; i<cont.getComponentCount(); i++) {
+            c = cont.getComponent(i);
+            if(c == null || !c.isVisible()) {
+                continue;
+            }
+            if(c instanceof AbstractButton
+               && ((AbstractButton)c).getMnemonic() != '\0') {
+                c.repaint();
+                continue;
+            } else if(c instanceof JLabel
+                      && ((JLabel)c).getDisplayedMnemonic() != '\0') {
+                c.repaint();
+                continue;
+            }
+            if(c instanceof Container) {
+                repaintMnemonicsInContainer((Container)c);
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsIconFactory.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,974 @@
+/*
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import javax.swing.*;
+import javax.swing.plaf.ButtonUI;
+import javax.swing.plaf.UIResource;
+
+import java.awt.*;
+import java.io.Serializable;
+
+import static com.sun.java.swing.plaf.windows.TMSchema.*;
+import static com.sun.java.swing.plaf.windows.XPStyle.Skin;
+
+import sun.swing.MenuItemCheckIconFactory;
+import sun.swing.SwingUtilities2;
+
+/**
+ * Factory object that can vend Icons appropriate for the Windows {@literal L & F}.
+ * <p>
+ * <strong>Warning:</strong>
+ * Serialized objects of this class will not be compatible with
+ * future Swing releases.  The current serialization support is appropriate
+ * for short term storage or RMI between applications running the same
+ * version of Swing.  A future release of Swing will provide support for
+ * long term persistence.
+ *
+ * @author David Kloba
+ * @author Georges Saab
+ * @author Rich Schiavi
+ */
+@SuppressWarnings("serial") // Same-version serialization only
+public class WindowsIconFactory implements Serializable
+{
+    private static Icon frame_closeIcon;
+    private static Icon frame_iconifyIcon;
+    private static Icon frame_maxIcon;
+    private static Icon frame_minIcon;
+    private static Icon frame_resizeIcon;
+    private static Icon checkBoxIcon;
+    private static Icon radioButtonIcon;
+    private static Icon checkBoxMenuItemIcon;
+    private static Icon radioButtonMenuItemIcon;
+    private static Icon menuItemCheckIcon;
+    private static Icon menuItemArrowIcon;
+    private static Icon menuArrowIcon;
+    private static VistaMenuItemCheckIconFactory menuItemCheckIconFactory;
+
+    public static Icon getMenuItemCheckIcon() {
+        if (menuItemCheckIcon == null) {
+            menuItemCheckIcon = new MenuItemCheckIcon();
+        }
+        return menuItemCheckIcon;
+    }
+
+    public static Icon getMenuItemArrowIcon() {
+        if (menuItemArrowIcon == null) {
+            menuItemArrowIcon = new MenuItemArrowIcon();
+        }
+        return menuItemArrowIcon;
+    }
+
+    public static Icon getMenuArrowIcon() {
+        if (menuArrowIcon == null) {
+            menuArrowIcon = new MenuArrowIcon();
+        }
+        return menuArrowIcon;
+    }
+
+    public static Icon getCheckBoxIcon() {
+        if (checkBoxIcon == null) {
+            checkBoxIcon = new CheckBoxIcon();
+        }
+        return checkBoxIcon;
+    }
+
+    public static Icon getRadioButtonIcon() {
+        if (radioButtonIcon == null) {
+            radioButtonIcon = new RadioButtonIcon();
+        }
+        return radioButtonIcon;
+    }
+
+    public static Icon getCheckBoxMenuItemIcon() {
+        if (checkBoxMenuItemIcon == null) {
+            checkBoxMenuItemIcon = new CheckBoxMenuItemIcon();
+        }
+        return checkBoxMenuItemIcon;
+    }
+
+    public static Icon getRadioButtonMenuItemIcon() {
+        if (radioButtonMenuItemIcon == null) {
+            radioButtonMenuItemIcon = new RadioButtonMenuItemIcon();
+        }
+        return radioButtonMenuItemIcon;
+    }
+
+    static
+    synchronized VistaMenuItemCheckIconFactory getMenuItemCheckIconFactory() {
+        if (menuItemCheckIconFactory == null) {
+            menuItemCheckIconFactory =
+                new VistaMenuItemCheckIconFactory();
+        }
+        return menuItemCheckIconFactory;
+    }
+
+    public static Icon createFrameCloseIcon() {
+        if (frame_closeIcon == null) {
+            frame_closeIcon = new FrameButtonIcon(Part.WP_CLOSEBUTTON);
+        }
+        return frame_closeIcon;
+    }
+
+    public static Icon createFrameIconifyIcon() {
+        if (frame_iconifyIcon == null) {
+            frame_iconifyIcon = new FrameButtonIcon(Part.WP_MINBUTTON);
+        }
+        return frame_iconifyIcon;
+    }
+
+    public static Icon createFrameMaximizeIcon() {
+        if (frame_maxIcon == null) {
+            frame_maxIcon = new FrameButtonIcon(Part.WP_MAXBUTTON);
+        }
+        return frame_maxIcon;
+    }
+
+    public static Icon createFrameMinimizeIcon() {
+        if (frame_minIcon == null) {
+            frame_minIcon = new FrameButtonIcon(Part.WP_RESTOREBUTTON);
+        }
+        return frame_minIcon;
+    }
+
+    public static Icon createFrameResizeIcon() {
+        if(frame_resizeIcon == null)
+            frame_resizeIcon = new ResizeIcon();
+        return frame_resizeIcon;
+    }
+
+
+    @SuppressWarnings("serial") // Same-version serialization only
+    private static class FrameButtonIcon implements Icon, Serializable {
+        private Part part;
+
+        private FrameButtonIcon(Part part) {
+            this.part = part;
+        }
+
+        public void paintIcon(Component c, Graphics g, int x0, int y0) {
+            int width = getIconWidth();
+            int height = getIconHeight();
+
+            XPStyle xp = XPStyle.getXP();
+            if (xp != null) {
+                Skin skin = xp.getSkin(c, part);
+                AbstractButton b = (AbstractButton)c;
+                ButtonModel model = b.getModel();
+
+                // Find out if frame is inactive
+                JInternalFrame jif = (JInternalFrame)SwingUtilities.
+                                        getAncestorOfClass(JInternalFrame.class, b);
+                boolean jifSelected = (jif != null && jif.isSelected());
+
+                State state;
+                if (jifSelected) {
+                    if (!model.isEnabled()) {
+                        state = State.DISABLED;
+                    } else if (model.isArmed() && model.isPressed()) {
+                        state = State.PUSHED;
+                    } else if (model.isRollover()) {
+                        state = State.HOT;
+                    } else {
+                        state = State.NORMAL;
+                    }
+                } else {
+                    if (!model.isEnabled()) {
+                        state = State.INACTIVEDISABLED;
+                    } else if (model.isArmed() && model.isPressed()) {
+                        state = State.INACTIVEPUSHED;
+                    } else if (model.isRollover()) {
+                        state = State.INACTIVEHOT;
+                    } else {
+                        state = State.INACTIVENORMAL;
+                    }
+                }
+                skin.paintSkin(g, 0, 0, width, height, state);
+            } else {
+                g.setColor(Color.black);
+                int x = width / 12 + 2;
+                int y = height / 5;
+                int h = height - y * 2 - 1;
+                int w = width * 3/4 -3;
+                int thickness2 = Math.max(height / 8, 2);
+                int thickness  = Math.max(width / 15, 1);
+                if (part == Part.WP_CLOSEBUTTON) {
+                    int lineWidth;
+                    if      (width > 47) lineWidth = 6;
+                    else if (width > 37) lineWidth = 5;
+                    else if (width > 26) lineWidth = 4;
+                    else if (width > 16) lineWidth = 3;
+                    else if (width > 12) lineWidth = 2;
+                    else                 lineWidth = 1;
+                    y = height / 12 + 2;
+                    if (lineWidth == 1) {
+                        if (w % 2 == 1) { x++; w++; }
+                        g.drawLine(x,     y, x+w-2, y+w-2);
+                        g.drawLine(x+w-2, y, x,     y+w-2);
+                    } else if (lineWidth == 2) {
+                        if (w > 6) { x++; w--; }
+                        g.drawLine(x,     y, x+w-2, y+w-2);
+                        g.drawLine(x+w-2, y, x,     y+w-2);
+                        g.drawLine(x+1,   y, x+w-1, y+w-2);
+                        g.drawLine(x+w-1, y, x+1,   y+w-2);
+                    } else {
+                        x += 2; y++; w -= 2;
+                        g.drawLine(x,     y,   x+w-1, y+w-1);
+                        g.drawLine(x+w-1, y,   x,     y+w-1);
+                        g.drawLine(x+1,   y,   x+w-1, y+w-2);
+                        g.drawLine(x+w-2, y,   x,     y+w-2);
+                        g.drawLine(x,     y+1, x+w-2, y+w-1);
+                        g.drawLine(x+w-1, y+1, x+1,   y+w-1);
+                        for (int i = 4; i <= lineWidth; i++) {
+                            g.drawLine(x+i-2,   y,     x+w-1,   y+w-i+1);
+                            g.drawLine(x,       y+i-2, x+w-i+1, y+w-1);
+                            g.drawLine(x+w-i+1, y,     x,       y+w-i+1);
+                            g.drawLine(x+w-1,   y+i-2, x+i-2,   y+w-1);
+                        }
+                    }
+                } else if (part == Part.WP_MINBUTTON) {
+                    g.fillRect(x, y+h-thickness2, w-w/3, thickness2);
+                } else if (part == Part.WP_MAXBUTTON) {
+                    g.fillRect(x, y, w, thickness2);
+                    g.fillRect(x, y, thickness, h);
+                    g.fillRect(x+w-thickness, y, thickness, h);
+                    g.fillRect(x, y+h-thickness, w, thickness);
+                } else if (part == Part.WP_RESTOREBUTTON) {
+                    g.fillRect(x+w/3, y, w-w/3, thickness2);
+                    g.fillRect(x+w/3, y, thickness, h/3);
+                    g.fillRect(x+w-thickness, y, thickness, h-h/3);
+                    g.fillRect(x+w-w/3, y+h-h/3-thickness, w/3, thickness);
+
+                    g.fillRect(x, y+h/3, w-w/3, thickness2);
+                    g.fillRect(x, y+h/3, thickness, h-h/3);
+                    g.fillRect(x+w-w/3-thickness, y+h/3, thickness, h-h/3);
+                    g.fillRect(x, y+h-thickness, w-w/3, thickness);
+                }
+            }
+        }
+
+        public int getIconWidth() {
+            int width;
+            if (XPStyle.getXP() != null) {
+                // Fix for XP bug where sometimes these sizes aren't updated properly
+                // Assume for now that height is correct and derive width using the
+                // ratio from the uxtheme part
+                width = UIManager.getInt("InternalFrame.titleButtonHeight") -2;
+                Dimension d = XPStyle.getPartSize(Part.WP_CLOSEBUTTON, State.NORMAL);
+                if (d != null && d.width != 0 && d.height != 0) {
+                    width = (int) ((float) width * d.width / d.height);
+                }
+            } else {
+                width = UIManager.getInt("InternalFrame.titleButtonWidth") -2;
+            }
+            if (XPStyle.getXP() != null) {
+                width -= 2;
+            }
+            return width;
+        }
+
+        public int getIconHeight() {
+            int height = UIManager.getInt("InternalFrame.titleButtonHeight")-4;
+            return height;
+        }
+    }
+
+
+
+        @SuppressWarnings("serial") // Same-version serialization only
+        private static class ResizeIcon implements Icon, Serializable {
+            public void paintIcon(Component c, Graphics g, int x, int y) {
+                g.setColor(UIManager.getColor("InternalFrame.resizeIconHighlight"));
+                g.drawLine(0, 11, 11, 0);
+                g.drawLine(4, 11, 11, 4);
+                g.drawLine(8, 11, 11, 8);
+
+                g.setColor(UIManager.getColor("InternalFrame.resizeIconShadow"));
+                g.drawLine(1, 11, 11, 1);
+                g.drawLine(2, 11, 11, 2);
+                g.drawLine(5, 11, 11, 5);
+                g.drawLine(6, 11, 11, 6);
+                g.drawLine(9, 11, 11, 9);
+                g.drawLine(10, 11, 11, 10);
+            }
+            public int getIconWidth() { return 13; }
+            public int getIconHeight() { return 13; }
+        };
+
+    @SuppressWarnings("serial") // Same-version serialization only
+    private static class CheckBoxIcon implements Icon, Serializable
+    {
+        static final int csize = 13;
+        public void paintIcon(Component c, Graphics g, int x, int y) {
+            JCheckBox cb = (JCheckBox) c;
+            ButtonModel model = cb.getModel();
+            XPStyle xp = XPStyle.getXP();
+
+            if (xp != null) {
+                State state;
+                if (model.isSelected()) {
+                    state = State.CHECKEDNORMAL;
+                    if (!model.isEnabled()) {
+                        state = State.CHECKEDDISABLED;
+                    } else if (model.isPressed() && model.isArmed()) {
+                        state = State.CHECKEDPRESSED;
+                    } else if (model.isRollover()) {
+                        state = State.CHECKEDHOT;
+                    }
+                } else {
+                    state = State.UNCHECKEDNORMAL;
+                    if (!model.isEnabled()) {
+                        state = State.UNCHECKEDDISABLED;
+                    } else if (model.isPressed() && model.isArmed()) {
+                        state = State.UNCHECKEDPRESSED;
+                    } else if (model.isRollover()) {
+                        state = State.UNCHECKEDHOT;
+                    }
+                }
+                Part part = Part.BP_CHECKBOX;
+                xp.getSkin(c, part).paintSkin(g, x, y, state);
+            } else {
+                // outer bevel
+                if(!cb.isBorderPaintedFlat()) {
+                    // Outer top/left
+                    g.setColor(UIManager.getColor("CheckBox.shadow"));
+                    g.drawLine(x, y, x+11, y);
+                    g.drawLine(x, y+1, x, y+11);
+
+                    // Outer bottom/right
+                    g.setColor(UIManager.getColor("CheckBox.highlight"));
+                    g.drawLine(x+12, y, x+12, y+12);
+                    g.drawLine(x, y+12, x+11, y+12);
+
+                    // Inner top.left
+                    g.setColor(UIManager.getColor("CheckBox.darkShadow"));
+                    g.drawLine(x+1, y+1, x+10, y+1);
+                    g.drawLine(x+1, y+2, x+1, y+10);
+
+                    // Inner bottom/right
+                    g.setColor(UIManager.getColor("CheckBox.light"));
+                    g.drawLine(x+1, y+11, x+11, y+11);
+                    g.drawLine(x+11, y+1, x+11, y+10);
+
+                    // inside box
+                    if((model.isPressed() && model.isArmed()) || !model.isEnabled()) {
+                        g.setColor(UIManager.getColor("CheckBox.background"));
+                    } else {
+                        g.setColor(UIManager.getColor("CheckBox.interiorBackground"));
+                    }
+                    g.fillRect(x+2, y+2, csize-4, csize-4);
+                } else {
+                    g.setColor(UIManager.getColor("CheckBox.shadow"));
+                    g.drawRect(x+1, y+1, csize-3, csize-3);
+
+                    if((model.isPressed() && model.isArmed()) || !model.isEnabled()) {
+                        g.setColor(UIManager.getColor("CheckBox.background"));
+                    } else {
+                        g.setColor(UIManager.getColor("CheckBox.interiorBackground"));
+                    }
+                    g.fillRect(x+2, y+2, csize-4, csize-4);
+                }
+
+                if(model.isEnabled()) {
+                    g.setColor(UIManager.getColor("CheckBox.foreground"));
+                } else {
+                    g.setColor(UIManager.getColor("CheckBox.shadow"));
+                }
+
+                // paint check
+                if (model.isSelected()) {
+                    if (SwingUtilities2.isScaledGraphics(g)) {
+                        int[] xPoints = {3, 5, 9, 9, 5, 3};
+                        int[] yPoints = {5, 7, 3, 5, 9, 7};
+                        g.translate(x, y);
+                        g.fillPolygon(xPoints, yPoints, 6);
+                        g.drawPolygon(xPoints, yPoints, 6);
+                        g.translate(-x, -y);
+                    } else {
+                        g.drawLine(x + 9, y + 3, x + 9, y + 3);
+                        g.drawLine(x + 8, y + 4, x + 9, y + 4);
+                        g.drawLine(x + 7, y + 5, x + 9, y + 5);
+                        g.drawLine(x + 6, y + 6, x + 8, y + 6);
+                        g.drawLine(x + 3, y + 7, x + 7, y + 7);
+                        g.drawLine(x + 4, y + 8, x + 6, y + 8);
+                        g.drawLine(x + 5, y + 9, x + 5, y + 9);
+                        g.drawLine(x + 3, y + 5, x + 3, y + 5);
+                        g.drawLine(x + 3, y + 6, x + 4, y + 6);
+                    }
+                }
+            }
+        }
+
+        public int getIconWidth() {
+            XPStyle xp = XPStyle.getXP();
+            if (xp != null) {
+                return xp.getSkin(null, Part.BP_CHECKBOX).getWidth();
+            } else {
+                return csize;
+            }
+        }
+
+        public int getIconHeight() {
+            XPStyle xp = XPStyle.getXP();
+            if (xp != null) {
+                return xp.getSkin(null, Part.BP_CHECKBOX).getHeight();
+            } else {
+                return csize;
+            }
+        }
+    }
+
+    @SuppressWarnings("serial") // Same-version serialization only
+    private static class RadioButtonIcon implements Icon, UIResource, Serializable
+    {
+        public void paintIcon(Component c, Graphics g, int x, int y) {
+            AbstractButton b = (AbstractButton) c;
+            ButtonModel model = b.getModel();
+            XPStyle xp = XPStyle.getXP();
+
+            if (xp != null) {
+                Part part = Part.BP_RADIOBUTTON;
+                Skin skin = xp.getSkin(b, part);
+                State state;
+                int index = 0;
+                if (model.isSelected()) {
+                    state = State.CHECKEDNORMAL;
+                    if (!model.isEnabled()) {
+                        state = State.CHECKEDDISABLED;
+                    } else if (model.isPressed() && model.isArmed()) {
+                        state = State.CHECKEDPRESSED;
+                    } else if (model.isRollover()) {
+                        state = State.CHECKEDHOT;
+                    }
+                } else {
+                    state = State.UNCHECKEDNORMAL;
+                    if (!model.isEnabled()) {
+                        state = State.UNCHECKEDDISABLED;
+                    } else if (model.isPressed() && model.isArmed()) {
+                        state = State.UNCHECKEDPRESSED;
+                    } else if (model.isRollover()) {
+                        state = State.UNCHECKEDHOT;
+                    }
+                }
+                skin.paintSkin(g, x, y, state);
+            } else {
+                // fill interior
+                if((model.isPressed() && model.isArmed()) || !model.isEnabled()) {
+                    g.setColor(UIManager.getColor("RadioButton.background"));
+                } else {
+                    g.setColor(UIManager.getColor("RadioButton.interiorBackground"));
+                }
+                g.fillRect(x+2, y+2, 8, 8);
+
+
+                boolean isScaledGraphics = SwingUtilities2.isScaledGraphics(g);
+
+                if (isScaledGraphics) {
+
+                    Graphics2D g2d = (Graphics2D) g;
+                    Stroke oldStroke = g2d.getStroke();
+                    g2d.setStroke(new BasicStroke(1.03f, BasicStroke.CAP_ROUND,
+                                                  BasicStroke.JOIN_ROUND));
+                    Object aaHint = g2d.getRenderingHint(RenderingHints.KEY_ANTIALIASING);
+                    g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
+                                         RenderingHints.VALUE_ANTIALIAS_ON);
+
+                    // outter left arc
+                    g.setColor(UIManager.getColor("RadioButton.shadow"));
+                    g.drawArc(x, y, 11, 11, 45, 180);
+                    // outter right arc
+                    g.setColor(UIManager.getColor("RadioButton.highlight"));
+                    g.drawArc(x, y, 11, 11, 45, -180);
+                    // inner left arc
+                    g.setColor(UIManager.getColor("RadioButton.darkShadow"));
+                    g.drawArc(x + 1, y + 1, 9, 9, 45, 180);
+                    // inner right arc
+                    g.setColor(UIManager.getColor("RadioButton.light"));
+                    g.drawArc(x + 1, y + 1, 9, 9, 45, -180);
+
+                    g2d.setStroke(oldStroke);
+
+                    if (model.isSelected()) {
+                        if (model.isEnabled()) {
+                            g.setColor(UIManager.getColor("RadioButton.foreground"));
+                        } else {
+                            g.setColor(UIManager.getColor("RadioButton.shadow"));
+                        }
+                        g.fillOval(x + 3, y + 3, 5, 5);
+                    }
+                    g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, aaHint);
+
+                } else {
+
+                    // outter left arc
+                    g.setColor(UIManager.getColor("RadioButton.shadow"));
+                    g.drawLine(x+4, y+0, x+7, y+0);
+                    g.drawLine(x+2, y+1, x+3, y+1);
+                    g.drawLine(x+8, y+1, x+9, y+1);
+                    g.drawLine(x+1, y+2, x+1, y+3);
+                    g.drawLine(x+0, y+4, x+0, y+7);
+                    g.drawLine(x+1, y+8, x+1, y+9);
+
+                    // outter right arc
+                    g.setColor(UIManager.getColor("RadioButton.highlight"));
+                    g.drawLine(x+2, y+10, x+3, y+10);
+                    g.drawLine(x+4, y+11, x+7, y+11);
+                    g.drawLine(x+8, y+10, x+9, y+10);
+                    g.drawLine(x+10, y+9, x+10, y+8);
+                    g.drawLine(x+11, y+7, x+11, y+4);
+                    g.drawLine(x+10, y+3, x+10, y+2);
+
+
+                    // inner left arc
+                    g.setColor(UIManager.getColor("RadioButton.darkShadow"));
+                    g.drawLine(x+4, y+1, x+7, y+1);
+                    g.drawLine(x+2, y+2, x+3, y+2);
+                    g.drawLine(x+8, y+2, x+9, y+2);
+                    g.drawLine(x+2, y+3, x+2, y+3);
+                    g.drawLine(x+1, y+4, x+1, y+7);
+                    g.drawLine(x+2, y+8, x+2, y+8);
+
+
+                    // inner right arc
+                    g.setColor(UIManager.getColor("RadioButton.light"));
+                    g.drawLine(x+2,  y+9,  x+3,  y+9);
+                    g.drawLine(x+4,  y+10, x+7,  y+10);
+                    g.drawLine(x+8,  y+9,  x+9,  y+9);
+                    g.drawLine(x+9,  y+8,  x+9,  y+8);
+                    g.drawLine(x+10, y+7,  x+10, y+4);
+                    g.drawLine(x+9,  y+3,  x+9,  y+3);
+
+
+                     // indicate whether selected or not
+                    if (model.isSelected()) {
+                        if (model.isEnabled()) {
+                            g.setColor(UIManager.getColor("RadioButton.foreground"));
+                        } else {
+                            g.setColor(UIManager.getColor("RadioButton.shadow"));
+                        }
+                        g.fillRect(x+4, y+5, 4, 2);
+                        g.fillRect(x+5, y+4, 2, 4);
+                    }
+                }
+            }
+        }
+
+        public int getIconWidth() {
+            XPStyle xp = XPStyle.getXP();
+            if (xp != null) {
+                return xp.getSkin(null, Part.BP_RADIOBUTTON).getWidth();
+            } else {
+                return 13;
+            }
+        }
+
+        public int getIconHeight() {
+            XPStyle xp = XPStyle.getXP();
+            if (xp != null) {
+                return xp.getSkin(null, Part.BP_RADIOBUTTON).getHeight();
+            } else {
+                return 13;
+            }
+        }
+    } // end class RadioButtonIcon
+
+
+    @SuppressWarnings("serial") // Same-version serialization only
+    private static class CheckBoxMenuItemIcon implements Icon, UIResource, Serializable
+    {
+        public void paintIcon(Component c, Graphics g, int x, int y) {
+            AbstractButton b = (AbstractButton) c;
+            ButtonModel model = b.getModel();
+            boolean isSelected = model.isSelected();
+            if (isSelected) {
+                y = y - getIconHeight() / 2;
+                g.drawLine(x+9, y+3, x+9, y+3);
+                g.drawLine(x+8, y+4, x+9, y+4);
+                g.drawLine(x+7, y+5, x+9, y+5);
+                g.drawLine(x+6, y+6, x+8, y+6);
+                g.drawLine(x+3, y+7, x+7, y+7);
+                g.drawLine(x+4, y+8, x+6, y+8);
+                g.drawLine(x+5, y+9, x+5, y+9);
+                g.drawLine(x+3, y+5, x+3, y+5);
+                g.drawLine(x+3, y+6, x+4, y+6);
+            }
+        }
+        public int getIconWidth() { return 9; }
+        public int getIconHeight() { return 9; }
+
+    } // End class CheckBoxMenuItemIcon
+
+
+    @SuppressWarnings("serial") // Same-version serialization only
+    private static class RadioButtonMenuItemIcon implements Icon, UIResource, Serializable
+    {
+        public void paintIcon(Component c, Graphics g, int x, int y) {
+            AbstractButton b = (AbstractButton) c;
+            ButtonModel model = b.getModel();
+            if (b.isSelected() == true) {
+               g.fillRoundRect(x+3,y+3, getIconWidth()-6, getIconHeight()-6,
+                               4, 4);
+            }
+        }
+        public int getIconWidth() { return 12; }
+        public int getIconHeight() { return 12; }
+
+    } // End class RadioButtonMenuItemIcon
+
+
+    @SuppressWarnings("serial") // Same-version serialization only
+    private static class MenuItemCheckIcon implements Icon, UIResource, Serializable{
+        public void paintIcon(Component c, Graphics g, int x, int y) {
+            /* For debugging:
+               Color oldColor = g.getColor();
+            g.setColor(Color.orange);
+            g.fill3DRect(x,y,getIconWidth(), getIconHeight(), true);
+            g.setColor(oldColor);
+            */
+        }
+        public int getIconWidth() { return 9; }
+        public int getIconHeight() { return 9; }
+
+    } // End class MenuItemCheckIcon
+
+    @SuppressWarnings("serial") // Same-version serialization only
+    private static class MenuItemArrowIcon implements Icon, UIResource, Serializable {
+        public void paintIcon(Component c, Graphics g, int x, int y) {
+            /* For debugging:
+            Color oldColor = g.getColor();
+            g.setColor(Color.green);
+            g.fill3DRect(x,y,getIconWidth(), getIconHeight(), true);
+            g.setColor(oldColor);
+            */
+        }
+        public int getIconWidth() { return 4; }
+        public int getIconHeight() { return 8; }
+
+    } // End class MenuItemArrowIcon
+
+    @SuppressWarnings("serial") // Same-version serialization only
+    private static class MenuArrowIcon implements Icon, UIResource, Serializable {
+        public void paintIcon(Component c, Graphics g, int x, int y) {
+            XPStyle xp = XPStyle.getXP();
+            if (WindowsMenuItemUI.isVistaPainting(xp)) {
+                State state = State.NORMAL;
+                if (c instanceof JMenuItem) {
+                    state = ((JMenuItem) c).getModel().isEnabled()
+                    ? State.NORMAL : State.DISABLED;
+                }
+                Skin skin = xp.getSkin(c, Part.MP_POPUPSUBMENU);
+                if (WindowsGraphicsUtils.isLeftToRight(c)) {
+                    skin.paintSkin(g, x, y, state);
+                } else {
+                    Graphics2D g2d = (Graphics2D)g.create();
+                    g2d.translate(x + skin.getWidth(), y);
+                    g2d.scale(-1, 1);
+                    skin.paintSkin(g2d, 0, 0, state);
+                    g2d.dispose();
+                }
+            } else {
+                g.translate(x,y);
+                if( WindowsGraphicsUtils.isLeftToRight(c) ) {
+                    g.drawLine( 0, 0, 0, 7 );
+                    g.drawLine( 1, 1, 1, 6 );
+                    g.drawLine( 2, 2, 2, 5 );
+                    g.drawLine( 3, 3, 3, 4 );
+                } else {
+                    g.drawLine( 4, 0, 4, 7 );
+                    g.drawLine( 3, 1, 3, 6 );
+                    g.drawLine( 2, 2, 2, 5 );
+                    g.drawLine( 1, 3, 1, 4 );
+                }
+                g.translate(-x,-y);
+            }
+        }
+        public int getIconWidth() {
+            XPStyle xp = XPStyle.getXP();
+            if (WindowsMenuItemUI.isVistaPainting(xp)) {
+                Skin skin = xp.getSkin(null, Part.MP_POPUPSUBMENU);
+                return skin.getWidth();
+            } else {
+                return 4;
+            }
+        }
+        public int getIconHeight() {
+            XPStyle xp = XPStyle.getXP();
+            if (WindowsMenuItemUI.isVistaPainting(xp)) {
+                Skin skin = xp.getSkin(null, Part.MP_POPUPSUBMENU);
+                return skin.getHeight();
+            } else {
+                return 8;
+            }
+        }
+    } // End class MenuArrowIcon
+
+    static class VistaMenuItemCheckIconFactory
+           implements MenuItemCheckIconFactory {
+        private static final int OFFSET = 3;
+
+        public Icon getIcon(JMenuItem component) {
+            return new VistaMenuItemCheckIcon(component);
+        }
+
+        public boolean isCompatible(Object icon, String prefix) {
+            return icon instanceof VistaMenuItemCheckIcon
+              && ((VistaMenuItemCheckIcon) icon).type == getType(prefix);
+        }
+
+        public Icon getIcon(String type) {
+            return new VistaMenuItemCheckIcon(type);
+        }
+
+        static int getIconWidth() {
+            XPStyle xp = XPStyle.getXP();
+            return ((xp != null) ? xp.getSkin(null, Part.MP_POPUPCHECK).getWidth() : 16)
+                + 2 * OFFSET;
+        }
+
+        private static Class<? extends JMenuItem> getType(Component c) {
+            Class<? extends JMenuItem> rv = null;
+            if (c instanceof JCheckBoxMenuItem) {
+                rv = JCheckBoxMenuItem.class;
+            } else if (c instanceof JRadioButtonMenuItem) {
+                rv = JRadioButtonMenuItem.class;
+            } else if (c instanceof JMenu) {
+                rv = JMenu.class;
+            } else if (c instanceof JMenuItem) {
+                rv = JMenuItem.class;
+            }
+            return rv;
+        }
+
+        private static Class<? extends JMenuItem> getType(String type) {
+            Class<? extends JMenuItem> rv = null;
+            if (type == "CheckBoxMenuItem") {
+                rv = JCheckBoxMenuItem.class;
+            } else if (type == "RadioButtonMenuItem") {
+                rv = JRadioButtonMenuItem.class;
+            } else if (type == "Menu") {
+                rv = JMenu.class;
+            } else if (type == "MenuItem") {
+                rv = JMenuItem.class;
+            } else {
+                // this should never happen
+                rv = JMenuItem.class;
+            }
+            return rv;
+        }
+
+        /**
+         * CheckIcon for JMenuItem, JMenu, JCheckBoxMenuItem and
+         * JRadioButtonMenuItem.
+         * Note: to be used on Vista only.
+         */
+        @SuppressWarnings("serial") // Same-version serialization only
+        private static class VistaMenuItemCheckIcon
+              implements Icon, UIResource, Serializable {
+
+            private final JMenuItem menuItem;
+            private final Class<? extends JMenuItem> type;
+
+            VistaMenuItemCheckIcon(JMenuItem menuItem) {
+                this.type = getType(menuItem);
+                this.menuItem = menuItem;
+            }
+            VistaMenuItemCheckIcon(String type) {
+                this.type = getType(type);
+                this.menuItem = null;
+            }
+
+            public int getIconHeight() {
+                Icon lafIcon = getLaFIcon();
+                if (lafIcon != null) {
+                    return lafIcon.getIconHeight();
+                }
+                Icon icon = getIcon();
+                int height = 0;
+                if (icon != null) {
+                    height = icon.getIconHeight();
+                } else {
+                    XPStyle xp = XPStyle.getXP();
+                    if (xp != null) {
+                        Skin skin = xp.getSkin(null, Part.MP_POPUPCHECK);
+                        height = skin.getHeight();
+                    } else {
+                        height = 16;
+                    }
+                }
+                height +=  2 * OFFSET;
+                return height;
+            }
+
+            public int getIconWidth() {
+                Icon lafIcon = getLaFIcon();
+                if (lafIcon != null) {
+                    return lafIcon.getIconWidth();
+                }
+                Icon icon = getIcon();
+                int width = 0;
+                if (icon != null) {
+                    width = icon.getIconWidth() + 2 * OFFSET;
+                } else {
+                    width = VistaMenuItemCheckIconFactory.getIconWidth();
+                }
+                return width;
+            }
+
+            public void paintIcon(Component c, Graphics g, int x, int y) {
+                Icon lafIcon = getLaFIcon();
+                if (lafIcon != null) {
+                    lafIcon.paintIcon(c, g, x, y);
+                    return;
+                }
+                assert menuItem == null || c == menuItem;
+                Icon icon = getIcon();
+                if (type == JCheckBoxMenuItem.class
+                      || type == JRadioButtonMenuItem.class) {
+                    AbstractButton b = (AbstractButton) c;
+                    if (b.isSelected()) {
+                        Part backgroundPart = Part.MP_POPUPCHECKBACKGROUND;
+                        Part part = Part.MP_POPUPCHECK;
+                        State backgroundState;
+                        State state;
+                        if (isEnabled(c, null)) {
+                            backgroundState =
+                                (icon != null) ? State.BITMAP : State.NORMAL;
+                            state = (type == JRadioButtonMenuItem.class)
+                              ? State.BULLETNORMAL
+                              : State.CHECKMARKNORMAL;
+                        } else {
+                            backgroundState = State.DISABLEDPUSHED;
+                            state =
+                                (type == JRadioButtonMenuItem.class)
+                                  ? State.BULLETDISABLED
+                                  : State.CHECKMARKDISABLED;
+                        }
+                        XPStyle xp = XPStyle.getXP();
+                        if (xp != null) {
+                            Skin skin;
+                            skin =  xp.getSkin(c, backgroundPart);
+                            skin.paintSkin(g, x, y,
+                                getIconWidth(), getIconHeight(), backgroundState);
+                            if (icon == null) {
+                                skin = xp.getSkin(c, part);
+                                skin.paintSkin(g, x + OFFSET, y + OFFSET, state);
+                            }
+                        }
+                    }
+                }
+                if (icon != null) {
+                    icon.paintIcon(c, g, x + OFFSET, y + OFFSET);
+                }
+            }
+            private static WindowsMenuItemUIAccessor getAccessor(
+                    JMenuItem menuItem) {
+                WindowsMenuItemUIAccessor rv = null;
+                ButtonUI uiObject = (menuItem != null) ? menuItem.getUI()
+                        : null;
+                if (uiObject instanceof WindowsMenuItemUI) {
+                    rv = ((WindowsMenuItemUI) uiObject).accessor;
+                } else if (uiObject instanceof WindowsMenuUI) {
+                    rv = ((WindowsMenuUI) uiObject).accessor;
+                } else if (uiObject instanceof WindowsCheckBoxMenuItemUI) {
+                    rv = ((WindowsCheckBoxMenuItemUI) uiObject).accessor;
+                } else if (uiObject instanceof WindowsRadioButtonMenuItemUI) {
+                    rv = ((WindowsRadioButtonMenuItemUI) uiObject).accessor;
+                }
+                return rv;
+            }
+
+            private static boolean isEnabled(Component  c, State state) {
+                if (state == null && c instanceof JMenuItem) {
+                    WindowsMenuItemUIAccessor accessor =
+                        getAccessor((JMenuItem) c);
+                    if (accessor != null) {
+                        state = accessor.getState((JMenuItem) c);
+                    }
+                }
+                if (state == null) {
+                    if (c != null) {
+                        return c.isEnabled();
+                    } else {
+                        return true;
+                    }
+                } else {
+                    return (state != State.DISABLED)
+                        && (state != State.DISABLEDHOT)
+                        && (state != State.DISABLEDPUSHED);
+                }
+            }
+            private Icon getIcon() {
+                Icon rv = null;
+                if (menuItem == null) {
+                    return rv;
+                }
+                WindowsMenuItemUIAccessor accessor =
+                    getAccessor(menuItem);
+                State state = (accessor != null) ? accessor.getState(menuItem)
+                        : null;
+                if (isEnabled(menuItem, null)) {
+                    if (state == State.PUSHED) {
+                        rv = menuItem.getPressedIcon();
+                    } else {
+                        rv = menuItem.getIcon();
+                    }
+                } else {
+                    rv = menuItem.getDisabledIcon();
+                }
+                return rv;
+            }
+            /**
+             * Check if developer changed icon in the UI table.
+             *
+             * @return the icon to use or {@code null} if the current one is to
+             * be used
+             */
+            private Icon getLaFIcon() {
+                // use icon from the UI table if it does not match this one.
+                Icon rv = (Icon) UIManager.getDefaults().get(typeToString(type));
+                if (rv instanceof VistaMenuItemCheckIcon
+                      && ((VistaMenuItemCheckIcon) rv).type == type) {
+                    rv = null;
+                }
+                return rv;
+            }
+
+            private static String typeToString(
+                    Class<? extends JMenuItem> type) {
+                assert type == JMenuItem.class
+                    || type == JMenu.class
+                    || type == JCheckBoxMenuItem.class
+                    || type == JRadioButtonMenuItem.class;
+                StringBuilder sb = new StringBuilder(type.getName());
+                // remove package name, dot and the first character
+                sb.delete(0, sb.lastIndexOf("J") + 1);
+                sb.append(".checkIcon");
+                return sb.toString();
+            }
+        }
+    } // End class VistaMenuItemCheckIconFactory
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsInternalFrameTitlePane.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,572 @@
+/*
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import sun.swing.SwingUtilities2;
+
+import javax.swing.*;
+import javax.swing.border.*;
+import javax.swing.UIManager;
+import javax.swing.plaf.*;
+import javax.swing.plaf.basic.BasicInternalFrameTitlePane;
+import java.awt.*;
+import java.awt.event.*;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyVetoException;
+
+import static com.sun.java.swing.plaf.windows.TMSchema.*;
+import static com.sun.java.swing.plaf.windows.XPStyle.Skin;
+
+@SuppressWarnings("serial") // Superclass is not serializable across versions
+public class WindowsInternalFrameTitlePane extends BasicInternalFrameTitlePane {
+    private Color selectedTitleGradientColor;
+    private Color notSelectedTitleGradientColor;
+    private JPopupMenu systemPopupMenu;
+    private JLabel systemLabel;
+
+    private Font titleFont;
+    private int titlePaneHeight;
+    private int buttonWidth, buttonHeight;
+    private boolean hotTrackingOn;
+
+    public WindowsInternalFrameTitlePane(JInternalFrame f) {
+        super(f);
+    }
+
+    protected void addSubComponents() {
+        add(systemLabel);
+        add(iconButton);
+        add(maxButton);
+        add(closeButton);
+    }
+
+    protected void installDefaults() {
+        super.installDefaults();
+
+        titlePaneHeight = UIManager.getInt("InternalFrame.titlePaneHeight");
+        buttonWidth     = UIManager.getInt("InternalFrame.titleButtonWidth")  - 4;
+        buttonHeight    = UIManager.getInt("InternalFrame.titleButtonHeight") - 4;
+
+        Object obj      = UIManager.get("InternalFrame.titleButtonToolTipsOn");
+        hotTrackingOn = (obj instanceof Boolean) ? (Boolean)obj : true;
+
+
+        if (XPStyle.getXP() != null) {
+            // Fix for XP bug where sometimes these sizes aren't updated properly
+            // Assume for now that height is correct and derive width using the
+            // ratio from the uxtheme part
+            buttonWidth = buttonHeight;
+            Dimension d = XPStyle.getPartSize(Part.WP_CLOSEBUTTON, State.NORMAL);
+            if (d != null && d.width != 0 && d.height != 0) {
+                buttonWidth = (int) ((float) buttonWidth * d.width / d.height);
+            }
+        } else {
+            buttonWidth += 2;
+            Color activeBorderColor =
+                    UIManager.getColor("InternalFrame.activeBorderColor");
+            setBorder(BorderFactory.createLineBorder(activeBorderColor, 1));
+        }
+        // JDK-8039383: initialize these colors because getXP() may return null when theme is changed
+        selectedTitleGradientColor =
+                UIManager.getColor("InternalFrame.activeTitleGradient");
+        notSelectedTitleGradientColor =
+                UIManager.getColor("InternalFrame.inactiveTitleGradient");
+    }
+
+    protected void uninstallListeners() {
+        // Get around protected method in superclass
+        super.uninstallListeners();
+    }
+
+    protected void createButtons() {
+        super.createButtons();
+        if (XPStyle.getXP() != null) {
+            iconButton.setContentAreaFilled(false);
+            maxButton.setContentAreaFilled(false);
+            closeButton.setContentAreaFilled(false);
+        }
+    }
+
+    protected void setButtonIcons() {
+        super.setButtonIcons();
+
+        if (!hotTrackingOn) {
+            iconButton.setToolTipText(null);
+            maxButton.setToolTipText(null);
+            closeButton.setToolTipText(null);
+        }
+    }
+
+
+    public void paintComponent(Graphics g)  {
+        XPStyle xp = XPStyle.getXP();
+
+        paintTitleBackground(g);
+
+        String title = frame.getTitle();
+        if (title != null) {
+            boolean isSelected = frame.isSelected();
+            Font oldFont = g.getFont();
+            Font newFont = (titleFont != null) ? titleFont : getFont();
+            g.setFont(newFont);
+
+            // Center text vertically.
+            FontMetrics fm = SwingUtilities2.getFontMetrics(frame, g, newFont);
+            int baseline = (getHeight() + fm.getAscent() - fm.getLeading() -
+                    fm.getDescent()) / 2;
+
+            Rectangle lastIconBounds = new Rectangle(0, 0, 0, 0);
+            if (frame.isIconifiable()) {
+                lastIconBounds = iconButton.getBounds();
+            } else if (frame.isMaximizable()) {
+                lastIconBounds = maxButton.getBounds();
+            } else if (frame.isClosable()) {
+                lastIconBounds = closeButton.getBounds();
+            }
+
+            int titleX;
+            int titleW;
+            int gap = 2;
+            if (WindowsGraphicsUtils.isLeftToRight(frame)) {
+                if (lastIconBounds.x == 0) { // There are no icons
+                    lastIconBounds.x = frame.getWidth() - frame.getInsets().right;
+                }
+                titleX = systemLabel.getX() + systemLabel.getWidth() + gap;
+                if (xp != null) {
+                    titleX += 2;
+                }
+                titleW = lastIconBounds.x - titleX - gap;
+            } else {
+                if (lastIconBounds.x == 0) { // There are no icons
+                    lastIconBounds.x = frame.getInsets().left;
+                }
+                titleW = SwingUtilities2.stringWidth(frame, fm, title);
+                int minTitleX = lastIconBounds.x + lastIconBounds.width + gap;
+                if (xp != null) {
+                    minTitleX += 2;
+                }
+                int availableWidth = systemLabel.getX() - gap - minTitleX;
+                if (availableWidth > titleW) {
+                    titleX = systemLabel.getX() - gap - titleW;
+                } else {
+                    titleX = minTitleX;
+                    titleW = availableWidth;
+                }
+            }
+            title = getTitle(frame.getTitle(), fm, titleW);
+
+            if (xp != null) {
+                String shadowType = null;
+                if (isSelected) {
+                    shadowType = xp.getString(this, Part.WP_CAPTION,
+                                              State.ACTIVE, Prop.TEXTSHADOWTYPE);
+                }
+                if ("single".equalsIgnoreCase(shadowType)) {
+                    Point shadowOffset = xp.getPoint(this, Part.WP_WINDOW, State.ACTIVE,
+                                                     Prop.TEXTSHADOWOFFSET);
+                    Color shadowColor  = xp.getColor(this, Part.WP_WINDOW, State.ACTIVE,
+                                                     Prop.TEXTSHADOWCOLOR, null);
+                    if (shadowOffset != null && shadowColor != null) {
+                        g.setColor(shadowColor);
+                        SwingUtilities2.drawString(frame, g, title,
+                                     titleX + shadowOffset.x,
+                                     baseline + shadowOffset.y);
+                    }
+                }
+            }
+            g.setColor(isSelected ? selectedTextColor : notSelectedTextColor);
+            SwingUtilities2.drawString(frame, g, title, titleX, baseline);
+            g.setFont(oldFont);
+        }
+    }
+
+    public Dimension getPreferredSize() {
+        return getMinimumSize();
+    }
+
+    public Dimension getMinimumSize() {
+        Dimension d = new Dimension(super.getMinimumSize());
+        d.height = titlePaneHeight + 2;
+
+        XPStyle xp = XPStyle.getXP();
+        if (xp != null) {
+            // Note: Don't know how to calculate height on XP,
+            // the captionbarheight is 25 but native caption is 30 (maximized 26)
+            if (frame.isMaximum()) {
+                d.height -= 1;
+            } else {
+                d.height += 3;
+            }
+        }
+        return d;
+    }
+
+    protected void paintTitleBackground(Graphics g) {
+        XPStyle xp = XPStyle.getXP();
+        if (xp != null) {
+            Part part = frame.isIcon() ? Part.WP_MINCAPTION
+                                       : (frame.isMaximum() ? Part.WP_MAXCAPTION
+                                                            : Part.WP_CAPTION);
+            State state = frame.isSelected() ? State.ACTIVE : State.INACTIVE;
+            Skin skin = xp.getSkin(this, part);
+            skin.paintSkin(g, 0,  0, getWidth(), getHeight(), state);
+        } else {
+            Boolean gradientsOn = (Boolean)LookAndFeel.getDesktopPropertyValue(
+                "win.frame.captionGradientsOn", Boolean.valueOf(false));
+            if (gradientsOn.booleanValue() && g instanceof Graphics2D) {
+                Graphics2D g2 = (Graphics2D)g;
+                Paint savePaint = g2.getPaint();
+
+                boolean isSelected = frame.isSelected();
+                int w = getWidth();
+
+                if (isSelected) {
+                    GradientPaint titleGradient = new GradientPaint(0,0,
+                            selectedTitleColor,
+                            (int)(w*.75),0,
+                            selectedTitleGradientColor);
+                    g2.setPaint(titleGradient);
+                } else {
+                    GradientPaint titleGradient = new GradientPaint(0,0,
+                            notSelectedTitleColor,
+                            (int)(w*.75),0,
+                            notSelectedTitleGradientColor);
+                    g2.setPaint(titleGradient);
+                }
+                g2.fillRect(0, 0, getWidth(), getHeight());
+                g2.setPaint(savePaint);
+            } else {
+                super.paintTitleBackground(g);
+            }
+        }
+    }
+
+    protected void assembleSystemMenu() {
+        systemPopupMenu = new JPopupMenu();
+        addSystemMenuItems(systemPopupMenu);
+        enableActions();
+        @SuppressWarnings("serial") // anonymous class
+        JLabel tmp = new JLabel(frame.getFrameIcon()) {
+            protected void paintComponent(Graphics g) {
+                int x = 0;
+                int y = 0;
+                int w = getWidth();
+                int h = getHeight();
+                g = g.create();  // Create scratch graphics
+                if (isOpaque()) {
+                    g.setColor(getBackground());
+                    g.fillRect(0, 0, w, h);
+                }
+                Icon icon = getIcon();
+                int iconWidth;
+                int iconHeight;
+                if (icon != null &&
+                    (iconWidth = icon.getIconWidth()) > 0 &&
+                    (iconHeight = icon.getIconHeight()) > 0) {
+
+                    // Set drawing scale to make icon scale to our desired size
+                    double drawScale;
+                    if (iconWidth > iconHeight) {
+                        // Center icon vertically
+                        y = (h - w*iconHeight/iconWidth) / 2;
+                        drawScale = w / (double)iconWidth;
+                    } else {
+                        // Center icon horizontally
+                        x = (w - h*iconWidth/iconHeight) / 2;
+                        drawScale = h / (double)iconHeight;
+                    }
+                    ((Graphics2D)g).translate(x, y);
+                    ((Graphics2D)g).scale(drawScale, drawScale);
+                    icon.paintIcon(this, g, 0, 0);
+                }
+                g.dispose();
+            }
+        };
+        systemLabel = tmp;
+        systemLabel.addMouseListener(new MouseAdapter() {
+            public void mouseClicked(MouseEvent e) {
+                if (e.getClickCount() == 2 && frame.isClosable() &&
+                    !frame.isIcon()) {
+                    systemPopupMenu.setVisible(false);
+                    frame.doDefaultCloseAction();
+                }
+                else {
+                    super.mouseClicked(e);
+                }
+            }
+            public void mousePressed(MouseEvent e) {
+                try {
+                    frame.setSelected(true);
+                } catch(PropertyVetoException pve) {
+                }
+                showSystemPopupMenu(e.getComponent());
+            }
+        });
+    }
+
+    protected void addSystemMenuItems(JPopupMenu menu) {
+        JMenuItem mi = menu.add(restoreAction);
+        mi.setMnemonic(getButtonMnemonic("restore"));
+        mi = menu.add(moveAction);
+        mi.setMnemonic(getButtonMnemonic("move"));
+        mi = menu.add(sizeAction);
+        mi.setMnemonic(getButtonMnemonic("size"));
+        mi = menu.add(iconifyAction);
+        mi.setMnemonic(getButtonMnemonic("minimize"));
+        mi = menu.add(maximizeAction);
+        mi.setMnemonic(getButtonMnemonic("maximize"));
+        menu.add(new JSeparator());
+        mi = menu.add(closeAction);
+        mi.setMnemonic(getButtonMnemonic("close"));
+    }
+
+    private static int getButtonMnemonic(String button) {
+        try {
+            return Integer.parseInt(UIManager.getString(
+                    "InternalFrameTitlePane." + button + "Button.mnemonic"));
+        } catch (NumberFormatException e) {
+            return -1;
+        }
+    }
+
+    protected void showSystemMenu(){
+        showSystemPopupMenu(systemLabel);
+    }
+
+    private void showSystemPopupMenu(Component invoker){
+        Dimension dim = new Dimension();
+        Border border = frame.getBorder();
+        if (border != null) {
+            dim.width += border.getBorderInsets(frame).left +
+                border.getBorderInsets(frame).right;
+            dim.height += border.getBorderInsets(frame).bottom +
+                border.getBorderInsets(frame).top;
+        }
+        if (!frame.isIcon()) {
+            systemPopupMenu.show(invoker,
+                getX() - dim.width,
+                getY() + getHeight() - dim.height);
+        } else {
+            systemPopupMenu.show(invoker,
+                getX() - dim.width,
+                getY() - systemPopupMenu.getPreferredSize().height -
+                     dim.height);
+        }
+    }
+
+    protected PropertyChangeListener createPropertyChangeListener() {
+        return new WindowsPropertyChangeHandler();
+    }
+
+    protected LayoutManager createLayout() {
+        return new WindowsTitlePaneLayout();
+    }
+
+    public class WindowsTitlePaneLayout extends BasicInternalFrameTitlePane.TitlePaneLayout {
+        private Insets captionMargin = null;
+        private Insets contentMargin = null;
+        private XPStyle xp = XPStyle.getXP();
+
+        WindowsTitlePaneLayout() {
+            if (xp != null) {
+                Component c = WindowsInternalFrameTitlePane.this;
+                captionMargin = xp.getMargin(c, Part.WP_CAPTION, null, Prop.CAPTIONMARGINS);
+                contentMargin = xp.getMargin(c, Part.WP_CAPTION, null, Prop.CONTENTMARGINS);
+            }
+            if (captionMargin == null) {
+                captionMargin = new Insets(0, 2, 0, 2);
+            }
+            if (contentMargin == null) {
+                contentMargin = new Insets(0, 0, 0, 0);
+            }
+        }
+
+        private int layoutButton(JComponent button, Part part,
+                                 int x, int y, int w, int h, int gap,
+                                 boolean leftToRight) {
+            if (!leftToRight) {
+                x -= w;
+            }
+            button.setBounds(x, y, w, h);
+            if (leftToRight) {
+                x += w + 2;
+            } else {
+                x -= 2;
+            }
+            return x;
+        }
+
+        public void layoutContainer(Container c) {
+            boolean leftToRight = WindowsGraphicsUtils.isLeftToRight(frame);
+            int x, y;
+            int w = getWidth();
+            int h = getHeight();
+
+            // System button
+            // Note: this icon is square, but the buttons aren't always.
+            int iconSize = (xp != null) ? (h-2)*6/10 : h-4;
+            if (xp != null) {
+                x = (leftToRight) ? captionMargin.left + 2 : w - captionMargin.right - 2;
+            } else {
+                x = (leftToRight) ? captionMargin.left : w - captionMargin.right;
+            }
+            y = (h - iconSize) / 2;
+            layoutButton(systemLabel, Part.WP_SYSBUTTON,
+                         x, y, iconSize, iconSize, 0,
+                         leftToRight);
+
+            // Right hand buttons
+            if (xp != null) {
+                x = (leftToRight) ? w - captionMargin.right - 2 : captionMargin.left + 2;
+                y = 1;  // XP seems to ignore margins and offset here
+                if (frame.isMaximum()) {
+                    y += 1;
+                } else {
+                    y += 5;
+                }
+            } else {
+                x = (leftToRight) ? w - captionMargin.right : captionMargin.left;
+                y = (h - buttonHeight) / 2;
+            }
+
+            if(frame.isClosable()) {
+                x = layoutButton(closeButton, Part.WP_CLOSEBUTTON,
+                                 x, y, buttonWidth, buttonHeight, 2,
+                                 !leftToRight);
+            }
+
+            if(frame.isMaximizable()) {
+                x = layoutButton(maxButton, Part.WP_MAXBUTTON,
+                                 x, y, buttonWidth, buttonHeight, (xp != null) ? 2 : 0,
+                                 !leftToRight);
+            }
+
+            if(frame.isIconifiable()) {
+                layoutButton(iconButton, Part.WP_MINBUTTON,
+                             x, y, buttonWidth, buttonHeight, 0,
+                             !leftToRight);
+            }
+        }
+    } // end WindowsTitlePaneLayout
+
+    public class WindowsPropertyChangeHandler extends PropertyChangeHandler {
+        public void propertyChange(PropertyChangeEvent evt) {
+            String prop = evt.getPropertyName();
+
+            // Update the internal frame icon for the system menu.
+            if (JInternalFrame.FRAME_ICON_PROPERTY.equals(prop) &&
+                    systemLabel != null) {
+                systemLabel.setIcon(frame.getFrameIcon());
+            }
+
+            super.propertyChange(evt);
+        }
+    }
+
+    /**
+     * A versatile Icon implementation which can take an array of Icon
+     * instances (typically <code>ImageIcon</code>s) and choose one that gives the best
+     * quality for a given Graphics2D scale factor when painting.
+     * <p>
+     * The class is public so it can be instantiated by UIDefaults.ProxyLazyValue.
+     * <p>
+     * Note: We assume here that icons are square.
+     */
+    public static class ScalableIconUIResource implements Icon, UIResource {
+        // We can use an arbitrary size here because we scale to it in paintIcon()
+        private static final int SIZE = 16;
+
+        private Icon[] icons;
+
+        /**
+         * @param objects an array of Icon or UIDefaults.LazyValue
+         * <p>
+         * The constructor is public so it can be called by UIDefaults.ProxyLazyValue.
+         */
+        public ScalableIconUIResource(Object[] objects) {
+            this.icons = new Icon[objects.length];
+
+            for (int i = 0; i < objects.length; i++) {
+                if (objects[i] instanceof UIDefaults.LazyValue) {
+                    icons[i] = (Icon)((UIDefaults.LazyValue)objects[i]).createValue(null);
+                } else {
+                    icons[i] = (Icon)objects[i];
+                }
+            }
+        }
+
+        /**
+         * @return the <code>Icon</code> closest to the requested size
+         */
+        protected Icon getBestIcon(int size) {
+            if (icons != null && icons.length > 0) {
+                int bestIndex = 0;
+                int minDiff = Integer.MAX_VALUE;
+                for (int i=0; i < icons.length; i++) {
+                    Icon icon = icons[i];
+                    int iconSize;
+                    if (icon != null && (iconSize = icon.getIconWidth()) > 0) {
+                        int diff = Math.abs(iconSize - size);
+                        if (diff < minDiff) {
+                            minDiff = diff;
+                            bestIndex = i;
+                        }
+                    }
+                }
+                return icons[bestIndex];
+            } else {
+                return null;
+            }
+        }
+
+        public void paintIcon(Component c, Graphics g, int x, int y) {
+            Graphics2D g2d = (Graphics2D)g.create();
+            // Calculate how big our drawing area is in pixels
+            // Assume we are square
+            int size = getIconWidth();
+            double scale = g2d.getTransform().getScaleX();
+            Icon icon = getBestIcon((int)(size * scale));
+            int iconSize;
+            if (icon != null && (iconSize = icon.getIconWidth()) > 0) {
+                // Set drawing scale to make icon act true to our reported size
+                double drawScale = size / (double)iconSize;
+                g2d.translate(x, y);
+                g2d.scale(drawScale, drawScale);
+                icon.paintIcon(c, g2d, 0, 0);
+            }
+            g2d.dispose();
+        }
+
+        public int getIconWidth() {
+            return SIZE;
+        }
+
+        public int getIconHeight() {
+            return SIZE;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsInternalFrameUI.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,135 @@
+/*
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import java.awt.*;
+import java.beans.*;
+import javax.swing.*;
+import javax.swing.border.*;
+import javax.swing.plaf.basic.*;
+import javax.swing.plaf.ComponentUI;
+
+import static com.sun.java.swing.plaf.windows.TMSchema.*;
+import static com.sun.java.swing.plaf.windows.XPStyle.Skin;
+
+/**
+ * Windows rendition of the component.
+ * <p>
+ * <strong>Warning:</strong>
+ * Serialized objects of this class will not be compatible with
+ * future Swing releases.  The current serialization support is appropriate
+ * for short term storage or RMI between applications running the same
+ * version of Swing.  A future release of Swing will provide support for
+ * long term persistence.
+ */
+public class WindowsInternalFrameUI extends BasicInternalFrameUI
+{
+    XPStyle xp = XPStyle.getXP();
+
+    public void installDefaults() {
+        super.installDefaults();
+
+        if (xp != null) {
+            frame.setBorder(new XPBorder());
+        } else {
+            frame.setBorder(UIManager.getBorder("InternalFrame.border"));
+        }
+    }
+
+    public void installUI(JComponent c)   {
+        super.installUI(c);
+
+        LookAndFeel.installProperty(c, "opaque",
+                                    xp == null? Boolean.TRUE : Boolean.FALSE);
+    }
+
+    public void uninstallDefaults() {
+        frame.setBorder(null);
+        super.uninstallDefaults();
+    }
+
+    public static ComponentUI createUI(JComponent b)    {
+        return new WindowsInternalFrameUI((JInternalFrame)b);
+    }
+
+    public WindowsInternalFrameUI(JInternalFrame w){
+        super(w);
+    }
+
+    protected DesktopManager createDesktopManager(){
+        return new WindowsDesktopManager();
+    }
+
+    protected JComponent createNorthPane(JInternalFrame w) {
+        titlePane = new WindowsInternalFrameTitlePane(w);
+        return titlePane;
+    }
+
+    @SuppressWarnings("serial") // Superclass is not serializable across versions
+    private class XPBorder extends AbstractBorder {
+        private Skin leftSkin   = xp.getSkin(frame, Part.WP_FRAMELEFT);
+        private Skin rightSkin  = xp.getSkin(frame, Part.WP_FRAMERIGHT);
+        private Skin bottomSkin = xp.getSkin(frame, Part.WP_FRAMEBOTTOM);
+
+        /**
+         * @param x the x position of the painted border
+         * @param y the y position of the painted border
+         * @param width the width of the painted border
+         * @param height the height of the painted border
+         */
+        public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
+            State state = ((JInternalFrame)c).isSelected() ? State.ACTIVE : State.INACTIVE;
+            int topBorderHeight  = (titlePane != null) ? titlePane.getSize().height : 0;
+
+            bottomSkin.paintSkin(g, 0, height-bottomSkin.getHeight(),
+                                 width, bottomSkin.getHeight(),
+                                 state);
+
+            leftSkin.paintSkin(g, 0, topBorderHeight-1,
+                               leftSkin.getWidth(), height-topBorderHeight-bottomSkin.getHeight()+2,
+                               state);
+
+            rightSkin.paintSkin(g, width-rightSkin.getWidth(), topBorderHeight-1,
+                                rightSkin.getWidth(), height-topBorderHeight-bottomSkin.getHeight()+2,
+                                state);
+
+        }
+
+        public Insets getBorderInsets(Component c, Insets insets) {
+            insets.top    = 4;
+            insets.left   = leftSkin.getWidth();
+            insets.right  = rightSkin.getWidth();
+            insets.bottom = bottomSkin.getHeight();
+
+            return insets;
+        }
+
+        public boolean isBorderOpaque() {
+            return true;
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsLabelUI.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,112 @@
+/*
+ * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import sun.swing.SwingUtilities2;
+import sun.awt.AppContext;
+
+import java.awt.Color;
+import java.awt.Graphics;
+
+import javax.swing.JComponent;
+import javax.swing.JLabel;
+import javax.swing.UIManager;
+
+import javax.swing.plaf.ComponentUI;
+
+import javax.swing.plaf.basic.BasicLabelUI;
+
+
+
+/**
+ * Windows rendition of the component.
+ * <p>
+ * <strong>Warning:</strong>
+ * Serialized objects of this class will not be compatible with
+ * future Swing releases.  The current serialization support is appropriate
+ * for short term storage or RMI between applications running the same
+ * version of Swing.  A future release of Swing will provide support for
+ * long term persistence.
+ */
+public class WindowsLabelUI extends BasicLabelUI {
+
+    private static final Object WINDOWS_LABEL_UI_KEY = new Object();
+
+    // ********************************
+    //          Create PLAF
+    // ********************************
+    public static ComponentUI createUI(JComponent c) {
+        AppContext appContext = AppContext.getAppContext();
+        WindowsLabelUI windowsLabelUI =
+                (WindowsLabelUI) appContext.get(WINDOWS_LABEL_UI_KEY);
+        if (windowsLabelUI == null) {
+            windowsLabelUI = new WindowsLabelUI();
+            appContext.put(WINDOWS_LABEL_UI_KEY, windowsLabelUI);
+        }
+        return windowsLabelUI;
+    }
+
+    protected void paintEnabledText(JLabel l, Graphics g, String s,
+                                    int textX, int textY) {
+        int mnemonicIndex = l.getDisplayedMnemonicIndex();
+        // W2K Feature: Check to see if the Underscore should be rendered.
+        if (WindowsLookAndFeel.isMnemonicHidden() == true) {
+            mnemonicIndex = -1;
+        }
+
+        g.setColor(l.getForeground());
+        SwingUtilities2.drawStringUnderlineCharAt(l, g, s, mnemonicIndex,
+                                                     textX, textY);
+    }
+
+    protected void paintDisabledText(JLabel l, Graphics g, String s,
+                                     int textX, int textY) {
+        int mnemonicIndex = l.getDisplayedMnemonicIndex();
+        // W2K Feature: Check to see if the Underscore should be rendered.
+        if (WindowsLookAndFeel.isMnemonicHidden() == true) {
+            mnemonicIndex = -1;
+        }
+        if ( UIManager.getColor("Label.disabledForeground") instanceof Color &&
+             UIManager.getColor("Label.disabledShadow") instanceof Color) {
+            g.setColor( UIManager.getColor("Label.disabledShadow") );
+            SwingUtilities2.drawStringUnderlineCharAt(l, g, s,
+                                                         mnemonicIndex,
+                                                         textX + 1, textY + 1);
+            g.setColor( UIManager.getColor("Label.disabledForeground") );
+            SwingUtilities2.drawStringUnderlineCharAt(l, g, s,
+                                                         mnemonicIndex,
+                                                         textX, textY);
+        } else {
+            Color background = l.getBackground();
+            g.setColor(background.brighter());
+            SwingUtilities2.drawStringUnderlineCharAt(l,g, s, mnemonicIndex,
+                                                         textX + 1, textY + 1);
+            g.setColor(background.darker());
+            SwingUtilities2.drawStringUnderlineCharAt(l,g, s, mnemonicIndex,
+                                                         textX, textY);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,2588 @@
+/*
+ * 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * <p>These classes are designed to be used while the
+ * corresponding <code>LookAndFeel</code> class has been installed
+ * (<code>UIManager.setLookAndFeel(new <i>XXX</i>LookAndFeel())</code>).
+ * Using them while a different <code>LookAndFeel</code> is installed
+ * may produce unexpected results, including exceptions.
+ * Additionally, changing the <code>LookAndFeel</code>
+ * maintained by the <code>UIManager</code> without updating the
+ * corresponding <code>ComponentUI</code> of any
+ * <code>JComponent</code>s may also produce unexpected results,
+ * such as the wrong colors showing up, and is generally not
+ * encouraged.
+ *
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import java.awt.*;
+import java.awt.image.BufferedImage;
+import java.awt.image.ImageFilter;
+import java.awt.image.ImageProducer;
+import java.awt.image.FilteredImageSource;
+import java.awt.image.RGBImageFilter;
+
+import javax.swing.plaf.*;
+import javax.swing.*;
+import javax.swing.plaf.basic.*;
+import javax.swing.border.*;
+import javax.swing.text.DefaultEditorKit;
+import static javax.swing.UIDefaults.LazyValue;
+
+import java.awt.Font;
+import java.awt.Color;
+import java.awt.event.ActionEvent;
+
+import java.security.AccessController;
+
+import sun.awt.SunToolkit;
+import sun.awt.OSInfo;
+import sun.awt.shell.ShellFolder;
+import sun.font.FontUtilities;
+import sun.security.action.GetPropertyAction;
+
+import sun.swing.DefaultLayoutStyle;
+import sun.swing.ImageIconUIResource;
+import sun.swing.SwingAccessor;
+import sun.swing.icon.SortArrowIcon;
+import sun.swing.SwingUtilities2;
+import sun.swing.StringUIClientPropertyKey;
+import sun.swing.plaf.windows.ClassicSortArrowIcon;
+
+import static com.sun.java.swing.plaf.windows.TMSchema.*;
+import static com.sun.java.swing.plaf.windows.XPStyle.Skin;
+
+import com.sun.java.swing.plaf.windows.WindowsIconFactory.VistaMenuItemCheckIconFactory;
+
+/**
+ * Implements the Windows95/98/NT/2000 Look and Feel.
+ * UI classes not implemented specifically for Windows will
+ * default to those implemented in Basic.
+ * <p>
+ * <strong>Warning:</strong>
+ * Serialized objects of this class will not be compatible with
+ * future Swing releases.  The current serialization support is appropriate
+ * for short term storage or RMI between applications running the same
+ * version of Swing.  A future release of Swing will provide support for
+ * long term persistence.
+ *
+ * @author unattributed
+ */
+@SuppressWarnings("serial") // Superclass is not serializable across versions
+public class WindowsLookAndFeel extends BasicLookAndFeel
+{
+    /**
+     * A client property that can be used with any JComponent that will end up
+     * calling the LookAndFeel.getDisabledIcon method. This client property,
+     * when set to Boolean.TRUE, will cause getDisabledIcon to use an
+     * alternate algorithm for creating disabled icons to produce icons
+     * that appear similar to the native Windows file chooser
+     */
+    static final Object HI_RES_DISABLED_ICON_CLIENT_KEY =
+        new StringUIClientPropertyKey(
+            "WindowsLookAndFeel.generateHiResDisabledIcon");
+
+    private boolean updatePending = false;
+
+    private boolean useSystemFontSettings = true;
+    private boolean useSystemFontSizeSettings;
+
+    // These properties are not used directly, but are kept as
+    // private members to avoid being GC'd.
+    private WindowsDesktopProperty themeActive, dllName, colorName, sizeName;
+    private WindowsDesktopProperty aaSettings;
+
+    private transient LayoutStyle style;
+
+    /**
+     * Base dialog units along the horizontal axis.
+     */
+    private int baseUnitX;
+
+    /**
+     * Base dialog units along the vertical axis.
+     */
+    private int baseUnitY;
+
+    public String getName() {
+        return "Windows";
+    }
+
+    public String getDescription() {
+        return "The Microsoft Windows Look and Feel";
+    }
+
+    public String getID() {
+        return "Windows";
+    }
+
+    public boolean isNativeLookAndFeel() {
+        return OSInfo.getOSType() == OSInfo.OSType.WINDOWS;
+    }
+
+    public boolean isSupportedLookAndFeel() {
+        return isNativeLookAndFeel();
+    }
+
+    public void initialize() {
+        super.initialize();
+
+        // Set the flag which determines which version of Windows should
+        // be rendered. This flag only need to be set once.
+        // if version <= 4.0 then the classic LAF should be loaded.
+        if (OSInfo.getWindowsVersion().compareTo(OSInfo.WINDOWS_95) <= 0) {
+            isClassicWindows = true;
+        } else {
+            isClassicWindows = false;
+            XPStyle.invalidateStyle();
+        }
+
+        // Using the fonts set by the user can potentially cause
+        // performance and compatibility issues, so allow this feature
+        // to be switched off either at runtime or programmatically
+        //
+        String systemFonts = java.security.AccessController.doPrivileged(
+               new GetPropertyAction("swing.useSystemFontSettings"));
+        useSystemFontSettings = (systemFonts == null ||
+                                 Boolean.valueOf(systemFonts).booleanValue());
+
+        if (useSystemFontSettings) {
+            Object value = UIManager.get("Application.useSystemFontSettings");
+
+            useSystemFontSettings = (value == null ||
+                                     Boolean.TRUE.equals(value));
+        }
+        KeyboardFocusManager.getCurrentKeyboardFocusManager().
+            addKeyEventPostProcessor(WindowsRootPaneUI.altProcessor);
+
+    }
+
+    /**
+     * Initialize the uiClassID to BasicComponentUI mapping.
+     * The JComponent classes define their own uiClassID constants
+     * (see AbstractComponent.getUIClassID).  This table must
+     * map those constants to a BasicComponentUI class of the
+     * appropriate type.
+     *
+     * @see BasicLookAndFeel#getDefaults
+     */
+    protected void initClassDefaults(UIDefaults table)
+    {
+        super.initClassDefaults(table);
+
+        final String windowsPackageName = "com.sun.java.swing.plaf.windows.";
+
+        Object[] uiDefaults = {
+              "ButtonUI", windowsPackageName + "WindowsButtonUI",
+            "CheckBoxUI", windowsPackageName + "WindowsCheckBoxUI",
+    "CheckBoxMenuItemUI", windowsPackageName + "WindowsCheckBoxMenuItemUI",
+               "LabelUI", windowsPackageName + "WindowsLabelUI",
+         "RadioButtonUI", windowsPackageName + "WindowsRadioButtonUI",
+ "RadioButtonMenuItemUI", windowsPackageName + "WindowsRadioButtonMenuItemUI",
+        "ToggleButtonUI", windowsPackageName + "WindowsToggleButtonUI",
+         "ProgressBarUI", windowsPackageName + "WindowsProgressBarUI",
+              "SliderUI", windowsPackageName + "WindowsSliderUI",
+           "SeparatorUI", windowsPackageName + "WindowsSeparatorUI",
+           "SplitPaneUI", windowsPackageName + "WindowsSplitPaneUI",
+             "SpinnerUI", windowsPackageName + "WindowsSpinnerUI",
+          "TabbedPaneUI", windowsPackageName + "WindowsTabbedPaneUI",
+            "TextAreaUI", windowsPackageName + "WindowsTextAreaUI",
+           "TextFieldUI", windowsPackageName + "WindowsTextFieldUI",
+       "PasswordFieldUI", windowsPackageName + "WindowsPasswordFieldUI",
+            "TextPaneUI", windowsPackageName + "WindowsTextPaneUI",
+          "EditorPaneUI", windowsPackageName + "WindowsEditorPaneUI",
+                "TreeUI", windowsPackageName + "WindowsTreeUI",
+             "ToolBarUI", windowsPackageName + "WindowsToolBarUI",
+    "ToolBarSeparatorUI", windowsPackageName + "WindowsToolBarSeparatorUI",
+            "ComboBoxUI", windowsPackageName + "WindowsComboBoxUI",
+         "TableHeaderUI", windowsPackageName + "WindowsTableHeaderUI",
+       "InternalFrameUI", windowsPackageName + "WindowsInternalFrameUI",
+         "DesktopPaneUI", windowsPackageName + "WindowsDesktopPaneUI",
+         "DesktopIconUI", windowsPackageName + "WindowsDesktopIconUI",
+         "FileChooserUI", windowsPackageName + "WindowsFileChooserUI",
+                "MenuUI", windowsPackageName + "WindowsMenuUI",
+            "MenuItemUI", windowsPackageName + "WindowsMenuItemUI",
+             "MenuBarUI", windowsPackageName + "WindowsMenuBarUI",
+           "PopupMenuUI", windowsPackageName + "WindowsPopupMenuUI",
+  "PopupMenuSeparatorUI", windowsPackageName + "WindowsPopupMenuSeparatorUI",
+           "ScrollBarUI", windowsPackageName + "WindowsScrollBarUI",
+            "RootPaneUI", windowsPackageName + "WindowsRootPaneUI"
+        };
+
+        table.putDefaults(uiDefaults);
+    }
+
+    /**
+     * Load the SystemColors into the defaults table.  The keys
+     * for SystemColor defaults are the same as the names of
+     * the public fields in SystemColor.  If the table is being
+     * created on a native Windows platform we use the SystemColor
+     * values, otherwise we create color objects whose values match
+     * the defaults Windows95 colors.
+     */
+    protected void initSystemColorDefaults(UIDefaults table)
+    {
+        String[] defaultSystemColors = {
+                "desktop", "#005C5C", /* Color of the desktop background */
+          "activeCaption", "#000080", /* Color for captions (title bars) when they are active. */
+      "activeCaptionText", "#FFFFFF", /* Text color for text in captions (title bars). */
+    "activeCaptionBorder", "#C0C0C0", /* Border color for caption (title bar) window borders. */
+        "inactiveCaption", "#808080", /* Color for captions (title bars) when not active. */
+    "inactiveCaptionText", "#C0C0C0", /* Text color for text in inactive captions (title bars). */
+  "inactiveCaptionBorder", "#C0C0C0", /* Border color for inactive caption (title bar) window borders. */
+                 "window", "#FFFFFF", /* Default color for the interior of windows */
+           "windowBorder", "#000000", /* ??? */
+             "windowText", "#000000", /* ??? */
+                   "menu", "#C0C0C0", /* Background color for menus */
+       "menuPressedItemB", "#000080", /* LightShadow of menubutton highlight */
+       "menuPressedItemF", "#FFFFFF", /* Default color for foreground "text" in menu item */
+               "menuText", "#000000", /* Text color for menus  */
+                   "text", "#C0C0C0", /* Text background color */
+               "textText", "#000000", /* Text foreground color */
+          "textHighlight", "#000080", /* Text background color when selected */
+      "textHighlightText", "#FFFFFF", /* Text color when selected */
+       "textInactiveText", "#808080", /* Text color when disabled */
+                "control", "#C0C0C0", /* Default color for controls (buttons, sliders, etc) */
+            "controlText", "#000000", /* Default color for text in controls */
+       "controlHighlight", "#C0C0C0",
+
+  /*"controlHighlight", "#E0E0E0",*/ /* Specular highlight (opposite of the shadow) */
+     "controlLtHighlight", "#FFFFFF", /* Highlight color for controls */
+          "controlShadow", "#808080", /* Shadow color for controls */
+        "controlDkShadow", "#000000", /* Dark shadow color for controls */
+              "scrollbar", "#E0E0E0", /* Scrollbar background (usually the "track") */
+                   "info", "#FFFFE1", /* ??? */
+               "infoText", "#000000"  /* ??? */
+        };
+
+        loadSystemColors(table, defaultSystemColors, isNativeLookAndFeel());
+    }
+
+   /**
+     * Initialize the defaults table with the name of the ResourceBundle
+     * used for getting localized defaults.
+     */
+    private void initResourceBundle(UIDefaults table) {
+        SwingAccessor.getUIDefaultsAccessor()
+                     .addInternalBundle(table,
+                             "com.sun.java.swing.plaf.windows.resources.windows");
+    }
+
+    // XXX - there are probably a lot of redundant values that could be removed.
+    // ie. Take a look at RadioButtonBorder, etc...
+    protected void initComponentDefaults(UIDefaults table)
+    {
+        super.initComponentDefaults( table );
+
+        initResourceBundle(table);
+
+        // *** Shared Fonts
+        LazyValue dialogPlain12 = t -> new FontUIResource(Font.DIALOG, Font.PLAIN, 12);
+
+        LazyValue sansSerifPlain12 =  t -> new FontUIResource(Font.SANS_SERIF, Font.PLAIN, 12);
+        LazyValue monospacedPlain12 = t -> new FontUIResource(Font.MONOSPACED, Font.PLAIN, 12);
+        LazyValue dialogBold12 = t -> new FontUIResource(Font.DIALOG, Font.BOLD, 12);
+
+        // *** Colors
+        // XXX - some of these doens't seem to be used
+        ColorUIResource red = new ColorUIResource(Color.red);
+        ColorUIResource black = new ColorUIResource(Color.black);
+        ColorUIResource white = new ColorUIResource(Color.white);
+        ColorUIResource gray = new ColorUIResource(Color.gray);
+        ColorUIResource darkGray = new ColorUIResource(Color.darkGray);
+        ColorUIResource scrollBarTrackHighlight = darkGray;
+
+        // Set the flag which determines which version of Windows should
+        // be rendered. This flag only need to be set once.
+        // if version <= 4.0 then the classic LAF should be loaded.
+        isClassicWindows = OSInfo.getWindowsVersion().compareTo(OSInfo.WINDOWS_95) <= 0;
+
+        // *** Tree
+        Object treeExpandedIcon = WindowsTreeUI.ExpandedIcon.createExpandedIcon();
+
+        Object treeCollapsedIcon = WindowsTreeUI.CollapsedIcon.createCollapsedIcon();
+
+
+        // *** Text
+        Object fieldInputMap = new UIDefaults.LazyInputMap(new Object[] {
+                      "control C", DefaultEditorKit.copyAction,
+                      "control V", DefaultEditorKit.pasteAction,
+                      "control X", DefaultEditorKit.cutAction,
+                           "COPY", DefaultEditorKit.copyAction,
+                          "PASTE", DefaultEditorKit.pasteAction,
+                            "CUT", DefaultEditorKit.cutAction,
+                 "control INSERT", DefaultEditorKit.copyAction,
+                   "shift INSERT", DefaultEditorKit.pasteAction,
+                   "shift DELETE", DefaultEditorKit.cutAction,
+                      "control A", DefaultEditorKit.selectAllAction,
+             "control BACK_SLASH", "unselect"/*DefaultEditorKit.unselectAction*/,
+                     "shift LEFT", DefaultEditorKit.selectionBackwardAction,
+                    "shift RIGHT", DefaultEditorKit.selectionForwardAction,
+                   "control LEFT", DefaultEditorKit.previousWordAction,
+                  "control RIGHT", DefaultEditorKit.nextWordAction,
+             "control shift LEFT", DefaultEditorKit.selectionPreviousWordAction,
+            "control shift RIGHT", DefaultEditorKit.selectionNextWordAction,
+                           "HOME", DefaultEditorKit.beginLineAction,
+                            "END", DefaultEditorKit.endLineAction,
+                     "shift HOME", DefaultEditorKit.selectionBeginLineAction,
+                      "shift END", DefaultEditorKit.selectionEndLineAction,
+                     "BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
+               "shift BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
+                         "ctrl H", DefaultEditorKit.deletePrevCharAction,
+                         "DELETE", DefaultEditorKit.deleteNextCharAction,
+                    "ctrl DELETE", DefaultEditorKit.deleteNextWordAction,
+                "ctrl BACK_SPACE", DefaultEditorKit.deletePrevWordAction,
+                          "RIGHT", DefaultEditorKit.forwardAction,
+                           "LEFT", DefaultEditorKit.backwardAction,
+                       "KP_RIGHT", DefaultEditorKit.forwardAction,
+                        "KP_LEFT", DefaultEditorKit.backwardAction,
+                          "ENTER", JTextField.notifyAction,
+                "control shift O", "toggle-componentOrientation"/*DefaultEditorKit.toggleComponentOrientation*/
+        });
+
+        Object passwordInputMap = new UIDefaults.LazyInputMap(new Object[] {
+                      "control C", DefaultEditorKit.copyAction,
+                      "control V", DefaultEditorKit.pasteAction,
+                      "control X", DefaultEditorKit.cutAction,
+                           "COPY", DefaultEditorKit.copyAction,
+                          "PASTE", DefaultEditorKit.pasteAction,
+                            "CUT", DefaultEditorKit.cutAction,
+                 "control INSERT", DefaultEditorKit.copyAction,
+                   "shift INSERT", DefaultEditorKit.pasteAction,
+                   "shift DELETE", DefaultEditorKit.cutAction,
+                      "control A", DefaultEditorKit.selectAllAction,
+             "control BACK_SLASH", "unselect"/*DefaultEditorKit.unselectAction*/,
+                     "shift LEFT", DefaultEditorKit.selectionBackwardAction,
+                    "shift RIGHT", DefaultEditorKit.selectionForwardAction,
+                   "control LEFT", DefaultEditorKit.beginLineAction,
+                  "control RIGHT", DefaultEditorKit.endLineAction,
+             "control shift LEFT", DefaultEditorKit.selectionBeginLineAction,
+            "control shift RIGHT", DefaultEditorKit.selectionEndLineAction,
+                           "HOME", DefaultEditorKit.beginLineAction,
+                            "END", DefaultEditorKit.endLineAction,
+                     "shift HOME", DefaultEditorKit.selectionBeginLineAction,
+                      "shift END", DefaultEditorKit.selectionEndLineAction,
+                     "BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
+               "shift BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
+                         "ctrl H", DefaultEditorKit.deletePrevCharAction,
+                         "DELETE", DefaultEditorKit.deleteNextCharAction,
+                          "RIGHT", DefaultEditorKit.forwardAction,
+                           "LEFT", DefaultEditorKit.backwardAction,
+                       "KP_RIGHT", DefaultEditorKit.forwardAction,
+                        "KP_LEFT", DefaultEditorKit.backwardAction,
+                          "ENTER", JTextField.notifyAction,
+                "control shift O", "toggle-componentOrientation"/*DefaultEditorKit.toggleComponentOrientation*/
+        });
+
+        Object multilineInputMap = new UIDefaults.LazyInputMap(new Object[] {
+                      "control C", DefaultEditorKit.copyAction,
+                      "control V", DefaultEditorKit.pasteAction,
+                      "control X", DefaultEditorKit.cutAction,
+                           "COPY", DefaultEditorKit.copyAction,
+                          "PASTE", DefaultEditorKit.pasteAction,
+                            "CUT", DefaultEditorKit.cutAction,
+                 "control INSERT", DefaultEditorKit.copyAction,
+                   "shift INSERT", DefaultEditorKit.pasteAction,
+                   "shift DELETE", DefaultEditorKit.cutAction,
+                     "shift LEFT", DefaultEditorKit.selectionBackwardAction,
+                    "shift RIGHT", DefaultEditorKit.selectionForwardAction,
+                   "control LEFT", DefaultEditorKit.previousWordAction,
+                  "control RIGHT", DefaultEditorKit.nextWordAction,
+             "control shift LEFT", DefaultEditorKit.selectionPreviousWordAction,
+            "control shift RIGHT", DefaultEditorKit.selectionNextWordAction,
+                      "control A", DefaultEditorKit.selectAllAction,
+             "control BACK_SLASH", "unselect"/*DefaultEditorKit.unselectAction*/,
+                           "HOME", DefaultEditorKit.beginLineAction,
+                            "END", DefaultEditorKit.endLineAction,
+                     "shift HOME", DefaultEditorKit.selectionBeginLineAction,
+                      "shift END", DefaultEditorKit.selectionEndLineAction,
+                   "control HOME", DefaultEditorKit.beginAction,
+                    "control END", DefaultEditorKit.endAction,
+             "control shift HOME", DefaultEditorKit.selectionBeginAction,
+              "control shift END", DefaultEditorKit.selectionEndAction,
+                             "UP", DefaultEditorKit.upAction,
+                           "DOWN", DefaultEditorKit.downAction,
+                     "BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
+               "shift BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
+                         "ctrl H", DefaultEditorKit.deletePrevCharAction,
+                         "DELETE", DefaultEditorKit.deleteNextCharAction,
+                    "ctrl DELETE", DefaultEditorKit.deleteNextWordAction,
+                "ctrl BACK_SPACE", DefaultEditorKit.deletePrevWordAction,
+                          "RIGHT", DefaultEditorKit.forwardAction,
+                           "LEFT", DefaultEditorKit.backwardAction,
+                       "KP_RIGHT", DefaultEditorKit.forwardAction,
+                        "KP_LEFT", DefaultEditorKit.backwardAction,
+                        "PAGE_UP", DefaultEditorKit.pageUpAction,
+                      "PAGE_DOWN", DefaultEditorKit.pageDownAction,
+                  "shift PAGE_UP", "selection-page-up",
+                "shift PAGE_DOWN", "selection-page-down",
+             "ctrl shift PAGE_UP", "selection-page-left",
+           "ctrl shift PAGE_DOWN", "selection-page-right",
+                       "shift UP", DefaultEditorKit.selectionUpAction,
+                     "shift DOWN", DefaultEditorKit.selectionDownAction,
+                          "ENTER", DefaultEditorKit.insertBreakAction,
+                            "TAB", DefaultEditorKit.insertTabAction,
+                      "control T", "next-link-action",
+                "control shift T", "previous-link-action",
+                  "control SPACE", "activate-link-action",
+                "control shift O", "toggle-componentOrientation"/*DefaultEditorKit.toggleComponentOrientation*/
+        });
+
+        Object menuItemAcceleratorDelimiter = "+";
+
+        Object ControlBackgroundColor = new WindowsDesktopProperty(
+                                                       "win.3d.backgroundColor",
+                                                        table.get("control"));
+        Object ControlLightColor      = new WindowsDesktopProperty(
+                                                       "win.3d.lightColor",
+                                                        table.get("controlHighlight"));
+        Object ControlHighlightColor  = new WindowsDesktopProperty(
+                                                       "win.3d.highlightColor",
+                                                        table.get("controlLtHighlight"));
+        Object ControlShadowColor     = new WindowsDesktopProperty(
+                                                       "win.3d.shadowColor",
+                                                        table.get("controlShadow"));
+        Object ControlDarkShadowColor = new WindowsDesktopProperty(
+                                                       "win.3d.darkShadowColor",
+                                                        table.get("controlDkShadow"));
+        Object ControlTextColor       = new WindowsDesktopProperty(
+                                                       "win.button.textColor",
+                                                        table.get("controlText"));
+        Object MenuBackgroundColor    = new WindowsDesktopProperty(
+                                                       "win.menu.backgroundColor",
+                                                        table.get("menu"));
+        Object MenuBarBackgroundColor = new WindowsDesktopProperty(
+                                                       "win.menubar.backgroundColor",
+                                                        table.get("menu"));
+        Object MenuTextColor          = new WindowsDesktopProperty(
+                                                       "win.menu.textColor",
+                                                        table.get("menuText"));
+        Object SelectionBackgroundColor = new WindowsDesktopProperty(
+                                                       "win.item.highlightColor",
+                                                        table.get("textHighlight"));
+        Object SelectionTextColor     = new WindowsDesktopProperty(
+                                                       "win.item.highlightTextColor",
+                                                        table.get("textHighlightText"));
+        Object WindowBackgroundColor  = new WindowsDesktopProperty(
+                                                       "win.frame.backgroundColor",
+                                                        table.get("window"));
+        Object WindowTextColor        = new WindowsDesktopProperty(
+                                                       "win.frame.textColor",
+                                                        table.get("windowText"));
+        Object WindowBorderWidth      = new WindowsDesktopProperty(
+                                                       "win.frame.sizingBorderWidth",
+                                                       Integer.valueOf(1));
+        Object TitlePaneHeight        = new WindowsDesktopProperty(
+                                                       "win.frame.captionHeight",
+                                                       Integer.valueOf(18));
+        Object TitleButtonWidth       = new WindowsDesktopProperty(
+                                                       "win.frame.captionButtonWidth",
+                                                       Integer.valueOf(16));
+        Object TitleButtonHeight      = new WindowsDesktopProperty(
+                                                       "win.frame.captionButtonHeight",
+                                                       Integer.valueOf(16));
+        Object InactiveTextColor      = new WindowsDesktopProperty(
+                                                       "win.text.grayedTextColor",
+                                                        table.get("textInactiveText"));
+        Object ScrollbarBackgroundColor = new WindowsDesktopProperty(
+                                                       "win.scrollbar.backgroundColor",
+                                                        table.get("scrollbar"));
+        Object buttonFocusColor = new FocusColorProperty();
+
+        Object TextBackground         = new XPColorValue(Part.EP_EDIT, null, Prop.FILLCOLOR,
+                                                         WindowBackgroundColor);
+        //The following four lines were commented out as part of bug 4991597
+        //This code *is* correct, however it differs from WindowsXP and is, apparently
+        //a Windows XP bug. Until Windows fixes this bug, we shall also exhibit the same
+        //behavior
+        //Object ReadOnlyTextBackground = new XPColorValue(Part.EP_EDITTEXT, State.READONLY, Prop.FILLCOLOR,
+        //                                                 ControlBackgroundColor);
+        //Object DisabledTextBackground = new XPColorValue(Part.EP_EDITTEXT, State.DISABLED, Prop.FILLCOLOR,
+        //                                                 ControlBackgroundColor);
+        Object ReadOnlyTextBackground = ControlBackgroundColor;
+        Object DisabledTextBackground = ControlBackgroundColor;
+
+        Object MenuFont = dialogPlain12;
+        Object FixedControlFont = monospacedPlain12;
+        Object ControlFont = dialogPlain12;
+        Object MessageFont = dialogPlain12;
+        Object WindowFont = dialogBold12;
+        Object ToolTipFont = sansSerifPlain12;
+        Object IconFont = ControlFont;
+
+        Object scrollBarWidth = new WindowsDesktopProperty("win.scrollbar.width", Integer.valueOf(16));
+
+        Object menuBarHeight = new WindowsDesktopProperty("win.menu.height", null);
+
+        Object hotTrackingOn = new WindowsDesktopProperty("win.item.hotTrackingOn", true);
+
+        Object showMnemonics = new WindowsDesktopProperty("win.menu.keyboardCuesOn", Boolean.TRUE);
+
+        if (useSystemFontSettings) {
+            MenuFont = getDesktopFontValue("win.menu.font", MenuFont);
+            FixedControlFont = getDesktopFontValue("win.ansiFixed.font", FixedControlFont);
+            ControlFont = getDesktopFontValue("win.defaultGUI.font", ControlFont);
+            MessageFont = getDesktopFontValue("win.messagebox.font", MessageFont);
+            WindowFont = getDesktopFontValue("win.frame.captionFont", WindowFont);
+            IconFont    = getDesktopFontValue("win.icon.font", IconFont);
+            ToolTipFont = getDesktopFontValue("win.tooltip.font", ToolTipFont);
+
+            /* Put the desktop AA settings in the defaults.
+             * JComponent.setUI() retrieves this and makes it available
+             * as a client property on the JComponent. Use the same key name
+             * for both client property and UIDefaults.
+             * Also need to set up listeners for changes in these settings.
+             */
+            SwingUtilities2.putAATextInfo(true, table);
+            this.aaSettings =
+                new FontDesktopProperty(SunToolkit.DESKTOPFONTHINTS);
+        }
+        if (useSystemFontSizeSettings) {
+            MenuFont = new WindowsFontSizeProperty("win.menu.font.height", Font.DIALOG, Font.PLAIN, 12);
+            FixedControlFont = new WindowsFontSizeProperty("win.ansiFixed.font.height", Font.MONOSPACED,
+                       Font.PLAIN, 12);
+            ControlFont = new WindowsFontSizeProperty("win.defaultGUI.font.height", Font.DIALOG, Font.PLAIN, 12);
+            MessageFont = new WindowsFontSizeProperty("win.messagebox.font.height", Font.DIALOG, Font.PLAIN, 12);
+            WindowFont = new WindowsFontSizeProperty("win.frame.captionFont.height", Font.DIALOG, Font.BOLD, 12);
+            ToolTipFont = new WindowsFontSizeProperty("win.tooltip.font.height", Font.SANS_SERIF, Font.PLAIN, 12);
+            IconFont    = new WindowsFontSizeProperty("win.icon.font.height", Font.DIALOG, Font.PLAIN, 12);
+        }
+
+
+        if (!(this instanceof WindowsClassicLookAndFeel) &&
+            (OSInfo.getOSType() == OSInfo.OSType.WINDOWS &&
+             OSInfo.getWindowsVersion().compareTo(OSInfo.WINDOWS_XP) >= 0) &&
+            AccessController.doPrivileged(new GetPropertyAction("swing.noxp")) == null) {
+
+            // These desktop properties are not used directly, but are needed to
+            // trigger realoading of UI's.
+            this.themeActive = new TriggerDesktopProperty("win.xpstyle.themeActive");
+            this.dllName     = new TriggerDesktopProperty("win.xpstyle.dllName");
+            this.colorName   = new TriggerDesktopProperty("win.xpstyle.colorName");
+            this.sizeName    = new TriggerDesktopProperty("win.xpstyle.sizeName");
+        }
+
+
+        Object[] defaults = {
+            // *** Auditory Feedback
+            // this key defines which of the various cues to render
+            // Overridden from BasicL&F. This L&F should play all sounds
+            // all the time. The infrastructure decides what to play.
+            // This is disabled until sound bugs can be resolved.
+            "AuditoryCues.playList", null, // table.get("AuditoryCues.cueList"),
+
+            "Application.useSystemFontSettings", Boolean.valueOf(useSystemFontSettings),
+
+            "TextField.focusInputMap", fieldInputMap,
+            "PasswordField.focusInputMap", passwordInputMap,
+            "TextArea.focusInputMap", multilineInputMap,
+            "TextPane.focusInputMap", multilineInputMap,
+            "EditorPane.focusInputMap", multilineInputMap,
+
+            // Buttons
+            "Button.font", ControlFont,
+            "Button.background", ControlBackgroundColor,
+            // Button.foreground, Button.shadow, Button.darkShadow,
+            // Button.disabledForground, and Button.disabledShadow are only
+            // used for Windows Classic. Windows XP will use colors
+            // from the current visual style.
+            "Button.foreground", ControlTextColor,
+            "Button.shadow", ControlShadowColor,
+            "Button.darkShadow", ControlDarkShadowColor,
+            "Button.light", ControlLightColor,
+            "Button.highlight", ControlHighlightColor,
+            "Button.disabledForeground", InactiveTextColor,
+            "Button.disabledShadow", ControlHighlightColor,
+            "Button.focus", buttonFocusColor,
+            "Button.dashedRectGapX", new XPValue(Integer.valueOf(3), Integer.valueOf(5)),
+            "Button.dashedRectGapY", new XPValue(Integer.valueOf(3), Integer.valueOf(4)),
+            "Button.dashedRectGapWidth", new XPValue(Integer.valueOf(6), Integer.valueOf(10)),
+            "Button.dashedRectGapHeight", new XPValue(Integer.valueOf(6), Integer.valueOf(8)),
+            "Button.textShiftOffset", new XPValue(Integer.valueOf(0),
+                                                  Integer.valueOf(1)),
+            // W2K keyboard navigation hidding.
+            "Button.showMnemonics", showMnemonics,
+            "Button.focusInputMap",
+               new UIDefaults.LazyInputMap(new Object[] {
+                            "SPACE", "pressed",
+                   "released SPACE", "released"
+                 }),
+
+            "Caret.width",
+                  new WindowsDesktopProperty("win.caret.width", null),
+
+            "CheckBox.font", ControlFont,
+            "CheckBox.interiorBackground", WindowBackgroundColor,
+            "CheckBox.background", ControlBackgroundColor,
+            "CheckBox.foreground", WindowTextColor,
+            "CheckBox.shadow", ControlShadowColor,
+            "CheckBox.darkShadow", ControlDarkShadowColor,
+            "CheckBox.light", ControlLightColor,
+            "CheckBox.highlight", ControlHighlightColor,
+            "CheckBox.focus", buttonFocusColor,
+            "CheckBox.focusInputMap",
+               new UIDefaults.LazyInputMap(new Object[] {
+                            "SPACE", "pressed",
+                   "released SPACE", "released"
+                 }),
+            // margin is 2 all the way around, BasicBorders.RadioButtonBorder
+            // (checkbox uses RadioButtonBorder) is 2 all the way around too.
+            "CheckBox.totalInsets", new Insets(4, 4, 4, 4),
+
+            "CheckBoxMenuItem.font", MenuFont,
+            "CheckBoxMenuItem.background", MenuBackgroundColor,
+            "CheckBoxMenuItem.foreground", MenuTextColor,
+            "CheckBoxMenuItem.selectionForeground", SelectionTextColor,
+            "CheckBoxMenuItem.selectionBackground", SelectionBackgroundColor,
+            "CheckBoxMenuItem.acceleratorForeground", MenuTextColor,
+            "CheckBoxMenuItem.acceleratorSelectionForeground", SelectionTextColor,
+            "CheckBoxMenuItem.commandSound", "win.sound.menuCommand",
+
+            "ComboBox.font", ControlFont,
+            "ComboBox.background", WindowBackgroundColor,
+            "ComboBox.foreground", WindowTextColor,
+            "ComboBox.buttonBackground", ControlBackgroundColor,
+            "ComboBox.buttonShadow", ControlShadowColor,
+            "ComboBox.buttonDarkShadow", ControlDarkShadowColor,
+            "ComboBox.buttonHighlight", ControlHighlightColor,
+            "ComboBox.selectionBackground", SelectionBackgroundColor,
+            "ComboBox.selectionForeground", SelectionTextColor,
+            "ComboBox.editorBorder", new XPValue(new EmptyBorder(1,4,1,1),
+                                                 new EmptyBorder(1,4,1,4)),
+            "ComboBox.disabledBackground",
+                        new XPColorValue(Part.CP_COMBOBOX, State.DISABLED,
+                        Prop.FILLCOLOR, DisabledTextBackground),
+            "ComboBox.disabledForeground",
+                        new XPColorValue(Part.CP_COMBOBOX, State.DISABLED,
+                        Prop.TEXTCOLOR, InactiveTextColor),
+            "ComboBox.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] {
+                   "ESCAPE", "hidePopup",
+                  "PAGE_UP", "pageUpPassThrough",
+                "PAGE_DOWN", "pageDownPassThrough",
+                     "HOME", "homePassThrough",
+                      "END", "endPassThrough",
+                     "DOWN", "selectNext2",
+                  "KP_DOWN", "selectNext2",
+                       "UP", "selectPrevious2",
+                    "KP_UP", "selectPrevious2",
+                    "ENTER", "enterPressed",
+                       "F4", "togglePopup",
+                 "alt DOWN", "togglePopup",
+              "alt KP_DOWN", "togglePopup",
+                   "alt UP", "togglePopup",
+                "alt KP_UP", "togglePopup"
+              }),
+
+            // DeskTop.
+            "Desktop.background", new WindowsDesktopProperty(
+                                                 "win.mdi.backgroundColor",
+                                                  table.get("desktop")),
+            "Desktop.ancestorInputMap",
+               new UIDefaults.LazyInputMap(new Object[] {
+                   "ctrl F5", "restore",
+                   "ctrl F4", "close",
+                   "ctrl F7", "move",
+                   "ctrl F8", "resize",
+                   "RIGHT", "right",
+                   "KP_RIGHT", "right",
+                   "LEFT", "left",
+                   "KP_LEFT", "left",
+                   "UP", "up",
+                   "KP_UP", "up",
+                   "DOWN", "down",
+                   "KP_DOWN", "down",
+                   "ESCAPE", "escape",
+                   "ctrl F9", "minimize",
+                   "ctrl F10", "maximize",
+                   "ctrl F6", "selectNextFrame",
+                   "ctrl TAB", "selectNextFrame",
+                   "ctrl alt F6", "selectNextFrame",
+                   "shift ctrl alt F6", "selectPreviousFrame",
+                   "ctrl F12", "navigateNext",
+                   "shift ctrl F12", "navigatePrevious"
+               }),
+
+            // DesktopIcon
+            "DesktopIcon.width", Integer.valueOf(160),
+
+            "EditorPane.font", ControlFont,
+            "EditorPane.background", WindowBackgroundColor,
+            "EditorPane.foreground", WindowTextColor,
+            "EditorPane.selectionBackground", SelectionBackgroundColor,
+            "EditorPane.selectionForeground", SelectionTextColor,
+            "EditorPane.caretForeground", WindowTextColor,
+            "EditorPane.inactiveForeground", InactiveTextColor,
+            "EditorPane.inactiveBackground", WindowBackgroundColor,
+            "EditorPane.disabledBackground", DisabledTextBackground,
+
+            "FileChooser.homeFolderIcon",  new LazyWindowsIcon(null,
+                                                               "icons/HomeFolder.gif"),
+            "FileChooser.listFont", IconFont,
+            "FileChooser.listViewBackground", new XPColorValue(Part.LVP_LISTVIEW, null, Prop.FILLCOLOR,
+                                                               WindowBackgroundColor),
+            "FileChooser.listViewBorder", new XPBorderValue(Part.LVP_LISTVIEW,
+               (LazyValue) t -> BorderUIResource.getLoweredBevelBorderUIResource()),
+            "FileChooser.listViewIcon",    new LazyWindowsIcon("fileChooserIcon ListView",
+                                                               "icons/ListView.gif"),
+            "FileChooser.listViewWindowsStyle", Boolean.TRUE,
+            "FileChooser.detailsViewIcon", new LazyWindowsIcon("fileChooserIcon DetailsView",
+                                                               "icons/DetailsView.gif"),
+            "FileChooser.viewMenuIcon", new LazyWindowsIcon("fileChooserIcon ViewMenu",
+                                                            "icons/ListView.gif"),
+            "FileChooser.upFolderIcon",    new LazyWindowsIcon("fileChooserIcon UpFolder",
+                                                               "icons/UpFolder.gif"),
+            "FileChooser.newFolderIcon",   new LazyWindowsIcon("fileChooserIcon NewFolder",
+                                                               "icons/NewFolder.gif"),
+            "FileChooser.useSystemExtensionHiding", Boolean.TRUE,
+
+            "FileChooser.usesSingleFilePane", Boolean.TRUE,
+            "FileChooser.noPlacesBar", new WindowsDesktopProperty("win.comdlg.noPlacesBar",
+                                                                  Boolean.FALSE),
+            "FileChooser.ancestorInputMap",
+               new UIDefaults.LazyInputMap(new Object[] {
+                     "ESCAPE", "cancelSelection",
+                     "F2", "editFileName",
+                     "F5", "refresh",
+                     "BACK_SPACE", "Go Up"
+                 }),
+
+            "FileView.directoryIcon", SwingUtilities2.makeIcon(getClass(),
+                                                               WindowsLookAndFeel.class,
+                                                               "icons/Directory.gif"),
+            "FileView.fileIcon", SwingUtilities2.makeIcon(getClass(),
+                                                          WindowsLookAndFeel.class,
+                                                          "icons/File.gif"),
+            "FileView.computerIcon", SwingUtilities2.makeIcon(getClass(),
+                                                              WindowsLookAndFeel.class,
+                                                              "icons/Computer.gif"),
+            "FileView.hardDriveIcon", SwingUtilities2.makeIcon(getClass(),
+                                                               WindowsLookAndFeel.class,
+                                                               "icons/HardDrive.gif"),
+            "FileView.floppyDriveIcon", SwingUtilities2.makeIcon(getClass(),
+                                                                 WindowsLookAndFeel.class,
+                                                                 "icons/FloppyDrive.gif"),
+
+            "FormattedTextField.font", ControlFont,
+            "InternalFrame.titleFont", WindowFont,
+            "InternalFrame.titlePaneHeight",   TitlePaneHeight,
+            "InternalFrame.titleButtonWidth",  TitleButtonWidth,
+            "InternalFrame.titleButtonHeight", TitleButtonHeight,
+            "InternalFrame.titleButtonToolTipsOn", hotTrackingOn,
+            "InternalFrame.borderColor", ControlBackgroundColor,
+            "InternalFrame.borderShadow", ControlShadowColor,
+            "InternalFrame.borderDarkShadow", ControlDarkShadowColor,
+            "InternalFrame.borderHighlight", ControlHighlightColor,
+            "InternalFrame.borderLight", ControlLightColor,
+            "InternalFrame.borderWidth", WindowBorderWidth,
+            "InternalFrame.minimizeIconBackground", ControlBackgroundColor,
+            "InternalFrame.resizeIconHighlight", ControlLightColor,
+            "InternalFrame.resizeIconShadow", ControlShadowColor,
+            "InternalFrame.activeBorderColor", new WindowsDesktopProperty(
+                                                       "win.frame.activeBorderColor",
+                                                       table.get("windowBorder")),
+            "InternalFrame.inactiveBorderColor", new WindowsDesktopProperty(
+                                                       "win.frame.inactiveBorderColor",
+                                                       table.get("windowBorder")),
+            "InternalFrame.activeTitleBackground", new WindowsDesktopProperty(
+                                                        "win.frame.activeCaptionColor",
+                                                         table.get("activeCaption")),
+            "InternalFrame.activeTitleGradient", new WindowsDesktopProperty(
+                                                        "win.frame.activeCaptionGradientColor",
+                                                         table.get("activeCaption")),
+            "InternalFrame.activeTitleForeground", new WindowsDesktopProperty(
+                                                        "win.frame.captionTextColor",
+                                                         table.get("activeCaptionText")),
+            "InternalFrame.inactiveTitleBackground", new WindowsDesktopProperty(
+                                                        "win.frame.inactiveCaptionColor",
+                                                         table.get("inactiveCaption")),
+            "InternalFrame.inactiveTitleGradient", new WindowsDesktopProperty(
+                                                        "win.frame.inactiveCaptionGradientColor",
+                                                         table.get("inactiveCaption")),
+            "InternalFrame.inactiveTitleForeground", new WindowsDesktopProperty(
+                                                        "win.frame.inactiveCaptionTextColor",
+                                                         table.get("inactiveCaptionText")),
+
+            "InternalFrame.maximizeIcon",
+                WindowsIconFactory.createFrameMaximizeIcon(),
+            "InternalFrame.minimizeIcon",
+                WindowsIconFactory.createFrameMinimizeIcon(),
+            "InternalFrame.iconifyIcon",
+                WindowsIconFactory.createFrameIconifyIcon(),
+            "InternalFrame.closeIcon",
+                WindowsIconFactory.createFrameCloseIcon(),
+            "InternalFrame.icon",
+                (LazyValue) t -> new WindowsInternalFrameTitlePane.ScalableIconUIResource(new Object[]{
+                    // The constructor takes one arg: an array of UIDefaults.LazyValue
+                    // representing the icons
+                        SwingUtilities2.makeIcon(getClass(), BasicLookAndFeel.class, "icons/JavaCup16.png"),
+                        SwingUtilities2.makeIcon(getClass(), WindowsLookAndFeel.class, "icons/JavaCup32.png")
+                }),
+            // Internal Frame Auditory Cue Mappings
+            "InternalFrame.closeSound", "win.sound.close",
+            "InternalFrame.maximizeSound", "win.sound.maximize",
+            "InternalFrame.minimizeSound", "win.sound.minimize",
+            "InternalFrame.restoreDownSound", "win.sound.restoreDown",
+            "InternalFrame.restoreUpSound", "win.sound.restoreUp",
+
+            "InternalFrame.windowBindings", new Object[] {
+                "shift ESCAPE", "showSystemMenu",
+                  "ctrl SPACE", "showSystemMenu",
+                      "ESCAPE", "hideSystemMenu"},
+
+            // Label
+            "Label.font", ControlFont,
+            "Label.background", ControlBackgroundColor,
+            "Label.foreground", WindowTextColor,
+            "Label.disabledForeground", InactiveTextColor,
+            "Label.disabledShadow", ControlHighlightColor,
+
+            // List.
+            "List.font", ControlFont,
+            "List.background", WindowBackgroundColor,
+            "List.foreground", WindowTextColor,
+            "List.selectionBackground", SelectionBackgroundColor,
+            "List.selectionForeground", SelectionTextColor,
+            "List.lockToPositionOnScroll", Boolean.TRUE,
+            "List.focusInputMap",
+               new UIDefaults.LazyInputMap(new Object[] {
+                           "ctrl C", "copy",
+                           "ctrl V", "paste",
+                           "ctrl X", "cut",
+                             "COPY", "copy",
+                            "PASTE", "paste",
+                              "CUT", "cut",
+                   "control INSERT", "copy",
+                     "shift INSERT", "paste",
+                     "shift DELETE", "cut",
+                               "UP", "selectPreviousRow",
+                            "KP_UP", "selectPreviousRow",
+                         "shift UP", "selectPreviousRowExtendSelection",
+                      "shift KP_UP", "selectPreviousRowExtendSelection",
+                    "ctrl shift UP", "selectPreviousRowExtendSelection",
+                 "ctrl shift KP_UP", "selectPreviousRowExtendSelection",
+                          "ctrl UP", "selectPreviousRowChangeLead",
+                       "ctrl KP_UP", "selectPreviousRowChangeLead",
+                             "DOWN", "selectNextRow",
+                          "KP_DOWN", "selectNextRow",
+                       "shift DOWN", "selectNextRowExtendSelection",
+                    "shift KP_DOWN", "selectNextRowExtendSelection",
+                  "ctrl shift DOWN", "selectNextRowExtendSelection",
+               "ctrl shift KP_DOWN", "selectNextRowExtendSelection",
+                        "ctrl DOWN", "selectNextRowChangeLead",
+                     "ctrl KP_DOWN", "selectNextRowChangeLead",
+                             "LEFT", "selectPreviousColumn",
+                          "KP_LEFT", "selectPreviousColumn",
+                       "shift LEFT", "selectPreviousColumnExtendSelection",
+                    "shift KP_LEFT", "selectPreviousColumnExtendSelection",
+                  "ctrl shift LEFT", "selectPreviousColumnExtendSelection",
+               "ctrl shift KP_LEFT", "selectPreviousColumnExtendSelection",
+                        "ctrl LEFT", "selectPreviousColumnChangeLead",
+                     "ctrl KP_LEFT", "selectPreviousColumnChangeLead",
+                            "RIGHT", "selectNextColumn",
+                         "KP_RIGHT", "selectNextColumn",
+                      "shift RIGHT", "selectNextColumnExtendSelection",
+                   "shift KP_RIGHT", "selectNextColumnExtendSelection",
+                 "ctrl shift RIGHT", "selectNextColumnExtendSelection",
+              "ctrl shift KP_RIGHT", "selectNextColumnExtendSelection",
+                       "ctrl RIGHT", "selectNextColumnChangeLead",
+                    "ctrl KP_RIGHT", "selectNextColumnChangeLead",
+                             "HOME", "selectFirstRow",
+                       "shift HOME", "selectFirstRowExtendSelection",
+                  "ctrl shift HOME", "selectFirstRowExtendSelection",
+                        "ctrl HOME", "selectFirstRowChangeLead",
+                              "END", "selectLastRow",
+                        "shift END", "selectLastRowExtendSelection",
+                   "ctrl shift END", "selectLastRowExtendSelection",
+                         "ctrl END", "selectLastRowChangeLead",
+                          "PAGE_UP", "scrollUp",
+                    "shift PAGE_UP", "scrollUpExtendSelection",
+               "ctrl shift PAGE_UP", "scrollUpExtendSelection",
+                     "ctrl PAGE_UP", "scrollUpChangeLead",
+                        "PAGE_DOWN", "scrollDown",
+                  "shift PAGE_DOWN", "scrollDownExtendSelection",
+             "ctrl shift PAGE_DOWN", "scrollDownExtendSelection",
+                   "ctrl PAGE_DOWN", "scrollDownChangeLead",
+                           "ctrl A", "selectAll",
+                       "ctrl SLASH", "selectAll",
+                  "ctrl BACK_SLASH", "clearSelection",
+                            "SPACE", "addToSelection",
+                       "ctrl SPACE", "toggleAndAnchor",
+                      "shift SPACE", "extendTo",
+                 "ctrl shift SPACE", "moveSelectionTo"
+                 }),
+
+            // PopupMenu
+            "PopupMenu.font", MenuFont,
+            "PopupMenu.background", MenuBackgroundColor,
+            "PopupMenu.foreground", MenuTextColor,
+            "PopupMenu.popupSound", "win.sound.menuPopup",
+            "PopupMenu.consumeEventOnClose", Boolean.TRUE,
+
+            // Menus
+            "Menu.font", MenuFont,
+            "Menu.foreground", MenuTextColor,
+            "Menu.background", MenuBackgroundColor,
+            "Menu.useMenuBarBackgroundForTopLevel", Boolean.TRUE,
+            "Menu.selectionForeground", SelectionTextColor,
+            "Menu.selectionBackground", SelectionBackgroundColor,
+            "Menu.acceleratorForeground", MenuTextColor,
+            "Menu.acceleratorSelectionForeground", SelectionTextColor,
+            "Menu.menuPopupOffsetX", Integer.valueOf(0),
+            "Menu.menuPopupOffsetY", Integer.valueOf(0),
+            "Menu.submenuPopupOffsetX", Integer.valueOf(-4),
+            "Menu.submenuPopupOffsetY", Integer.valueOf(-3),
+            "Menu.crossMenuMnemonic", Boolean.FALSE,
+            "Menu.preserveTopLevelSelection", Boolean.TRUE,
+
+            // MenuBar.
+            "MenuBar.font", MenuFont,
+            "MenuBar.background", new XPValue(MenuBarBackgroundColor,
+                                              MenuBackgroundColor),
+            "MenuBar.foreground", MenuTextColor,
+            "MenuBar.shadow", ControlShadowColor,
+            "MenuBar.highlight", ControlHighlightColor,
+            "MenuBar.height", menuBarHeight,
+            "MenuBar.rolloverEnabled", hotTrackingOn,
+            "MenuBar.windowBindings", new Object[] {
+                "F10", "takeFocus" },
+
+            "MenuItem.font", MenuFont,
+            "MenuItem.acceleratorFont", MenuFont,
+            "MenuItem.foreground", MenuTextColor,
+            "MenuItem.background", MenuBackgroundColor,
+            "MenuItem.selectionForeground", SelectionTextColor,
+            "MenuItem.selectionBackground", SelectionBackgroundColor,
+            "MenuItem.disabledForeground", InactiveTextColor,
+            "MenuItem.acceleratorForeground", MenuTextColor,
+            "MenuItem.acceleratorSelectionForeground", SelectionTextColor,
+            "MenuItem.acceleratorDelimiter", menuItemAcceleratorDelimiter,
+                 // Menu Item Auditory Cue Mapping
+            "MenuItem.commandSound", "win.sound.menuCommand",
+             // indicates that keyboard navigation won't skip disabled menu items
+            "MenuItem.disabledAreNavigable", Boolean.TRUE,
+
+            "RadioButton.font", ControlFont,
+            "RadioButton.interiorBackground", WindowBackgroundColor,
+            "RadioButton.background", ControlBackgroundColor,
+            "RadioButton.foreground", WindowTextColor,
+            "RadioButton.shadow", ControlShadowColor,
+            "RadioButton.darkShadow", ControlDarkShadowColor,
+            "RadioButton.light", ControlLightColor,
+            "RadioButton.highlight", ControlHighlightColor,
+            "RadioButton.focus", buttonFocusColor,
+            "RadioButton.focusInputMap",
+               new UIDefaults.LazyInputMap(new Object[] {
+                          "SPACE", "pressed",
+                 "released SPACE", "released"
+              }),
+            // margin is 2 all the way around, BasicBorders.RadioButtonBorder
+            // is 2 all the way around too.
+            "RadioButton.totalInsets", new Insets(4, 4, 4, 4),
+
+
+            "RadioButtonMenuItem.font", MenuFont,
+            "RadioButtonMenuItem.foreground", MenuTextColor,
+            "RadioButtonMenuItem.background", MenuBackgroundColor,
+            "RadioButtonMenuItem.selectionForeground", SelectionTextColor,
+            "RadioButtonMenuItem.selectionBackground", SelectionBackgroundColor,
+            "RadioButtonMenuItem.disabledForeground", InactiveTextColor,
+            "RadioButtonMenuItem.acceleratorForeground", MenuTextColor,
+            "RadioButtonMenuItem.acceleratorSelectionForeground", SelectionTextColor,
+            "RadioButtonMenuItem.commandSound", "win.sound.menuCommand",
+
+            // OptionPane.
+            "OptionPane.font", MessageFont,
+            "OptionPane.messageFont", MessageFont,
+            "OptionPane.buttonFont", MessageFont,
+            "OptionPane.background", ControlBackgroundColor,
+            "OptionPane.foreground", WindowTextColor,
+            "OptionPane.buttonMinimumWidth", new XPDLUValue(50, 50, SwingConstants.EAST),
+            "OptionPane.messageForeground", ControlTextColor,
+            "OptionPane.errorIcon",       new LazyWindowsIcon("optionPaneIcon Error",
+                                                              "icons/Error.gif"),
+            "OptionPane.informationIcon", new LazyWindowsIcon("optionPaneIcon Information",
+                                                              "icons/Inform.gif"),
+            "OptionPane.questionIcon",    new LazyWindowsIcon("optionPaneIcon Question",
+                                                              "icons/Question.gif"),
+            "OptionPane.warningIcon",     new LazyWindowsIcon("optionPaneIcon Warning",
+                                                              "icons/Warn.gif"),
+            "OptionPane.windowBindings", new Object[] {
+                "ESCAPE", "close" },
+                 // Option Pane Auditory Cue Mappings
+            "OptionPane.errorSound", "win.sound.hand", // Error
+            "OptionPane.informationSound", "win.sound.asterisk", // Info Plain
+            "OptionPane.questionSound", "win.sound.question", // Question
+            "OptionPane.warningSound", "win.sound.exclamation", // Warning
+
+            "FormattedTextField.focusInputMap",
+              new UIDefaults.LazyInputMap(new Object[] {
+                           "ctrl C", DefaultEditorKit.copyAction,
+                           "ctrl V", DefaultEditorKit.pasteAction,
+                           "ctrl X", DefaultEditorKit.cutAction,
+                             "COPY", DefaultEditorKit.copyAction,
+                            "PASTE", DefaultEditorKit.pasteAction,
+                              "CUT", DefaultEditorKit.cutAction,
+                   "control INSERT", DefaultEditorKit.copyAction,
+                     "shift INSERT", DefaultEditorKit.pasteAction,
+                     "shift DELETE", DefaultEditorKit.cutAction,
+                       "shift LEFT", DefaultEditorKit.selectionBackwardAction,
+                    "shift KP_LEFT", DefaultEditorKit.selectionBackwardAction,
+                      "shift RIGHT", DefaultEditorKit.selectionForwardAction,
+                   "shift KP_RIGHT", DefaultEditorKit.selectionForwardAction,
+                        "ctrl LEFT", DefaultEditorKit.previousWordAction,
+                     "ctrl KP_LEFT", DefaultEditorKit.previousWordAction,
+                       "ctrl RIGHT", DefaultEditorKit.nextWordAction,
+                    "ctrl KP_RIGHT", DefaultEditorKit.nextWordAction,
+                  "ctrl shift LEFT", DefaultEditorKit.selectionPreviousWordAction,
+               "ctrl shift KP_LEFT", DefaultEditorKit.selectionPreviousWordAction,
+                 "ctrl shift RIGHT", DefaultEditorKit.selectionNextWordAction,
+              "ctrl shift KP_RIGHT", DefaultEditorKit.selectionNextWordAction,
+                           "ctrl A", DefaultEditorKit.selectAllAction,
+                             "HOME", DefaultEditorKit.beginLineAction,
+                              "END", DefaultEditorKit.endLineAction,
+                       "shift HOME", DefaultEditorKit.selectionBeginLineAction,
+                        "shift END", DefaultEditorKit.selectionEndLineAction,
+                       "BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
+                 "shift BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
+                           "ctrl H", DefaultEditorKit.deletePrevCharAction,
+                           "DELETE", DefaultEditorKit.deleteNextCharAction,
+                      "ctrl DELETE", DefaultEditorKit.deleteNextWordAction,
+                  "ctrl BACK_SPACE", DefaultEditorKit.deletePrevWordAction,
+                            "RIGHT", DefaultEditorKit.forwardAction,
+                             "LEFT", DefaultEditorKit.backwardAction,
+                         "KP_RIGHT", DefaultEditorKit.forwardAction,
+                          "KP_LEFT", DefaultEditorKit.backwardAction,
+                            "ENTER", JTextField.notifyAction,
+                  "ctrl BACK_SLASH", "unselect",
+                   "control shift O", "toggle-componentOrientation",
+                           "ESCAPE", "reset-field-edit",
+                               "UP", "increment",
+                            "KP_UP", "increment",
+                             "DOWN", "decrement",
+                          "KP_DOWN", "decrement",
+              }),
+            "FormattedTextField.inactiveBackground", ReadOnlyTextBackground,
+            "FormattedTextField.disabledBackground", DisabledTextBackground,
+            "FormattedTextField.background", TextBackground,
+            "FormattedTextField.foreground", WindowTextColor,
+
+            // *** Panel
+            "Panel.font", ControlFont,
+            "Panel.background", ControlBackgroundColor,
+            "Panel.foreground", WindowTextColor,
+
+            // *** PasswordField
+            "PasswordField.font", ControlFont,
+            "PasswordField.background", TextBackground,
+            "PasswordField.foreground", WindowTextColor,
+            "PasswordField.inactiveForeground", InactiveTextColor,      // for disabled
+            "PasswordField.inactiveBackground", ReadOnlyTextBackground, // for readonly
+            "PasswordField.disabledBackground", DisabledTextBackground, // for disabled
+            "PasswordField.selectionBackground", SelectionBackgroundColor,
+            "PasswordField.selectionForeground", SelectionTextColor,
+            "PasswordField.caretForeground",WindowTextColor,
+            "PasswordField.echoChar", new XPValue((char)0x25CF, '*'),
+
+            // *** ProgressBar
+            "ProgressBar.font", ControlFont,
+            "ProgressBar.foreground",  SelectionBackgroundColor,
+            "ProgressBar.background", ControlBackgroundColor,
+            "ProgressBar.shadow", ControlShadowColor,
+            "ProgressBar.highlight", ControlHighlightColor,
+            "ProgressBar.selectionForeground", ControlBackgroundColor,
+            "ProgressBar.selectionBackground", SelectionBackgroundColor,
+            "ProgressBar.cellLength", Integer.valueOf(7),
+            "ProgressBar.cellSpacing", Integer.valueOf(2),
+            "ProgressBar.indeterminateInsets", new Insets(3, 3, 3, 3),
+
+            // *** RootPane.
+            // These bindings are only enabled when there is a default
+            // button set on the rootpane.
+            "RootPane.defaultButtonWindowKeyBindings", new Object[] {
+                             "ENTER", "press",
+                    "released ENTER", "release",
+                        "ctrl ENTER", "press",
+               "ctrl released ENTER", "release"
+              },
+
+            // *** ScrollBar.
+            "ScrollBar.background", ScrollbarBackgroundColor,
+            "ScrollBar.foreground", ControlBackgroundColor,
+            "ScrollBar.track", white,
+            "ScrollBar.trackForeground", ScrollbarBackgroundColor,
+            "ScrollBar.trackHighlight", black,
+            "ScrollBar.trackHighlightForeground", scrollBarTrackHighlight,
+            "ScrollBar.thumb", ControlBackgroundColor,
+            "ScrollBar.thumbHighlight", ControlHighlightColor,
+            "ScrollBar.thumbDarkShadow", ControlDarkShadowColor,
+            "ScrollBar.thumbShadow", ControlShadowColor,
+            "ScrollBar.width", scrollBarWidth,
+            "ScrollBar.ancestorInputMap",
+               new UIDefaults.LazyInputMap(new Object[] {
+                       "RIGHT", "positiveUnitIncrement",
+                    "KP_RIGHT", "positiveUnitIncrement",
+                        "DOWN", "positiveUnitIncrement",
+                     "KP_DOWN", "positiveUnitIncrement",
+                   "PAGE_DOWN", "positiveBlockIncrement",
+              "ctrl PAGE_DOWN", "positiveBlockIncrement",
+                        "LEFT", "negativeUnitIncrement",
+                     "KP_LEFT", "negativeUnitIncrement",
+                          "UP", "negativeUnitIncrement",
+                       "KP_UP", "negativeUnitIncrement",
+                     "PAGE_UP", "negativeBlockIncrement",
+                "ctrl PAGE_UP", "negativeBlockIncrement",
+                        "HOME", "minScroll",
+                         "END", "maxScroll"
+                 }),
+
+            // *** ScrollPane.
+            "ScrollPane.font", ControlFont,
+            "ScrollPane.background", ControlBackgroundColor,
+            "ScrollPane.foreground", ControlTextColor,
+            "ScrollPane.ancestorInputMap",
+               new UIDefaults.LazyInputMap(new Object[] {
+                           "RIGHT", "unitScrollRight",
+                        "KP_RIGHT", "unitScrollRight",
+                            "DOWN", "unitScrollDown",
+                         "KP_DOWN", "unitScrollDown",
+                            "LEFT", "unitScrollLeft",
+                         "KP_LEFT", "unitScrollLeft",
+                              "UP", "unitScrollUp",
+                           "KP_UP", "unitScrollUp",
+                         "PAGE_UP", "scrollUp",
+                       "PAGE_DOWN", "scrollDown",
+                    "ctrl PAGE_UP", "scrollLeft",
+                  "ctrl PAGE_DOWN", "scrollRight",
+                       "ctrl HOME", "scrollHome",
+                        "ctrl END", "scrollEnd"
+                 }),
+
+            // *** Separator
+            "Separator.background", ControlHighlightColor,
+            "Separator.foreground", ControlShadowColor,
+
+            // *** Slider.
+            "Slider.font", ControlFont,
+            "Slider.foreground", ControlBackgroundColor,
+            "Slider.background", ControlBackgroundColor,
+            "Slider.highlight", ControlHighlightColor,
+            "Slider.shadow", ControlShadowColor,
+            "Slider.focus", ControlDarkShadowColor,
+            "Slider.focusInputMap",
+               new UIDefaults.LazyInputMap(new Object[] {
+                       "RIGHT", "positiveUnitIncrement",
+                    "KP_RIGHT", "positiveUnitIncrement",
+                        "DOWN", "negativeUnitIncrement",
+                     "KP_DOWN", "negativeUnitIncrement",
+                   "PAGE_DOWN", "negativeBlockIncrement",
+                        "LEFT", "negativeUnitIncrement",
+                     "KP_LEFT", "negativeUnitIncrement",
+                          "UP", "positiveUnitIncrement",
+                       "KP_UP", "positiveUnitIncrement",
+                     "PAGE_UP", "positiveBlockIncrement",
+                        "HOME", "minScroll",
+                         "END", "maxScroll"
+                 }),
+
+            // Spinner
+            "Spinner.font", ControlFont,
+            "Spinner.ancestorInputMap",
+               new UIDefaults.LazyInputMap(new Object[] {
+                               "UP", "increment",
+                            "KP_UP", "increment",
+                             "DOWN", "decrement",
+                          "KP_DOWN", "decrement",
+               }),
+
+            // *** SplitPane
+            "SplitPane.background", ControlBackgroundColor,
+            "SplitPane.highlight", ControlHighlightColor,
+            "SplitPane.shadow", ControlShadowColor,
+            "SplitPane.darkShadow", ControlDarkShadowColor,
+            "SplitPane.dividerSize", Integer.valueOf(5),
+            "SplitPane.ancestorInputMap",
+               new UIDefaults.LazyInputMap(new Object[] {
+                        "UP", "negativeIncrement",
+                      "DOWN", "positiveIncrement",
+                      "LEFT", "negativeIncrement",
+                     "RIGHT", "positiveIncrement",
+                     "KP_UP", "negativeIncrement",
+                   "KP_DOWN", "positiveIncrement",
+                   "KP_LEFT", "negativeIncrement",
+                  "KP_RIGHT", "positiveIncrement",
+                      "HOME", "selectMin",
+                       "END", "selectMax",
+                        "F8", "startResize",
+                        "F6", "toggleFocus",
+                  "ctrl TAB", "focusOutForward",
+            "ctrl shift TAB", "focusOutBackward"
+               }),
+
+            // *** TabbedPane
+            "TabbedPane.tabsOverlapBorder", new XPValue(Boolean.TRUE, Boolean.FALSE),
+            "TabbedPane.tabInsets",         new XPValue(new InsetsUIResource(1, 4, 1, 4),
+                                                        new InsetsUIResource(0, 4, 1, 4)),
+            "TabbedPane.tabAreaInsets",     new XPValue(new InsetsUIResource(3, 2, 2, 2),
+                                                        new InsetsUIResource(3, 2, 0, 2)),
+            "TabbedPane.font", ControlFont,
+            "TabbedPane.background", ControlBackgroundColor,
+            "TabbedPane.foreground", ControlTextColor,
+            "TabbedPane.highlight", ControlHighlightColor,
+            "TabbedPane.light", ControlLightColor,
+            "TabbedPane.shadow", ControlShadowColor,
+            "TabbedPane.darkShadow", ControlDarkShadowColor,
+            "TabbedPane.focus", ControlTextColor,
+            "TabbedPane.focusInputMap",
+              new UIDefaults.LazyInputMap(new Object[] {
+                         "RIGHT", "navigateRight",
+                      "KP_RIGHT", "navigateRight",
+                          "LEFT", "navigateLeft",
+                       "KP_LEFT", "navigateLeft",
+                            "UP", "navigateUp",
+                         "KP_UP", "navigateUp",
+                          "DOWN", "navigateDown",
+                       "KP_DOWN", "navigateDown",
+                     "ctrl DOWN", "requestFocusForVisibleComponent",
+                  "ctrl KP_DOWN", "requestFocusForVisibleComponent",
+                }),
+            "TabbedPane.ancestorInputMap",
+               new UIDefaults.LazyInputMap(new Object[] {
+                         "ctrl TAB", "navigateNext",
+                   "ctrl shift TAB", "navigatePrevious",
+                   "ctrl PAGE_DOWN", "navigatePageDown",
+                     "ctrl PAGE_UP", "navigatePageUp",
+                          "ctrl UP", "requestFocus",
+                       "ctrl KP_UP", "requestFocus",
+                 }),
+
+            // *** Table
+            "Table.font", ControlFont,
+            "Table.foreground", ControlTextColor,  // cell text color
+            "Table.background", WindowBackgroundColor,  // cell background color
+            "Table.highlight", ControlHighlightColor,
+            "Table.light", ControlLightColor,
+            "Table.shadow", ControlShadowColor,
+            "Table.darkShadow", ControlDarkShadowColor,
+            "Table.selectionForeground", SelectionTextColor,
+            "Table.selectionBackground", SelectionBackgroundColor,
+            "Table.gridColor", gray,  // grid line color
+            "Table.focusCellBackground", WindowBackgroundColor,
+            "Table.focusCellForeground", ControlTextColor,
+            "Table.ancestorInputMap",
+               new UIDefaults.LazyInputMap(new Object[] {
+                               "ctrl C", "copy",
+                               "ctrl V", "paste",
+                               "ctrl X", "cut",
+                                 "COPY", "copy",
+                                "PASTE", "paste",
+                                  "CUT", "cut",
+                       "control INSERT", "copy",
+                         "shift INSERT", "paste",
+                         "shift DELETE", "cut",
+                                "RIGHT", "selectNextColumn",
+                             "KP_RIGHT", "selectNextColumn",
+                          "shift RIGHT", "selectNextColumnExtendSelection",
+                       "shift KP_RIGHT", "selectNextColumnExtendSelection",
+                     "ctrl shift RIGHT", "selectNextColumnExtendSelection",
+                  "ctrl shift KP_RIGHT", "selectNextColumnExtendSelection",
+                           "ctrl RIGHT", "selectNextColumnChangeLead",
+                        "ctrl KP_RIGHT", "selectNextColumnChangeLead",
+                                 "LEFT", "selectPreviousColumn",
+                              "KP_LEFT", "selectPreviousColumn",
+                           "shift LEFT", "selectPreviousColumnExtendSelection",
+                        "shift KP_LEFT", "selectPreviousColumnExtendSelection",
+                      "ctrl shift LEFT", "selectPreviousColumnExtendSelection",
+                   "ctrl shift KP_LEFT", "selectPreviousColumnExtendSelection",
+                            "ctrl LEFT", "selectPreviousColumnChangeLead",
+                         "ctrl KP_LEFT", "selectPreviousColumnChangeLead",
+                                 "DOWN", "selectNextRow",
+                              "KP_DOWN", "selectNextRow",
+                           "shift DOWN", "selectNextRowExtendSelection",
+                        "shift KP_DOWN", "selectNextRowExtendSelection",
+                      "ctrl shift DOWN", "selectNextRowExtendSelection",
+                   "ctrl shift KP_DOWN", "selectNextRowExtendSelection",
+                            "ctrl DOWN", "selectNextRowChangeLead",
+                         "ctrl KP_DOWN", "selectNextRowChangeLead",
+                                   "UP", "selectPreviousRow",
+                                "KP_UP", "selectPreviousRow",
+                             "shift UP", "selectPreviousRowExtendSelection",
+                          "shift KP_UP", "selectPreviousRowExtendSelection",
+                        "ctrl shift UP", "selectPreviousRowExtendSelection",
+                     "ctrl shift KP_UP", "selectPreviousRowExtendSelection",
+                              "ctrl UP", "selectPreviousRowChangeLead",
+                           "ctrl KP_UP", "selectPreviousRowChangeLead",
+                                 "HOME", "selectFirstColumn",
+                           "shift HOME", "selectFirstColumnExtendSelection",
+                      "ctrl shift HOME", "selectFirstRowExtendSelection",
+                            "ctrl HOME", "selectFirstRow",
+                                  "END", "selectLastColumn",
+                            "shift END", "selectLastColumnExtendSelection",
+                       "ctrl shift END", "selectLastRowExtendSelection",
+                             "ctrl END", "selectLastRow",
+                              "PAGE_UP", "scrollUpChangeSelection",
+                        "shift PAGE_UP", "scrollUpExtendSelection",
+                   "ctrl shift PAGE_UP", "scrollLeftExtendSelection",
+                         "ctrl PAGE_UP", "scrollLeftChangeSelection",
+                            "PAGE_DOWN", "scrollDownChangeSelection",
+                      "shift PAGE_DOWN", "scrollDownExtendSelection",
+                 "ctrl shift PAGE_DOWN", "scrollRightExtendSelection",
+                       "ctrl PAGE_DOWN", "scrollRightChangeSelection",
+                                  "TAB", "selectNextColumnCell",
+                            "shift TAB", "selectPreviousColumnCell",
+                                "ENTER", "selectNextRowCell",
+                          "shift ENTER", "selectPreviousRowCell",
+                               "ctrl A", "selectAll",
+                           "ctrl SLASH", "selectAll",
+                      "ctrl BACK_SLASH", "clearSelection",
+                               "ESCAPE", "cancel",
+                                   "F2", "startEditing",
+                                "SPACE", "addToSelection",
+                           "ctrl SPACE", "toggleAndAnchor",
+                          "shift SPACE", "extendTo",
+                     "ctrl shift SPACE", "moveSelectionTo",
+                                   "F8", "focusHeader"
+                 }),
+            "Table.sortIconHighlight", ControlShadowColor,
+            "Table.sortIconLight", white,
+
+            "TableHeader.font", ControlFont,
+            "TableHeader.foreground", ControlTextColor, // header text color
+            "TableHeader.background", ControlBackgroundColor, // header background
+            "TableHeader.focusCellBackground",
+                new XPValue(XPValue.NULL_VALUE,     // use default bg from XP styles
+                            WindowBackgroundColor), // or white bg otherwise
+
+            // *** TextArea
+            "TextArea.font", FixedControlFont,
+            "TextArea.background", WindowBackgroundColor,
+            "TextArea.foreground", WindowTextColor,
+            "TextArea.inactiveForeground", InactiveTextColor,
+            "TextArea.inactiveBackground", WindowBackgroundColor,
+            "TextArea.disabledBackground", DisabledTextBackground,
+            "TextArea.selectionBackground", SelectionBackgroundColor,
+            "TextArea.selectionForeground", SelectionTextColor,
+            "TextArea.caretForeground", WindowTextColor,
+
+            // *** TextField
+            "TextField.font", ControlFont,
+            "TextField.background", TextBackground,
+            "TextField.foreground", WindowTextColor,
+            "TextField.shadow", ControlShadowColor,
+            "TextField.darkShadow", ControlDarkShadowColor,
+            "TextField.light", ControlLightColor,
+            "TextField.highlight", ControlHighlightColor,
+            "TextField.inactiveForeground", InactiveTextColor,      // for disabled
+            "TextField.inactiveBackground", ReadOnlyTextBackground, // for readonly
+            "TextField.disabledBackground", DisabledTextBackground, // for disabled
+            "TextField.selectionBackground", SelectionBackgroundColor,
+            "TextField.selectionForeground", SelectionTextColor,
+            "TextField.caretForeground", WindowTextColor,
+
+            // *** TextPane
+            "TextPane.font", ControlFont,
+            "TextPane.background", WindowBackgroundColor,
+            "TextPane.foreground", WindowTextColor,
+            "TextPane.selectionBackground", SelectionBackgroundColor,
+            "TextPane.selectionForeground", SelectionTextColor,
+            "TextPane.inactiveBackground", WindowBackgroundColor,
+            "TextPane.disabledBackground", DisabledTextBackground,
+            "TextPane.caretForeground", WindowTextColor,
+
+            // *** TitledBorder
+            "TitledBorder.font", ControlFont,
+            "TitledBorder.titleColor",
+                        new XPColorValue(Part.BP_GROUPBOX, null, Prop.TEXTCOLOR,
+                                         WindowTextColor),
+
+            // *** ToggleButton
+            "ToggleButton.font", ControlFont,
+            "ToggleButton.background", ControlBackgroundColor,
+            "ToggleButton.foreground", ControlTextColor,
+            "ToggleButton.shadow", ControlShadowColor,
+            "ToggleButton.darkShadow", ControlDarkShadowColor,
+            "ToggleButton.light", ControlLightColor,
+            "ToggleButton.highlight", ControlHighlightColor,
+            "ToggleButton.focus", ControlTextColor,
+            "ToggleButton.textShiftOffset", Integer.valueOf(1),
+            "ToggleButton.focusInputMap",
+              new UIDefaults.LazyInputMap(new Object[] {
+                            "SPACE", "pressed",
+                   "released SPACE", "released"
+                }),
+
+            // *** ToolBar
+            "ToolBar.font", MenuFont,
+            "ToolBar.background", ControlBackgroundColor,
+            "ToolBar.foreground", ControlTextColor,
+            "ToolBar.shadow", ControlShadowColor,
+            "ToolBar.darkShadow", ControlDarkShadowColor,
+            "ToolBar.light", ControlLightColor,
+            "ToolBar.highlight", ControlHighlightColor,
+            "ToolBar.dockingBackground", ControlBackgroundColor,
+            "ToolBar.dockingForeground", red,
+            "ToolBar.floatingBackground", ControlBackgroundColor,
+            "ToolBar.floatingForeground", darkGray,
+            "ToolBar.ancestorInputMap",
+               new UIDefaults.LazyInputMap(new Object[] {
+                        "UP", "navigateUp",
+                     "KP_UP", "navigateUp",
+                      "DOWN", "navigateDown",
+                   "KP_DOWN", "navigateDown",
+                      "LEFT", "navigateLeft",
+                   "KP_LEFT", "navigateLeft",
+                     "RIGHT", "navigateRight",
+                  "KP_RIGHT", "navigateRight"
+                 }),
+            "ToolBar.separatorSize", null,
+
+            // *** ToolTip
+            "ToolTip.font", ToolTipFont,
+            "ToolTip.background", new WindowsDesktopProperty("win.tooltip.backgroundColor", table.get("info")),
+            "ToolTip.foreground", new WindowsDesktopProperty("win.tooltip.textColor", table.get("infoText")),
+
+        // *** ToolTipManager
+            "ToolTipManager.enableToolTipMode", "activeApplication",
+
+        // *** Tree
+            "Tree.selectionBorderColor", black,
+            "Tree.drawDashedFocusIndicator", Boolean.TRUE,
+            "Tree.lineTypeDashed", Boolean.TRUE,
+            "Tree.font", ControlFont,
+            "Tree.background", WindowBackgroundColor,
+            "Tree.foreground", WindowTextColor,
+            "Tree.hash", gray,
+            "Tree.leftChildIndent", Integer.valueOf(8),
+            "Tree.rightChildIndent", Integer.valueOf(11),
+            "Tree.textForeground", WindowTextColor,
+            "Tree.textBackground", WindowBackgroundColor,
+            "Tree.selectionForeground", SelectionTextColor,
+            "Tree.selectionBackground", SelectionBackgroundColor,
+            "Tree.expandedIcon", treeExpandedIcon,
+            "Tree.collapsedIcon", treeCollapsedIcon,
+            "Tree.openIcon",   new ActiveWindowsIcon("win.icon.shellIconBPP",
+                                   "shell32Icon 5", "icons/TreeOpen.gif"),
+            "Tree.closedIcon", new ActiveWindowsIcon("win.icon.shellIconBPP",
+                                   "shell32Icon 4", "icons/TreeClosed.gif"),
+            "Tree.focusInputMap",
+               new UIDefaults.LazyInputMap(new Object[] {
+                                    "ADD", "expand",
+                               "SUBTRACT", "collapse",
+                                 "ctrl C", "copy",
+                                 "ctrl V", "paste",
+                                 "ctrl X", "cut",
+                                   "COPY", "copy",
+                                  "PASTE", "paste",
+                                    "CUT", "cut",
+                         "control INSERT", "copy",
+                           "shift INSERT", "paste",
+                           "shift DELETE", "cut",
+                                     "UP", "selectPrevious",
+                                  "KP_UP", "selectPrevious",
+                               "shift UP", "selectPreviousExtendSelection",
+                            "shift KP_UP", "selectPreviousExtendSelection",
+                          "ctrl shift UP", "selectPreviousExtendSelection",
+                       "ctrl shift KP_UP", "selectPreviousExtendSelection",
+                                "ctrl UP", "selectPreviousChangeLead",
+                             "ctrl KP_UP", "selectPreviousChangeLead",
+                                   "DOWN", "selectNext",
+                                "KP_DOWN", "selectNext",
+                             "shift DOWN", "selectNextExtendSelection",
+                          "shift KP_DOWN", "selectNextExtendSelection",
+                        "ctrl shift DOWN", "selectNextExtendSelection",
+                     "ctrl shift KP_DOWN", "selectNextExtendSelection",
+                              "ctrl DOWN", "selectNextChangeLead",
+                           "ctrl KP_DOWN", "selectNextChangeLead",
+                                  "RIGHT", "selectChild",
+                               "KP_RIGHT", "selectChild",
+                                   "LEFT", "selectParent",
+                                "KP_LEFT", "selectParent",
+                                "PAGE_UP", "scrollUpChangeSelection",
+                          "shift PAGE_UP", "scrollUpExtendSelection",
+                     "ctrl shift PAGE_UP", "scrollUpExtendSelection",
+                           "ctrl PAGE_UP", "scrollUpChangeLead",
+                              "PAGE_DOWN", "scrollDownChangeSelection",
+                        "shift PAGE_DOWN", "scrollDownExtendSelection",
+                   "ctrl shift PAGE_DOWN", "scrollDownExtendSelection",
+                         "ctrl PAGE_DOWN", "scrollDownChangeLead",
+                                   "HOME", "selectFirst",
+                             "shift HOME", "selectFirstExtendSelection",
+                        "ctrl shift HOME", "selectFirstExtendSelection",
+                              "ctrl HOME", "selectFirstChangeLead",
+                                    "END", "selectLast",
+                              "shift END", "selectLastExtendSelection",
+                         "ctrl shift END", "selectLastExtendSelection",
+                               "ctrl END", "selectLastChangeLead",
+                                     "F2", "startEditing",
+                                 "ctrl A", "selectAll",
+                             "ctrl SLASH", "selectAll",
+                        "ctrl BACK_SLASH", "clearSelection",
+                              "ctrl LEFT", "scrollLeft",
+                           "ctrl KP_LEFT", "scrollLeft",
+                             "ctrl RIGHT", "scrollRight",
+                          "ctrl KP_RIGHT", "scrollRight",
+                                  "SPACE", "addToSelection",
+                             "ctrl SPACE", "toggleAndAnchor",
+                            "shift SPACE", "extendTo",
+                       "ctrl shift SPACE", "moveSelectionTo"
+                 }),
+            "Tree.ancestorInputMap",
+               new UIDefaults.LazyInputMap(new Object[] {
+                     "ESCAPE", "cancel"
+                 }),
+
+            // *** Viewport
+            "Viewport.font", ControlFont,
+            "Viewport.background", ControlBackgroundColor,
+            "Viewport.foreground", WindowTextColor,
+
+
+        };
+
+        table.putDefaults(defaults);
+        table.putDefaults(getLazyValueDefaults());
+        initVistaComponentDefaults(table);
+    }
+
+    static boolean isOnVista() {
+        return OSInfo.getOSType() == OSInfo.OSType.WINDOWS
+                && OSInfo.getWindowsVersion().compareTo(OSInfo.WINDOWS_VISTA) >= 0;
+    }
+
+    static boolean isOnWindows7() {
+        return OSInfo.getOSType() == OSInfo.OSType.WINDOWS
+                && OSInfo.getWindowsVersion().compareTo(OSInfo.WINDOWS_7) >= 0;
+    }
+
+    private void initVistaComponentDefaults(UIDefaults table) {
+        if (! isOnVista()) {
+            return;
+        }
+        /* START handling menus for Vista */
+        String[] menuClasses = { "MenuItem", "Menu",
+                "CheckBoxMenuItem", "RadioButtonMenuItem",
+        };
+
+        Object menuDefaults[] = new Object[menuClasses.length * 2];
+
+        /* all the menus need to be non opaque. */
+        for (int i = 0, j = 0; i < menuClasses.length; i++) {
+            String key = menuClasses[i] + ".opaque";
+            Object oldValue = table.get(key);
+            menuDefaults[j++] = key;
+            menuDefaults[j++] =
+                new XPValue(Boolean.FALSE, oldValue);
+        }
+        table.putDefaults(menuDefaults);
+
+        /*
+         * acceleratorSelectionForeground color is the same as
+         * acceleratorForeground
+         */
+        for (int i = 0, j = 0; i < menuClasses.length; i++) {
+            String key = menuClasses[i] + ".acceleratorSelectionForeground";
+            Object oldValue = table.get(key);
+            menuDefaults[j++] = key;
+            menuDefaults[j++] =
+                new XPValue(
+                    table.getColor(
+                        menuClasses[i] + ".acceleratorForeground"),
+                        oldValue);
+        }
+        table.putDefaults(menuDefaults);
+
+        /* they have the same MenuItemCheckIconFactory */
+        VistaMenuItemCheckIconFactory menuItemCheckIconFactory =
+            WindowsIconFactory.getMenuItemCheckIconFactory();
+        for (int i = 0, j = 0; i < menuClasses.length; i++) {
+            String key = menuClasses[i] + ".checkIconFactory";
+            Object oldValue = table.get(key);
+            menuDefaults[j++] = key;
+            menuDefaults[j++] =
+                new XPValue(menuItemCheckIconFactory, oldValue);
+        }
+        table.putDefaults(menuDefaults);
+
+        for (int i = 0, j = 0; i < menuClasses.length; i++) {
+            String key = menuClasses[i] + ".checkIcon";
+            Object oldValue = table.get(key);
+            menuDefaults[j++] = key;
+            menuDefaults[j++] =
+                new XPValue(menuItemCheckIconFactory.getIcon(menuClasses[i]),
+                    oldValue);
+        }
+        table.putDefaults(menuDefaults);
+
+
+        /* height can be even */
+        for (int i = 0, j = 0; i < menuClasses.length; i++) {
+            String key = menuClasses[i] + ".evenHeight";
+            Object oldValue = table.get(key);
+            menuDefaults[j++] = key;
+            menuDefaults[j++] = new XPValue(Boolean.TRUE, oldValue);
+        }
+        table.putDefaults(menuDefaults);
+
+        /*For Windows7 margin and checkIconOffset should be greater than 0 */
+        if (!isOnWindows7()) {
+            /* no margins */
+            InsetsUIResource insets = new InsetsUIResource(0, 0, 0, 0);
+            for (int i = 0, j = 0; i < menuClasses.length; i++) {
+                String key = menuClasses[i] + ".margin";
+                Object oldValue = table.get(key);
+                menuDefaults[j++] = key;
+                menuDefaults[j++] = new XPValue(insets, oldValue);
+            }
+            table.putDefaults(menuDefaults);
+
+            /* set checkIcon offset */
+            Integer checkIconOffsetInteger =
+                Integer.valueOf(0);
+            for (int i = 0, j = 0; i < menuClasses.length; i++) {
+                String key = menuClasses[i] + ".checkIconOffset";
+                Object oldValue = table.get(key);
+                menuDefaults[j++] = key;
+                menuDefaults[j++] =
+                    new XPValue(checkIconOffsetInteger, oldValue);
+            }
+            table.putDefaults(menuDefaults);
+        }
+        /* set width of the gap after check icon */
+        Integer afterCheckIconGap = WindowsPopupMenuUI.getSpanBeforeGutter()
+                + WindowsPopupMenuUI.getGutterWidth()
+                + WindowsPopupMenuUI.getSpanAfterGutter();
+        for (int i = 0, j = 0; i < menuClasses.length; i++) {
+            String key = menuClasses[i] + ".afterCheckIconGap";
+            Object oldValue = table.get(key);
+            menuDefaults[j++] = key;
+            menuDefaults[j++] =
+                new XPValue(afterCheckIconGap, oldValue);
+        }
+        table.putDefaults(menuDefaults);
+
+        /* text is started after this position */
+        Object minimumTextOffset = new UIDefaults.ActiveValue() {
+            public Object createValue(UIDefaults table) {
+                return VistaMenuItemCheckIconFactory.getIconWidth()
+                + WindowsPopupMenuUI.getSpanBeforeGutter()
+                + WindowsPopupMenuUI.getGutterWidth()
+                + WindowsPopupMenuUI.getSpanAfterGutter();
+            }
+        };
+        for (int i = 0, j = 0; i < menuClasses.length; i++) {
+            String key = menuClasses[i] + ".minimumTextOffset";
+            Object oldValue = table.get(key);
+            menuDefaults[j++] = key;
+            menuDefaults[j++] = new XPValue(minimumTextOffset, oldValue);
+        }
+        table.putDefaults(menuDefaults);
+
+        /*
+         * JPopupMenu has a bit of free space around menu items
+         */
+        String POPUP_MENU_BORDER = "PopupMenu.border";
+
+        Object popupMenuBorder = new XPBorderValue(Part.MENU,
+            (LazyValue) t -> BasicBorders.getInternalFrameBorder(),
+                  BorderFactory.createEmptyBorder(2, 2, 2, 2));
+        table.put(POPUP_MENU_BORDER, popupMenuBorder);
+        /* END handling menus for Vista */
+
+        /* START table handling for Vista */
+        table.put("Table.ascendingSortIcon", new XPValue(
+            new SkinIcon(Part.HP_HEADERSORTARROW, State.SORTEDDOWN),
+               (LazyValue) t -> new ClassicSortArrowIcon(true)));
+        table.put("Table.descendingSortIcon", new XPValue(
+            new SkinIcon(Part.HP_HEADERSORTARROW, State.SORTEDUP),
+               (LazyValue) t -> new ClassicSortArrowIcon(false)));
+        /* END table handling for Vista */
+    }
+
+    /**
+     * If we support loading of fonts from the desktop this will return
+     * a WindowsDesktopProperty representing the font. If the font can't be
+     * represented in the current encoding this will return null and
+     * turn off the use of system fonts.
+     */
+    private Object getDesktopFontValue(String fontName, Object backup) {
+        if (useSystemFontSettings) {
+            return new WindowsFontProperty(fontName, backup);
+        }
+        return null;
+    }
+
+    // When a desktop property change is detected, these classes must be
+    // reinitialized in the defaults table to ensure the classes reference
+    // the updated desktop property values (colors mostly)
+    //
+    private Object[] getLazyValueDefaults() {
+
+        Object buttonBorder =
+            new XPBorderValue(Part.BP_PUSHBUTTON,
+               (LazyValue) t -> BasicBorders.getButtonBorder());
+
+        Object textFieldBorder =
+            new XPBorderValue(Part.EP_EDIT,
+               (LazyValue) t -> BasicBorders.getTextFieldBorder());
+
+        Object textFieldMargin =
+            new XPValue(new InsetsUIResource(2, 2, 2, 2),
+                        new InsetsUIResource(1, 1, 1, 1));
+
+        Object spinnerBorder =
+            new XPBorderValue(Part.EP_EDIT, textFieldBorder,
+                              new EmptyBorder(2, 2, 2, 2));
+
+        Object spinnerArrowInsets =
+            new XPValue(new InsetsUIResource(1, 1, 1, 1),
+                        null);
+
+        Object comboBoxBorder = new XPBorderValue(Part.CP_COMBOBOX, textFieldBorder);
+
+        // For focus rectangle for cells and trees.
+        LazyValue focusCellHighlightBorder = t -> WindowsBorders.getFocusCellHighlightBorder();
+
+        LazyValue etchedBorder = t -> BorderUIResource.getEtchedBorderUIResource();
+
+        LazyValue internalFrameBorder = t -> WindowsBorders.getInternalFrameBorder();
+
+        LazyValue loweredBevelBorder = t -> BorderUIResource.getLoweredBevelBorderUIResource();
+
+
+        LazyValue marginBorder = t -> new BasicBorders.MarginBorder();
+
+        LazyValue menuBarBorder = t -> BasicBorders.getMenuBarBorder();
+
+
+        Object popupMenuBorder = new XPBorderValue(Part.MENU,
+            (LazyValue) t -> BasicBorders.getInternalFrameBorder());
+
+        // *** ProgressBar
+        LazyValue progressBarBorder = t -> WindowsBorders.getProgressBarBorder();
+
+        LazyValue radioButtonBorder = t -> BasicBorders.getRadioButtonBorder();
+
+        Object scrollPaneBorder =
+            new XPBorderValue(Part.LBP_LISTBOX, textFieldBorder);
+
+        Object tableScrollPaneBorder =
+            new XPBorderValue(Part.LBP_LISTBOX, loweredBevelBorder);
+
+        LazyValue tableHeaderBorder = t -> WindowsBorders.getTableHeaderBorder();
+
+        // *** ToolBar
+        LazyValue toolBarBorder = t -> WindowsBorders.getToolBarBorder();
+
+        // *** ToolTips
+        LazyValue toolTipBorder = t -> BorderUIResource.getBlackLineBorderUIResource();
+
+
+
+        LazyValue checkBoxIcon = t -> WindowsIconFactory.getCheckBoxIcon();
+
+        LazyValue radioButtonIcon = t -> WindowsIconFactory.getRadioButtonIcon();
+
+        LazyValue radioButtonMenuItemIcon = t -> WindowsIconFactory.getRadioButtonMenuItemIcon();
+
+        LazyValue menuItemCheckIcon = t -> WindowsIconFactory.getMenuItemCheckIcon();
+
+        LazyValue menuItemArrowIcon = t -> WindowsIconFactory.getMenuItemArrowIcon();
+
+        LazyValue menuArrowIcon = t -> WindowsIconFactory.getMenuArrowIcon();
+
+        Color highlight = (Color) Toolkit.getDefaultToolkit().
+                getDesktopProperty("win.3d.highlightColor");
+
+        Color shadow = (Color) Toolkit.getDefaultToolkit().
+                getDesktopProperty("win.3d.shadowColor");
+
+        Object[] lazyDefaults = {
+            "Button.border", buttonBorder,
+            "CheckBox.border", radioButtonBorder,
+            "ComboBox.border", comboBoxBorder,
+            "DesktopIcon.border", internalFrameBorder,
+            "FormattedTextField.border", textFieldBorder,
+            "FormattedTextField.margin", textFieldMargin,
+            "InternalFrame.border", internalFrameBorder,
+            "List.focusCellHighlightBorder", focusCellHighlightBorder,
+            "Table.focusCellHighlightBorder", focusCellHighlightBorder,
+            "Menu.border", marginBorder,
+            "MenuBar.border", menuBarBorder,
+            "MenuItem.border", marginBorder,
+            "PasswordField.border", textFieldBorder,
+            "PasswordField.margin", textFieldMargin,
+            "PopupMenu.border", popupMenuBorder,
+            "ProgressBar.border", progressBarBorder,
+            "RadioButton.border", radioButtonBorder,
+            "ScrollPane.border", scrollPaneBorder,
+            "Spinner.border", spinnerBorder,
+            "Spinner.arrowButtonInsets", spinnerArrowInsets,
+            "Spinner.arrowButtonSize", new Dimension(17, 9),
+            "Table.scrollPaneBorder", tableScrollPaneBorder,
+            "TableHeader.cellBorder", tableHeaderBorder,
+            "TextArea.margin", textFieldMargin,
+            "TextField.border", textFieldBorder,
+            "TextField.margin", textFieldMargin,
+            "TitledBorder.border", new UIDefaults.LazyValue() {
+                public Object createValue(UIDefaults table) {
+                    return new BorderUIResource.
+                            EtchedBorderUIResource(highlight, shadow);
+                }
+            },
+            "ToggleButton.border", radioButtonBorder,
+            "ToolBar.border", toolBarBorder,
+            "ToolTip.border", toolTipBorder,
+
+            "CheckBox.icon", checkBoxIcon,
+            "Menu.arrowIcon", menuArrowIcon,
+            "MenuItem.checkIcon", menuItemCheckIcon,
+            "MenuItem.arrowIcon", menuItemArrowIcon,
+            "RadioButton.icon", radioButtonIcon,
+            "RadioButtonMenuItem.checkIcon", radioButtonMenuItemIcon,
+            "InternalFrame.layoutTitlePaneAtOrigin",
+                        new XPValue(Boolean.TRUE, Boolean.FALSE),
+            "Table.ascendingSortIcon", new XPValue(
+               (LazyValue) t -> new SortArrowIcon(true,"Table.sortIconColor"),
+                  (LazyValue) t -> new ClassicSortArrowIcon(true)),
+            "Table.descendingSortIcon", new XPValue(
+               (LazyValue) t -> new SortArrowIcon(false,"Table.sortIconColor"),
+                  (LazyValue) t -> new ClassicSortArrowIcon(false)),
+        };
+
+        return lazyDefaults;
+    }
+
+    public void uninitialize() {
+        super.uninitialize();
+
+        if (WindowsPopupMenuUI.mnemonicListener != null) {
+            MenuSelectionManager.defaultManager().
+                removeChangeListener(WindowsPopupMenuUI.mnemonicListener);
+        }
+        KeyboardFocusManager.getCurrentKeyboardFocusManager().
+            removeKeyEventPostProcessor(WindowsRootPaneUI.altProcessor);
+        WindowsDesktopProperty.flushUnreferencedProperties();
+    }
+
+
+    // Toggle flag for drawing the mnemonic state
+    private static boolean isMnemonicHidden = true;
+
+    // Flag which indicates that the Win98/Win2k/WinME features
+    // should be disabled.
+    private static boolean isClassicWindows = false;
+
+    /**
+     * Sets the state of the hide mnemonic flag. This flag is used by the
+     * component UI delegates to determine if the mnemonic should be rendered.
+     * This method is a non operation if the underlying operating system
+     * does not support the mnemonic hiding feature.
+     *
+     * @param hide true if mnemonics should be hidden
+     * @since 1.4
+     */
+    public static void setMnemonicHidden(boolean hide) {
+        if (UIManager.getBoolean("Button.showMnemonics") == true) {
+            // Do not hide mnemonics if the UI defaults do not support this
+            isMnemonicHidden = false;
+        } else {
+            isMnemonicHidden = hide;
+        }
+    }
+
+    /**
+     * Gets the state of the hide mnemonic flag. This only has meaning
+     * if this feature is supported by the underlying OS.
+     *
+     * @return true if mnemonics are hidden, otherwise, false
+     * @see #setMnemonicHidden
+     * @since 1.4
+     */
+    public static boolean isMnemonicHidden() {
+        if (UIManager.getBoolean("Button.showMnemonics") == true) {
+            // Do not hide mnemonics if the UI defaults do not support this
+            isMnemonicHidden = false;
+        }
+        return isMnemonicHidden;
+    }
+
+    /**
+     * Gets the state of the flag which indicates if the old Windows
+     * look and feel should be rendered. This flag is used by the
+     * component UI delegates as a hint to determine which style the component
+     * should be rendered.
+     *
+     * @return true if Windows 95 and Windows NT 4 look and feel should
+     *         be rendered
+     * @since 1.4
+     */
+    public static boolean isClassicWindows() {
+        return isClassicWindows;
+    }
+
+    /**
+     * <p>
+     * Invoked when the user attempts an invalid operation,
+     * such as pasting into an uneditable <code>JTextField</code>
+     * that has focus.
+     * </p>
+     * <p>
+     * If the user has enabled visual error indication on
+     * the desktop, this method will flash the caption bar
+     * of the active window. The user can also set the
+     * property awt.visualbell=true to achieve the same
+     * results.
+     * </p>
+     *
+     * @param component Component the error occurred in, may be
+     *                  null indicating the error condition is
+     *                  not directly associated with a
+     *                  <code>Component</code>.
+     *
+     * @see javax.swing.LookAndFeel#provideErrorFeedback
+     */
+     public void provideErrorFeedback(Component component) {
+         super.provideErrorFeedback(component);
+     }
+
+    /**
+     * {@inheritDoc}
+     */
+    public LayoutStyle getLayoutStyle() {
+        LayoutStyle style = this.style;
+        if (style == null) {
+            style = new WindowsLayoutStyle();
+            this.style = style;
+        }
+        return style;
+    }
+
+    // ********* Auditory Cue support methods and objects *********
+
+    /**
+     * Returns an <code>Action</code>.
+     * <P>
+     * This Action contains the information and logic to render an
+     * auditory cue. The <code>Object</code> that is passed to this
+     * method contains the information needed to render the auditory
+     * cue. Normally, this <code>Object</code> is a <code>String</code>
+     * that points to a <code>Toolkit</code> <code>desktopProperty</code>.
+     * This <code>desktopProperty</code> is resolved by AWT and the
+     * Windows OS.
+     * <P>
+     * This <code>Action</code>'s <code>actionPerformed</code> method
+     * is fired by the <code>playSound</code> method.
+     *
+     * @return      an Action which knows how to render the auditory
+     *              cue for one particular system or user activity
+     * @see #playSound(Action)
+     * @since 1.4
+     */
+    protected Action createAudioAction(Object key) {
+        if (key != null) {
+            String audioKey = (String)key;
+            String audioValue = (String)UIManager.get(key);
+            return new AudioAction(audioKey, audioValue);
+        } else {
+            return null;
+        }
+    }
+
+    static void repaintRootPane(Component c) {
+        JRootPane root = null;
+        for (; c != null; c = c.getParent()) {
+            if (c instanceof JRootPane) {
+                root = (JRootPane)c;
+            }
+        }
+
+        if (root != null) {
+            root.repaint();
+        } else {
+            c.repaint();
+        }
+    }
+
+    /**
+     * Pass the name String to the super constructor. This is used
+     * later to identify the Action and decide whether to play it or
+     * not. Store the resource String. It is used to get the audio
+     * resource. In this case, the resource is a <code>Runnable</code>
+     * supplied by <code>Toolkit</code>. This <code>Runnable</code> is
+     * effectively a pointer down into the Win32 OS that knows how to
+     * play the right sound.
+     *
+     * @since 1.4
+     */
+    @SuppressWarnings("serial") // Superclass is not serializable across versions
+    private static class AudioAction extends AbstractAction {
+        private Runnable audioRunnable;
+        private String audioResource;
+        /**
+         * We use the String as the name of the Action and as a pointer to
+         * the underlying OSes audio resource.
+         */
+        public AudioAction(String name, String resource) {
+            super(name);
+            audioResource = resource;
+        }
+        public void actionPerformed(ActionEvent e) {
+            if (audioRunnable == null) {
+                audioRunnable = (Runnable)Toolkit.getDefaultToolkit().getDesktopProperty(audioResource);
+            }
+            if (audioRunnable != null) {
+                // Runnable appears to block until completed playing, hence
+                // start up another thread to handle playing.
+                new Thread(null, audioRunnable, "Audio", 0, false).start();
+            }
+        }
+    }
+
+    /**
+     * Gets an <code>Icon</code> from the native libraries if available,
+     * otherwise gets it from an image resource file.
+     */
+    private static class LazyWindowsIcon implements UIDefaults.LazyValue {
+        private String nativeImage;
+        private String resource;
+
+        LazyWindowsIcon(String nativeImage, String resource) {
+            this.nativeImage = nativeImage;
+            this.resource = resource;
+        }
+
+        public Object createValue(UIDefaults table) {
+            if (nativeImage != null) {
+                Image image = (Image)ShellFolder.get(nativeImage);
+                if (image != null) {
+                    return new ImageIcon(image);
+                }
+            }
+            return SwingUtilities2.makeIcon(getClass(),
+                                            WindowsLookAndFeel.class,
+                                            resource);
+        }
+    }
+
+
+    /**
+     * Gets an <code>Icon</code> from the native libraries if available.
+     * A desktop property is used to trigger reloading the icon when needed.
+     */
+    private class ActiveWindowsIcon implements UIDefaults.ActiveValue {
+        private Icon icon;
+        private String nativeImageName;
+        private String fallbackName;
+        private WindowsDesktopProperty desktopProperty;
+
+        ActiveWindowsIcon(String desktopPropertyName,
+                            String nativeImageName, String fallbackName) {
+            this.nativeImageName = nativeImageName;
+            this.fallbackName = fallbackName;
+
+            if (OSInfo.getOSType() == OSInfo.OSType.WINDOWS &&
+                    OSInfo.getWindowsVersion().compareTo(OSInfo.WINDOWS_XP) < 0) {
+                // This desktop property is needed to trigger reloading the icon.
+                // It is kept in member variable to avoid GC.
+                this.desktopProperty = new TriggerDesktopProperty(desktopPropertyName) {
+                    @Override protected void updateUI() {
+                        icon = null;
+                        super.updateUI();
+                    }
+                };
+            }
+        }
+
+        @Override
+        public Object createValue(UIDefaults table) {
+            if (icon == null) {
+                Image image = (Image)ShellFolder.get(nativeImageName);
+                if (image != null) {
+                    icon = new ImageIconUIResource(image);
+                }
+            }
+            if (icon == null && fallbackName != null) {
+                UIDefaults.LazyValue fallback = (UIDefaults.LazyValue)
+                        SwingUtilities2.makeIcon(WindowsLookAndFeel.class,
+                            BasicLookAndFeel.class, fallbackName);
+                icon = (Icon) fallback.createValue(table);
+            }
+            return icon;
+        }
+    }
+
+    /**
+     * Icon backed-up by XP Skin.
+     */
+    private static class SkinIcon implements Icon, UIResource {
+        private final Part part;
+        private final State state;
+        SkinIcon(Part part, State state) {
+            this.part = part;
+            this.state = state;
+        }
+
+        /**
+         * Draw the icon at the specified location.  Icon implementations
+         * may use the Component argument to get properties useful for
+         * painting, e.g. the foreground or background color.
+         */
+        public void paintIcon(Component c, Graphics g, int x, int y) {
+            XPStyle xp = XPStyle.getXP();
+            assert xp != null;
+            if (xp != null) {
+                Skin skin = xp.getSkin(null, part);
+                skin.paintSkin(g, x, y, state);
+            }
+        }
+
+        /**
+         * Returns the icon's width.
+         *
+         * @return an int specifying the fixed width of the icon.
+         */
+        public int getIconWidth() {
+            int width = 0;
+            XPStyle xp = XPStyle.getXP();
+            assert xp != null;
+            if (xp != null) {
+                Skin skin = xp.getSkin(null, part);
+                width = skin.getWidth();
+            }
+            return width;
+        }
+
+        /**
+         * Returns the icon's height.
+         *
+         * @return an int specifying the fixed height of the icon.
+         */
+        public int getIconHeight() {
+            int height = 0;
+            XPStyle xp = XPStyle.getXP();
+            if (xp != null) {
+                Skin skin = xp.getSkin(null, part);
+                height = skin.getHeight();
+            }
+            return height;
+        }
+
+    }
+
+    /**
+     * WindowsDesktopProperty for fonts. If a font with the name 'MS Sans Serif'
+     * is returned, it is mapped to 'Microsoft Sans Serif'.
+     */
+    private static class WindowsFontProperty extends WindowsDesktopProperty {
+        WindowsFontProperty(String key, Object backup) {
+            super(key, backup);
+        }
+
+        public void invalidate(LookAndFeel laf) {
+            if ("win.defaultGUI.font.height".equals(getKey())) {
+                ((WindowsLookAndFeel)laf).style = null;
+            }
+            super.invalidate(laf);
+        }
+
+        protected Object configureValue(Object value) {
+            if (value instanceof Font) {
+                Font font = (Font)value;
+                if ("MS Sans Serif".equals(font.getName())) {
+                    int size = font.getSize();
+                    // 4950968: Workaround to mimic the way Windows maps the default
+                    // font size of 6 pts to the smallest available bitmap font size.
+                    // This happens mostly on Win 98/Me & NT.
+                    int dpi;
+                    try {
+                        dpi = Toolkit.getDefaultToolkit().getScreenResolution();
+                    } catch (HeadlessException ex) {
+                        dpi = 96;
+                    }
+                    if (Math.round(size * 72F / dpi) < 8) {
+                        size = Math.round(8 * dpi / 72F);
+                    }
+                    Font msFont = new FontUIResource("Microsoft Sans Serif",
+                                          font.getStyle(), size);
+                    if (msFont.getName() != null &&
+                        msFont.getName().equals(msFont.getFamily())) {
+                        font = msFont;
+                    } else if (size != font.getSize()) {
+                        font = new FontUIResource("MS Sans Serif",
+                                                  font.getStyle(), size);
+                    }
+                }
+
+                if (FontUtilities.fontSupportsDefaultEncoding(font)) {
+                    if (!(font instanceof UIResource)) {
+                        font = new FontUIResource(font);
+                    }
+                }
+                else {
+                    font = FontUtilities.getCompositeFontUIResource(font);
+                }
+                return font;
+
+            }
+            return super.configureValue(value);
+        }
+    }
+
+
+    /**
+     * WindowsDesktopProperty for fonts that only gets sizes from the desktop,
+     * font name and style are passed into the constructor
+     */
+    private static class WindowsFontSizeProperty extends
+                                                 WindowsDesktopProperty {
+        private String fontName;
+        private int fontSize;
+        private int fontStyle;
+
+        WindowsFontSizeProperty(String key, String fontName,
+                                int fontStyle, int fontSize) {
+            super(key, null);
+            this.fontName = fontName;
+            this.fontSize = fontSize;
+            this.fontStyle = fontStyle;
+        }
+
+        protected Object configureValue(Object value) {
+            if (value == null) {
+                value = new FontUIResource(fontName, fontStyle, fontSize);
+            }
+            else if (value instanceof Integer) {
+                value = new FontUIResource(fontName, fontStyle,
+                                           ((Integer)value).intValue());
+            }
+            return value;
+        }
+    }
+
+
+    /**
+     * A value wrapper that actively retrieves values from xp or falls back
+     * to the classic value if not running XP styles.
+     */
+    private static class XPValue implements UIDefaults.ActiveValue {
+        protected Object classicValue, xpValue;
+
+        // A constant that lets you specify null when using XP styles.
+        private static final Object NULL_VALUE = new Object();
+
+        XPValue(Object xpValue, Object classicValue) {
+            this.xpValue = xpValue;
+            this.classicValue = classicValue;
+        }
+
+        public Object createValue(UIDefaults table) {
+            Object value = null;
+            if (XPStyle.getXP() != null) {
+                value = getXPValue(table);
+            }
+
+            if (value == null) {
+                value = getClassicValue(table);
+            } else if (value == NULL_VALUE) {
+                value = null;
+            }
+
+            return value;
+        }
+
+        protected Object getXPValue(UIDefaults table) {
+            return recursiveCreateValue(xpValue, table);
+        }
+
+        protected Object getClassicValue(UIDefaults table) {
+            return recursiveCreateValue(classicValue, table);
+        }
+
+        private Object recursiveCreateValue(Object value, UIDefaults table) {
+            if (value instanceof UIDefaults.LazyValue) {
+                value = ((UIDefaults.LazyValue)value).createValue(table);
+            }
+            if (value instanceof UIDefaults.ActiveValue) {
+                return ((UIDefaults.ActiveValue)value).createValue(table);
+            } else {
+                return value;
+            }
+        }
+    }
+
+    private static class XPBorderValue extends XPValue {
+        private final Border extraMargin;
+
+        XPBorderValue(Part xpValue, Object classicValue) {
+            this(xpValue, classicValue, null);
+        }
+
+        XPBorderValue(Part xpValue, Object classicValue, Border extraMargin) {
+            super(xpValue, classicValue);
+            this.extraMargin = extraMargin;
+        }
+
+        public Object getXPValue(UIDefaults table) {
+            XPStyle xp = XPStyle.getXP();
+            Border xpBorder = xp != null ? xp.getBorder(null, (Part)xpValue) : null;
+            if (xpBorder != null && extraMargin != null) {
+                return new BorderUIResource.
+                        CompoundBorderUIResource(xpBorder, extraMargin);
+            } else {
+                return xpBorder;
+            }
+        }
+    }
+
+    private static class XPColorValue extends XPValue {
+        XPColorValue(Part part, State state, Prop prop, Object classicValue) {
+            super(new XPColorValueKey(part, state, prop), classicValue);
+        }
+
+        public Object getXPValue(UIDefaults table) {
+            XPColorValueKey key = (XPColorValueKey)xpValue;
+            XPStyle xp = XPStyle.getXP();
+            return xp != null ? xp.getColor(key.skin, key.prop, null) : null;
+        }
+
+        private static class XPColorValueKey {
+            Skin skin;
+            Prop prop;
+
+            XPColorValueKey(Part part, State state, Prop prop) {
+                this.skin = new Skin(part, state);
+                this.prop = prop;
+            }
+        }
+    }
+
+    private class XPDLUValue extends XPValue {
+        private int direction;
+
+        XPDLUValue(int xpdlu, int classicdlu, int direction) {
+            super(Integer.valueOf(xpdlu), Integer.valueOf(classicdlu));
+            this.direction = direction;
+        }
+
+        public Object getXPValue(UIDefaults table) {
+            int px = dluToPixels(((Integer)xpValue).intValue(), direction);
+            return Integer.valueOf(px);
+        }
+
+        public Object getClassicValue(UIDefaults table) {
+            int px = dluToPixels(((Integer)classicValue).intValue(), direction);
+            return Integer.valueOf(px);
+        }
+    }
+
+    private class TriggerDesktopProperty extends WindowsDesktopProperty {
+        TriggerDesktopProperty(String key) {
+            super(key, null);
+            // This call adds a property change listener for the property,
+            // which triggers a call to updateUI(). The value returned
+            // is not interesting here.
+            getValueFromDesktop();
+        }
+
+        protected void updateUI() {
+            super.updateUI();
+
+            // Make sure property change listener is readded each time
+            getValueFromDesktop();
+        }
+    }
+
+    private class FontDesktopProperty extends TriggerDesktopProperty {
+        FontDesktopProperty(String key) {
+            super(key);
+        }
+
+        protected void updateUI() {
+            UIDefaults defaults = UIManager.getLookAndFeelDefaults();
+            SwingUtilities2.putAATextInfo(true, defaults);
+            super.updateUI();
+        }
+    }
+
+    // Windows LayoutStyle.  From:
+    // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwue/html/ch14e.asp
+    @SuppressWarnings("fallthrough")
+    private class WindowsLayoutStyle extends DefaultLayoutStyle {
+        @Override
+        public int getPreferredGap(JComponent component1,
+                JComponent component2, ComponentPlacement type, int position,
+                Container parent) {
+            // Checks args
+            super.getPreferredGap(component1, component2, type, position,
+                                  parent);
+
+            switch(type) {
+            case INDENT:
+                // Windows doesn't spec this
+                if (position == SwingConstants.EAST ||
+                        position == SwingConstants.WEST) {
+                    int indent = getIndent(component1, position);
+                    if (indent > 0) {
+                        return indent;
+                    }
+                    return 10;
+                }
+                // Fall through to related.
+            case RELATED:
+                if (isLabelAndNonlabel(component1, component2, position)) {
+                    // Between text labels and their associated controls (for
+                    // example, text boxes and list boxes): 3
+                    // NOTE: We're not honoring:
+                    // 'Text label beside a button 3 down from the top of
+                    // the button,' but I suspect that is an attempt to
+                    // enforce a baseline layout which will be handled
+                    // separately.  In order to enforce this we would need
+                    // this API to return a more complicated type (Insets,
+                    // or something else).
+                    return getButtonGap(component1, component2, position,
+                                        dluToPixels(3, position));
+                }
+                // Between related controls: 4
+                return getButtonGap(component1, component2, position,
+                                    dluToPixels(4, position));
+            case UNRELATED:
+                // Between unrelated controls: 7
+                return getButtonGap(component1, component2, position,
+                                    dluToPixels(7, position));
+            }
+            return 0;
+        }
+
+        @Override
+        public int getContainerGap(JComponent component, int position,
+                                   Container parent) {
+            // Checks args
+            super.getContainerGap(component, position, parent);
+            return getButtonGap(component, position, dluToPixels(7, position));
+        }
+
+    }
+
+    /**
+     * Converts the dialog unit argument to pixels along the specified
+     * axis.
+     */
+    private int dluToPixels(int dlu, int direction) {
+        if (baseUnitX == 0) {
+            calculateBaseUnits();
+        }
+        if (direction == SwingConstants.EAST ||
+            direction == SwingConstants.WEST) {
+            return dlu * baseUnitX / 4;
+        }
+        assert (direction == SwingConstants.NORTH ||
+                direction == SwingConstants.SOUTH);
+        return dlu * baseUnitY / 8;
+    }
+
+    /**
+     * Calculates the dialog unit mapping.
+     */
+    @SuppressWarnings("deprecation")
+    private void calculateBaseUnits() {
+        // This calculation comes from:
+        // http://support.microsoft.com/default.aspx?scid=kb;EN-US;125681
+        FontMetrics metrics = Toolkit.getDefaultToolkit().getFontMetrics(
+                UIManager.getFont("Button.font"));
+        baseUnitX = metrics.stringWidth(
+                "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz");
+        baseUnitX = (baseUnitX / 26 + 1) / 2;
+        // The -1 comes from experimentation.
+        baseUnitY = metrics.getAscent() + metrics.getDescent() - 1;
+    }
+
+    /**
+     * {@inheritDoc}
+     *
+     * @since 1.6
+     */
+    public Icon getDisabledIcon(JComponent component, Icon icon) {
+        // if the component has a HI_RES_DISABLED_ICON_CLIENT_KEY
+        // client property set to Boolean.TRUE, then use the new
+        // hi res algorithm for creating the disabled icon (used
+        // in particular by the WindowsFileChooserUI class)
+        if (icon != null
+                && component != null
+                && Boolean.TRUE.equals(component.getClientProperty(HI_RES_DISABLED_ICON_CLIENT_KEY))
+                && icon.getIconWidth() > 0
+                && icon.getIconHeight() > 0) {
+            BufferedImage img = new BufferedImage(icon.getIconWidth(),
+                    icon.getIconWidth(), BufferedImage.TYPE_INT_ARGB);
+            icon.paintIcon(component, img.getGraphics(), 0, 0);
+            ImageFilter filter = new RGBGrayFilter();
+            ImageProducer producer = new FilteredImageSource(img.getSource(), filter);
+            Image resultImage = component.createImage(producer);
+            return new ImageIconUIResource(resultImage);
+        }
+        return super.getDisabledIcon(component, icon);
+    }
+
+    private static class RGBGrayFilter extends RGBImageFilter {
+        public RGBGrayFilter() {
+            canFilterIndexColorModel = true;
+        }
+        public int filterRGB(int x, int y, int rgb) {
+            // find the average of red, green, and blue
+            float avg = (((rgb >> 16) & 0xff) / 255f +
+                          ((rgb >>  8) & 0xff) / 255f +
+                           (rgb        & 0xff) / 255f) / 3;
+            // pull out the alpha channel
+            float alpha = (((rgb>>24)&0xff)/255f);
+            // calc the average
+            avg = Math.min(1.0f, (1f-avg)/(100.0f/35.0f) + avg);
+            // turn back into rgb
+            int rgbval = (int)(alpha * 255f) << 24 |
+                         (int)(avg   * 255f) << 16 |
+                         (int)(avg   * 255f) <<  8 |
+                         (int)(avg   * 255f);
+            return rgbval;
+        }
+    }
+
+    private static class FocusColorProperty extends WindowsDesktopProperty {
+        public FocusColorProperty () {
+            // Fallback value is never used because of the configureValue method doesn't return null
+            super("win.3d.backgroundColor", Color.BLACK);
+        }
+
+        @Override
+        protected Object configureValue(Object value) {
+            Object highContrastOn = Toolkit.getDefaultToolkit().
+                    getDesktopProperty("win.highContrast.on");
+            if (highContrastOn == null || !((Boolean) highContrastOn).booleanValue()) {
+                return Color.BLACK;
+            }
+            return Color.BLACK.equals(value) ? Color.WHITE : Color.BLACK;
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsMenuBarUI.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,187 @@
+/*
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import javax.swing.plaf.basic.*;
+import javax.swing.*;
+import javax.swing.plaf.ActionMapUIResource;
+import javax.swing.plaf.ComponentUI;
+import java.awt.event.ActionEvent;
+import java.awt.event.HierarchyEvent;
+import java.awt.event.HierarchyListener;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.awt.event.WindowListener;
+import java.awt.event.WindowStateListener;
+
+import java.awt.*;
+
+import com.sun.java.swing.plaf.windows.TMSchema.*;
+import com.sun.java.swing.plaf.windows.XPStyle.*;
+
+/**
+ * Windows rendition of the component.
+ * <p>
+ * <strong>Warning:</strong>
+ * Serialized objects of this class will not be compatible with
+ * future Swing releases.  The current serialization support is appropriate
+ * for short term storage or RMI between applications running the same
+ * version of Swing.  A future release of Swing will provide support for
+ * long term persistence.
+ */
+public class WindowsMenuBarUI extends BasicMenuBarUI
+{
+    /* to be accessed on the EDT only */
+    private WindowListener windowListener = null;
+    private HierarchyListener hierarchyListener = null;
+    private Window window = null;
+
+    public static ComponentUI createUI(JComponent x) {
+        return new WindowsMenuBarUI();
+    }
+
+    @Override
+    protected void uninstallListeners() {
+        uninstallWindowListener();
+        if (hierarchyListener != null) {
+            menuBar.removeHierarchyListener(hierarchyListener);
+            hierarchyListener = null;
+        }
+        super.uninstallListeners();
+    }
+    private void installWindowListener() {
+        if (windowListener == null) {
+            Component component = menuBar.getTopLevelAncestor();
+            if (component instanceof Window) {
+                window = (Window) component;
+                windowListener = new WindowAdapter() {
+                    @Override
+                    public void windowActivated(WindowEvent e) {
+                        menuBar.repaint();
+                    }
+                    @Override
+                    public void windowDeactivated(WindowEvent e) {
+                        menuBar.repaint();
+                    }
+                };
+                ((Window) component).addWindowListener(windowListener);
+            }
+        }
+    }
+    private void uninstallWindowListener() {
+        if (windowListener != null && window != null) {
+            window.removeWindowListener(windowListener);
+        }
+        window = null;
+        windowListener = null;
+    }
+    @Override
+    protected void installListeners() {
+        if (WindowsLookAndFeel.isOnVista()) {
+            installWindowListener();
+            hierarchyListener =
+                new HierarchyListener() {
+                    public void hierarchyChanged(HierarchyEvent e) {
+                        if ((e.getChangeFlags()
+                                & HierarchyEvent.DISPLAYABILITY_CHANGED) != 0) {
+                            if (menuBar.isDisplayable()) {
+                                installWindowListener();
+                            } else {
+                                uninstallWindowListener();
+                            }
+                        }
+                    }
+            };
+            menuBar.addHierarchyListener(hierarchyListener);
+        }
+        super.installListeners();
+    }
+
+    protected void installKeyboardActions() {
+        super.installKeyboardActions();
+        ActionMap map = SwingUtilities.getUIActionMap(menuBar);
+        if (map == null) {
+            map = new ActionMapUIResource();
+            SwingUtilities.replaceUIActionMap(menuBar, map);
+        }
+        map.put("takeFocus", new TakeFocus());
+    }
+
+    /**
+     * Action that activates the menu (e.g. when F10 is pressed).
+     * Unlike BasicMenuBarUI.TakeFocus, this Action will not show menu popup.
+     */
+    @SuppressWarnings("serial") // Superclass is not serializable across versions
+    private static class TakeFocus extends AbstractAction {
+        public void actionPerformed(ActionEvent e) {
+            JMenuBar menuBar = (JMenuBar)e.getSource();
+            JMenu menu = menuBar.getMenu(0);
+            if (menu != null) {
+                MenuSelectionManager msm =
+                    MenuSelectionManager.defaultManager();
+                MenuElement path[] = new MenuElement[2];
+                path[0] = (MenuElement)menuBar;
+                path[1] = (MenuElement)menu;
+                msm.setSelectedPath(path);
+
+                // show mnemonics
+                WindowsLookAndFeel.setMnemonicHidden(false);
+                WindowsLookAndFeel.repaintRootPane(menuBar);
+            }
+        }
+    }
+
+    @Override
+    public void paint(Graphics g, JComponent c) {
+        XPStyle xp = XPStyle.getXP();
+        if (WindowsMenuItemUI.isVistaPainting(xp)) {
+            Skin skin;
+            skin = xp.getSkin(c, Part.MP_BARBACKGROUND);
+            int width = c.getWidth();
+            int height = c.getHeight();
+            State state =  isActive(c) ? State.ACTIVE : State.INACTIVE;
+            skin.paintSkin(g, 0, 0, width, height, state);
+        } else {
+            super.paint(g, c);
+        }
+    }
+
+    /**
+     * Checks if component belongs to an active window.
+     * @param c component to check
+     * @return true if component belongs to an active window
+     */
+    static boolean isActive(JComponent c) {
+        JRootPane rootPane = c.getRootPane();
+        if (rootPane != null) {
+            Component component = rootPane.getParent();
+            if (component instanceof Window) {
+                return ((Window) component).isActive();
+            }
+        }
+        return true;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsMenuItemUI.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,180 @@
+/*
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import java.awt.*;
+import javax.swing.*;
+import javax.swing.plaf.*;
+import javax.swing.plaf.basic.*;
+
+import sun.swing.SwingUtilities2;
+
+import com.sun.java.swing.plaf.windows.TMSchema.*;
+import com.sun.java.swing.plaf.windows.XPStyle.*;
+
+/**
+ * Windows rendition of the component.
+ * <p>
+ * <strong>Warning:</strong>
+ * Serialized objects of this class will not be compatible with
+ * future Swing releases.  The current serialization support is appropriate
+ * for short term storage or RMI between applications running the same
+ * version of Swing.  A future release of Swing will provide support for
+ * long term persistence.
+ *
+ * @author Igor Kushnirskiy
+ */
+
+public class WindowsMenuItemUI extends BasicMenuItemUI {
+    final WindowsMenuItemUIAccessor accessor =
+        new  WindowsMenuItemUIAccessor() {
+
+            public JMenuItem getMenuItem() {
+                return menuItem;
+            }
+
+            public State getState(JMenuItem menuItem) {
+                return WindowsMenuItemUI.getState(this, menuItem);
+            }
+
+            public Part getPart(JMenuItem menuItem) {
+                return WindowsMenuItemUI.getPart(this, menuItem);
+            }
+    };
+    public static ComponentUI createUI(JComponent c) {
+        return new WindowsMenuItemUI();
+    }
+
+    /**
+     * Method which renders the text of the current menu item.
+     *
+     * @param g Graphics context
+     * @param menuItem Current menu item to render
+     * @param textRect Bounding rectangle to render the text.
+     * @param text String to render
+     */
+    protected void paintText(Graphics g, JMenuItem menuItem,
+                             Rectangle textRect, String text) {
+        if (WindowsMenuItemUI.isVistaPainting()) {
+            WindowsMenuItemUI.paintText(accessor, g, menuItem, textRect, text);
+            return;
+        }
+        ButtonModel model = menuItem.getModel();
+        Color oldColor = g.getColor();
+
+        if(model.isEnabled() &&
+            (model.isArmed() || (menuItem instanceof JMenu &&
+             model.isSelected()))) {
+            g.setColor(selectionForeground); // Uses protected field.
+        }
+
+        WindowsGraphicsUtils.paintText(g, menuItem, textRect, text, 0);
+
+        g.setColor(oldColor);
+    }
+
+    @Override
+    protected void paintBackground(Graphics g, JMenuItem menuItem,
+            Color bgColor) {
+        if (WindowsMenuItemUI.isVistaPainting()) {
+            WindowsMenuItemUI.paintBackground(accessor, g, menuItem, bgColor);
+            return;
+        }
+        super.paintBackground(g, menuItem, bgColor);
+    }
+
+    static void paintBackground(WindowsMenuItemUIAccessor menuItemUI,
+            Graphics g, JMenuItem menuItem, Color bgColor) {
+        XPStyle xp = XPStyle.getXP();
+        assert isVistaPainting(xp);
+        if (isVistaPainting(xp)) {
+            int menuWidth = menuItem.getWidth();
+            int menuHeight = menuItem.getHeight();
+            if (menuItem.isOpaque()) {
+                Color oldColor = g.getColor();
+                g.setColor(menuItem.getBackground());
+                g.fillRect(0,0, menuWidth, menuHeight);
+                g.setColor(oldColor);
+            }
+            Part part = menuItemUI.getPart(menuItem);
+            Skin skin = xp.getSkin(menuItem, part);
+            skin.paintSkin(g, 0 , 0,
+                menuWidth,
+                menuHeight,
+                menuItemUI.getState(menuItem));
+        }
+    }
+
+    static void paintText(WindowsMenuItemUIAccessor menuItemUI, Graphics g,
+                                JMenuItem menuItem, Rectangle textRect,
+                                String text) {
+        assert isVistaPainting();
+        if (isVistaPainting()) {
+            State state = menuItemUI.getState(menuItem);
+
+            /* part of it copied from WindowsGraphicsUtils.java */
+            FontMetrics fm = SwingUtilities2.getFontMetrics(menuItem, g);
+            int mnemIndex = menuItem.getDisplayedMnemonicIndex();
+            // W2K Feature: Check to see if the Underscore should be rendered.
+            if (WindowsLookAndFeel.isMnemonicHidden() == true) {
+                mnemIndex = -1;
+            }
+            WindowsGraphicsUtils.paintXPText(menuItem,
+                menuItemUI.getPart(menuItem), state,
+                g, textRect.x,
+                textRect.y + fm.getAscent(),
+                text, mnemIndex);
+        }
+    }
+
+    static State getState(WindowsMenuItemUIAccessor menuItemUI, JMenuItem menuItem) {
+        State state;
+        ButtonModel model = menuItem.getModel();
+        if (model.isArmed()) {
+            state = (model.isEnabled()) ? State.HOT : State.DISABLEDHOT;
+        } else {
+            state = (model.isEnabled()) ? State.NORMAL : State.DISABLED;
+        }
+        return state;
+    }
+
+    static Part getPart(WindowsMenuItemUIAccessor menuItemUI, JMenuItem menuItem) {
+        return Part.MP_POPUPITEM;
+    }
+
+    /*
+     * TODO idk can we use XPStyle.isVista?
+     * is it possible that in some theme some Vista parts are not defined while
+     * others are?
+     */
+    static boolean isVistaPainting(final XPStyle xp) {
+        return xp != null && xp.isSkinDefined(null, Part.MP_POPUPITEM);
+    }
+
+    static boolean isVistaPainting() {
+        return isVistaPainting(XPStyle.getXP());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsMenuItemUIAccessor.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import java.awt.Color;
+import java.awt.Graphics;
+
+import javax.swing.JMenuItem;
+
+import com.sun.java.swing.plaf.windows.TMSchema.Part;
+import com.sun.java.swing.plaf.windows.TMSchema.State;
+
+/**
+ * Accessor interface for WindowsMenuItemUI to allow for "multiple implementation
+ * inheritance".
+ *
+ * @author Igor Kushnirskiy
+ */
+interface WindowsMenuItemUIAccessor {
+    JMenuItem getMenuItem();
+    State getState(JMenuItem menuItem);
+    Part getPart(JMenuItem menuItem);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsMenuUI.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,295 @@
+/*
+ * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import java.awt.*;
+import java.awt.event.MouseEvent;
+
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.basic.BasicMenuUI;
+import javax.swing.event.MouseInputListener;
+import javax.swing.*;
+
+import com.sun.java.swing.plaf.windows.TMSchema.Part;
+import com.sun.java.swing.plaf.windows.TMSchema.State;
+
+/**
+ * Windows rendition of the component.
+ * <p>
+ * <strong>Warning:</strong>
+ * Serialized objects of this class will not be compatible with
+ * future Swing releases.  The current serialization support is appropriate
+ * for short term storage or RMI between applications running the same
+ * version of Swing.  A future release of Swing will provide support for
+ * long term persistence.
+ */
+public class WindowsMenuUI extends BasicMenuUI {
+    protected Integer menuBarHeight;
+    protected boolean hotTrackingOn;
+
+    final WindowsMenuItemUIAccessor accessor =
+        new WindowsMenuItemUIAccessor() {
+
+            public JMenuItem getMenuItem() {
+                return menuItem;
+            }
+
+            public State getState(JMenuItem menu) {
+                State state = menu.isEnabled() ? State.NORMAL
+                        : State.DISABLED;
+                ButtonModel model = menu.getModel();
+                if (model.isArmed() || model.isSelected()) {
+                    state = (menu.isEnabled()) ? State.PUSHED
+                            : State.DISABLEDPUSHED;
+                } else if (model.isRollover()
+                           && ((JMenu) menu).isTopLevelMenu()) {
+                    /*
+                     * Only paint rollover if no other menu on menubar is
+                     * selected
+                     */
+                    State stateTmp = state;
+                    state = (menu.isEnabled()) ? State.HOT
+                            : State.DISABLEDHOT;
+                    for (MenuElement menuElement :
+                        ((JMenuBar) menu.getParent()).getSubElements()) {
+                        if (((JMenuItem) menuElement).isSelected()) {
+                            state = stateTmp;
+                            break;
+                        }
+                    }
+                }
+
+                //non top level menus have HOT state instead of PUSHED
+                if (!((JMenu) menu).isTopLevelMenu()) {
+                    if (state == State.PUSHED) {
+                        state = State.HOT;
+                    } else if (state == State.DISABLEDPUSHED) {
+                        state = State.DISABLEDHOT;
+                    }
+                }
+
+                /*
+                 * on Vista top level menu for non active frame looks disabled
+                 */
+                if (((JMenu) menu).isTopLevelMenu() && WindowsMenuItemUI.isVistaPainting()) {
+                    if (! WindowsMenuBarUI.isActive(menu)) {
+                        state = State.DISABLED;
+                    }
+                }
+                return state;
+            }
+
+            public Part getPart(JMenuItem menuItem) {
+                return ((JMenu) menuItem).isTopLevelMenu() ? Part.MP_BARITEM
+                        : Part.MP_POPUPITEM;
+            }
+    };
+    public static ComponentUI createUI(JComponent x) {
+        return new WindowsMenuUI();
+    }
+
+    protected void installDefaults() {
+        super.installDefaults();
+        if (!WindowsLookAndFeel.isClassicWindows()) {
+            menuItem.setRolloverEnabled(true);
+        }
+
+        menuBarHeight = (Integer)UIManager.getInt("MenuBar.height");
+
+        Object obj      = UIManager.get("MenuBar.rolloverEnabled");
+        hotTrackingOn = (obj instanceof Boolean) ? (Boolean)obj : true;
+    }
+
+    /**
+     * Draws the background of the menu.
+     * @since 1.4
+     */
+    protected void paintBackground(Graphics g, JMenuItem menuItem, Color bgColor) {
+        if (WindowsMenuItemUI.isVistaPainting()) {
+            WindowsMenuItemUI.paintBackground(accessor, g, menuItem, bgColor);
+            return;
+        }
+
+        JMenu menu = (JMenu)menuItem;
+        ButtonModel model = menu.getModel();
+
+        // Use superclass method for the old Windows LAF,
+        // for submenus, and for XP toplevel if selected or pressed
+        if (WindowsLookAndFeel.isClassicWindows() ||
+            !menu.isTopLevelMenu() ||
+            (XPStyle.getXP() != null && (model.isArmed() || model.isSelected()))) {
+
+            super.paintBackground(g, menu, bgColor);
+            return;
+        }
+
+        Color oldColor = g.getColor();
+        int menuWidth = menu.getWidth();
+        int menuHeight = menu.getHeight();
+
+        UIDefaults table = UIManager.getLookAndFeelDefaults();
+        Color highlight = table.getColor("controlLtHighlight");
+        Color shadow = table.getColor("controlShadow");
+
+        g.setColor(menu.getBackground());
+        g.fillRect(0,0, menuWidth, menuHeight);
+
+        if (menu.isOpaque()) {
+            if (model.isArmed() || model.isSelected()) {
+                // Draw a lowered bevel border
+                g.setColor(shadow);
+                g.drawLine(0,0, menuWidth - 1,0);
+                g.drawLine(0,0, 0,menuHeight - 2);
+
+                g.setColor(highlight);
+                g.drawLine(menuWidth - 1,0, menuWidth - 1,menuHeight - 2);
+                g.drawLine(0,menuHeight - 2, menuWidth - 1,menuHeight - 2);
+            } else if (model.isRollover() && model.isEnabled()) {
+                // Only paint rollover if no other menu on menubar is selected
+                boolean otherMenuSelected = false;
+                MenuElement[] menus = ((JMenuBar)menu.getParent()).getSubElements();
+                for (int i = 0; i < menus.length; i++) {
+                    if (((JMenuItem)menus[i]).isSelected()) {
+                        otherMenuSelected = true;
+                        break;
+                    }
+                }
+                if (!otherMenuSelected) {
+                    if (XPStyle.getXP() != null) {
+                        g.setColor(selectionBackground); // Uses protected field.
+                        g.fillRect(0, 0, menuWidth, menuHeight);
+                    } else {
+                        // Draw a raised bevel border
+                        g.setColor(highlight);
+                        g.drawLine(0,0, menuWidth - 1,0);
+                        g.drawLine(0,0, 0,menuHeight - 2);
+
+                        g.setColor(shadow);
+                        g.drawLine(menuWidth - 1,0, menuWidth - 1,menuHeight - 2);
+                        g.drawLine(0,menuHeight - 2, menuWidth - 1,menuHeight - 2);
+                    }
+                }
+            }
+        }
+        g.setColor(oldColor);
+    }
+
+    /**
+     * Method which renders the text of the current menu item.
+     *
+     * @param g Graphics context
+     * @param menuItem Current menu item to render
+     * @param textRect Bounding rectangle to render the text.
+     * @param text String to render
+     * @since 1.4
+     */
+    protected void paintText(Graphics g, JMenuItem menuItem,
+                             Rectangle textRect, String text) {
+        if (WindowsMenuItemUI.isVistaPainting()) {
+            WindowsMenuItemUI.paintText(accessor, g, menuItem, textRect, text);
+            return;
+        }
+        JMenu menu = (JMenu)menuItem;
+        ButtonModel model = menuItem.getModel();
+        Color oldColor = g.getColor();
+
+        // Only paint rollover if no other menu on menubar is selected
+        boolean paintRollover = model.isRollover();
+        if (paintRollover && menu.isTopLevelMenu()) {
+            MenuElement[] menus = ((JMenuBar)menu.getParent()).getSubElements();
+            for (int i = 0; i < menus.length; i++) {
+                if (((JMenuItem)menus[i]).isSelected()) {
+                    paintRollover = false;
+                    break;
+                }
+            }
+        }
+
+        if ((model.isSelected() && (WindowsLookAndFeel.isClassicWindows() ||
+                                    !menu.isTopLevelMenu())) ||
+            (XPStyle.getXP() != null && (paintRollover ||
+                                         model.isArmed() ||
+                                         model.isSelected()))) {
+            g.setColor(selectionForeground); // Uses protected field.
+        }
+
+        WindowsGraphicsUtils.paintText(g, menuItem, textRect, text, 0);
+
+        g.setColor(oldColor);
+    }
+
+    protected MouseInputListener createMouseInputListener(JComponent c) {
+        return new WindowsMouseInputHandler();
+    }
+
+    /**
+     * This class implements a mouse handler that sets the rollover flag to
+     * true when the mouse enters the menu and false when it exits.
+     * @since 1.4
+     */
+    protected class WindowsMouseInputHandler extends BasicMenuUI.MouseInputHandler {
+        public void mouseEntered(MouseEvent evt) {
+            super.mouseEntered(evt);
+
+            JMenu menu = (JMenu)evt.getSource();
+            if (hotTrackingOn && menu.isTopLevelMenu() && menu.isRolloverEnabled()) {
+                menu.getModel().setRollover(true);
+                menuItem.repaint();
+            }
+        }
+
+        public void mouseExited(MouseEvent evt) {
+            super.mouseExited(evt);
+
+            JMenu menu = (JMenu)evt.getSource();
+            ButtonModel model = menu.getModel();
+            if (menu.isRolloverEnabled()) {
+                model.setRollover(false);
+                menuItem.repaint();
+            }
+        }
+    }
+
+    protected Dimension getPreferredMenuItemSize(JComponent c,
+                                                     Icon checkIcon,
+                                                     Icon arrowIcon,
+                                                     int defaultTextIconGap) {
+
+        Dimension d = super.getPreferredMenuItemSize(c, checkIcon, arrowIcon,
+                                                     defaultTextIconGap);
+
+        // Note: When toolbar containers (rebars) are implemented, only do
+        // this if the JMenuBar is not in a rebar (i.e. ignore the desktop
+        // property win.menu.height if in a rebar.)
+        if (c instanceof JMenu && ((JMenu)c).isTopLevelMenu() &&
+            menuBarHeight != null && d.height < menuBarHeight) {
+
+            d.height = menuBarHeight;
+        }
+
+        return d;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsOptionPaneUI.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 1997, 2000, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import javax.swing.*;
+import javax.swing.plaf.*;
+import javax.swing.plaf.basic.*;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+
+
+/**
+ * Windows rendition of the component.
+ * <p>
+ * <strong>Warning:</strong>
+ * Serialized objects of this class will not be compatible with
+ * future Swing releases.  The current serialization support is appropriate
+ * for short term storage or RMI between applications running the same
+ * version of Swing.  A future release of Swing will provide support for
+ * long term persistence.
+ */
+public class WindowsOptionPaneUI extends BasicOptionPaneUI {
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsPasswordFieldUI.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import javax.swing.plaf.*;
+import javax.swing.plaf.basic.*;
+import javax.swing.*;
+import javax.swing.text.Caret;
+
+
+
+/**
+ * Windows rendition of the component.
+ * <p>
+ * <strong>Warning:</strong>
+ * Serialized objects of this class will not be compatible with
+ * future Swing releases.  The current serialization support is appropriate
+ * for short term storage or RMI between applications running the same
+ * version of Swing.  A future release of Swing will provide support for
+ * long term persistence.
+ */
+public class WindowsPasswordFieldUI extends BasicPasswordFieldUI {
+
+    /**
+     * Creates a UI for a JPasswordField
+     *
+     * @param c the password field
+     * @return the UI
+     */
+    public static ComponentUI createUI(JComponent c) {
+        return new WindowsPasswordFieldUI();
+    }
+
+
+    /**
+     * Creates the object to use for a caret.  By default an
+     * instance of WindowsCaret is created.  This method
+     * can be redefined to provide something else that implements
+     * the InputPosition interface or a subclass of DefaultCaret.
+     *
+     * @return the caret object
+     */
+    protected Caret createCaret() {
+        return new WindowsTextUI.WindowsCaret();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsPopupMenuSeparatorUI.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import java.awt.*;
+
+import javax.swing.*;
+import javax.swing.plaf.basic.BasicPopupMenuSeparatorUI;
+import javax.swing.plaf.ComponentUI;
+
+import com.sun.java.swing.plaf.windows.TMSchema.Part;
+import com.sun.java.swing.plaf.windows.TMSchema.State;
+import com.sun.java.swing.plaf.windows.XPStyle.Skin;
+
+/**
+ * Windows {@literal L&F} implementation of PopupMenuSeparatorUI.
+ *
+ * @author Leif Samuelsson
+ * @author Igor Kushnirskiy
+ */
+
+public class WindowsPopupMenuSeparatorUI extends BasicPopupMenuSeparatorUI {
+
+    public static ComponentUI createUI(JComponent c) {
+        return new WindowsPopupMenuSeparatorUI();
+    }
+
+    public void paint(Graphics g, JComponent c) {
+        Dimension s = c.getSize();
+        XPStyle xp = XPStyle.getXP();
+        if (WindowsMenuItemUI.isVistaPainting(xp)) {
+            int x = 1;
+            Component parent = c.getParent();
+            if (parent instanceof JComponent) {
+                Object gutterOffsetObject =
+                    ((JComponent) parent).getClientProperty(
+                        WindowsPopupMenuUI.GUTTER_OFFSET_KEY);
+                if (gutterOffsetObject instanceof Integer) {
+                    /*
+                     * gutter offset is in parent's coordinates.
+                     * See comment in
+                     * WindowsPopupMenuUI.getTextOffset(JComponent)
+                     */
+                    x = ((Integer) gutterOffsetObject).intValue() - c.getX();
+                    x += WindowsPopupMenuUI.getGutterWidth();
+                }
+            }
+            Skin skin = xp.getSkin(c, Part.MP_POPUPSEPARATOR);
+            int skinHeight = skin.getHeight();
+            int y = (s.height - skinHeight) / 2;
+            skin.paintSkin(g, x, y, s.width - x - 1, skinHeight, State.NORMAL);
+        } else {
+            int y = s.height / 2;
+            g.setColor(c.getForeground());
+            g.drawLine(1, y - 1, s.width - 2, y - 1);
+
+            g.setColor(c.getBackground());
+            g.drawLine(1, y,     s.width - 2, y);
+        }
+    }
+
+    public Dimension getPreferredSize(JComponent c) {
+        int fontHeight = 0;
+        Font font = c.getFont();
+        if (font != null) {
+            fontHeight = c.getFontMetrics(font).getHeight();
+        }
+
+        return new Dimension(0, fontHeight/2 + 2);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsPopupMenuUI.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,224 @@
+/*
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import java.awt.Component;
+import java.awt.Graphics;
+import java.awt.Insets;
+import java.awt.KeyEventPostProcessor;
+import java.awt.KeyboardFocusManager;
+import java.awt.Window;
+import java.awt.event.KeyEvent;
+import javax.swing.*;
+import javax.swing.event.*;
+import javax.swing.plaf.*;
+import javax.swing.plaf.basic.*;
+
+import sun.swing.StringUIClientPropertyKey;
+
+import com.sun.java.swing.plaf.windows.TMSchema.Part;
+import com.sun.java.swing.plaf.windows.TMSchema.State;
+import com.sun.java.swing.plaf.windows.XPStyle.Skin;
+import static sun.swing.SwingUtilities2.BASICMENUITEMUI_MAX_TEXT_OFFSET;
+
+/**
+ * Windows rendition of the component.
+ * <p>
+ * <strong>Warning:</strong>
+ * Serialized objects of this class will not be compatible with
+ * future Swing releases.  The current serialization support is appropriate
+ * for short term storage or RMI between applications running the same
+ * version of Swing.  A future release of Swing will provide support for
+ * long term persistence.
+ *
+ * @author Igor Kushnirskiy
+ */
+public class WindowsPopupMenuUI extends BasicPopupMenuUI {
+
+    static MnemonicListener mnemonicListener = null;
+    static final Object GUTTER_OFFSET_KEY =
+        new StringUIClientPropertyKey("GUTTER_OFFSET_KEY");
+
+    public static ComponentUI createUI(JComponent c) {
+        return new WindowsPopupMenuUI();
+    }
+
+    public void installListeners() {
+        super.installListeners();
+        if (! UIManager.getBoolean("Button.showMnemonics") &&
+            mnemonicListener == null) {
+
+            mnemonicListener = new MnemonicListener();
+            MenuSelectionManager.defaultManager().
+                addChangeListener(mnemonicListener);
+        }
+    }
+
+    /**
+     * Returns the <code>Popup</code> that will be responsible for
+     * displaying the <code>JPopupMenu</code>.
+     *
+     * @param popupMenu JPopupMenu requesting Popup
+     * @param x     Screen x location Popup is to be shown at
+     * @param y     Screen y location Popup is to be shown at.
+     * @return Popup that will show the JPopupMenu
+     * @since 1.4
+     */
+    public Popup getPopup(JPopupMenu popupMenu, int x, int y) {
+        PopupFactory popupFactory = PopupFactory.getSharedInstance();
+        return popupFactory.getPopup(popupMenu.getInvoker(), popupMenu, x, y);
+    }
+
+    static class MnemonicListener implements ChangeListener {
+        JRootPane repaintRoot = null;
+
+        public void stateChanged(ChangeEvent ev) {
+            MenuSelectionManager msm = (MenuSelectionManager)ev.getSource();
+            MenuElement[] path = msm.getSelectedPath();
+            if (path.length == 0) {
+                if(!WindowsLookAndFeel.isMnemonicHidden()) {
+                    // menu was canceled -- hide mnemonics
+                    WindowsLookAndFeel.setMnemonicHidden(true);
+                    if (repaintRoot != null) {
+                        Window win =
+                            SwingUtilities.getWindowAncestor(repaintRoot);
+                        WindowsGraphicsUtils.repaintMnemonicsInWindow(win);
+                    }
+                }
+            } else {
+                Component c = (Component)path[0];
+                if (c instanceof JPopupMenu) c = ((JPopupMenu)c).getInvoker();
+                repaintRoot = SwingUtilities.getRootPane(c);
+            }
+        }
+    }
+
+    /**
+     * Returns offset for the text.
+     * BasicMenuItemUI sets max text offset on the JPopupMenuUI.
+     * @param c PopupMenu to return text offset for.
+     * @return text offset for the component
+     */
+    static int getTextOffset(JComponent c) {
+        int rv = -1;
+        Object maxTextOffset =
+            c.getClientProperty(BASICMENUITEMUI_MAX_TEXT_OFFSET);
+        if (maxTextOffset instanceof Integer) {
+            /*
+             * this is in JMenuItem coordinates.
+             * Let's assume all the JMenuItem have the same offset along X.
+             */
+            rv = (Integer) maxTextOffset;
+            int menuItemOffset = 0;
+            Component component = c.getComponent(0);
+            if (component != null) {
+                menuItemOffset = component.getX();
+            }
+            rv += menuItemOffset;
+        }
+        return rv;
+    }
+
+    /**
+     * Returns span before gutter.
+     * used only on Vista.
+     * @return span before gutter
+     */
+    static int getSpanBeforeGutter() {
+        return 3;
+    }
+
+    /**
+     * Returns span after gutter.
+     * used only on Vista.
+     * @return span after gutter
+     */
+    static int getSpanAfterGutter() {
+        return 3;
+    }
+
+    /**
+     * Returns gutter width.
+     * used only on Vista.
+     * @return width of the gutter
+     */
+    static int getGutterWidth() {
+        int rv = 2;
+        XPStyle xp = XPStyle.getXP();
+        if (xp != null) {
+            Skin skin = xp.getSkin(null, Part.MP_POPUPGUTTER);
+            rv = skin.getWidth();
+        }
+        return rv;
+    }
+
+    /**
+     * Checks if PopupMenu is leftToRight
+     * The orientation is derived from the children of the component.
+     * It is leftToRight if all the children are leftToRight
+     *
+     * @param c component to return orientation for
+     * @return true if all the children are leftToRight
+     */
+    private static boolean isLeftToRight(JComponent c) {
+        boolean leftToRight = true;
+        for (int i = c.getComponentCount() - 1; i >=0 && leftToRight; i-- ) {
+            leftToRight =
+                c.getComponent(i).getComponentOrientation().isLeftToRight();
+        }
+        return leftToRight;
+    }
+
+    @Override
+    public void paint(Graphics g, JComponent c) {
+        XPStyle xp = XPStyle.getXP();
+        if (WindowsMenuItemUI.isVistaPainting(xp)) {
+            Skin skin = xp.getSkin(c, Part.MP_POPUPBACKGROUND);
+            skin.paintSkin(g, 0, 0, c.getWidth(),c.getHeight(), State.NORMAL);
+            int textOffset = getTextOffset(c);
+            if (textOffset >= 0
+                    /* paint gutter only for leftToRight case */
+                    && isLeftToRight(c)) {
+                skin = xp.getSkin(c, Part.MP_POPUPGUTTER);
+                int gutterWidth = getGutterWidth();
+                int gutterOffset =
+                    textOffset - getSpanAfterGutter() - gutterWidth;
+                c.putClientProperty(GUTTER_OFFSET_KEY,
+                    Integer.valueOf(gutterOffset));
+                Insets insets = c.getInsets();
+                skin.paintSkin(g, gutterOffset, insets.top,
+                    gutterWidth, c.getHeight() - insets.bottom - insets.top,
+                    State.NORMAL);
+            } else {
+                if (c.getClientProperty(GUTTER_OFFSET_KEY) != null) {
+                    c.putClientProperty(GUTTER_OFFSET_KEY, null);
+                }
+            }
+        } else {
+            super.paint(g, c);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsPopupWindow.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.sun.java.swing.plaf.windows;
+
+import javax.swing.JWindow;
+import java.awt.Window;
+import java.awt.Graphics;
+
+/**
+ * A class which tags a window with a particular semantic usage,
+ * either tooltip, menu, sub-menu, popup-menu, or comobobox-popup.
+ * This is used as a temporary solution for getting native AWT support
+ * for transition effects in Windows 98 and Windows 2000.  The native
+ * code will interpret the windowType property and automatically
+ * implement appropriate animation when the window is shown/hidden.
+ * <p>
+ * Note that support for transition effects may be supported with a
+ * different mechanism in the future and so this class is
+ * package-private and targeted for Swing implementation use only.
+ * <p>
+ * <strong>Warning:</strong>
+ * Serialized objects of this class will not be compatible with
+ * future Swing releases.  The current serialization support is appropriate
+ * for short term storage or RMI between applications running the same
+ * version of Swing.  A future release of Swing will provide support for
+ * long term persistence.
+ *
+ * @author Amy Fowler
+ */
+@SuppressWarnings("serial") // Superclass is not serializable across versions
+class WindowsPopupWindow extends JWindow {
+
+    static final int UNDEFINED_WINDOW_TYPE      = 0;
+    static final int TOOLTIP_WINDOW_TYPE        = 1;
+    static final int MENU_WINDOW_TYPE           = 2;
+    static final int SUBMENU_WINDOW_TYPE        = 3;
+    static final int POPUPMENU_WINDOW_TYPE      = 4;
+    static final int COMBOBOX_POPUP_WINDOW_TYPE = 5;
+
+    private int windowType;
+
+    WindowsPopupWindow(Window parent) {
+        super(parent);
+        setFocusableWindowState(false);
+    }
+
+    void setWindowType(int type) {
+        windowType = type;
+    }
+
+    int getWindowType() {
+        return windowType;
+    }
+
+    public void update(Graphics g) {
+        paint(g);
+    }
+
+    @SuppressWarnings("deprecation")
+    public void hide() {
+        super.hide();
+        /** We need to call removeNotify() here because hide() does
+         * something only if Component.visible is true. When the app
+         * frame is miniaturized, the parent frame of this frame is
+         * invisible, causing AWT to believe that this frame
+         *  is invisible and causing hide() to do nothing
+         */
+        removeNotify();
+    }
+
+    @SuppressWarnings("deprecation")
+    public void show() {
+        super.show();
+        this.pack();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsProgressBarUI.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,412 @@
+/*
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import javax.swing.plaf.basic.*;
+import javax.swing.plaf.*;
+import javax.swing.*;
+import java.awt.*;
+
+import static com.sun.java.swing.plaf.windows.TMSchema.*;
+import static com.sun.java.swing.plaf.windows.XPStyle.Skin;
+
+
+/**
+ * Windows rendition of the component.
+ * <p>
+ * <strong>Warning:</strong>
+ * Serialized objects of this class will not be compatible with
+ * future Swing releases.  The current serialization support is appropriate
+ * for short term storage or RMI between applications running the same
+ * version of Swing.  A future release of Swing will provide support for
+ * long term persistence.
+ *
+ * @author Michael C. Albers
+ */
+public class WindowsProgressBarUI extends BasicProgressBarUI
+{
+
+    private Rectangle previousFullBox;
+    private Insets indeterminateInsets;
+
+    public static ComponentUI createUI(JComponent x) {
+        return new WindowsProgressBarUI();
+    }
+
+
+    protected void installDefaults() {
+        super.installDefaults();
+
+        if (XPStyle.getXP() != null) {
+            LookAndFeel.installProperty(progressBar, "opaque", Boolean.FALSE);
+            progressBar.setBorder(null);
+            indeterminateInsets = UIManager.getInsets("ProgressBar.indeterminateInsets");
+        }
+    }
+
+    /**
+     * Returns the baseline.
+     *
+     * @throws NullPointerException {@inheritDoc}
+     * @throws IllegalArgumentException {@inheritDoc}
+     * @see javax.swing.JComponent#getBaseline(int, int)
+     * @since 1.6
+     */
+    public int getBaseline(JComponent c, int width, int height) {
+        int baseline = super.getBaseline(c, width, height);
+        if (XPStyle.getXP() != null && progressBar.isStringPainted() &&
+                progressBar.getOrientation() == JProgressBar.HORIZONTAL) {
+            FontMetrics metrics = progressBar.
+                    getFontMetrics(progressBar.getFont());
+            int y = progressBar.getInsets().top;
+            if (progressBar.isIndeterminate()) {
+                y = -1;
+                height--;
+            }
+            else {
+                y = 0;
+                height -= 3;
+            }
+            baseline = y + (height + metrics.getAscent() -
+                        metrics.getLeading() -
+                        metrics.getDescent()) / 2;
+        }
+        return baseline;
+    }
+
+    protected Dimension getPreferredInnerHorizontal() {
+        XPStyle xp = XPStyle.getXP();
+        if (xp != null) {
+             Skin skin = xp.getSkin(progressBar, Part.PP_BAR);
+             return new Dimension(
+                     (int)super.getPreferredInnerHorizontal().getWidth(),
+                     skin.getHeight());
+         }
+         return super.getPreferredInnerHorizontal();
+    }
+
+    protected Dimension getPreferredInnerVertical() {
+         XPStyle xp = XPStyle.getXP();
+         if (xp != null) {
+             Skin skin = xp.getSkin(progressBar, Part.PP_BARVERT);
+             return new Dimension(
+                     skin.getWidth(),
+                     (int)super.getPreferredInnerVertical().getHeight());
+         }
+         return super.getPreferredInnerVertical();
+    }
+
+    protected void paintDeterminate(Graphics g, JComponent c) {
+        XPStyle xp = XPStyle.getXP();
+        if (xp != null) {
+            boolean vertical = (progressBar.getOrientation() == JProgressBar.VERTICAL);
+            boolean isLeftToRight = WindowsGraphicsUtils.isLeftToRight(c);
+            int barRectWidth = progressBar.getWidth();
+            int barRectHeight = progressBar.getHeight()-1;
+            // amount of progress to draw
+            int amountFull = getAmountFull(null, barRectWidth, barRectHeight);
+
+            paintXPBackground(g, vertical, barRectWidth, barRectHeight);
+            // Paint progress
+            if (progressBar.isStringPainted()) {
+                // Do not paint the standard stripes from the skin, because they obscure
+                // the text
+                g.setColor(progressBar.getForeground());
+                barRectHeight -= 2;
+                barRectWidth -= 2;
+
+                if (barRectWidth <= 0 || barRectHeight <= 0) {
+                    return;
+                }
+
+                Graphics2D g2 = (Graphics2D)g;
+                g2.setStroke(new BasicStroke((float)(vertical ? barRectWidth : barRectHeight),
+                                             BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL));
+                if (!vertical) {
+                    if (isLeftToRight) {
+                        g2.drawLine(2,              barRectHeight / 2 + 1,
+                                    amountFull - 2, barRectHeight / 2 + 1);
+                    } else {
+                        g2.drawLine(2 + barRectWidth,
+                                    barRectHeight / 2 + 1,
+                                    2 + barRectWidth - (amountFull - 2),
+                                    barRectHeight / 2 + 1);
+                    }
+                    paintString(g, 0, 0, barRectWidth, barRectHeight, amountFull, null);
+                } else {
+                    g2.drawLine(barRectWidth/2 + 1, barRectHeight + 1,
+                                barRectWidth/2 + 1, barRectHeight + 1 - amountFull + 2);
+                    paintString(g, 2, 2, barRectWidth, barRectHeight, amountFull, null);
+                }
+
+            } else {
+                Skin skin = xp.getSkin(progressBar, vertical ? Part.PP_CHUNKVERT : Part.PP_CHUNK);
+                int thickness;
+                if (vertical) {
+                    thickness = barRectWidth - 5;
+                } else {
+                    thickness = barRectHeight - 5;
+                }
+
+                int chunkSize = xp.getInt(progressBar, Part.PP_PROGRESS, null, Prop.PROGRESSCHUNKSIZE, 2);
+                int spaceSize = xp.getInt(progressBar, Part.PP_PROGRESS, null, Prop.PROGRESSSPACESIZE, 0);
+                int nChunks = (amountFull-4) / (chunkSize + spaceSize);
+
+                // See if we can squeeze in an extra chunk without spacing after
+                if (spaceSize > 0 && (nChunks * (chunkSize + spaceSize) + chunkSize) < (amountFull-4)) {
+                    nChunks++;
+                }
+
+                for (int i = 0; i < nChunks; i++) {
+                    if (vertical) {
+                        skin.paintSkin(g,
+                                       3, barRectHeight - i * (chunkSize + spaceSize) - chunkSize - 2,
+                                       thickness, chunkSize, null);
+                    } else {
+                        if (isLeftToRight) {
+                            skin.paintSkin(g,
+                                           4 + i * (chunkSize + spaceSize), 2,
+                                           chunkSize, thickness, null);
+                        } else {
+                            skin.paintSkin(g,
+                                           barRectWidth - (2 + (i+1) * (chunkSize + spaceSize)), 2,
+                                           chunkSize, thickness, null);
+                        }
+                    }
+                }
+            }
+        } else {
+            super.paintDeterminate(g, c);
+        }
+    }
+
+
+    /**
+     * {@inheritDoc}
+     * @since 1.6
+     */
+    protected void setAnimationIndex(int newValue) {
+        super.setAnimationIndex(newValue);
+        XPStyle xp = XPStyle.getXP();
+        if (xp != null) {
+            if (boxRect != null) {
+                // get the full repaint area and add it the
+                // previous one so we can erase it
+                Rectangle chunk = getFullChunkBounds(boxRect);
+                if (previousFullBox != null) {
+                    chunk.add(previousFullBox);
+                }
+                progressBar.repaint(chunk);
+            } else {
+                progressBar.repaint();
+            }
+        }
+    }
+
+
+    /**
+     * {@inheritDoc}
+     * @since 1.6
+     */
+    protected int getBoxLength(int availableLength, int otherDimension) {
+        XPStyle xp = XPStyle.getXP();
+        if (xp != null) {
+            return 6; // an apparently hard coded value in Windows
+        }
+        return super.getBoxLength(availableLength, otherDimension);
+    }
+
+    /**
+     * {@inheritDoc}
+     * @since 1.6
+     */
+    protected Rectangle getBox(Rectangle r) {
+        Rectangle rect = super.getBox(r);
+
+        XPStyle xp = XPStyle.getXP();
+        if (xp != null) {
+            boolean vertical = (progressBar.getOrientation()
+                                 == JProgressBar.VERTICAL);
+            Part part = vertical ? Part.PP_BARVERT : Part.PP_BAR;
+            Insets ins = indeterminateInsets;
+
+            int currentFrame = getAnimationIndex();
+            int framecount = getFrameCount()/2;
+
+            int gap = xp.getInt(progressBar, Part.PP_PROGRESS, null,
+                    Prop.PROGRESSSPACESIZE, 0);
+            currentFrame = currentFrame % framecount;
+
+            // this code adjusts the chunk size to properly account for the
+            // size and gap specified in the XP style. It also does it's own
+            // box placement for the chunk animation. This is required because
+            // the inherited algorithm from BasicProgressBarUI goes back and
+            // forth whereas XP only goes in one direction. XP also has ghosted
+            // trailing chunks to create the illusion of speed. This code
+            // adjusts the pixel length of the animation to account for the
+            // trails.
+            if (!vertical) {
+                rect.y = rect.y + ins.top;
+                rect.height = progressBar.getHeight() - ins.top - ins.bottom;
+                int len = progressBar.getWidth() - ins.left - ins.right;
+                len += (rect.width+gap)*2; // add 2x for the trails
+                double delta = (double)(len) / (double)framecount;
+                rect.x = (int)(delta * currentFrame) + ins.left;
+            } else {
+                rect.x = rect.x + ins.left;
+                rect.width = progressBar.getWidth() - ins.left - ins.right;
+                int len = progressBar.getHeight() - ins.top - ins.bottom;
+                len += (rect.height+gap)*2; // add 2x for the trails
+                double delta = (double)(len) / (double)framecount;
+                rect.y = (int)(delta * currentFrame) + ins.top;
+            }
+        }
+        return rect;
+    }
+
+
+    protected void paintIndeterminate(Graphics g, JComponent c) {
+        XPStyle xp = XPStyle.getXP();
+        if (xp != null) {
+            boolean vertical = (progressBar.getOrientation()
+                                 == JProgressBar.VERTICAL);
+            int barRectWidth = progressBar.getWidth();
+            int barRectHeight = progressBar.getHeight();
+            paintXPBackground(g, vertical, barRectWidth, barRectHeight);
+
+            // Paint the bouncing box.
+            boxRect = getBox(boxRect);
+            if (boxRect != null) {
+                g.setColor(progressBar.getForeground());
+                if (!(g instanceof Graphics2D)) {
+                    return;
+                }
+                paintIndeterminateFrame(boxRect, (Graphics2D)g, vertical,
+                                        barRectWidth, barRectHeight);
+                if (progressBar.isStringPainted()) {
+                    if (!vertical) {
+                        paintString(g, -1, -1, barRectWidth, barRectHeight, 0, null);
+                    } else {
+                        paintString(g, 1, 1, barRectWidth, barRectHeight, 0, null);
+                    }
+                }
+            }
+        } else {
+            super.paintIndeterminate(g, c);
+        }
+    }
+
+    private Rectangle getFullChunkBounds(Rectangle box) {
+        boolean vertical = (progressBar.getOrientation() == JProgressBar.VERTICAL);
+        XPStyle xp = XPStyle.getXP();
+        int gap = (xp != null) ? xp.getInt(progressBar, Part.PP_PROGRESS,
+                                           null, Prop.PROGRESSSPACESIZE, 0)
+                               : 0;
+
+        if (!vertical) {
+            int chunksize = box.width+gap;
+            return new Rectangle(box.x-chunksize*2, box.y, chunksize*3, box.height);
+        } else {
+            int chunksize = box.height+gap;
+            return new Rectangle(box.x, box.y-chunksize*2, box.width, chunksize*3);
+        }
+    }
+
+    private void paintIndeterminateFrame(Rectangle box, Graphics2D g,
+                                          boolean vertical,
+                                          int bgwidth, int bgheight) {
+        XPStyle xp = XPStyle.getXP();
+        if (xp == null) {
+            return;
+        }
+
+        // create a new graphics to keep drawing surface state
+        Graphics2D gfx = (Graphics2D)g.create();
+
+        Part part = vertical ? Part.PP_BARVERT : Part.PP_BAR;
+        Part chunk = vertical ? Part.PP_CHUNKVERT : Part.PP_CHUNK;
+
+        // calculate the chunk offsets
+        int gap = xp.getInt(progressBar, Part.PP_PROGRESS, null,
+                            Prop.PROGRESSSPACESIZE, 0);
+        int deltax = 0;
+        int deltay = 0;
+        if (!vertical) {
+            deltax = -box.width - gap;
+            deltay = 0;
+        } else {
+            deltax = 0;
+            deltay = -box.height - gap;
+        }
+
+        // Calculate the area of the chunks combined
+        Rectangle fullBox = getFullChunkBounds(box);
+
+        // save this box for the next time
+        previousFullBox = fullBox;
+
+        // this is the entire progress bar minus the track and borders
+        Insets ins = indeterminateInsets;
+        Rectangle progbarExtents = new Rectangle(ins.left, ins.top,
+                                                 bgwidth  - ins.left - ins.right,
+                                                 bgheight - ins.top  - ins.bottom);
+
+        // only paint where the chunks overlap with the progress bar drawing area
+        Rectangle repaintArea = progbarExtents.intersection(fullBox);
+
+        // adjust the cliprect to chop the chunks when they go off the end
+        gfx.clip(repaintArea);
+
+        // get the skin
+        XPStyle.Skin skin = xp.getSkin(progressBar, chunk);
+
+        // do the drawing
+        gfx.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.8f));
+        skin.paintSkin(gfx, box.x, box.y, box.width, box.height, null);
+        box.translate(deltax, deltay);
+        gfx.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f));
+        skin.paintSkin(gfx, box.x, box.y, box.width, box.height, null);
+        box.translate(deltax, deltay);
+        gfx.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.2f));
+        skin.paintSkin(gfx, box.x, box.y, box.width, box.height, null);
+
+        // get rid of our clip and composite changes
+        gfx.dispose();
+    }
+
+    private void paintXPBackground(Graphics g, boolean vertical,
+                                   int barRectWidth, int barRectHeight) {
+        XPStyle xp = XPStyle.getXP();
+        if (xp == null) {
+            return;
+        }
+        Part part = vertical ? Part.PP_BARVERT : Part.PP_BAR;
+        Skin skin = xp.getSkin(progressBar, part);
+
+        // Paint background
+        skin.paintSkin(g, 0, 0, barRectWidth, barRectHeight, null);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsRadioButtonMenuItemUI.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import java.awt.*;
+import javax.swing.*;
+import javax.swing.plaf.*;
+import javax.swing.plaf.basic.*;
+
+import com.sun.java.swing.plaf.windows.TMSchema.Part;
+import com.sun.java.swing.plaf.windows.TMSchema.State;
+
+/**
+ * Windows rendition of the component.
+ * <p>
+ * <strong>Warning:</strong>
+ * Serialized objects of this class will not be compatible with
+ * future Swing releases.  The current serialization support is appropriate
+ * for short term storage or RMI between applications running the same
+ * version of Swing.  A future release of Swing will provide support for
+ * long term persistence.
+ */
+public class WindowsRadioButtonMenuItemUI extends BasicRadioButtonMenuItemUI {
+
+    final WindowsMenuItemUIAccessor accessor =
+        new WindowsMenuItemUIAccessor() {
+
+           public JMenuItem getMenuItem() {
+               return menuItem;
+           }
+
+           public State getState(JMenuItem menuItem) {
+               return WindowsMenuItemUI.getState(this, menuItem);
+           }
+
+           public Part getPart(JMenuItem menuItem) {
+               return WindowsMenuItemUI.getPart(this, menuItem);
+           }
+    };
+    public static ComponentUI createUI(JComponent b) {
+        return new WindowsRadioButtonMenuItemUI();
+    }
+
+    @Override
+    protected  void paintBackground(Graphics g, JMenuItem menuItem,
+            Color bgColor) {
+        if (WindowsMenuItemUI.isVistaPainting()) {
+            WindowsMenuItemUI.paintBackground(accessor, g, menuItem, bgColor);
+            return;
+        }
+        super.paintBackground(g, menuItem, bgColor);
+    }
+
+    /**
+     * Method which renders the text of the current menu item.
+     *
+     * @param g Graphics context
+     * @param menuItem Current menu item to render
+     * @param textRect Bounding rectangle to render the text.
+     * @param text String to render
+     * @since 1.4
+     */
+    protected void paintText(Graphics g, JMenuItem menuItem,
+            Rectangle textRect, String text) {
+        if (WindowsMenuItemUI.isVistaPainting()) {
+            WindowsMenuItemUI.paintText(accessor, g, menuItem, textRect, text);
+            return;
+        }
+        ButtonModel model = menuItem.getModel();
+        Color oldColor = g.getColor();
+
+        if(model.isEnabled() && model.isArmed()) {
+            g.setColor(selectionForeground); // Uses protected field.
+        }
+
+        WindowsGraphicsUtils.paintText(g, menuItem, textRect, text, 0);
+
+        g.setColor(oldColor);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsRadioButtonUI.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,135 @@
+/*
+ * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import sun.awt.AppContext;
+
+import javax.swing.plaf.basic.*;
+import javax.swing.*;
+import javax.swing.plaf.*;
+
+import java.awt.*;
+
+
+/**
+ * Windows rendition of the component.
+ * <p>
+ * <strong>Warning:</strong>
+ * Serialized objects of this class will not be compatible with
+ * future Swing releases.  The current serialization support is appropriate
+ * for short term storage or RMI between applications running the same
+ * version of Swing.  A future release of Swing will provide support for
+ * long term persistence.
+ */
+public class WindowsRadioButtonUI extends BasicRadioButtonUI
+{
+    private static final Object WINDOWS_RADIO_BUTTON_UI_KEY = new Object();
+
+    protected int dashedRectGapX;
+    protected int dashedRectGapY;
+    protected int dashedRectGapWidth;
+    protected int dashedRectGapHeight;
+
+    protected Color focusColor;
+
+    private boolean initialized = false;
+
+    // ********************************
+    //          Create PLAF
+    // ********************************
+    public static ComponentUI createUI(JComponent c) {
+        AppContext appContext = AppContext.getAppContext();
+        WindowsRadioButtonUI windowsRadioButtonUI =
+                (WindowsRadioButtonUI) appContext.get(WINDOWS_RADIO_BUTTON_UI_KEY);
+        if (windowsRadioButtonUI == null) {
+            windowsRadioButtonUI = new WindowsRadioButtonUI();
+            appContext.put(WINDOWS_RADIO_BUTTON_UI_KEY, windowsRadioButtonUI);
+        }
+        return windowsRadioButtonUI;
+    }
+
+    // ********************************
+    //           Defaults
+    // ********************************
+    public void installDefaults(AbstractButton b) {
+        super.installDefaults(b);
+        if(!initialized) {
+            dashedRectGapX = ((Integer)UIManager.get("Button.dashedRectGapX")).intValue();
+            dashedRectGapY = ((Integer)UIManager.get("Button.dashedRectGapY")).intValue();
+            dashedRectGapWidth = ((Integer)UIManager.get("Button.dashedRectGapWidth")).intValue();
+            dashedRectGapHeight = ((Integer)UIManager.get("Button.dashedRectGapHeight")).intValue();
+            focusColor = UIManager.getColor(getPropertyPrefix() + "focus");
+            initialized = true;
+        }
+        if (XPStyle.getXP() != null) {
+            LookAndFeel.installProperty(b, "rolloverEnabled", Boolean.TRUE);
+        }
+    }
+
+    protected void uninstallDefaults(AbstractButton b) {
+        super.uninstallDefaults(b);
+        initialized = false;
+    }
+
+    protected Color getFocusColor() {
+        return focusColor;
+    }
+
+    // ********************************
+    //          Paint Methods
+    // ********************************
+
+    /**
+     * Overridden method to render the text without the mnemonic
+     */
+    protected void paintText(Graphics g, AbstractButton b, Rectangle textRect, String text) {
+        WindowsGraphicsUtils.paintText(g, b, textRect, text, getTextShiftOffset());
+    }
+
+
+    protected void paintFocus(Graphics g, Rectangle textRect, Dimension d){
+        g.setColor(getFocusColor());
+        BasicGraphicsUtils.drawDashedRect(g, textRect.x, textRect.y, textRect.width, textRect.height);
+    }
+
+    // ********************************
+    //          Layout Methods
+    // ********************************
+    public Dimension getPreferredSize(JComponent c) {
+        Dimension d = super.getPreferredSize(c);
+
+        /* Ensure that the width and height of the button is odd,
+         * to allow for the focus line if focus is painted
+         */
+        AbstractButton b = (AbstractButton)c;
+        if (d != null && b.isFocusPainted()) {
+            if(d.width % 2 == 0) { d.width += 1; }
+            if(d.height % 2 == 0) { d.height += 1; }
+        }
+        return d;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsRootPaneUI.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,212 @@
+/*
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.Event;
+import java.awt.KeyEventPostProcessor;
+import java.awt.Window;
+import java.awt.Toolkit;
+
+import sun.awt.AWTAccessor;
+import sun.awt.SunToolkit;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.KeyEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.ActionMap;
+import javax.swing.InputMap;
+import javax.swing.KeyStroke;
+import javax.swing.JComponent;
+import javax.swing.JLabel;
+import javax.swing.JRootPane;
+import javax.swing.SwingUtilities;
+import javax.swing.UIManager;
+import javax.swing.AbstractButton;
+import javax.swing.JFrame;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.MenuElement;
+import javax.swing.MenuSelectionManager;
+
+import javax.swing.plaf.ActionMapUIResource;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.InputMapUIResource;
+
+import javax.swing.plaf.basic.BasicRootPaneUI;
+import javax.swing.plaf.basic.ComboPopup;
+
+/**
+ * Windows implementation of RootPaneUI, there is one shared between all
+ * JRootPane instances.
+ *
+ * @author Mark Davidson
+ * @since 1.4
+ */
+public class WindowsRootPaneUI extends BasicRootPaneUI {
+
+    private static final WindowsRootPaneUI windowsRootPaneUI = new WindowsRootPaneUI();
+    static final AltProcessor altProcessor = new AltProcessor();
+
+    public static ComponentUI createUI(JComponent c) {
+        return windowsRootPaneUI;
+    }
+
+    static class AltProcessor implements KeyEventPostProcessor {
+        static boolean altKeyPressed = false;
+        static boolean menuCanceledOnPress = false;
+        static JRootPane root = null;
+        static Window winAncestor = null;
+
+        void altPressed(KeyEvent ev) {
+            MenuSelectionManager msm =
+                MenuSelectionManager.defaultManager();
+            MenuElement[] path = msm.getSelectedPath();
+            if (path.length > 0 && ! (path[0] instanceof ComboPopup)) {
+                msm.clearSelectedPath();
+                menuCanceledOnPress = true;
+                ev.consume();
+            } else if(path.length > 0) { // We are in ComboBox
+                menuCanceledOnPress = false;
+                WindowsLookAndFeel.setMnemonicHidden(false);
+                WindowsGraphicsUtils.repaintMnemonicsInWindow(winAncestor);
+                ev.consume();
+            } else {
+                menuCanceledOnPress = false;
+                WindowsLookAndFeel.setMnemonicHidden(false);
+                WindowsGraphicsUtils.repaintMnemonicsInWindow(winAncestor);
+                JMenuBar mbar = root != null ? root.getJMenuBar() : null;
+                if(mbar == null && winAncestor instanceof JFrame) {
+                    mbar = ((JFrame)winAncestor).getJMenuBar();
+                }
+                JMenu menu = mbar != null ? mbar.getMenu(0) : null;
+                if(menu != null) {
+                    ev.consume();
+                }
+            }
+        }
+
+        void altReleased(KeyEvent ev) {
+            if (menuCanceledOnPress) {
+                WindowsLookAndFeel.setMnemonicHidden(true);
+                WindowsGraphicsUtils.repaintMnemonicsInWindow(winAncestor);
+                return;
+            }
+
+            MenuSelectionManager msm =
+                MenuSelectionManager.defaultManager();
+            if (msm.getSelectedPath().length == 0) {
+                // if no menu is active, we try activating the menubar
+
+                JMenuBar mbar = root != null ? root.getJMenuBar() : null;
+                if(mbar == null && winAncestor instanceof JFrame) {
+                    mbar = ((JFrame)winAncestor).getJMenuBar();
+                }
+                JMenu menu = mbar != null ? mbar.getMenu(0) : null;
+
+                // It might happen that the altRelease event is processed
+                // with a reasonable delay since it has been generated.
+                // Here we check the last deactivation time of the containing
+                // window. If this time appears to be greater than the altRelease
+                // event time the event is skipped to avoid unexpected menu
+                // activation. See 7121442.
+                // Also we must ensure that original source of key event belongs
+                // to the same window object as winAncestor. See 8001633.
+                boolean skip = false;
+                Toolkit tk = Toolkit.getDefaultToolkit();
+                if (tk instanceof SunToolkit) {
+                    Component originalSource = AWTAccessor.getKeyEventAccessor()
+                            .getOriginalSource(ev);
+                    skip = SunToolkit.getContainingWindow(originalSource) != winAncestor ||
+                            ev.getWhen() <= ((SunToolkit) tk).getWindowDeactivationTime(winAncestor);
+                }
+
+                if (menu != null && !skip) {
+                    MenuElement[] path = new MenuElement[2];
+                    path[0] = mbar;
+                    path[1] = menu;
+                    msm.setSelectedPath(path);
+                } else if(!WindowsLookAndFeel.isMnemonicHidden()) {
+                    WindowsLookAndFeel.setMnemonicHidden(true);
+                    WindowsGraphicsUtils.repaintMnemonicsInWindow(winAncestor);
+                }
+            } else {
+                if((msm.getSelectedPath())[0] instanceof ComboPopup) {
+                    WindowsLookAndFeel.setMnemonicHidden(true);
+                    WindowsGraphicsUtils.repaintMnemonicsInWindow(winAncestor);
+                }
+            }
+
+        }
+
+        public boolean postProcessKeyEvent(KeyEvent ev) {
+            if(ev.isConsumed() && ev.getKeyCode() != KeyEvent.VK_ALT) {
+                // mnemonic combination, it's consumed, but we need
+                // set altKeyPressed to false, otherwise after selection
+                // component by mnemonic combination a menu will be open
+                altKeyPressed = false;
+                return false;
+            }
+            if (ev.getKeyCode() == KeyEvent.VK_ALT) {
+                root = SwingUtilities.getRootPane(ev.getComponent());
+                winAncestor = (root == null ? null :
+                        SwingUtilities.getWindowAncestor(root));
+
+                if (ev.getID() == KeyEvent.KEY_PRESSED) {
+                    if (!altKeyPressed) {
+                        altPressed(ev);
+                    }
+                    altKeyPressed = true;
+                    return true;
+                } else if (ev.getID() == KeyEvent.KEY_RELEASED) {
+                    if (altKeyPressed) {
+                        altReleased(ev);
+                    } else {
+                        MenuSelectionManager msm =
+                            MenuSelectionManager.defaultManager();
+                        MenuElement[] path = msm.getSelectedPath();
+                        if (path.length <= 0) {
+                            WindowsLookAndFeel.setMnemonicHidden(true);
+                            WindowsGraphicsUtils.repaintMnemonicsInWindow(winAncestor);
+                        }
+                    }
+                    altKeyPressed = false;
+                }
+                root = null;
+                winAncestor = null;
+            } else {
+                if (WindowsLookAndFeel.isMnemonicHidden() && ev.isAltDown()) {
+                    WindowsLookAndFeel.setMnemonicHidden(false);
+                    WindowsGraphicsUtils.repaintMnemonicsInWindow(winAncestor);
+                }
+                altKeyPressed = false;
+            }
+            return false;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsScrollBarUI.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,503 @@
+/*
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import java.awt.*;
+import java.awt.event.*;
+import java.awt.image.*;
+import java.lang.ref.*;
+import java.util.*;
+import javax.swing.plaf.basic.*;
+import javax.swing.*;
+import javax.swing.plaf.ComponentUI;
+
+import static com.sun.java.swing.plaf.windows.TMSchema.*;
+import static com.sun.java.swing.plaf.windows.XPStyle.Skin;
+
+
+/**
+ * Windows rendition of the component.
+ * <p>
+ * <strong>Warning:</strong>
+ * Serialized objects of this class will not be compatible with
+ * future Swing releases.  The current serialization support is appropriate
+ * for short term storage or RMI between applications running the same
+ * version of Swing.  A future release of Swing will provide support for
+ * long term persistence.
+ */
+public class WindowsScrollBarUI extends BasicScrollBarUI {
+    private Grid thumbGrid;
+    private Grid highlightGrid;
+    private Dimension horizontalThumbSize;
+    private Dimension verticalThumbSize;
+
+    /**
+     * Creates a UI for a JScrollBar.
+     *
+     * @param c the text field
+     * @return the UI
+     */
+    public static ComponentUI createUI(JComponent c) {
+        return new WindowsScrollBarUI();
+    }
+
+    protected void installDefaults() {
+        super.installDefaults();
+
+        XPStyle xp = XPStyle.getXP();
+        if (xp != null) {
+            scrollbar.setBorder(null);
+            horizontalThumbSize = getSize(scrollbar, xp, Part.SBP_THUMBBTNHORZ);
+            verticalThumbSize = getSize(scrollbar, xp, Part.SBP_THUMBBTNVERT);
+        } else {
+            horizontalThumbSize = null;
+            verticalThumbSize = null;
+        }
+    }
+
+    private static Dimension getSize(Component component, XPStyle xp, Part part) {
+        Skin skin = xp.getSkin(component, part);
+        return new Dimension(skin.getWidth(), skin.getHeight());
+    }
+
+    @Override
+    protected Dimension getMinimumThumbSize() {
+        if ((horizontalThumbSize == null) || (verticalThumbSize == null)) {
+            return super.getMinimumThumbSize();
+        }
+        return JScrollBar.HORIZONTAL == scrollbar.getOrientation()
+                ? horizontalThumbSize
+                : verticalThumbSize;
+    }
+
+    public void uninstallUI(JComponent c) {
+        super.uninstallUI(c);
+        thumbGrid = highlightGrid = null;
+    }
+
+    protected void configureScrollBarColors() {
+        super.configureScrollBarColors();
+        Color color = UIManager.getColor("ScrollBar.trackForeground");
+        if (color != null && trackColor != null) {
+            thumbGrid = Grid.getGrid(color, trackColor);
+        }
+
+        color = UIManager.getColor("ScrollBar.trackHighlightForeground");
+        if (color != null && trackHighlightColor != null) {
+            highlightGrid = Grid.getGrid(color, trackHighlightColor);
+        }
+    }
+
+    protected JButton createDecreaseButton(int orientation)  {
+        return new WindowsArrowButton(orientation,
+                                    UIManager.getColor("ScrollBar.thumb"),
+                                    UIManager.getColor("ScrollBar.thumbShadow"),
+                                    UIManager.getColor("ScrollBar.thumbDarkShadow"),
+                                    UIManager.getColor("ScrollBar.thumbHighlight"));
+    }
+
+    protected JButton createIncreaseButton(int orientation)  {
+        return new WindowsArrowButton(orientation,
+                                    UIManager.getColor("ScrollBar.thumb"),
+                                    UIManager.getColor("ScrollBar.thumbShadow"),
+                                    UIManager.getColor("ScrollBar.thumbDarkShadow"),
+                                    UIManager.getColor("ScrollBar.thumbHighlight"));
+    }
+
+    /**
+     * {@inheritDoc}
+     * @since 1.6
+     */
+    @Override
+    protected ArrowButtonListener createArrowButtonListener(){
+        // we need to repaint the entire scrollbar because state change for each
+        // button causes a state change for the thumb and other button on Vista
+        if(XPStyle.isVista()) {
+            return new ArrowButtonListener() {
+                public void mouseEntered(MouseEvent evt) {
+                    repaint();
+                    super.mouseEntered(evt);
+                }
+                public void mouseExited(MouseEvent evt) {
+                    repaint();
+                    super.mouseExited(evt);
+                }
+                private void repaint() {
+                    scrollbar.repaint();
+                }
+            };
+        } else {
+            return super.createArrowButtonListener();
+        }
+    }
+
+    protected void paintTrack(Graphics g, JComponent c, Rectangle trackBounds){
+        boolean v = (scrollbar.getOrientation() == JScrollBar.VERTICAL);
+
+        XPStyle xp = XPStyle.getXP();
+        if (xp != null) {
+            JScrollBar sb = (JScrollBar)c;
+            State state = State.NORMAL;
+            // Pending: Implement rollover (hot) and pressed
+            if (!sb.isEnabled()) {
+                state = State.DISABLED;
+            }
+            Part part = v ? Part.SBP_LOWERTRACKVERT : Part.SBP_LOWERTRACKHORZ;
+            xp.getSkin(sb, part).paintSkin(g, trackBounds, state);
+        } else if (thumbGrid == null) {
+            super.paintTrack(g, c, trackBounds);
+        }
+        else {
+            thumbGrid.paint(g, trackBounds.x, trackBounds.y, trackBounds.width,
+                            trackBounds.height);
+            if (trackHighlight == DECREASE_HIGHLIGHT) {
+                paintDecreaseHighlight(g);
+            }
+            else if (trackHighlight == INCREASE_HIGHLIGHT) {
+                paintIncreaseHighlight(g);
+            }
+        }
+    }
+
+    protected void paintThumb(Graphics g, JComponent c, Rectangle thumbBounds) {
+        boolean v = (scrollbar.getOrientation() == JScrollBar.VERTICAL);
+
+        XPStyle xp = XPStyle.getXP();
+        if (xp != null) {
+            JScrollBar sb = (JScrollBar)c;
+            State state = State.NORMAL;
+            if (!sb.isEnabled()) {
+                state = State.DISABLED;
+            } else if (isDragging) {
+                state = State.PRESSED;
+            } else if (isThumbRollover()) {
+                state = State.HOT;
+            } else if (XPStyle.isVista()) {
+                if ((incrButton != null && incrButton.getModel().isRollover()) ||
+                    (decrButton != null && decrButton.getModel().isRollover())) {
+                    state = State.HOVER;
+                }
+            }
+            // Paint thumb
+            Part thumbPart = v ? Part.SBP_THUMBBTNVERT : Part.SBP_THUMBBTNHORZ;
+            xp.getSkin(sb, thumbPart).paintSkin(g, thumbBounds, state);
+            // Paint gripper
+            Part gripperPart = v ? Part.SBP_GRIPPERVERT : Part.SBP_GRIPPERHORZ;
+            Skin skin = xp.getSkin(sb, gripperPart);
+            Insets gripperInsets = xp.getMargin(c, thumbPart, null, Prop.CONTENTMARGINS);
+            if (gripperInsets == null ||
+                (v && (thumbBounds.height - gripperInsets.top -
+                       gripperInsets.bottom >= skin.getHeight())) ||
+                (!v && (thumbBounds.width - gripperInsets.left -
+                        gripperInsets.right >= skin.getWidth()))) {
+                skin.paintSkin(g,
+                               thumbBounds.x + (thumbBounds.width  - skin.getWidth()) / 2,
+                               thumbBounds.y + (thumbBounds.height - skin.getHeight()) / 2,
+                               skin.getWidth(), skin.getHeight(), state);
+            }
+        } else {
+            super.paintThumb(g, c, thumbBounds);
+        }
+    }
+
+
+    protected void paintDecreaseHighlight(Graphics g) {
+        if (highlightGrid == null) {
+            super.paintDecreaseHighlight(g);
+        }
+        else {
+            Insets insets = scrollbar.getInsets();
+            Rectangle thumbR = getThumbBounds();
+            int x, y, w, h;
+
+            if (scrollbar.getOrientation() == JScrollBar.VERTICAL) {
+                x = insets.left;
+                y = decrButton.getY() + decrButton.getHeight();
+                w = scrollbar.getWidth() - (insets.left + insets.right);
+                h = thumbR.y - y;
+            }
+            else {
+                x = decrButton.getX() + decrButton.getHeight();
+                y = insets.top;
+                w = thumbR.x - x;
+                h = scrollbar.getHeight() - (insets.top + insets.bottom);
+            }
+            highlightGrid.paint(g, x, y, w, h);
+        }
+    }
+
+
+    protected void paintIncreaseHighlight(Graphics g) {
+        if (highlightGrid == null) {
+            super.paintDecreaseHighlight(g);
+        }
+        else {
+            Insets insets = scrollbar.getInsets();
+            Rectangle thumbR = getThumbBounds();
+            int x, y, w, h;
+
+            if (scrollbar.getOrientation() == JScrollBar.VERTICAL) {
+                x = insets.left;
+                y = thumbR.y + thumbR.height;
+                w = scrollbar.getWidth() - (insets.left + insets.right);
+                h = incrButton.getY() - y;
+            }
+            else {
+                x = thumbR.x + thumbR.width;
+                y = insets.top;
+                w = incrButton.getX() - x;
+                h = scrollbar.getHeight() - (insets.top + insets.bottom);
+            }
+            highlightGrid.paint(g, x, y, w, h);
+        }
+    }
+
+
+    /**
+     * {@inheritDoc}
+     * @since 1.6
+     */
+    @Override
+    protected void setThumbRollover(boolean active) {
+        boolean old = isThumbRollover();
+        super.setThumbRollover(active);
+        // we need to repaint the entire scrollbar because state change for thumb
+        // causes state change for incr and decr buttons on Vista
+        if(XPStyle.isVista() && active != old) {
+            scrollbar.repaint();
+        }
+    }
+
+    /**
+     * WindowsArrowButton is used for the buttons to position the
+     * document up/down. It differs from BasicArrowButton in that the
+     * preferred size is always a square.
+     */
+    @SuppressWarnings("serial") // Superclass is not serializable across versions
+    private class WindowsArrowButton extends BasicArrowButton {
+
+        public WindowsArrowButton(int direction, Color background, Color shadow,
+                         Color darkShadow, Color highlight) {
+            super(direction, background, shadow, darkShadow, highlight);
+        }
+
+        public WindowsArrowButton(int direction) {
+            super(direction);
+        }
+
+        public void paint(Graphics g) {
+            XPStyle xp = XPStyle.getXP();
+            if (xp != null) {
+                ButtonModel model = getModel();
+                Skin skin = xp.getSkin(this, Part.SBP_ARROWBTN);
+                State state = null;
+
+                boolean jointRollover = XPStyle.isVista() && (isThumbRollover() ||
+                    (this == incrButton && decrButton.getModel().isRollover()) ||
+                    (this == decrButton && incrButton.getModel().isRollover()));
+
+                // normal, rollover, pressed, disabled
+                if (model.isArmed() && model.isPressed()) {
+                    switch (direction) {
+                        case NORTH: state = State.UPPRESSED;    break;
+                        case SOUTH: state = State.DOWNPRESSED;  break;
+                        case WEST:  state = State.LEFTPRESSED;  break;
+                        case EAST:  state = State.RIGHTPRESSED; break;
+                    }
+                } else if (!model.isEnabled()) {
+                    switch (direction) {
+                        case NORTH: state = State.UPDISABLED;    break;
+                        case SOUTH: state = State.DOWNDISABLED;  break;
+                        case WEST:  state = State.LEFTDISABLED;  break;
+                        case EAST:  state = State.RIGHTDISABLED; break;
+                    }
+                } else if (model.isRollover() || model.isPressed()) {
+                    switch (direction) {
+                        case NORTH: state = State.UPHOT;    break;
+                        case SOUTH: state = State.DOWNHOT;  break;
+                        case WEST:  state = State.LEFTHOT;  break;
+                        case EAST:  state = State.RIGHTHOT; break;
+                    }
+                } else if (jointRollover) {
+                    switch (direction) {
+                        case NORTH: state = State.UPHOVER;    break;
+                        case SOUTH: state = State.DOWNHOVER;  break;
+                        case WEST:  state = State.LEFTHOVER;  break;
+                        case EAST:  state = State.RIGHTHOVER; break;
+                    }
+                } else {
+                    switch (direction) {
+                        case NORTH: state = State.UPNORMAL;    break;
+                        case SOUTH: state = State.DOWNNORMAL;  break;
+                        case WEST:  state = State.LEFTNORMAL;  break;
+                        case EAST:  state = State.RIGHTNORMAL; break;
+                    }
+                }
+
+                skin.paintSkin(g, 0, 0, getWidth(), getHeight(), state);
+            } else {
+                super.paint(g);
+            }
+        }
+
+        public Dimension getPreferredSize() {
+            int size = 16;
+            if (scrollbar != null) {
+                switch (scrollbar.getOrientation()) {
+                case JScrollBar.VERTICAL:
+                    size = scrollbar.getWidth();
+                    break;
+                case JScrollBar.HORIZONTAL:
+                    size = scrollbar.getHeight();
+                    break;
+                }
+                size = Math.max(size, 5);
+            }
+            return new Dimension(size, size);
+        }
+    }
+
+
+    /**
+     * This should be pulled out into its own class if more classes need to
+     * use it.
+     * <p>
+     * Grid is used to draw the track for windows scrollbars. Grids
+     * are cached in a HashMap, with the key being the rgb components
+     * of the foreground/background colors. Further the Grid is held through
+     * a WeakRef so that it can be freed when no longer needed. As the
+     * Grid is rather expensive to draw, it is drawn in a BufferedImage.
+     */
+    private static class Grid {
+        private static final int BUFFER_SIZE = 64;
+        private static HashMap<String, WeakReference<Grid>> map;
+
+        private BufferedImage image;
+
+        static {
+            map = new HashMap<String, WeakReference<Grid>>();
+        }
+
+        public static Grid getGrid(Color fg, Color bg) {
+            String key = fg.getRGB() + " " + bg.getRGB();
+            WeakReference<Grid> ref = map.get(key);
+            Grid grid = (ref == null) ? null : ref.get();
+            if (grid == null) {
+                grid = new Grid(fg, bg);
+                map.put(key, new WeakReference<Grid>(grid));
+            }
+            return grid;
+        }
+
+        public Grid(Color fg, Color bg) {
+            int cmap[] = { fg.getRGB(), bg.getRGB() };
+            IndexColorModel icm = new IndexColorModel(8, 2, cmap, 0, false, -1,
+                                                      DataBuffer.TYPE_BYTE);
+            image = new BufferedImage(BUFFER_SIZE, BUFFER_SIZE,
+                                      BufferedImage.TYPE_BYTE_INDEXED, icm);
+            Graphics g = image.getGraphics();
+            try {
+                g.setClip(0, 0, BUFFER_SIZE, BUFFER_SIZE);
+                paintGrid(g, fg, bg);
+            }
+            finally {
+                g.dispose();
+            }
+        }
+
+        /**
+         * Paints the grid into the specified Graphics at the specified
+         * location.
+         */
+        public void paint(Graphics g, int x, int y, int w, int h) {
+            Rectangle clipRect = g.getClipBounds();
+            int minX = Math.max(x, clipRect.x);
+            int minY = Math.max(y, clipRect.y);
+            int maxX = Math.min(clipRect.x + clipRect.width, x + w);
+            int maxY = Math.min(clipRect.y + clipRect.height, y + h);
+
+            if (maxX <= minX || maxY <= minY) {
+                return;
+            }
+            int xOffset = (minX - x) % 2;
+            for (int xCounter = minX; xCounter < maxX;
+                 xCounter += BUFFER_SIZE) {
+                int yOffset = (minY - y) % 2;
+                int width = Math.min(BUFFER_SIZE - xOffset,
+                                     maxX - xCounter);
+
+                for (int yCounter = minY; yCounter < maxY;
+                     yCounter += BUFFER_SIZE) {
+                    int height = Math.min(BUFFER_SIZE - yOffset,
+                                          maxY - yCounter);
+
+                    g.drawImage(image, xCounter, yCounter,
+                                xCounter + width, yCounter + height,
+                                xOffset, yOffset,
+                                xOffset + width, yOffset + height, null);
+                    if (yOffset != 0) {
+                        yCounter -= yOffset;
+                        yOffset = 0;
+                    }
+                }
+                if (xOffset != 0) {
+                    xCounter -= xOffset;
+                    xOffset = 0;
+                }
+            }
+        }
+
+        /**
+         * Actually renders the grid into the Graphics <code>g</code>.
+         */
+        private void paintGrid(Graphics g, Color fg, Color bg) {
+            Rectangle clipRect = g.getClipBounds();
+            g.setColor(bg);
+            g.fillRect(clipRect.x, clipRect.y, clipRect.width,
+                       clipRect.height);
+            g.setColor(fg);
+            g.translate(clipRect.x, clipRect.y);
+            int width = clipRect.width;
+            int height = clipRect.height;
+            int xCounter = clipRect.x % 2;
+            for (int end = width - height; xCounter < end; xCounter += 2) {
+                g.drawLine(xCounter, 0, xCounter + height, height);
+            }
+            for (int end = width; xCounter < end; xCounter += 2) {
+                g.drawLine(xCounter, 0, width, width - xCounter);
+            }
+
+            int yCounter = ((clipRect.x % 2) == 0) ? 2 : 1;
+            for (int end = height - width; yCounter < end; yCounter += 2) {
+                g.drawLine(0, yCounter, width, yCounter + width);
+            }
+            for (int end = height; yCounter < end; yCounter += 2) {
+                g.drawLine(0, yCounter, height - yCounter, height);
+            }
+            g.translate(-clipRect.x, -clipRect.y);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsScrollPaneUI.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import javax.swing.plaf.basic.*;
+import javax.swing.*;
+
+
+
+/**
+ * Windows rendition of the component.
+ * <p>
+ * <strong>Warning:</strong>
+ * Serialized objects of this class will not be compatible with
+ * future Swing releases.  The current serialization support is appropriate
+ * for short term storage or RMI between applications running the same
+ * version of Swing.  A future release of Swing will provide support for
+ * long term persistence.
+ */
+public class WindowsScrollPaneUI extends BasicScrollPaneUI
+{}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsSeparatorUI.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import javax.swing.plaf.basic.*;
+
+/**
+ * Windows Separator.
+ */
+public class WindowsSeparatorUI extends BasicSeparatorUI { }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsSliderUI.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,233 @@
+/*
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import java.awt.*;
+import java.awt.event.MouseEvent;
+
+import javax.swing.plaf.*;
+import javax.swing.plaf.basic.*;
+import javax.swing.*;
+
+import static com.sun.java.swing.plaf.windows.TMSchema.*;
+import static com.sun.java.swing.plaf.windows.XPStyle.Skin;
+
+
+/**
+ * Windows rendition of the component.
+ * <p>
+ * <strong>Warning:</strong>
+ * Serialized objects of this class will not be compatible with
+ * future Swing releases.  The current serialization support is appropriate
+ * for short term storage or RMI between applications running the same
+ * version of Swing.  A future release of Swing will provide support for
+ * long term persistence.
+ */
+public class WindowsSliderUI extends BasicSliderUI
+{
+    private boolean rollover = false;
+    private boolean pressed = false;
+
+    public WindowsSliderUI(JSlider b){
+        super(b);
+    }
+
+    public static ComponentUI createUI(JComponent b) {
+        return new WindowsSliderUI((JSlider)b);
+    }
+
+
+    /**
+     * Overrides to return a private track listener subclass which handles
+     * the HOT, PRESSED, and FOCUSED states.
+     * @since 1.6
+     */
+    protected TrackListener createTrackListener(JSlider slider) {
+        return new WindowsTrackListener();
+    }
+
+    private class WindowsTrackListener extends TrackListener {
+
+        public void mouseMoved(MouseEvent e) {
+            updateRollover(thumbRect.contains(e.getX(), e.getY()));
+            super.mouseMoved(e);
+        }
+
+        public void mouseEntered(MouseEvent e) {
+            updateRollover(thumbRect.contains(e.getX(), e.getY()));
+            super.mouseEntered(e);
+        }
+
+        public void mouseExited(MouseEvent e) {
+            updateRollover(false);
+            super.mouseExited(e);
+        }
+
+        public void mousePressed(MouseEvent e) {
+            updatePressed(thumbRect.contains(e.getX(), e.getY()));
+            super.mousePressed(e);
+        }
+
+        public void mouseReleased(MouseEvent e) {
+            updatePressed(false);
+            super.mouseReleased(e);
+        }
+
+        public void updatePressed(boolean newPressed) {
+            // You can't press a disabled slider
+            if (!slider.isEnabled()) {
+                return;
+            }
+            if (pressed != newPressed) {
+                pressed = newPressed;
+                slider.repaint(thumbRect);
+            }
+        }
+
+        public void updateRollover(boolean newRollover) {
+            // You can't have a rollover on a disabled slider
+            if (!slider.isEnabled()) {
+                return;
+            }
+            if (rollover != newRollover) {
+                rollover = newRollover;
+                slider.repaint(thumbRect);
+            }
+        }
+
+    }
+
+
+    public void paintTrack(Graphics g)  {
+        XPStyle xp = XPStyle.getXP();
+        if (xp != null) {
+            boolean vertical = (slider.getOrientation() == JSlider.VERTICAL);
+            Part part = vertical ? Part.TKP_TRACKVERT : Part.TKP_TRACK;
+            Skin skin = xp.getSkin(slider, part);
+
+            if (vertical) {
+                int x = (trackRect.width - skin.getWidth()) / 2;
+                skin.paintSkin(g, trackRect.x + x, trackRect.y,
+                               skin.getWidth(), trackRect.height, null);
+            } else {
+                int y = (trackRect.height - skin.getHeight()) / 2;
+                skin.paintSkin(g, trackRect.x, trackRect.y + y,
+                               trackRect.width, skin.getHeight(), null);
+            }
+        } else {
+            super.paintTrack(g);
+        }
+    }
+
+
+    protected void paintMinorTickForHorizSlider( Graphics g, Rectangle tickBounds, int x ) {
+        XPStyle xp = XPStyle.getXP();
+        if (xp != null) {
+            g.setColor(xp.getColor(slider, Part.TKP_TICS, null, Prop.COLOR, Color.black));
+        }
+        super.paintMinorTickForHorizSlider(g, tickBounds, x);
+    }
+
+    protected void paintMajorTickForHorizSlider( Graphics g, Rectangle tickBounds, int x ) {
+        XPStyle xp = XPStyle.getXP();
+        if (xp != null) {
+            g.setColor(xp.getColor(slider, Part.TKP_TICS, null, Prop.COLOR, Color.black));
+        }
+        super.paintMajorTickForHorizSlider(g, tickBounds, x);
+    }
+
+    protected void paintMinorTickForVertSlider( Graphics g, Rectangle tickBounds, int y ) {
+        XPStyle xp = XPStyle.getXP();
+        if (xp != null) {
+            g.setColor(xp.getColor(slider, Part.TKP_TICSVERT, null, Prop.COLOR, Color.black));
+        }
+        super.paintMinorTickForVertSlider(g, tickBounds, y);
+    }
+
+    protected void paintMajorTickForVertSlider( Graphics g, Rectangle tickBounds, int y ) {
+        XPStyle xp = XPStyle.getXP();
+        if (xp != null) {
+            g.setColor(xp.getColor(slider, Part.TKP_TICSVERT, null, Prop.COLOR, Color.black));
+        }
+        super.paintMajorTickForVertSlider(g, tickBounds, y);
+    }
+
+
+    public void paintThumb(Graphics g)  {
+        XPStyle xp = XPStyle.getXP();
+        if (xp != null) {
+            Part part = getXPThumbPart();
+            State state = State.NORMAL;
+
+            if (slider.hasFocus()) {
+                state = State.FOCUSED;
+            }
+            if (rollover) {
+                state = State.HOT;
+            }
+            if (pressed) {
+                state = State.PRESSED;
+            }
+            if(!slider.isEnabled()) {
+                state = State.DISABLED;
+            }
+
+            xp.getSkin(slider, part).paintSkin(g, thumbRect.x, thumbRect.y, state);
+        } else {
+            super.paintThumb(g);
+        }
+    }
+
+    protected Dimension getThumbSize() {
+        XPStyle xp = XPStyle.getXP();
+        if (xp != null) {
+            Dimension size = new Dimension();
+            Skin s = xp.getSkin(slider, getXPThumbPart());
+            size.width = s.getWidth();
+            size.height = s.getHeight();
+            return size;
+        } else {
+            return super.getThumbSize();
+        }
+    }
+
+    private Part getXPThumbPart() {
+        Part part;
+        boolean vertical = (slider.getOrientation() == JSlider.VERTICAL);
+        boolean leftToRight = slider.getComponentOrientation().isLeftToRight();
+        Boolean paintThumbArrowShape =
+                (Boolean)slider.getClientProperty("Slider.paintThumbArrowShape");
+        if ((!slider.getPaintTicks() && paintThumbArrowShape == null) ||
+            paintThumbArrowShape == Boolean.FALSE) {
+                part = vertical ? Part.TKP_THUMBVERT
+                                : Part.TKP_THUMB;
+        } else {
+                part = vertical ? (leftToRight ? Part.TKP_THUMBRIGHT : Part.TKP_THUMBLEFT)
+                                : Part.TKP_THUMBBOTTOM;
+        }
+        return part;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsSpinnerUI.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import java.awt.*;
+import java.awt.event.*;
+
+import javax.swing.plaf.basic.*;
+import javax.swing.plaf.*;
+import javax.swing.*;
+
+import static com.sun.java.swing.plaf.windows.TMSchema.Part;
+import static com.sun.java.swing.plaf.windows.TMSchema.State;
+import static com.sun.java.swing.plaf.windows.XPStyle.Skin;
+
+
+public class WindowsSpinnerUI extends BasicSpinnerUI {
+    public static ComponentUI createUI(JComponent c) {
+        return new WindowsSpinnerUI();
+    }
+
+    /**
+     * {@inheritDoc}
+     * @since 1.6
+     */
+    public void paint(Graphics g, JComponent c) {
+        if (XPStyle.getXP() != null) {
+            paintXPBackground(g, c);
+        }
+        super.paint(g,c);
+    }
+
+    private State getXPState(JComponent c) {
+        State state = State.NORMAL;
+        if (!c.isEnabled()) {
+            state = State.DISABLED;
+        }
+        return state;
+    }
+
+    private void paintXPBackground(Graphics g, JComponent c) {
+        XPStyle xp = XPStyle.getXP();
+        if (xp == null) {
+            return;
+        }
+        Skin skin = xp.getSkin(c, Part.EP_EDIT);
+        State state = getXPState(c);
+        skin.paintSkin(g, 0, 0, c.getWidth(), c.getHeight(), state);
+    }
+
+    protected Component createPreviousButton() {
+        if (XPStyle.getXP() != null) {
+            JButton xpButton = new XPStyle.GlyphButton(spinner, Part.SPNP_DOWN);
+            Dimension size = UIManager.getDimension("Spinner.arrowButtonSize");
+            xpButton.setPreferredSize(size);
+            xpButton.setRequestFocusEnabled(false);
+            installPreviousButtonListeners(xpButton);
+            return xpButton;
+        }
+        return super.createPreviousButton();
+    }
+
+    protected Component createNextButton() {
+        if (XPStyle.getXP() != null) {
+            JButton xpButton = new XPStyle.GlyphButton(spinner, Part.SPNP_UP);
+            Dimension size = UIManager.getDimension("Spinner.arrowButtonSize");
+            xpButton.setPreferredSize(size);
+            xpButton.setRequestFocusEnabled(false);
+            installNextButtonListeners(xpButton);
+            return xpButton;
+        }
+        return super.createNextButton();
+    }
+
+    private UIResource getUIResource(Object[] listeners) {
+        for (int counter = 0; counter < listeners.length; counter++) {
+            if (listeners[counter] instanceof UIResource) {
+                return (UIResource)listeners[counter];
+            }
+        }
+        return null;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsSplitPaneDivider.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import java.awt.*;
+import javax.swing.JSplitPane;
+import javax.swing.UIManager;
+import javax.swing.plaf.basic.BasicSplitPaneUI;
+import javax.swing.plaf.basic.BasicSplitPaneDivider;
+
+
+/**
+ * Divider used for Windows split pane.
+ * <p>
+ * <strong>Warning:</strong>
+ * Serialized objects of this class will not be compatible with
+ * future Swing releases.  The current serialization support is appropriate
+ * for short term storage or RMI between applications running the same
+ * version of Swing.  A future release of Swing will provide support for
+ * long term persistence.
+ *
+ * @author Jeff Dinkins
+ */
+@SuppressWarnings("serial") // Superclass is not serializable across versions
+public class WindowsSplitPaneDivider extends BasicSplitPaneDivider
+{
+
+    /**
+     * Creates a new Windows SplitPaneDivider
+     */
+    public WindowsSplitPaneDivider(BasicSplitPaneUI ui) {
+        super(ui);
+    }
+
+    /**
+      * Paints the divider.
+      */
+    public void paint(Graphics g) {
+        Color bgColor = (splitPane.hasFocus()) ?
+                            UIManager.getColor("SplitPane.shadow") :
+                            getBackground();
+        Dimension size = getSize();
+
+        if(bgColor != null) {
+            g.setColor(bgColor);
+            g.fillRect(0, 0, size.width, size.height);
+        }
+        super.paint(g);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsSplitPaneUI.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import javax.swing.plaf.basic.*;
+import javax.swing.*;
+
+import javax.swing.plaf.basic.BasicSplitPaneUI;
+import javax.swing.plaf.basic.BasicSplitPaneDivider;
+import javax.swing.plaf.*;
+
+
+/**
+ * Windows rendition of the component.
+ * <p>
+ * <strong>Warning:</strong>
+ * Serialized objects of this class will not be compatible with
+ * future Swing releases.  The current serialization support is appropriate
+ * for short term storage or RMI between applications running the same
+ * version of Swing.  A future release of Swing will provide support for
+ * long term persistence.
+ */
+public class WindowsSplitPaneUI extends BasicSplitPaneUI
+{
+
+    public WindowsSplitPaneUI() {
+        super();
+    }
+
+    /**
+      * Creates a new WindowsSplitPaneUI instance
+      */
+    public static ComponentUI createUI(JComponent x) {
+        return new WindowsSplitPaneUI();
+    }
+
+    /**
+      * Creates the default divider.
+      */
+    public BasicSplitPaneDivider createDefaultDivider() {
+        return new WindowsSplitPaneDivider(this);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsTabbedPaneUI.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,228 @@
+/*
+ * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import java.awt.*;
+
+import javax.swing.plaf.basic.*;
+import javax.swing.plaf.*;
+import javax.swing.*;
+import java.util.Set;
+import java.util.HashSet;
+import java.awt.event.*;
+
+import static com.sun.java.swing.plaf.windows.TMSchema.*;
+import static com.sun.java.swing.plaf.windows.XPStyle.Skin;
+
+
+/**
+ * Windows rendition of the component.
+ * <p>
+ * <strong>Warning:</strong>
+ * Serialized objects of this class will not be compatible with
+ * future Swing releases.  The current serialization support is appropriate
+ * for short term storage or RMI between applications running the same
+ * version of Swing.  A future release of Swing will provide support for
+ * long term persistence.
+ */
+public class WindowsTabbedPaneUI extends BasicTabbedPaneUI {
+    /**
+     * Keys to use for forward focus traversal when the JComponent is
+     * managing focus.
+     */
+    private static Set<KeyStroke> managingFocusForwardTraversalKeys;
+
+    /**
+     * Keys to use for backward focus traversal when the JComponent is
+     * managing focus.
+     */
+    private static Set<KeyStroke> managingFocusBackwardTraversalKeys;
+
+    private boolean contentOpaque = true;
+
+    @SuppressWarnings("deprecation")
+    protected void installDefaults() {
+        super.installDefaults();
+        contentOpaque = UIManager.getBoolean("TabbedPane.contentOpaque");
+
+        // focus forward traversal key
+        if (managingFocusForwardTraversalKeys==null) {
+            managingFocusForwardTraversalKeys = new HashSet<KeyStroke>();
+            managingFocusForwardTraversalKeys.add(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0));
+        }
+        tabPane.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, managingFocusForwardTraversalKeys);
+        // focus backward traversal key
+        if (managingFocusBackwardTraversalKeys==null) {
+            managingFocusBackwardTraversalKeys = new HashSet<KeyStroke>();
+            managingFocusBackwardTraversalKeys.add( KeyStroke.getKeyStroke(KeyEvent.VK_TAB, InputEvent.SHIFT_MASK));
+        }
+        tabPane.setFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, managingFocusBackwardTraversalKeys);
+    }
+
+    protected void uninstallDefaults() {
+        // sets the focus forward and backward traversal keys to null
+        // to restore the defaults
+        tabPane.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, null);
+        tabPane.setFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, null);
+        super.uninstallDefaults();
+    }
+
+    public static ComponentUI createUI(JComponent c) {
+        return new WindowsTabbedPaneUI();
+    }
+
+    protected void setRolloverTab(int index) {
+        // Rollover is only supported on XP
+        if (XPStyle.getXP() != null) {
+            int oldRolloverTab = getRolloverTab();
+            super.setRolloverTab(index);
+            Rectangle r1 = null;
+            Rectangle r2 = null;
+            if ( (oldRolloverTab >= 0) && (oldRolloverTab < tabPane.getTabCount()) ) {
+                r1 = getTabBounds(tabPane, oldRolloverTab);
+            }
+            if (index >= 0) {
+                r2 = getTabBounds(tabPane, index);
+            }
+            if (r1 != null) {
+                if (r2 != null) {
+                    tabPane.repaint(r1.union(r2));
+                } else {
+                    tabPane.repaint(r1);
+                }
+            } else if (r2 != null) {
+                tabPane.repaint(r2);
+            }
+        }
+    }
+
+    protected void paintContentBorder(Graphics g, int tabPlacement, int selectedIndex) {
+        XPStyle xp = XPStyle.getXP();
+        if (xp != null && (contentOpaque || tabPane.isOpaque())) {
+            Skin skin = xp.getSkin(tabPane, Part.TABP_PANE);
+            if (skin != null) {
+                Insets insets = tabPane.getInsets();
+                // Note: don't call getTabAreaInsets(), because it causes rotation.
+                // Make sure "TabbedPane.tabsOverlapBorder" is set to true in WindowsLookAndFeel
+                Insets tabAreaInsets = UIManager.getInsets("TabbedPane.tabAreaInsets");
+                int x = insets.left;
+                int y = insets.top;
+                int w = tabPane.getWidth() - insets.right - insets.left;
+                int h = tabPane.getHeight() - insets.top - insets.bottom;
+
+                // Expand area by tabAreaInsets.bottom to allow tabs to overlap onto the border.
+                if (tabPlacement == LEFT || tabPlacement == RIGHT) {
+                    int tabWidth = calculateTabAreaWidth(tabPlacement, runCount, maxTabWidth);
+                    if (tabPlacement == LEFT) {
+                        x += (tabWidth - tabAreaInsets.bottom);
+                    }
+                    w -= (tabWidth - tabAreaInsets.bottom);
+                } else {
+                    int tabHeight = calculateTabAreaHeight(tabPlacement, runCount, maxTabHeight);
+                    if (tabPlacement == TOP) {
+                        y += (tabHeight - tabAreaInsets.bottom);
+                    }
+                    h -= (tabHeight - tabAreaInsets.bottom);
+                }
+
+                paintRotatedSkin(g, skin, tabPlacement, x, y, w, h, null);
+                return;
+            }
+        }
+        super.paintContentBorder(g, tabPlacement, selectedIndex);
+    }
+
+    protected void paintTabBackground(Graphics g, int tabPlacement, int tabIndex,
+                                      int x, int y, int w, int h, boolean isSelected ) {
+        if (XPStyle.getXP() == null) {
+            super.paintTabBackground(g, tabPlacement, tabIndex, x, y, w, h, isSelected);
+        }
+    }
+
+    protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex,
+                                  int x, int y, int w, int h, boolean isSelected ) {
+        XPStyle xp = XPStyle.getXP();
+        if (xp != null) {
+            Part part;
+
+            int tabCount = tabPane.getTabCount();
+            int tabRun = getRunForTab(tabCount, tabIndex);
+            if (tabRuns[tabRun] == tabIndex) {
+                part = Part.TABP_TABITEMLEFTEDGE;
+            } else if (tabCount > 1 && lastTabInRun(tabCount, tabRun) == tabIndex) {
+                part = Part.TABP_TABITEMRIGHTEDGE;
+                if (isSelected) {
+                    // Align with right edge
+                    if (tabPlacement == TOP || tabPlacement == BOTTOM) {
+                        w++;
+                    } else {
+                        h++;
+                    }
+                }
+            } else {
+                part = Part.TABP_TABITEM;
+            }
+
+            State state = State.NORMAL;
+            if (isSelected) {
+                state = State.SELECTED;
+            } else if (tabIndex == getRolloverTab()) {
+                state = State.HOT;
+            }
+
+            paintRotatedSkin(g, xp.getSkin(tabPane, part), tabPlacement, x, y, w, h, state);
+        } else {
+            super.paintTabBorder(g, tabPlacement, tabIndex, x, y, w, h, isSelected);
+        }
+    }
+
+    private void paintRotatedSkin(Graphics g, Skin skin, int tabPlacement,
+                                  int x, int y, int w, int h, State state) {
+        Graphics2D g2d = (Graphics2D)g.create();
+        g2d.translate(x, y);
+        switch (tabPlacement) {
+           case RIGHT:  g2d.translate(w, 0);
+                        g2d.rotate(Math.toRadians(90.0));
+                        skin.paintSkin(g2d, 0, 0, h, w, state);
+                        break;
+
+           case LEFT:   g2d.scale(-1.0, 1.0);
+                        g2d.rotate(Math.toRadians(90.0));
+                        skin.paintSkin(g2d, 0, 0, h, w, state);
+                        break;
+
+           case BOTTOM: g2d.translate(0, h);
+                        g2d.scale(-1.0, 1.0);
+                        g2d.rotate(Math.toRadians(180.0));
+                        skin.paintSkin(g2d, 0, 0, w, h, state);
+                        break;
+
+           case TOP:
+           default:     skin.paintSkin(g2d, 0, 0, w, h, state);
+        }
+        g2d.dispose();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsTableHeaderUI.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,247 @@
+/*
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import java.awt.*;
+import javax.swing.*;
+import javax.swing.border.*;
+import javax.swing.plaf.*;
+import javax.swing.plaf.basic.*;
+import javax.swing.table.*;
+
+import static com.sun.java.swing.plaf.windows.TMSchema.*;
+import static com.sun.java.swing.plaf.windows.XPStyle.*;
+import sun.swing.table.*;
+import sun.swing.SwingUtilities2;
+
+
+public class WindowsTableHeaderUI extends BasicTableHeaderUI {
+    private TableCellRenderer originalHeaderRenderer;
+
+    public static ComponentUI createUI(JComponent h) {
+        return new WindowsTableHeaderUI();
+    }
+
+    public void installUI(JComponent c) {
+        super.installUI(c);
+
+        if (XPStyle.getXP() != null) {
+            originalHeaderRenderer = header.getDefaultRenderer();
+            if (originalHeaderRenderer instanceof UIResource) {
+                header.setDefaultRenderer(new XPDefaultRenderer());
+            }
+        }
+    }
+
+    public void uninstallUI(JComponent c) {
+        if (header.getDefaultRenderer() instanceof XPDefaultRenderer) {
+            header.setDefaultRenderer(originalHeaderRenderer);
+        }
+        super.uninstallUI(c);
+    }
+
+    @Override
+    protected void rolloverColumnUpdated(int oldColumn, int newColumn) {
+        if (XPStyle.getXP() != null) {
+            header.repaint(header.getHeaderRect(oldColumn));
+            header.repaint(header.getHeaderRect(newColumn));
+        }
+    }
+
+    @SuppressWarnings("serial") // JDK-implementation class
+    private class XPDefaultRenderer extends DefaultTableCellHeaderRenderer {
+        Skin skin;
+        boolean isSelected, hasFocus, hasRollover;
+        int column;
+
+        XPDefaultRenderer() {
+            setHorizontalAlignment(LEADING);
+        }
+
+        public Component getTableCellRendererComponent(JTable table, Object value,
+                                                       boolean isSelected, boolean hasFocus,
+                                                       int row, int column) {
+            super.getTableCellRendererComponent(table, value, isSelected,
+                                                hasFocus, row, column);
+            this.isSelected = isSelected;
+            this.hasFocus = hasFocus;
+            this.column = column;
+            this.hasRollover = (column == getRolloverColumn());
+            if (skin == null) {
+                XPStyle xp = XPStyle.getXP();
+                skin = (xp != null) ? xp.getSkin(header, Part.HP_HEADERITEM) : null;
+            }
+            Insets margins = (skin != null) ? skin.getContentMargin() : null;
+            Border border = null;
+            int contentTop = 0;
+            int contentLeft = 0;
+            int contentBottom = 0;
+            int contentRight = 0;
+            if (margins != null) {
+                contentTop = margins.top;
+                contentLeft = margins.left;
+                contentBottom = margins.bottom;
+                contentRight = margins.right;
+            }
+            /* idk:
+             * Both on Vista and XP there is some offset to the
+             * HP_HEADERITEM content. It does not seem to come from
+             * Prop.CONTENTMARGINS. Do not know where it is defined.
+             * using some hardcoded values.
+             */
+            contentLeft += 5;
+            contentBottom += 4;
+            contentRight += 5;
+
+            /* On Vista sortIcon is painted above the header's text.
+             * We use border to paint it.
+             */
+            Icon sortIcon;
+            if (WindowsLookAndFeel.isOnVista()
+                && ((sortIcon = getIcon()) instanceof javax.swing.plaf.UIResource
+                    || sortIcon == null)) {
+                contentTop += 1;
+                setIcon(null);
+                sortIcon = null;
+                SortOrder sortOrder =
+                    getColumnSortOrder(table, column);
+                if (sortOrder != null) {
+                    switch (sortOrder) {
+                    case ASCENDING:
+                        sortIcon =
+                            UIManager.getIcon("Table.ascendingSortIcon");
+                        break;
+                    case DESCENDING:
+                        sortIcon =
+                            UIManager.getIcon("Table.descendingSortIcon");
+                        break;
+                    }
+                }
+                if (sortIcon != null) {
+                    contentBottom = sortIcon.getIconHeight();
+                    border = new IconBorder(sortIcon, contentTop, contentLeft,
+                                            contentBottom, contentRight);
+                } else {
+                    sortIcon =
+                        UIManager.getIcon("Table.ascendingSortIcon");
+                    int sortIconHeight =
+                        (sortIcon != null) ? sortIcon.getIconHeight() : 0;
+                    if (sortIconHeight != 0) {
+                        contentBottom = sortIconHeight;
+                    }
+                    border =
+                        new EmptyBorder(
+                            sortIconHeight + contentTop, contentLeft,
+                            contentBottom, contentRight);
+                }
+            } else {
+                contentTop += 3;
+                border = new EmptyBorder(contentTop, contentLeft,
+                                         contentBottom, contentRight);
+            }
+            setBorder(border);
+            return this;
+        }
+
+        public void paint(Graphics g) {
+            Dimension size = getSize();
+            State state = State.NORMAL;
+            TableColumn draggedColumn = header.getDraggedColumn();
+            if (draggedColumn != null &&
+                    column == SwingUtilities2.convertColumnIndexToView(
+                            header.getColumnModel(), draggedColumn.getModelIndex())) {
+                state = State.PRESSED;
+            } else if (isSelected || hasFocus || hasRollover) {
+                state = State.HOT;
+            }
+            /* on Vista there are more states for sorted columns */
+            if (WindowsLookAndFeel.isOnVista()) {
+                SortOrder sortOrder = getColumnSortOrder(header.getTable(), column);
+                if (sortOrder != null) {
+                     switch(sortOrder) {
+                     case ASCENDING:
+                     case DESCENDING:
+                         switch (state) {
+                         case NORMAL:
+                             state = State.SORTEDNORMAL;
+                             break;
+                         case PRESSED:
+                             state = State.SORTEDPRESSED;
+                             break;
+                         case HOT:
+                             state = State.SORTEDHOT;
+                             break;
+                         default:
+                             /* do nothing */
+                         }
+                         break;
+                     default :
+                         /* do nothing */
+                     }
+                }
+            }
+            skin.paintSkin(g, 0, 0, size.width-1, size.height-1, state);
+            super.paint(g);
+        }
+    }
+
+    /**
+     * A border with an Icon at the middle of the top side.
+     * Outer insets can be provided for this border.
+     */
+    private static class IconBorder implements Border, UIResource{
+        private final Icon icon;
+        private final int top;
+        private final int left;
+        private final int bottom;
+        private final int right;
+        /**
+         * Creates this border;
+         * @param icon - icon to paint for this border
+         * @param top, left, bottom, right - outer insets for this border
+         */
+        public IconBorder(Icon icon, int top, int left,
+                          int bottom, int right) {
+            this.icon = icon;
+            this.top = top;
+            this.left = left;
+            this.bottom = bottom;
+            this.right = right;
+        }
+        public Insets getBorderInsets(Component c) {
+            return new Insets(icon.getIconHeight() + top, left, bottom, right);
+        }
+        public boolean isBorderOpaque() {
+            return false;
+        }
+        public void paintBorder(Component c, Graphics g, int x, int y,
+                                int width, int height) {
+            icon.paintIcon(c, g,
+                x + left + (width - left - right - icon.getIconWidth()) / 2,
+                y + top);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsTextAreaUI.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import javax.swing.plaf.*;
+import javax.swing.plaf.basic.*;
+import javax.swing.*;
+import javax.swing.text.Caret;
+
+
+
+/**
+ * Windows rendition of the component.
+ * <p>
+ * <strong>Warning:</strong>
+ * Serialized objects of this class will not be compatible with
+ * future Swing releases.  The current serialization support is appropriate
+ * for short term storage or RMI between applications running the same
+ * version of Swing.  A future release of Swing will provide support for
+ * long term persistence.
+ */
+public class WindowsTextAreaUI extends BasicTextAreaUI {
+    /**
+     * Creates the object to use for a caret.  By default an
+     * instance of WindowsCaret is created.  This method
+     * can be redefined to provide something else that implements
+     * the InputPosition interface or a subclass of DefaultCaret.
+     *
+     * @return the caret object
+     */
+    protected Caret createCaret() {
+        return new WindowsTextUI.WindowsCaret();
+    }
+
+    /**
+     * Creates a UI for a JTextField.
+     *
+     * @param c the text field
+     * @return the UI
+     */
+    public static ComponentUI createUI(JComponent c) {
+        return new WindowsTextAreaUI();
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsTextFieldUI.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,177 @@
+/*
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import java.awt.*;
+import java.awt.event.*;
+import java.beans.PropertyChangeEvent;
+import javax.swing.plaf.*;
+import javax.swing.plaf.basic.BasicTextFieldUI;
+import javax.swing.text.*;
+import javax.swing.*;
+import javax.swing.plaf.UIResource;
+import sun.swing.DefaultLookup;
+
+
+
+/**
+ * Provides the Windows look and feel for a text field.  This
+ * is basically the following customizations to the default
+ * look-and-feel.
+ * <ul>
+ * <li>The border is beveled (using the standard control color).
+ * <li>The background is white by default.
+ * <li>The highlight color is a dark color, blue by default.
+ * <li>The foreground color is high contrast in the selected
+ *  area, white by default.  The unselected foreground is black.
+ * <li>The cursor blinks at about 1/2 second intervals.
+ * <li>The entire value is selected when focus is gained.
+ * <li>Shift-left-arrow and shift-right-arrow extend selection
+ * <li>Ctrl-left-arrow and ctrl-right-arrow act like home and
+ *   end respectively.
+ * </ul>
+ * <p>
+ * <strong>Warning:</strong>
+ * Serialized objects of this class will not be compatible with
+ * future Swing releases.  The current serialization support is appropriate
+ * for short term storage or RMI between applications running the same
+ * version of Swing.  A future release of Swing will provide support for
+ * long term persistence.
+ *
+ * @author  Timothy Prinzing
+ */
+public class WindowsTextFieldUI extends BasicTextFieldUI
+{
+    /**
+     * Creates a UI for a JTextField.
+     *
+     * @param c the text field
+     * @return the UI
+     */
+    public static ComponentUI createUI(JComponent c) {
+        return new WindowsTextFieldUI();
+    }
+
+    /**
+     * Paints a background for the view.  This will only be
+     * called if isOpaque() on the associated component is
+     * true.  The default is to paint the background color
+     * of the component.
+     *
+     * @param g the graphics context
+     */
+    protected void paintBackground(Graphics g) {
+        super.paintBackground(g);
+    }
+
+    /**
+     * Creates the caret for a field.
+     *
+     * @return the caret
+     */
+    protected Caret createCaret() {
+        return new WindowsFieldCaret();
+    }
+
+    /**
+     * WindowsFieldCaret has different scrolling behavior than
+     * DefaultCaret.
+     */
+    @SuppressWarnings("serial") // Superclass is not serializable across versions
+    static class WindowsFieldCaret extends DefaultCaret implements UIResource {
+
+        public WindowsFieldCaret() {
+            super();
+        }
+
+        /**
+         * Adjusts the visibility of the caret according to
+         * the windows feel which seems to be to move the
+         * caret out into the field by about a quarter of
+         * a field length if not visible.
+         */
+        protected void adjustVisibility(Rectangle r) {
+            SwingUtilities.invokeLater(new SafeScroller(r));
+        }
+
+        /**
+         * Gets the painter for the Highlighter.
+         *
+         * @return the painter
+         */
+        protected Highlighter.HighlightPainter getSelectionPainter() {
+            return WindowsTextUI.WindowsPainter;
+        }
+
+
+        private class SafeScroller implements Runnable {
+            SafeScroller(Rectangle r) {
+                this.r = r;
+            }
+
+            @SuppressWarnings("deprecation")
+            public void run() {
+                JTextField field = (JTextField) getComponent();
+                if (field != null) {
+                    TextUI ui = field.getUI();
+                    int dot = getDot();
+                    // PENDING: We need to expose the bias in DefaultCaret.
+                    Position.Bias bias = Position.Bias.Forward;
+                    Rectangle startRect = null;
+                    try {
+                        startRect = ui.modelToView(field, dot, bias);
+                    } catch (BadLocationException ble) {}
+
+                    Insets i = field.getInsets();
+                    BoundedRangeModel vis = field.getHorizontalVisibility();
+                    int x = r.x + vis.getValue() - i.left;
+                    int quarterSpan = vis.getExtent() / 4;
+                    if (r.x < i.left) {
+                        vis.setValue(x - quarterSpan);
+                    } else if (r.x + r.width > i.left + vis.getExtent()) {
+                        vis.setValue(x - (3 * quarterSpan));
+                    }
+                    // If we scroll, our visual location will have changed,
+                    // but we won't have updated our internal location as
+                    // the model hasn't changed. This checks for the change,
+                    // and if necessary, resets the internal location.
+                    if (startRect != null) {
+                        try {
+                            Rectangle endRect;
+                            endRect = ui.modelToView(field, dot, bias);
+                            if (endRect != null && !endRect.equals(startRect)){
+                                damage(endRect);
+                            }
+                        } catch (BadLocationException ble) {}
+                    }
+                }
+            }
+
+            private Rectangle r;
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsTextPaneUI.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import javax.swing.plaf.*;
+import javax.swing.plaf.basic.*;
+import javax.swing.*;
+import javax.swing.text.Caret;
+
+
+/**
+ * Windows rendition of the component.
+ * <p>
+ * <strong>Warning:</strong>
+ * Serialized objects of this class will not be compatible with
+ * future Swing releases.  The current serialization support is appropriate
+ * for short term storage or RMI between applications running the same
+ * version of Swing.  A future release of Swing will provide support for
+ * long term persistence.
+ */
+public class WindowsTextPaneUI extends BasicTextPaneUI
+{
+    /**
+     * Creates a UI for a JTextPane.
+     *
+     * @param c the styled text component
+     * @return the UI
+     */
+    public static ComponentUI createUI(JComponent c) {
+        return new WindowsTextPaneUI();
+    }
+
+    /**
+     * Creates the object to use for a caret.  By default an
+     * instance of WindowsCaret is created.  This method
+     * can be redefined to provide something else that implements
+     * the InputPosition interface or a subclass of DefaultCaret.
+     *
+     * @return the caret object
+     */
+    protected Caret createCaret() {
+        return new WindowsTextUI.WindowsCaret();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsTextUI.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,238 @@
+/*
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.Rectangle;
+import java.awt.Shape;
+import javax.swing.plaf.basic.*;
+import javax.swing.*;
+import javax.swing.plaf.TextUI;
+import javax.swing.plaf.UIResource;
+import javax.swing.text.*;
+
+/**
+ * Windows text rendering.
+ * <p>
+ * <strong>Warning:</strong>
+ * Serialized objects of this class will not be compatible with
+ * future Swing releases.  The current serialization support is appropriate
+ * for short term storage or RMI between applications running the same
+ * version of Swing.  A future release of Swing will provide support for
+ * long term persistence.
+ */
+public abstract class WindowsTextUI extends BasicTextUI {
+    /**
+     * Creates the object to use for a caret.  By default an
+     * instance of WindowsCaret is created.  This method
+     * can be redefined to provide something else that implements
+     * the InputPosition interface or a subclass of DefaultCaret.
+     *
+     * @return the caret object
+     */
+    protected Caret createCaret() {
+        return new WindowsCaret();
+    }
+
+    /* public */
+    static LayeredHighlighter.LayerPainter WindowsPainter = new WindowsHighlightPainter(null);
+
+    /* public */
+    @SuppressWarnings("serial") // Superclass is not serializable across versions
+    static class WindowsCaret extends DefaultCaret
+                     implements UIResource {
+        /**
+         * Gets the painter for the Highlighter.
+         *
+         * @return the painter
+         */
+        protected Highlighter.HighlightPainter getSelectionPainter() {
+            return WindowsTextUI.WindowsPainter;
+        }
+    }
+
+    /* public */
+    static class WindowsHighlightPainter extends
+                     DefaultHighlighter.DefaultHighlightPainter {
+        WindowsHighlightPainter(Color c) {
+            super(c);
+        }
+
+        // --- HighlightPainter methods ---------------------------------------
+
+        /**
+         * Paints a highlight.
+         *
+         * @param g the graphics context
+         * @param offs0 the starting model offset >= 0
+         * @param offs1 the ending model offset >= offs1
+         * @param bounds the bounding box for the highlight
+         * @param c the editor
+         */
+        @SuppressWarnings("deprecation")
+        public void paint(Graphics g, int offs0, int offs1, Shape bounds, JTextComponent c) {
+            Rectangle alloc = bounds.getBounds();
+            try {
+                // --- determine locations ---
+                TextUI mapper = c.getUI();
+                Rectangle p0 = mapper.modelToView(c, offs0);
+                Rectangle p1 = mapper.modelToView(c, offs1);
+
+                // --- render ---
+                Color color = getColor();
+
+                if (color == null) {
+                    g.setColor(c.getSelectionColor());
+                }
+                else {
+                    g.setColor(color);
+                }
+                boolean firstIsDot = false;
+                boolean secondIsDot = false;
+                if (c.isEditable()) {
+                    int dot = c.getCaretPosition();
+                    firstIsDot = (offs0 == dot);
+                    secondIsDot = (offs1 == dot);
+                }
+                if (p0.y == p1.y) {
+                    // same line, render a rectangle
+                    Rectangle r = p0.union(p1);
+                    if (r.width > 0) {
+                        if (firstIsDot) {
+                            r.x++;
+                            r.width--;
+                        }
+                        else if (secondIsDot) {
+                            r.width--;
+                        }
+                    }
+                    g.fillRect(r.x, r.y, r.width, r.height);
+                } else {
+                    // different lines
+                    int p0ToMarginWidth = alloc.x + alloc.width - p0.x;
+                    if (firstIsDot && p0ToMarginWidth > 0) {
+                        p0.x++;
+                        p0ToMarginWidth--;
+                    }
+                    g.fillRect(p0.x, p0.y, p0ToMarginWidth, p0.height);
+                    if ((p0.y + p0.height) != p1.y) {
+                        g.fillRect(alloc.x, p0.y + p0.height, alloc.width,
+                                   p1.y - (p0.y + p0.height));
+                    }
+                    if (secondIsDot && p1.x > alloc.x) {
+                        p1.x--;
+                    }
+                    g.fillRect(alloc.x, p1.y, (p1.x - alloc.x), p1.height);
+                }
+            } catch (BadLocationException e) {
+                // can't render
+            }
+        }
+
+        // --- LayerPainter methods ----------------------------
+        /**
+         * Paints a portion of a highlight.
+         *
+         * @param g the graphics context
+         * @param offs0 the starting model offset >= 0
+         * @param offs1 the ending model offset >= offs1
+         * @param bounds the bounding box of the view, which is not
+         *        necessarily the region to paint.
+         * @param c the editor
+         * @param view View painting for
+         * @return region drawing occurred in
+         */
+        public Shape paintLayer(Graphics g, int offs0, int offs1,
+                                Shape bounds, JTextComponent c, View view) {
+            Color color = getColor();
+
+            if (color == null) {
+                g.setColor(c.getSelectionColor());
+            }
+            else {
+                g.setColor(color);
+            }
+            boolean firstIsDot = false;
+            boolean secondIsDot = false;
+            if (c.isEditable()) {
+                int dot = c.getCaretPosition();
+                firstIsDot = (offs0 == dot);
+                secondIsDot = (offs1 == dot);
+            }
+            if (offs0 == view.getStartOffset() &&
+                offs1 == view.getEndOffset()) {
+                // Contained in view, can just use bounds.
+                Rectangle alloc;
+                if (bounds instanceof Rectangle) {
+                    alloc = (Rectangle)bounds;
+                }
+                else {
+                    alloc = bounds.getBounds();
+                }
+                if (firstIsDot && alloc.width > 0) {
+                    g.fillRect(alloc.x + 1, alloc.y, alloc.width - 1,
+                               alloc.height);
+                }
+                else if (secondIsDot && alloc.width > 0) {
+                    g.fillRect(alloc.x, alloc.y, alloc.width - 1,
+                               alloc.height);
+                }
+                else {
+                    g.fillRect(alloc.x, alloc.y, alloc.width, alloc.height);
+                }
+                return alloc;
+            }
+            else {
+                // Should only render part of View.
+                try {
+                    // --- determine locations ---
+                    Shape shape = view.modelToView(offs0, Position.Bias.Forward,
+                                                   offs1,Position.Bias.Backward,
+                                                   bounds);
+                    Rectangle r = (shape instanceof Rectangle) ?
+                                  (Rectangle)shape : shape.getBounds();
+                    if (firstIsDot && r.width > 0) {
+                        g.fillRect(r.x + 1, r.y, r.width - 1, r.height);
+                    }
+                    else if (secondIsDot && r.width > 0) {
+                        g.fillRect(r.x, r.y, r.width - 1, r.height);
+                    }
+                    else {
+                        g.fillRect(r.x, r.y, r.width, r.height);
+                    }
+                    return r;
+                } catch (BadLocationException e) {
+                    // can't render
+                }
+            }
+            // Only if exception
+            return null;
+        }
+
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsToggleButtonUI.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,181 @@
+/*
+ * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import sun.awt.AppContext;
+
+import javax.swing.plaf.basic.*;
+import javax.swing.border.*;
+import javax.swing.plaf.*;
+import javax.swing.*;
+
+import java.awt.*;
+import java.beans.PropertyChangeEvent;
+
+
+
+/**
+ * A Windows toggle button.
+ * <p>
+ * <strong>Warning:</strong>
+ * Serialized objects of this class will not be compatible with
+ * future Swing releases.  The current serialization support is appropriate
+ * for short term storage or RMI between applications running the same
+ * version of Swing.  A future release of Swing will provide support for
+ * long term persistence.
+ *
+ * @author Jeff Dinkins
+ */
+public class WindowsToggleButtonUI extends BasicToggleButtonUI
+{
+    protected int dashedRectGapX;
+    protected int dashedRectGapY;
+    protected int dashedRectGapWidth;
+    protected int dashedRectGapHeight;
+
+    protected Color focusColor;
+
+    private static final Object WINDOWS_TOGGLE_BUTTON_UI_KEY = new Object();
+
+    private boolean defaults_initialized = false;
+
+    public static ComponentUI createUI(JComponent b) {
+        AppContext appContext = AppContext.getAppContext();
+        WindowsToggleButtonUI windowsToggleButtonUI =
+                (WindowsToggleButtonUI) appContext.get(WINDOWS_TOGGLE_BUTTON_UI_KEY);
+        if (windowsToggleButtonUI == null) {
+            windowsToggleButtonUI = new WindowsToggleButtonUI();
+            appContext.put(WINDOWS_TOGGLE_BUTTON_UI_KEY, windowsToggleButtonUI);
+        }
+        return windowsToggleButtonUI;
+    }
+
+
+    // ********************************
+    //            Defaults
+    // ********************************
+    protected void installDefaults(AbstractButton b) {
+        super.installDefaults(b);
+        if(!defaults_initialized) {
+            String pp = getPropertyPrefix();
+            dashedRectGapX = ((Integer)UIManager.get("Button.dashedRectGapX")).intValue();
+            dashedRectGapY = ((Integer)UIManager.get("Button.dashedRectGapY")).intValue();
+            dashedRectGapWidth = ((Integer)UIManager.get("Button.dashedRectGapWidth")).intValue();
+            dashedRectGapHeight = ((Integer)UIManager.get("Button.dashedRectGapHeight")).intValue();
+            focusColor = UIManager.getColor(pp + "focus");
+            defaults_initialized = true;
+        }
+
+        XPStyle xp = XPStyle.getXP();
+        if (xp != null) {
+            b.setBorder(xp.getBorder(b, WindowsButtonUI.getXPButtonType(b)));
+            LookAndFeel.installProperty(b, "opaque", Boolean.FALSE);
+            LookAndFeel.installProperty(b, "rolloverEnabled", Boolean.TRUE);
+        }
+    }
+
+    protected void uninstallDefaults(AbstractButton b) {
+        super.uninstallDefaults(b);
+        defaults_initialized = false;
+    }
+
+
+    protected Color getFocusColor() {
+        return focusColor;
+    }
+
+
+    // ********************************
+    //         Paint Methods
+    // ********************************
+
+    private transient Color cachedSelectedColor = null;
+    private transient Color cachedBackgroundColor = null;
+    private transient Color cachedHighlightColor = null;
+
+    protected void paintButtonPressed(Graphics g, AbstractButton b) {
+        if (XPStyle.getXP() == null && b.isContentAreaFilled()) {
+            Color oldColor = g.getColor();
+            Color c1 = b.getBackground();
+            Color c2 = UIManager.getColor("ToggleButton.highlight");
+            if (c1 != cachedBackgroundColor || c2 != cachedHighlightColor) {
+                int r1 = c1.getRed(), r2 = c2.getRed();
+                int g1 = c1.getGreen(), g2 = c2.getGreen();
+                int b1 = c1.getBlue(), b2 = c2.getBlue();
+                cachedSelectedColor = new Color(
+                        Math.min(r1, r2) + Math.abs(r1 - r2) / 2,
+                        Math.min(g1, g2) + Math.abs(g1 - g2) / 2,
+                        Math.min(b1, b2) + Math.abs(b1 - b2) / 2
+                );
+                cachedBackgroundColor = c1;
+                cachedHighlightColor = c2;
+            }
+            g.setColor(cachedSelectedColor);
+            g.fillRect(0, 0, b.getWidth(), b.getHeight());
+            g.setColor(oldColor);
+        }
+    }
+
+    public void paint(Graphics g, JComponent c) {
+        if (XPStyle.getXP() != null) {
+            WindowsButtonUI.paintXPButtonBackground(g, c);
+        }
+        super.paint(g, c);
+    }
+
+
+    /**
+     * Overridden method to render the text without the mnemonic
+     */
+    protected void paintText(Graphics g, AbstractButton b, Rectangle textRect, String text) {
+        WindowsGraphicsUtils.paintText(g, b, textRect, text, getTextShiftOffset());
+    }
+
+    protected void paintFocus(Graphics g, AbstractButton b,
+                              Rectangle viewRect, Rectangle textRect, Rectangle iconRect) {
+        g.setColor(getFocusColor());
+        BasicGraphicsUtils.drawDashedRect(g, dashedRectGapX, dashedRectGapY,
+                                          b.getWidth() - dashedRectGapWidth,
+                                          b.getHeight() - dashedRectGapHeight);
+    }
+
+    // ********************************
+    //          Layout Methods
+    // ********************************
+    public Dimension getPreferredSize(JComponent c) {
+        Dimension d = super.getPreferredSize(c);
+
+        /* Ensure that the width and height of the button is odd,
+         * to allow for the focus line if focus is painted
+         */
+        AbstractButton b = (AbstractButton)c;
+        if (d != null && b.isFocusPainted()) {
+            if(d.width % 2 == 0) { d.width += 1; }
+            if(d.height % 2 == 0) { d.height += 1; }
+        }
+        return d;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsToolBarSeparatorUI.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import java.awt.*;
+
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.basic.*;
+import javax.swing.*;
+
+import static com.sun.java.swing.plaf.windows.TMSchema.Part;
+import static com.sun.java.swing.plaf.windows.XPStyle.Skin;
+
+
+/**
+ * Draws Windows toolbar separators.
+ *
+ * @author Mark Davidson
+ */
+public class WindowsToolBarSeparatorUI extends BasicToolBarSeparatorUI {
+
+    public static ComponentUI createUI( JComponent c ) {
+        return new WindowsToolBarSeparatorUI();
+    }
+
+    public Dimension getPreferredSize(JComponent c) {
+        Dimension size = ((JToolBar.Separator)c).getSeparatorSize();
+
+        if (size != null) {
+            size = size.getSize();
+        } else {
+            size = new Dimension(6, 6);
+            XPStyle xp = XPStyle.getXP();
+            if (xp != null) {
+                boolean vertical = ((JSeparator)c).getOrientation() == SwingConstants.VERTICAL;
+                Part part = vertical ? Part.TP_SEPARATOR : Part.TP_SEPARATORVERT;
+                Skin skin = xp.getSkin(c, part);
+                size.width = skin.getWidth();
+                size.height = skin.getHeight();
+            }
+
+            if (((JSeparator)c).getOrientation() == SwingConstants.VERTICAL) {
+                size.height = 0;
+            } else {
+                size.width = 0;
+            }
+        }
+        return size;
+    }
+
+    public Dimension getMaximumSize(JComponent c) {
+        Dimension pref = getPreferredSize(c);
+        if (((JSeparator)c).getOrientation() == SwingConstants.VERTICAL) {
+            return new Dimension(pref.width, Short.MAX_VALUE);
+        } else {
+            return new Dimension(Short.MAX_VALUE, pref.height);
+        }
+    }
+
+    public void paint( Graphics g, JComponent c ) {
+        boolean vertical = ((JSeparator)c).getOrientation() == SwingConstants.VERTICAL;
+        Dimension size = c.getSize();
+
+        XPStyle xp = XPStyle.getXP();
+        if (xp != null) {
+            Part part = vertical ? Part.TP_SEPARATOR : Part.TP_SEPARATORVERT;
+            Skin skin = xp.getSkin(c, part);
+
+            int dx = vertical ? (size.width - skin.getWidth()) / 2 : 0;
+            int dy = vertical ? 0 : (size.height - skin.getHeight()) / 2;
+            int dw = vertical ? skin.getWidth() : size.width;
+            int dh = vertical ? size.height : skin.getHeight();
+            skin.paintSkin(g, dx, dy, dw, dh, null);
+        } else {
+
+        Color temp = g.getColor();
+
+        UIDefaults table = UIManager.getLookAndFeelDefaults();
+
+        Color shadow = table.getColor("ToolBar.shadow");
+        Color highlight = table.getColor("ToolBar.highlight");
+
+        if (vertical) {
+            int x = (size.width / 2) - 1;
+            g.setColor(shadow);
+            g.drawLine(x, 2, x, size.height - 2);
+
+            g.setColor(highlight);
+            g.drawLine(x + 1, 2, x + 1, size.height - 2);
+        } else {
+            int y = (size.height / 2) - 1;
+            g.setColor(shadow);
+            g.drawLine(2, y, size.width - 2, y);
+            g.setColor(highlight);
+            g.drawLine(2, y + 1, size.width - 2, y + 1);
+        }
+        g.setColor(temp);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsToolBarUI.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import java.awt.*;
+
+import javax.swing.AbstractButton;
+import javax.swing.JComponent;
+import javax.swing.JToggleButton;
+import javax.swing.UIDefaults;
+import javax.swing.UIManager;
+
+import javax.swing.border.Border;
+import javax.swing.border.CompoundBorder;
+import javax.swing.border.EmptyBorder;
+
+import javax.swing.plaf.*;
+
+import javax.swing.plaf.basic.BasicBorders;
+import javax.swing.plaf.basic.BasicToolBarUI;
+
+import static com.sun.java.swing.plaf.windows.TMSchema.Part;
+
+
+public class WindowsToolBarUI extends BasicToolBarUI {
+
+    public static ComponentUI createUI(JComponent c) {
+        return new WindowsToolBarUI();
+    }
+
+    protected void installDefaults() {
+        if (XPStyle.getXP() != null) {
+            setRolloverBorders(true);
+        }
+        super.installDefaults();
+    }
+
+    protected Border createRolloverBorder() {
+        if (XPStyle.getXP() != null) {
+            return new EmptyBorder(3, 3, 3, 3);
+        } else {
+            return super.createRolloverBorder();
+        }
+    }
+
+    protected Border createNonRolloverBorder() {
+        if (XPStyle.getXP() != null) {
+            return new EmptyBorder(3, 3, 3, 3);
+        } else {
+            return super.createNonRolloverBorder();
+        }
+    }
+
+    public void paint(Graphics g, JComponent c) {
+        XPStyle xp = XPStyle.getXP();
+        if (xp != null) {
+            xp.getSkin(c, Part.TP_TOOLBAR).paintSkin(g, 0, 0,
+                        c.getWidth(), c.getHeight(), null, true);
+        } else {
+            super.paint(g, c);
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     * @since 1.6
+     */
+    protected Border getRolloverBorder(AbstractButton b) {
+        XPStyle xp = XPStyle.getXP();
+        if (xp != null) {
+            return xp.getBorder(b, WindowsButtonUI.getXPButtonType(b));
+        } else {
+            return super.getRolloverBorder(b);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsTreeUI.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,245 @@
+/*
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import java.awt.*;
+import java.awt.event.*;
+
+import java.io.*;
+import java.util.*;
+
+import javax.swing.plaf.basic.*;
+import javax.swing.*;
+import javax.swing.plaf.*;
+
+import javax.swing.tree.*;
+
+import static com.sun.java.swing.plaf.windows.TMSchema.*;
+import static com.sun.java.swing.plaf.windows.XPStyle.Skin;
+
+
+/**
+ * A Windows tree.
+ * <p>
+ * <strong>Warning:</strong>
+ * Serialized objects of this class will not be compatible with
+ * future Swing releases.  The current serialization support is appropriate
+ * for short term storage or RMI between applications running the same
+ * version of Swing.  A future release of Swing will provide support for
+ * long term persistence.
+ *
+ * @author Scott Violet
+ */
+public class WindowsTreeUI extends BasicTreeUI {
+
+    public static ComponentUI createUI( JComponent c )
+      {
+        return new WindowsTreeUI();
+      }
+
+
+    /**
+      * Ensures that the rows identified by beginRow through endRow are
+      * visible.
+      */
+    protected void ensureRowsAreVisible(int beginRow, int endRow) {
+        if(tree != null && beginRow >= 0 && endRow < getRowCount(tree)) {
+            Rectangle visRect = tree.getVisibleRect();
+            if(beginRow == endRow) {
+                Rectangle     scrollBounds = getPathBounds(tree, getPathForRow
+                                                           (tree, beginRow));
+
+                if(scrollBounds != null) {
+                    scrollBounds.x = visRect.x;
+                    scrollBounds.width = visRect.width;
+                    tree.scrollRectToVisible(scrollBounds);
+                }
+            }
+            else {
+                Rectangle   beginRect = getPathBounds(tree, getPathForRow
+                                                      (tree, beginRow));
+                if (beginRect != null) {
+                    Rectangle   testRect = beginRect;
+                    int         beginY = beginRect.y;
+                    int         maxY = beginY + visRect.height;
+
+                    for(int counter = beginRow + 1; counter <= endRow; counter++) {
+                        testRect = getPathBounds(tree,
+                                                 getPathForRow(tree, counter));
+                        if(testRect != null && (testRect.y + testRect.height) > maxY) {
+                            counter = endRow;
+                        }
+                    }
+
+                    if (testRect == null) {
+                        return;
+                    }
+
+                    tree.scrollRectToVisible(new Rectangle(visRect.x, beginY, 1,
+                                                      testRect.y + testRect.height-
+                                                      beginY));
+                }
+            }
+        }
+    }
+
+    protected static final int HALF_SIZE = 4;
+    protected static final int SIZE = 9;
+
+    /**
+     * Returns the default cell renderer that is used to do the
+     * stamping of each node.
+     */
+    protected TreeCellRenderer createDefaultCellRenderer() {
+        return new WindowsTreeCellRenderer();
+    }
+
+    /**
+     * The minus sign button icon
+     * <p>
+     * <strong>Warning:</strong>
+     * Serialized objects of this class will not be compatible with
+     * future Swing releases.  The current serialization support is appropriate
+     * for short term storage or RMI between applications running the same
+     * version of Swing.  A future release of Swing will provide support for
+     * long term persistence.
+     */
+    @SuppressWarnings("serial") // Same-version serialization only
+    public static class ExpandedIcon implements Icon, Serializable {
+
+        public static Icon createExpandedIcon() {
+            return new ExpandedIcon();
+        }
+
+        Skin getSkin(Component c) {
+            XPStyle xp = XPStyle.getXP();
+            return (xp != null) ? xp.getSkin(c, Part.TVP_GLYPH) : null;
+        }
+
+        public void paintIcon(Component c, Graphics g, int x, int y) {
+            Skin skin = getSkin(c);
+            if (skin != null) {
+                skin.paintSkin(g, x, y, State.OPENED);
+                return;
+            }
+
+            Color     backgroundColor = c.getBackground();
+
+            if(backgroundColor != null)
+                g.setColor(backgroundColor);
+            else
+                g.setColor(Color.white);
+            g.fillRect(x, y, SIZE-1, SIZE-1);
+            g.setColor(Color.gray);
+            g.drawRect(x, y, SIZE-1, SIZE-1);
+            g.setColor(Color.black);
+            g.drawLine(x + 2, y + HALF_SIZE, x + (SIZE - 3), y + HALF_SIZE);
+        }
+
+        public int getIconWidth() {
+            Skin skin = getSkin(null);
+            return (skin != null) ? skin.getWidth() : SIZE;
+        }
+
+        public int getIconHeight() {
+            Skin skin = getSkin(null);
+            return (skin != null) ? skin.getHeight() : SIZE;
+        }
+    }
+
+    /**
+     * The plus sign button icon
+     * <p>
+     * <strong>Warning:</strong>
+     * Serialized objects of this class will not be compatible with
+     * future Swing releases.  The current serialization support is appropriate
+     * for short term storage or RMI between applications running the same
+     * version of Swing.  A future release of Swing will provide support for
+     * long term persistence.
+     */
+    @SuppressWarnings("serial") // Superclass is not serializable across versions
+    public static class CollapsedIcon extends ExpandedIcon {
+        public static Icon createCollapsedIcon() {
+            return new CollapsedIcon();
+        }
+
+        public void paintIcon(Component c, Graphics g, int x, int y) {
+            Skin skin = getSkin(c);
+            if (skin != null) {
+                skin.paintSkin(g, x, y, State.CLOSED);
+            } else {
+            super.paintIcon(c, g, x, y);
+            g.drawLine(x + HALF_SIZE, y + 2, x + HALF_SIZE, y + (SIZE - 3));
+            }
+        }
+    }
+
+    @SuppressWarnings("serial") // Superclass is not serializable across versions
+    public class WindowsTreeCellRenderer extends DefaultTreeCellRenderer {
+
+        /**
+         * Configures the renderer based on the passed in components.
+         * The value is set from messaging the tree with
+         * <code>convertValueToText</code>, which ultimately invokes
+         * <code>toString</code> on <code>value</code>.
+         * The foreground color is set based on the selection and the icon
+         * is set based on on leaf and expanded.
+         */
+        public Component getTreeCellRendererComponent(JTree tree, Object value,
+                                                      boolean sel,
+                                                      boolean expanded,
+                                                      boolean leaf, int row,
+                                                      boolean hasFocus) {
+            super.getTreeCellRendererComponent(tree, value, sel,
+                                               expanded, leaf, row,
+                                               hasFocus);
+            // Windows displays the open icon when the tree item selected.
+            if (!tree.isEnabled()) {
+                setEnabled(false);
+                if (leaf) {
+                    setDisabledIcon(getLeafIcon());
+                } else if (sel) {
+                    setDisabledIcon(getOpenIcon());
+                } else {
+                    setDisabledIcon(getClosedIcon());
+                }
+            }
+            else {
+                setEnabled(true);
+                if (leaf) {
+                    setIcon(getLeafIcon());
+                } else if (sel) {
+                    setIcon(getOpenIcon());
+                } else {
+                    setIcon(getClosedIcon());
+                }
+            }
+            return this;
+        }
+
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/XPStyle.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,774 @@
+/*
+ * 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.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * <p>These classes are designed to be used while the
+ * corresponding <code>LookAndFeel</code> class has been installed
+ * (<code>UIManager.setLookAndFeel(new <i>XXX</i>LookAndFeel())</code>).
+ * Using them while a different <code>LookAndFeel</code> is installed
+ * may produce unexpected results, including exceptions.
+ * Additionally, changing the <code>LookAndFeel</code>
+ * maintained by the <code>UIManager</code> without updating the
+ * corresponding <code>ComponentUI</code> of any
+ * <code>JComponent</code>s may also produce unexpected results,
+ * such as the wrong colors showing up, and is generally not
+ * encouraged.
+ *
+ */
+
+package com.sun.java.swing.plaf.windows;
+
+import java.awt.*;
+import java.awt.image.*;
+import java.security.AccessController;
+import java.util.*;
+
+import javax.swing.*;
+import javax.swing.border.*;
+import javax.swing.plaf.*;
+import javax.swing.text.JTextComponent;
+
+import sun.awt.image.SunWritableRaster;
+import sun.awt.windows.ThemeReader;
+import sun.security.action.GetPropertyAction;
+import sun.swing.CachedPainter;
+
+import static com.sun.java.swing.plaf.windows.TMSchema.*;
+
+
+/**
+ * Implements Windows XP Styles for the Windows Look and Feel.
+ *
+ * @author Leif Samuelsson
+ */
+class XPStyle {
+    // Singleton instance of this class
+    private static XPStyle xp;
+
+    // Singleton instance of SkinPainter
+    private static SkinPainter skinPainter = new SkinPainter();
+
+    private static Boolean themeActive = null;
+
+    private HashMap<String, Border> borderMap;
+    private HashMap<String, Color>  colorMap;
+
+    private boolean flatMenus;
+
+    static {
+        invalidateStyle();
+    }
+
+    /** Static method for clearing the hashmap and loading the
+     * current XP style and theme
+     */
+    static synchronized void invalidateStyle() {
+        xp = null;
+        themeActive = null;
+        skinPainter.flush();
+    }
+
+    /** Get the singleton instance of this class
+     *
+     * @return the singleton instance of this class or null if XP styles
+     * are not active or if this is not Windows XP
+     */
+    static synchronized XPStyle getXP() {
+        if (themeActive == null) {
+            Toolkit toolkit = Toolkit.getDefaultToolkit();
+            themeActive =
+                (Boolean)toolkit.getDesktopProperty("win.xpstyle.themeActive");
+            if (themeActive == null) {
+                themeActive = Boolean.FALSE;
+            }
+            if (themeActive.booleanValue()) {
+                GetPropertyAction propertyAction =
+                    new GetPropertyAction("swing.noxp");
+                if (AccessController.doPrivileged(propertyAction) == null &&
+                    ThemeReader.isThemed() &&
+                    !(UIManager.getLookAndFeel()
+                      instanceof WindowsClassicLookAndFeel)) {
+
+                    xp = new XPStyle();
+                }
+            }
+        }
+        return ThemeReader.isXPStyleEnabled() ? xp : null;
+    }
+
+    static boolean isVista() {
+        XPStyle xp = XPStyle.getXP();
+        return (xp != null && xp.isSkinDefined(null, Part.CP_DROPDOWNBUTTONRIGHT));
+    }
+
+    /** Get a named <code>String</code> value from the current style
+     *
+     * @param part a <code>Part</code>
+     * @param state a <code>String</code>
+     * @param prop a <code>String</code>
+     * @return a <code>String</code> or null if key is not found
+     *    in the current style
+     *
+     * This is currently only used by WindowsInternalFrameTitlePane for painting
+     * title foregound and can be removed when no longer needed
+     */
+    String getString(Component c, Part part, State state, Prop prop) {
+        return getTypeEnumName(c, part, state, prop);
+    }
+
+    TypeEnum getTypeEnum(Component c, Part part, State state, Prop prop) {
+        int enumValue = ThemeReader.getEnum(part.getControlName(c), part.getValue(),
+                                            State.getValue(part, state),
+                                            prop.getValue());
+        return TypeEnum.getTypeEnum(prop, enumValue);
+    }
+
+    private static String getTypeEnumName(Component c, Part part, State state, Prop prop) {
+        int enumValue = ThemeReader.getEnum(part.getControlName(c), part.getValue(),
+                                            State.getValue(part, state),
+                                            prop.getValue());
+        if (enumValue == -1) {
+            return null;
+        }
+        return TypeEnum.getTypeEnum(prop, enumValue).getName();
+    }
+
+
+
+
+    /** Get a named <code>int</code> value from the current style
+     *
+     * @param part a <code>Part</code>
+     * @return an <code>int</code> or null if key is not found
+     *    in the current style
+     */
+    int getInt(Component c, Part part, State state, Prop prop, int fallback) {
+        return ThemeReader.getInt(part.getControlName(c), part.getValue(),
+                                  State.getValue(part, state),
+                                  prop.getValue());
+    }
+
+    /** Get a named <code>Dimension</code> value from the current style
+     *
+     * @return a <code>Dimension</code> or null if key is not found
+     *    in the current style
+     *
+     * This is currently only used by WindowsProgressBarUI and the value
+     * should probably be cached there instead of here.
+     */
+    Dimension getDimension(Component c, Part part, State state, Prop prop) {
+        Dimension d = ThemeReader.getPosition(part.getControlName(c), part.getValue(),
+                                              State.getValue(part, state),
+                                              prop.getValue());
+        return (d != null) ? d : new Dimension();
+    }
+
+    /** Get a named <code>Point</code> (e.g. a location or an offset) value
+     *  from the current style
+     *
+     * @return a <code>Point</code> or null if key is not found
+     *    in the current style
+     *
+     * This is currently only used by WindowsInternalFrameTitlePane for painting
+     * title foregound and can be removed when no longer needed
+     */
+    Point getPoint(Component c, Part part, State state, Prop prop) {
+        Dimension d = ThemeReader.getPosition(part.getControlName(c), part.getValue(),
+                                              State.getValue(part, state),
+                                              prop.getValue());
+        return (d != null) ? new Point(d.width, d.height) : new Point();
+    }
+
+    /** Get a named <code>Insets</code> value from the current style
+     *
+     * @return an <code>Insets</code> object or null if key is not found
+     *    in the current style
+     *
+     * This is currently only used to create borders and by
+     * WindowsInternalFrameTitlePane for painting title foregound.
+     * The return value is already cached in those places.
+     */
+    Insets getMargin(Component c, Part part, State state, Prop prop) {
+        Insets insets = ThemeReader.getThemeMargins(part.getControlName(c), part.getValue(),
+                                                    State.getValue(part, state),
+                                                    prop.getValue());
+        return (insets != null) ? insets : new Insets(0, 0, 0, 0);
+    }
+
+
+    /** Get a named <code>Color</code> value from the current style
+     *
+     * @return a <code>Color</code> or null if key is not found
+     *    in the current style
+     */
+    synchronized Color getColor(Skin skin, Prop prop, Color fallback) {
+        String key = skin.toString() + "." + prop.name();
+        Part part = skin.part;
+        Color color = colorMap.get(key);
+        if (color == null) {
+            color = ThemeReader.getColor(part.getControlName(null), part.getValue(),
+                                         State.getValue(part, skin.state),
+                                         prop.getValue());
+            if (color != null) {
+                color = new ColorUIResource(color);
+                colorMap.put(key, color);
+            }
+        }
+        return (color != null) ? color : fallback;
+    }
+
+    Color getColor(Component c, Part part, State state, Prop prop, Color fallback) {
+        return getColor(new Skin(c, part, state), prop, fallback);
+    }
+
+
+
+    /** Get a named <code>Border</code> value from the current style
+     *
+     * @param part a <code>Part</code>
+     * @return a <code>Border</code> or null if key is not found
+     *    in the current style or if the style for the particular
+     *    part is not defined as "borderfill".
+     */
+    synchronized Border getBorder(Component c, Part part) {
+        if (part == Part.MENU) {
+            // Special case because XP has no skin for menus
+            if (flatMenus) {
+                // TODO: The classic border uses this color, but we should
+                // create a new UI property called "PopupMenu.borderColor"
+                // instead.
+                return new XPFillBorder(UIManager.getColor("InternalFrame.borderShadow"),
+                                        1);
+            } else {
+                return null;    // Will cause L&F to use classic border
+            }
+        }
+        Skin skin = new Skin(c, part, null);
+        Border border = borderMap.get(skin.string);
+        if (border == null) {
+            String bgType = getTypeEnumName(c, part, null, Prop.BGTYPE);
+            if ("borderfill".equalsIgnoreCase(bgType)) {
+                int thickness = getInt(c, part, null, Prop.BORDERSIZE, 1);
+                Color color = getColor(skin, Prop.BORDERCOLOR, Color.black);
+                border = new XPFillBorder(color, thickness);
+                if (part == Part.CP_COMBOBOX) {
+                    border = new XPStatefulFillBorder(color, thickness, part, Prop.BORDERCOLOR);
+                }
+            } else if ("imagefile".equalsIgnoreCase(bgType)) {
+                Insets m = getMargin(c, part, null, Prop.SIZINGMARGINS);
+                if (m != null) {
+                    if (getBoolean(c, part, null, Prop.BORDERONLY)) {
+                        border = new XPImageBorder(c, part);
+                    } else if (part == Part.CP_COMBOBOX) {
+                        border = new EmptyBorder(1, 1, 1, 1);
+                    } else {
+                        if(part == Part.TP_BUTTON) {
+                            border = new XPEmptyBorder(new Insets(3,3,3,3));
+                        } else {
+                            border = new XPEmptyBorder(m);
+                        }
+                    }
+                }
+            }
+            if (border != null) {
+                borderMap.put(skin.string, border);
+            }
+        }
+        return border;
+    }
+
+    @SuppressWarnings("serial") // Superclass is not serializable across versions
+    private class XPFillBorder extends LineBorder implements UIResource {
+        XPFillBorder(Color color, int thickness) {
+            super(color, thickness);
+        }
+
+        public Insets getBorderInsets(Component c, Insets insets)       {
+            Insets margin = null;
+            //
+            // Ideally we'd have an interface defined for classes which
+            // support margins (to avoid this hackery), but we've
+            // decided against it for simplicity
+            //
+           if (c instanceof AbstractButton) {
+               margin = ((AbstractButton)c).getMargin();
+           } else if (c instanceof JToolBar) {
+               margin = ((JToolBar)c).getMargin();
+           } else if (c instanceof JTextComponent) {
+               margin = ((JTextComponent)c).getMargin();
+           }
+           insets.top    = (margin != null? margin.top : 0)    + thickness;
+           insets.left   = (margin != null? margin.left : 0)   + thickness;
+           insets.bottom = (margin != null? margin.bottom : 0) + thickness;
+           insets.right =  (margin != null? margin.right : 0)  + thickness;
+
+           return insets;
+        }
+    }
+
+    @SuppressWarnings("serial") // Superclass is not serializable across versions
+    private class XPStatefulFillBorder extends XPFillBorder {
+        private final Part part;
+        private final Prop prop;
+        XPStatefulFillBorder(Color color, int thickness, Part part, Prop prop) {
+            super(color, thickness);
+            this.part = part;
+            this.prop = prop;
+        }
+
+        public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
+            State state = State.NORMAL;
+            // special casing for comboboxes.
+            // there may be more special cases in the future
+            if(c instanceof JComboBox) {
+                JComboBox<?> cb = (JComboBox)c;
+                // note. in the future this should be replaced with a call
+                // to BasicLookAndFeel.getUIOfType()
+                if(cb.getUI() instanceof WindowsComboBoxUI) {
+                    WindowsComboBoxUI wcb = (WindowsComboBoxUI)cb.getUI();
+                    state = wcb.getXPComboBoxState(cb);
+                }
+            }
+            lineColor = getColor(c, part, state, prop, Color.black);
+            super.paintBorder(c, g, x, y, width, height);
+        }
+    }
+
+    @SuppressWarnings("serial") // Superclass is not serializable across versions
+    private class XPImageBorder extends AbstractBorder implements UIResource {
+        Skin skin;
+
+        XPImageBorder(Component c, Part part) {
+            this.skin = getSkin(c, part);
+        }
+
+        public void paintBorder(Component c, Graphics g,
+                                int x, int y, int width, int height) {
+            skin.paintSkin(g, x, y, width, height, null);
+        }
+
+        public Insets getBorderInsets(Component c, Insets insets)       {
+            Insets margin = null;
+            Insets borderInsets = skin.getContentMargin();
+            if(borderInsets == null) {
+                borderInsets = new Insets(0, 0, 0, 0);
+            }
+            //
+            // Ideally we'd have an interface defined for classes which
+            // support margins (to avoid this hackery), but we've
+            // decided against it for simplicity
+            //
+           if (c instanceof AbstractButton) {
+               margin = ((AbstractButton)c).getMargin();
+           } else if (c instanceof JToolBar) {
+               margin = ((JToolBar)c).getMargin();
+           } else if (c instanceof JTextComponent) {
+               margin = ((JTextComponent)c).getMargin();
+           }
+           insets.top    = (margin != null? margin.top : 0)    + borderInsets.top;
+           insets.left   = (margin != null? margin.left : 0)   + borderInsets.left;
+           insets.bottom = (margin != null? margin.bottom : 0) + borderInsets.bottom;
+           insets.right  = (margin != null? margin.right : 0)  + borderInsets.right;
+
+           return insets;
+        }
+    }
+
+    @SuppressWarnings("serial") // Superclass is not serializable across versions
+    private class XPEmptyBorder extends EmptyBorder implements UIResource {
+        XPEmptyBorder(Insets m) {
+            super(m.top+2, m.left+2, m.bottom+2, m.right+2);
+        }
+
+        public Insets getBorderInsets(Component c, Insets insets)       {
+            insets = super.getBorderInsets(c, insets);
+
+            Insets margin = null;
+            if (c instanceof AbstractButton) {
+                Insets m = ((AbstractButton)c).getMargin();
+                // if this is a toolbar button then ignore getMargin()
+                // and subtract the padding added by the constructor
+                if(c.getParent() instanceof JToolBar
+                   && ! (c instanceof JRadioButton)
+                   && ! (c instanceof JCheckBox)
+                   && m instanceof InsetsUIResource) {
+                    insets.top -= 2;
+                    insets.left -= 2;
+                    insets.bottom -= 2;
+                    insets.right -= 2;
+                } else {
+                    margin = m;
+                }
+            } else if (c instanceof JToolBar) {
+                margin = ((JToolBar)c).getMargin();
+            } else if (c instanceof JTextComponent) {
+                margin = ((JTextComponent)c).getMargin();
+            }
+            if (margin != null) {
+                insets.top    = margin.top + 2;
+                insets.left   = margin.left + 2;
+                insets.bottom = margin.bottom + 2;
+                insets.right  = margin.right + 2;
+            }
+            return insets;
+        }
+    }
+    boolean isSkinDefined(Component c, Part part) {
+        return (part.getValue() == 0)
+            || ThemeReader.isThemePartDefined(
+                   part.getControlName(c), part.getValue(), 0);
+    }
+
+
+    /** Get a <code>Skin</code> object from the current style
+     * for a named part (component type)
+     *
+     * @param part a <code>Part</code>
+     * @return a <code>Skin</code> object
+     */
+    synchronized Skin getSkin(Component c, Part part) {
+        assert isSkinDefined(c, part) : "part " + part + " is not defined";
+        return new Skin(c, part, null);
+    }
+
+
+    long getThemeTransitionDuration(Component c, Part part, State stateFrom,
+                                    State stateTo, Prop prop) {
+         return ThemeReader.getThemeTransitionDuration(part.getControlName(c),
+                                          part.getValue(),
+                                          State.getValue(part, stateFrom),
+                                          State.getValue(part, stateTo),
+                                          (prop != null) ? prop.getValue() : 0);
+    }
+
+
+    /** A class which encapsulates attributes for a given part
+     * (component type) and which provides methods for painting backgrounds
+     * and glyphs
+     */
+    static class Skin {
+        final Component component;
+        final Part part;
+        final State state;
+
+        private final String string;
+        private Dimension size = null;
+        private boolean switchStates = false;
+
+        Skin(Component component, Part part) {
+            this(component, part, null);
+        }
+
+        Skin(Part part, State state) {
+            this(null, part, state);
+        }
+
+        Skin(Component component, Part part, State state) {
+            this.component = component;
+            this.part  = part;
+            this.state = state;
+
+            String str = part.getControlName(component) +"." + part.name();
+            if (state != null) {
+                str += "("+state.name()+")";
+            }
+            string = str;
+        }
+
+        Insets getContentMargin() {
+            /* idk: it seems margins are the same for all 'big enough'
+             * bounding rectangles.
+             */
+            int boundingWidth = 100;
+            int boundingHeight = 100;
+
+            Insets insets = ThemeReader.getThemeBackgroundContentMargins(
+                part.getControlName(null), part.getValue(),
+                0, boundingWidth, boundingHeight);
+            return (insets != null) ? insets : new Insets(0, 0, 0, 0);
+        }
+
+        boolean haveToSwitchStates() {
+            return switchStates;
+        }
+
+        void switchStates(boolean b) {
+            switchStates = b;
+        }
+
+        private int getWidth(State state) {
+            if (size == null) {
+                size = getPartSize(part, state);
+            }
+            return (size != null) ? size.width : 0;
+        }
+
+        int getWidth() {
+            return getWidth((state != null) ? state : State.NORMAL);
+        }
+
+        private int getHeight(State state) {
+            if (size == null) {
+                size = getPartSize(part, state);
+            }
+            return (size != null) ? size.height : 0;
+        }
+
+        int getHeight() {
+            return getHeight((state != null) ? state : State.NORMAL);
+        }
+
+        public String toString() {
+            return string;
+        }
+
+        public boolean equals(Object obj) {
+            return (obj instanceof Skin && ((Skin)obj).string.equals(string));
+        }
+
+        public int hashCode() {
+            return string.hashCode();
+        }
+
+        /** Paint a skin at x, y.
+         *
+         * @param g   the graphics context to use for painting
+         * @param dx  the destination <i>x</i> coordinate
+         * @param dy  the destination <i>y</i> coordinate
+         * @param state which state to paint
+         */
+        void paintSkin(Graphics g, int dx, int dy, State state) {
+            if (state == null) {
+                state = this.state;
+            }
+            paintSkin(g, dx, dy, getWidth(state), getHeight(state), state);
+        }
+
+        /** Paint a skin in an area defined by a rectangle.
+         *
+         * @param g the graphics context to use for painting
+         * @param r     a <code>Rectangle</code> defining the area to fill,
+         *                     may cause the image to be stretched or tiled
+         * @param state which state to paint
+         */
+        void paintSkin(Graphics g, Rectangle r, State state) {
+            paintSkin(g, r.x, r.y, r.width, r.height, state);
+        }
+
+        /** Paint a skin at a defined position and size
+         *  This method supports animation.
+         *
+         * @param g   the graphics context to use for painting
+         * @param dx  the destination <i>x</i> coordinate
+         * @param dy  the destination <i>y</i> coordinate
+         * @param dw  the width of the area to fill, may cause
+         *                  the image to be stretched or tiled
+         * @param dh  the height of the area to fill, may cause
+         *                  the image to be stretched or tiled
+         * @param state which state to paint
+         */
+        void paintSkin(Graphics g, int dx, int dy, int dw, int dh, State state) {
+            if (XPStyle.getXP() == null) {
+                return;
+            }
+            if (ThemeReader.isGetThemeTransitionDurationDefined()
+                  && component instanceof JComponent
+                  && SwingUtilities.getAncestorOfClass(CellRendererPane.class,
+                                                       component) == null) {
+                AnimationController.paintSkin((JComponent) component, this,
+                                              g, dx, dy, dw, dh, state);
+            } else {
+                paintSkinRaw(g, dx, dy, dw, dh, state);
+            }
+        }
+
+        /** Paint a skin at a defined position and size. This method
+         *  does not trigger animation. It is needed for the animation
+         *  support.
+         *
+         * @param g   the graphics context to use for painting
+         * @param dx  the destination <i>x</i> coordinate.
+         * @param dy  the destination <i>y</i> coordinate.
+         * @param dw  the width of the area to fill, may cause
+         *                  the image to be stretched or tiled
+         * @param dh  the height of the area to fill, may cause
+         *                  the image to be stretched or tiled
+         * @param state which state to paint
+         */
+        void paintSkinRaw(Graphics g, int dx, int dy, int dw, int dh, State state) {
+            if (XPStyle.getXP() == null) {
+                return;
+            }
+            skinPainter.paint(null, g, dx, dy, dw, dh, this, state);
+        }
+
+        /** Paint a skin at a defined position and size
+         *
+         * @param g   the graphics context to use for painting
+         * @param dx  the destination <i>x</i> coordinate
+         * @param dy  the destination <i>y</i> coordinate
+         * @param dw  the width of the area to fill, may cause
+         *                  the image to be stretched or tiled
+         * @param dh  the height of the area to fill, may cause
+         *                  the image to be stretched or tiled
+         * @param state which state to paint
+         * @param borderFill should test if the component uses a border fill
+                            and skip painting if it is
+         */
+        void paintSkin(Graphics g, int dx, int dy, int dw, int dh, State state,
+                boolean borderFill) {
+            if (XPStyle.getXP() == null) {
+                return;
+            }
+            if(borderFill && "borderfill".equals(getTypeEnumName(component, part,
+                    state, Prop.BGTYPE))) {
+                return;
+            }
+            skinPainter.paint(null, g, dx, dy, dw, dh, this, state);
+        }
+    }
+
+    private static class SkinPainter extends CachedPainter {
+        SkinPainter() {
+            super(30);
+            flush();
+        }
+
+        public void flush() {
+            super.flush();
+        }
+
+        protected void paintToImage(Component c, Image image, Graphics g,
+                                    int w, int h, Object[] args) {
+            Skin skin = (Skin)args[0];
+            Part part = skin.part;
+            State state = (State)args[1];
+            if (state == null) {
+                state = skin.state;
+            }
+            if (c == null) {
+                c = skin.component;
+            }
+            BufferedImage bi = (BufferedImage)image;
+            w = bi.getWidth();
+            h = bi.getHeight();
+
+            WritableRaster raster = bi.getRaster();
+            DataBufferInt dbi = (DataBufferInt)raster.getDataBuffer();
+            // Note that stealData() requires a markDirty() afterwards
+            // since we modify the data in it.
+            ThemeReader.paintBackground(SunWritableRaster.stealData(dbi, 0),
+                                        part.getControlName(c), part.getValue(),
+                                        State.getValue(part, state),
+                                        0, 0, w, h, w);
+            SunWritableRaster.markDirty(dbi);
+        }
+
+        protected Image createImage(Component c, int w, int h,
+                                    GraphicsConfiguration config, Object[] args) {
+            return new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
+        }
+    }
+
+    @SuppressWarnings("serial") // Superclass is not serializable across versions
+    static class GlyphButton extends JButton {
+        protected Skin skin;
+
+        public GlyphButton(Component parent, Part part) {
+            XPStyle xp = getXP();
+            skin = xp != null ? xp.getSkin(parent, part) : null;
+            setBorder(null);
+            setContentAreaFilled(false);
+            setMinimumSize(new Dimension(5, 5));
+            setPreferredSize(new Dimension(16, 16));
+            setMaximumSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE));
+        }
+
+        @SuppressWarnings("deprecation")
+        public boolean isFocusTraversable() {
+            return false;
+        }
+
+        protected State getState() {
+            State state = State.NORMAL;
+            if (!isEnabled()) {
+                state = State.DISABLED;
+            } else if (getModel().isPressed()) {
+                state = State.PRESSED;
+            } else if (getModel().isRollover()) {
+                state = State.HOT;
+            }
+            return state;
+        }
+
+        public void paintComponent(Graphics g) {
+            if (XPStyle.getXP() == null || skin == null) {
+                return;
+            }
+            Dimension d = getSize();
+            skin.paintSkin(g, 0, 0, d.width, d.height, getState());
+        }
+
+        public void setPart(Component parent, Part part) {
+            XPStyle xp = getXP();
+            skin = xp != null ? xp.getSkin(parent, part) : null;
+            revalidate();
+            repaint();
+        }
+
+        protected void paintBorder(Graphics g) {
+        }
+
+
+    }
+
+    // Private constructor
+    private XPStyle() {
+        flatMenus = getSysBoolean(Prop.FLATMENUS);
+
+        colorMap  = new HashMap<String, Color>();
+        borderMap = new HashMap<String, Border>();
+        // Note: All further access to the maps must be synchronized
+    }
+
+
+    private boolean getBoolean(Component c, Part part, State state, Prop prop) {
+        return ThemeReader.getBoolean(part.getControlName(c), part.getValue(),
+                                      State.getValue(part, state),
+                                      prop.getValue());
+    }
+
+
+
+    static Dimension getPartSize(Part part, State state) {
+        return ThemeReader.getPartSize(part.getControlName(null), part.getValue(),
+                                       State.getValue(part, state));
+    }
+
+    private static boolean getSysBoolean(Prop prop) {
+        // We can use any widget name here, I guess.
+        return ThemeReader.getSysBoolean("window", prop.getValue());
+    }
+}
Binary file src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/icons/Computer.gif has changed
Binary file src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/icons/DetailsView.gif has changed
Binary file src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/icons/Directory.gif has changed
Binary file src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/icons/Error.gif has changed
Binary file src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/icons/File.gif has changed
Binary file src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/icons/FloppyDrive.gif has changed
Binary file src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/icons/HardDrive.gif has changed
Binary file src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/icons/HomeFolder.gif has changed
Binary file src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/icons/Inform.gif has changed
Binary file src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/icons/JavaCup32.png has changed
Binary file src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/icons/ListView.gif has changed
Binary file src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/icons/NewFolder.gif has changed
Binary file src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/icons/Question.gif has changed
Binary file src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/icons/TreeClosed.gif has changed
Binary file src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/icons/TreeLeaf.gif has changed
Binary file src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/icons/TreeOpen.gif has changed
Binary file src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/icons/UpFolder.gif has changed
Binary file src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/icons/Warn.gif has changed
Binary file src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/icons/image-delayed.png has changed
Binary file src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/icons/image-failed.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/resources/windows.properties	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,47 @@
+# This properties file is used to create a PropertyResourceBundle
+# It contains Locale specific strings used be the Windows Look and Feel.
+# Currently, the following components need this for support:
+#
+#    FileChooser
+#
+# When this file is read in, the strings are put into the 
+# defaults table.  This is an implementation detail of the current
+# workings of Swing.  DO NOT DEPEND ON THIS.  
+# This may change in future versions of Swing as we improve localization 
+# support.
+#
+# Refer to the note in basic.properties for a description as to what
+# the mnemonics correspond to and how to calculate them.
+#
+# @author Steve Wilson
+
+
+############ FILE CHOOSER STRINGS #############
+
+FileChooser.lookInLabel.textAndMnemonic=Look &in:
+FileChooser.saveInLabel.textAndMnemonic=Save in:
+FileChooser.fileNameLabel.textAndMnemonic=File &name:
+FileChooser.folderNameLabel.textAndMnemonic=Folder &name:
+FileChooser.filesOfTypeLabel.textAndMnemonic=Files of &type:
+FileChooser.upFolderToolTip.textAndMnemonic=Up One Level
+FileChooser.upFolderAccessibleName=Up
+FileChooser.homeFolderToolTip.textAndMnemonic=Home
+FileChooser.homeFolderAccessibleName=Home
+FileChooser.newFolderToolTip.textAndMnemonic=Create New Folder
+FileChooser.newFolderAccessibleName=New Folder
+FileChooser.newFolderActionLabel.textAndMnemonic=New Folder
+FileChooser.listViewButtonToolTip.textAndMnemonic=List
+FileChooser.listViewButtonAccessibleName=List
+FileChooser.listViewActionLabel.textAndMnemonic=List
+FileChooser.detailsViewButtonToolTip.textAndMnemonic=Details
+FileChooser.detailsViewButtonAccessibleName=Details
+FileChooser.viewMenuButtonToolTipText = View Menu
+FileChooser.viewMenuButtonAccessibleName = View Menu
+FileChooser.detailsViewActionLabel.textAndMnemonic=Details
+FileChooser.refreshActionLabel.textAndMnemonic=Refresh
+FileChooser.viewMenuLabel.textAndMnemonic=View
+FileChooser.fileNameHeader.textAndMnemonic=Name
+FileChooser.fileSizeHeader.textAndMnemonic=Size
+FileChooser.fileTypeHeader.textAndMnemonic=Type
+FileChooser.fileDateHeader.textAndMnemonic=Modified
+FileChooser.fileAttrHeader.textAndMnemonic=Attributes
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/resources/windows_de.properties	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,47 @@
+# This properties file is used to create a PropertyResourceBundle
+# It contains Locale specific strings used be the Windows Look and Feel.
+# Currently, the following components need this for support:
+#
+#    FileChooser
+#
+# When this file is read in, the strings are put into the 
+# defaults table.  This is an implementation detail of the current
+# workings of Swing.  DO NOT DEPEND ON THIS.  
+# This may change in future versions of Swing as we improve localization 
+# support.
+#
+# Refer to the note in basic.properties for a description as to what
+# the mnemonics correspond to and how to calculate them.
+#
+# @author Steve Wilson
+
+
+############ FILE CHOOSER STRINGS #############
+
+FileChooser.lookInLabel.textAndMnemonic=Suchen &in:
+FileChooser.saveInLabel.textAndMnemonic=Speichern in:
+FileChooser.fileNameLabel.textAndMnemonic=&Dateiname:
+FileChooser.folderNameLabel.textAndMnemonic=Ordner&name:
+FileChooser.filesOfTypeLabel.textAndMnemonic=Datei&typ:
+FileChooser.upFolderToolTip.textAndMnemonic=Eine Ebene h\u00F6her
+FileChooser.upFolderAccessibleName=Nach oben
+FileChooser.homeFolderToolTip.textAndMnemonic=Home
+FileChooser.homeFolderAccessibleName=Home
+FileChooser.newFolderToolTip.textAndMnemonic=Neuen Ordner erstellen
+FileChooser.newFolderAccessibleName=Neuer Ordner
+FileChooser.newFolderActionLabel.textAndMnemonic=Neuer Ordner
+FileChooser.listViewButtonToolTip.textAndMnemonic=Liste
+FileChooser.listViewButtonAccessibleName=Liste
+FileChooser.listViewActionLabel.textAndMnemonic=Liste
+FileChooser.detailsViewButtonToolTip.textAndMnemonic=Details
+FileChooser.detailsViewButtonAccessibleName=Details
+FileChooser.viewMenuButtonToolTipText = Ansichtsmen\u00FC
+FileChooser.viewMenuButtonAccessibleName = Ansichtsmen\u00FC
+FileChooser.detailsViewActionLabel.textAndMnemonic=Details
+FileChooser.refreshActionLabel.textAndMnemonic=Aktualisieren
+FileChooser.viewMenuLabel.textAndMnemonic=Ansicht
+FileChooser.fileNameHeader.textAndMnemonic=Name
+FileChooser.fileSizeHeader.textAndMnemonic=Gr\u00F6\u00DFe
+FileChooser.fileTypeHeader.textAndMnemonic=Typ
+FileChooser.fileDateHeader.textAndMnemonic=Ge\u00E4ndert
+FileChooser.fileAttrHeader.textAndMnemonic=Attribute
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/resources/windows_es.properties	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,47 @@
+# This properties file is used to create a PropertyResourceBundle
+# It contains Locale specific strings used be the Windows Look and Feel.
+# Currently, the following components need this for support:
+#
+#    FileChooser
+#
+# When this file is read in, the strings are put into the 
+# defaults table.  This is an implementation detail of the current
+# workings of Swing.  DO NOT DEPEND ON THIS.  
+# This may change in future versions of Swing as we improve localization 
+# support.
+#
+# Refer to the note in basic.properties for a description as to what
+# the mnemonics correspond to and how to calculate them.
+#
+# @author Steve Wilson
+
+
+############ FILE CHOOSER STRINGS #############
+
+FileChooser.lookInLabel.textAndMnemonic=&Buscar en:
+FileChooser.saveInLabel.textAndMnemonic=Guardar en:
+FileChooser.fileNameLabel.textAndMnemonic=&Nombre de archivo:
+FileChooser.folderNameLabel.textAndMnemonic=&Nombre de carpeta:
+FileChooser.filesOfTypeLabel.textAndMnemonic=Archivos de &tipo:
+FileChooser.upFolderToolTip.textAndMnemonic=Subir un Nivel
+FileChooser.upFolderAccessibleName=Arriba
+FileChooser.homeFolderToolTip.textAndMnemonic=Inicio
+FileChooser.homeFolderAccessibleName=Inicio
+FileChooser.newFolderToolTip.textAndMnemonic=Crear Nueva Carpeta
+FileChooser.newFolderAccessibleName=Nueva Carpeta
+FileChooser.newFolderActionLabel.textAndMnemonic=Nueva Carpeta
+FileChooser.listViewButtonToolTip.textAndMnemonic=Lista
+FileChooser.listViewButtonAccessibleName=Lista
+FileChooser.listViewActionLabel.textAndMnemonic=Lista
+FileChooser.detailsViewButtonToolTip.textAndMnemonic=Detalles
+FileChooser.detailsViewButtonAccessibleName=Detalles
+FileChooser.viewMenuButtonToolTipText = Men\u00FA Ver
+FileChooser.viewMenuButtonAccessibleName = Men\u00FA Ver
+FileChooser.detailsViewActionLabel.textAndMnemonic=Detalles
+FileChooser.refreshActionLabel.textAndMnemonic=Refrescar
+FileChooser.viewMenuLabel.textAndMnemonic=Ver
+FileChooser.fileNameHeader.textAndMnemonic=Nombre
+FileChooser.fileSizeHeader.textAndMnemonic=Tama\u00F1o
+FileChooser.fileTypeHeader.textAndMnemonic=Tipo
+FileChooser.fileDateHeader.textAndMnemonic=Modificado
+FileChooser.fileAttrHeader.textAndMnemonic=Atributos
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/resources/windows_fr.properties	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,47 @@
+# This properties file is used to create a PropertyResourceBundle
+# It contains Locale specific strings used be the Windows Look and Feel.
+# Currently, the following components need this for support:
+#
+#    FileChooser
+#
+# When this file is read in, the strings are put into the 
+# defaults table.  This is an implementation detail of the current
+# workings of Swing.  DO NOT DEPEND ON THIS.  
+# This may change in future versions of Swing as we improve localization 
+# support.
+#
+# Refer to the note in basic.properties for a description as to what
+# the mnemonics correspond to and how to calculate them.
+#
+# @author Steve Wilson
+
+
+############ FILE CHOOSER STRINGS #############
+
+FileChooser.lookInLabel.textAndMnemonic=Rechercher &dans :
+FileChooser.saveInLabel.textAndMnemonic=Enregistrer dans :
+FileChooser.fileNameLabel.textAndMnemonic=&Nom du fichier :
+FileChooser.folderNameLabel.textAndMnemonic=&Nom du dossier :
+FileChooser.filesOfTypeLabel.textAndMnemonic=&Type de fichier :
+FileChooser.upFolderToolTip.textAndMnemonic=Remonte d'un niveau.
+FileChooser.upFolderAccessibleName=Monter
+FileChooser.homeFolderToolTip.textAndMnemonic=R\u00E9pertoire de base
+FileChooser.homeFolderAccessibleName=R\u00E9pertoire de base
+FileChooser.newFolderToolTip.textAndMnemonic=Cr\u00E9e un dossier.
+FileChooser.newFolderAccessibleName=Nouveau dossier
+FileChooser.newFolderActionLabel.textAndMnemonic=Nouveau dossier
+FileChooser.listViewButtonToolTip.textAndMnemonic=Liste
+FileChooser.listViewButtonAccessibleName=Liste
+FileChooser.listViewActionLabel.textAndMnemonic=Liste
+FileChooser.detailsViewButtonToolTip.textAndMnemonic=D\u00E9tails
+FileChooser.detailsViewButtonAccessibleName=D\u00E9tails
+FileChooser.viewMenuButtonToolTipText = Menu Affichage
+FileChooser.viewMenuButtonAccessibleName = Menu Affichage
+FileChooser.detailsViewActionLabel.textAndMnemonic=D\u00E9tails
+FileChooser.refreshActionLabel.textAndMnemonic=Actualiser
+FileChooser.viewMenuLabel.textAndMnemonic=Affichage
+FileChooser.fileNameHeader.textAndMnemonic=Nom
+FileChooser.fileSizeHeader.textAndMnemonic=Taille
+FileChooser.fileTypeHeader.textAndMnemonic=Type
+FileChooser.fileDateHeader.textAndMnemonic=Modifi\u00E9
+FileChooser.fileAttrHeader.textAndMnemonic=Attributs
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/resources/windows_it.properties	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,47 @@
+# This properties file is used to create a PropertyResourceBundle
+# It contains Locale specific strings used be the Windows Look and Feel.
+# Currently, the following components need this for support:
+#
+#    FileChooser
+#
+# When this file is read in, the strings are put into the 
+# defaults table.  This is an implementation detail of the current
+# workings of Swing.  DO NOT DEPEND ON THIS.  
+# This may change in future versions of Swing as we improve localization 
+# support.
+#
+# Refer to the note in basic.properties for a description as to what
+# the mnemonics correspond to and how to calculate them.
+#
+# @author Steve Wilson
+
+
+############ FILE CHOOSER STRINGS #############
+
+FileChooser.lookInLabel.textAndMnemonic=Cerca &in:
+FileChooser.saveInLabel.textAndMnemonic=Salva in:
+FileChooser.fileNameLabel.textAndMnemonic=&Nome file:
+FileChooser.folderNameLabel.textAndMnemonic=&Nome cartella:
+FileChooser.filesOfTypeLabel.textAndMnemonic=&Tipo file:
+FileChooser.upFolderToolTip.textAndMnemonic=Cartella superiore
+FileChooser.upFolderAccessibleName=Superiore
+FileChooser.homeFolderToolTip.textAndMnemonic=Home
+FileChooser.homeFolderAccessibleName=Home
+FileChooser.newFolderToolTip.textAndMnemonic=Crea nuova cartella
+FileChooser.newFolderAccessibleName=Nuova cartella
+FileChooser.newFolderActionLabel.textAndMnemonic=Nuova cartella
+FileChooser.listViewButtonToolTip.textAndMnemonic=Lista
+FileChooser.listViewButtonAccessibleName=Lista
+FileChooser.listViewActionLabel.textAndMnemonic=Lista
+FileChooser.detailsViewButtonToolTip.textAndMnemonic=Dettagli
+FileChooser.detailsViewButtonAccessibleName=Dettagli
+FileChooser.viewMenuButtonToolTipText = Visualizza menu
+FileChooser.viewMenuButtonAccessibleName = Visualizza menu
+FileChooser.detailsViewActionLabel.textAndMnemonic=Dettagli
+FileChooser.refreshActionLabel.textAndMnemonic=Aggiorna
+FileChooser.viewMenuLabel.textAndMnemonic=Visualizza
+FileChooser.fileNameHeader.textAndMnemonic=Nome
+FileChooser.fileSizeHeader.textAndMnemonic=Dimensioni
+FileChooser.fileTypeHeader.textAndMnemonic=Tipo
+FileChooser.fileDateHeader.textAndMnemonic=Modificato
+FileChooser.fileAttrHeader.textAndMnemonic=Attributi
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/resources/windows_ja.properties	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,47 @@
+# This properties file is used to create a PropertyResourceBundle
+# It contains Locale specific strings used be the Windows Look and Feel.
+# Currently, the following components need this for support:
+#
+#    FileChooser
+#
+# When this file is read in, the strings are put into the 
+# defaults table.  This is an implementation detail of the current
+# workings of Swing.  DO NOT DEPEND ON THIS.  
+# This may change in future versions of Swing as we improve localization 
+# support.
+#
+# Refer to the note in basic.properties for a description as to what
+# the mnemonics correspond to and how to calculate them.
+#
+# @author Steve Wilson
+
+
+############ FILE CHOOSER STRINGS #############
+
+FileChooser.lookInLabel.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u306E\u5834\u6240(&I):
+FileChooser.saveInLabel.textAndMnemonic=\u4FDD\u5B58:
+FileChooser.fileNameLabel.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u540D(&N):
+FileChooser.folderNameLabel.textAndMnemonic=\u30D5\u30A9\u30EB\u30C0\u540D(&N):
+FileChooser.filesOfTypeLabel.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u306E\u30BF\u30A4\u30D7(&T):
+FileChooser.upFolderToolTip.textAndMnemonic=1\u30EC\u30D9\u30EB\u4E0A\u3078
+FileChooser.upFolderAccessibleName=\u4E0A\u3078
+FileChooser.homeFolderToolTip.textAndMnemonic=\u30DB\u30FC\u30E0
+FileChooser.homeFolderAccessibleName=\u30DB\u30FC\u30E0
+FileChooser.newFolderToolTip.textAndMnemonic=\u65B0\u898F\u30D5\u30A9\u30EB\u30C0\u306E\u4F5C\u6210
+FileChooser.newFolderAccessibleName=\u65B0\u898F\u30D5\u30A9\u30EB\u30C0
+FileChooser.newFolderActionLabel.textAndMnemonic=\u65B0\u898F\u30D5\u30A9\u30EB\u30C0
+FileChooser.listViewButtonToolTip.textAndMnemonic=\u30EA\u30B9\u30C8
+FileChooser.listViewButtonAccessibleName=\u30EA\u30B9\u30C8
+FileChooser.listViewActionLabel.textAndMnemonic=\u30EA\u30B9\u30C8
+FileChooser.detailsViewButtonToolTip.textAndMnemonic=\u8A73\u7D30
+FileChooser.detailsViewButtonAccessibleName=\u8A73\u7D30
+FileChooser.viewMenuButtonToolTipText = \u8868\u793A\u30E1\u30CB\u30E5\u30FC
+FileChooser.viewMenuButtonAccessibleName = \u8868\u793A\u30E1\u30CB\u30E5\u30FC
+FileChooser.detailsViewActionLabel.textAndMnemonic=\u8A73\u7D30
+FileChooser.refreshActionLabel.textAndMnemonic=\u30EA\u30D5\u30EC\u30C3\u30B7\u30E5
+FileChooser.viewMenuLabel.textAndMnemonic=\u8868\u793A
+FileChooser.fileNameHeader.textAndMnemonic=\u540D\u524D
+FileChooser.fileSizeHeader.textAndMnemonic=\u30B5\u30A4\u30BA
+FileChooser.fileTypeHeader.textAndMnemonic=\u30BF\u30A4\u30D7
+FileChooser.fileDateHeader.textAndMnemonic=\u4FEE\u6B63\u65E5
+FileChooser.fileAttrHeader.textAndMnemonic=\u5C5E\u6027
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/resources/windows_ko.properties	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,47 @@
+# This properties file is used to create a PropertyResourceBundle
+# It contains Locale specific strings used be the Windows Look and Feel.
+# Currently, the following components need this for support:
+#
+#    FileChooser
+#
+# When this file is read in, the strings are put into the 
+# defaults table.  This is an implementation detail of the current
+# workings of Swing.  DO NOT DEPEND ON THIS.  
+# This may change in future versions of Swing as we improve localization 
+# support.
+#
+# Refer to the note in basic.properties for a description as to what
+# the mnemonics correspond to and how to calculate them.
+#
+# @author Steve Wilson
+
+
+############ FILE CHOOSER STRINGS #############
+
+FileChooser.lookInLabel.textAndMnemonic=\uCC3E\uB294 \uC704\uCE58(&I):
+FileChooser.saveInLabel.textAndMnemonic=\uC800\uC7A5 \uC704\uCE58:
+FileChooser.fileNameLabel.textAndMnemonic=\uD30C\uC77C \uC774\uB984(&N):
+FileChooser.folderNameLabel.textAndMnemonic=\uD3F4\uB354 \uC774\uB984(&N):
+FileChooser.filesOfTypeLabel.textAndMnemonic=\uD30C\uC77C \uC720\uD615(&T):
+FileChooser.upFolderToolTip.textAndMnemonic=\uD55C \uB808\uBCA8 \uC704\uB85C
+FileChooser.upFolderAccessibleName=\uC704\uB85C
+FileChooser.homeFolderToolTip.textAndMnemonic=\uD648
+FileChooser.homeFolderAccessibleName=\uD648
+FileChooser.newFolderToolTip.textAndMnemonic=\uC0C8 \uD3F4\uB354 \uC0DD\uC131
+FileChooser.newFolderAccessibleName=\uC0C8 \uD3F4\uB354
+FileChooser.newFolderActionLabel.textAndMnemonic=\uC0C8 \uD3F4\uB354
+FileChooser.listViewButtonToolTip.textAndMnemonic=\uBAA9\uB85D
+FileChooser.listViewButtonAccessibleName=\uBAA9\uB85D
+FileChooser.listViewActionLabel.textAndMnemonic=\uBAA9\uB85D
+FileChooser.detailsViewButtonToolTip.textAndMnemonic=\uC138\uBD80\uC815\uBCF4
+FileChooser.detailsViewButtonAccessibleName=\uC138\uBD80\uC815\uBCF4
+FileChooser.viewMenuButtonToolTipText = \uBCF4\uAE30 \uBA54\uB274
+FileChooser.viewMenuButtonAccessibleName = \uBCF4\uAE30 \uBA54\uB274
+FileChooser.detailsViewActionLabel.textAndMnemonic=\uC138\uBD80\uC815\uBCF4
+FileChooser.refreshActionLabel.textAndMnemonic=\uC0C8\uB85C\uACE0\uCE68
+FileChooser.viewMenuLabel.textAndMnemonic=\uBCF4\uAE30
+FileChooser.fileNameHeader.textAndMnemonic=\uC774\uB984
+FileChooser.fileSizeHeader.textAndMnemonic=\uD06C\uAE30
+FileChooser.fileTypeHeader.textAndMnemonic=\uC720\uD615
+FileChooser.fileDateHeader.textAndMnemonic=\uC218\uC815 \uB0A0\uC9DC
+FileChooser.fileAttrHeader.textAndMnemonic=\uC18D\uC131
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/resources/windows_pt_BR.properties	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,47 @@
+# This properties file is used to create a PropertyResourceBundle
+# It contains Locale specific strings used be the Windows Look and Feel.
+# Currently, the following components need this for support:
+#
+#    FileChooser
+#
+# When this file is read in, the strings are put into the 
+# defaults table.  This is an implementation detail of the current
+# workings of Swing.  DO NOT DEPEND ON THIS.  
+# This may change in future versions of Swing as we improve localization 
+# support.
+#
+# Refer to the note in basic.properties for a description as to what
+# the mnemonics correspond to and how to calculate them.
+#
+# @author Steve Wilson
+
+
+############ FILE CHOOSER STRINGS #############
+
+FileChooser.lookInLabel.textAndMnemonic=Pesquisar &em:
+FileChooser.saveInLabel.textAndMnemonic=Salvar em:
+FileChooser.fileNameLabel.textAndMnemonic=&Nome do arquivo:
+FileChooser.folderNameLabel.textAndMnemonic=&Nome da pasta:
+FileChooser.filesOfTypeLabel.textAndMnemonic=Arquivos do &tipo:
+FileChooser.upFolderToolTip.textAndMnemonic=Um N\u00EDvel Acima
+FileChooser.upFolderAccessibleName=Acima
+FileChooser.homeFolderToolTip.textAndMnemonic=In\u00EDcio
+FileChooser.homeFolderAccessibleName=In\u00EDcio
+FileChooser.newFolderToolTip.textAndMnemonic=Criar Nova Pasta
+FileChooser.newFolderAccessibleName=Nova Pasta
+FileChooser.newFolderActionLabel.textAndMnemonic=Nova Pasta
+FileChooser.listViewButtonToolTip.textAndMnemonic=Lista
+FileChooser.listViewButtonAccessibleName=Lista
+FileChooser.listViewActionLabel.textAndMnemonic=Lista
+FileChooser.detailsViewButtonToolTip.textAndMnemonic=Detalhes
+FileChooser.detailsViewButtonAccessibleName=Detalhes
+FileChooser.viewMenuButtonToolTipText = Exibir Menu
+FileChooser.viewMenuButtonAccessibleName = Exibir Menu
+FileChooser.detailsViewActionLabel.textAndMnemonic=Detalhes
+FileChooser.refreshActionLabel.textAndMnemonic=Atualizar
+FileChooser.viewMenuLabel.textAndMnemonic=Exibir
+FileChooser.fileNameHeader.textAndMnemonic=Nome
+FileChooser.fileSizeHeader.textAndMnemonic=Tamanho
+FileChooser.fileTypeHeader.textAndMnemonic=Tipo
+FileChooser.fileDateHeader.textAndMnemonic=Modificado
+FileChooser.fileAttrHeader.textAndMnemonic=Atributos
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/resources/windows_sv.properties	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,47 @@
+# This properties file is used to create a PropertyResourceBundle
+# It contains Locale specific strings used be the Windows Look and Feel.
+# Currently, the following components need this for support:
+#
+#    FileChooser
+#
+# When this file is read in, the strings are put into the 
+# defaults table.  This is an implementation detail of the current
+# workings of Swing.  DO NOT DEPEND ON THIS.  
+# This may change in future versions of Swing as we improve localization 
+# support.
+#
+# Refer to the note in basic.properties for a description as to what
+# the mnemonics correspond to and how to calculate them.
+#
+# @author Steve Wilson
+
+
+############ FILE CHOOSER STRINGS #############
+
+FileChooser.lookInLabel.textAndMnemonic=Leta &i:
+FileChooser.saveInLabel.textAndMnemonic=Spara i:
+FileChooser.fileNameLabel.textAndMnemonic=Fil&namn:
+FileChooser.folderNameLabel.textAndMnemonic=Mapp&namn:
+FileChooser.filesOfTypeLabel.textAndMnemonic=Filer av &typen:
+FileChooser.upFolderToolTip.textAndMnemonic=Upp en niv\u00E5
+FileChooser.upFolderAccessibleName=Upp
+FileChooser.homeFolderToolTip.textAndMnemonic=Hem
+FileChooser.homeFolderAccessibleName=Hem
+FileChooser.newFolderToolTip.textAndMnemonic=Skapa ny mapp
+FileChooser.newFolderAccessibleName=Ny mapp
+FileChooser.newFolderActionLabel.textAndMnemonic=Ny mapp
+FileChooser.listViewButtonToolTip.textAndMnemonic=Lista
+FileChooser.listViewButtonAccessibleName=Lista
+FileChooser.listViewActionLabel.textAndMnemonic=Lista
+FileChooser.detailsViewButtonToolTip.textAndMnemonic=Detaljer
+FileChooser.detailsViewButtonAccessibleName=Detaljer
+FileChooser.viewMenuButtonToolTipText = Menyn Visa
+FileChooser.viewMenuButtonAccessibleName = Menyn Visa
+FileChooser.detailsViewActionLabel.textAndMnemonic=Detaljer
+FileChooser.refreshActionLabel.textAndMnemonic=F\u00F6rnya
+FileChooser.viewMenuLabel.textAndMnemonic=Vy
+FileChooser.fileNameHeader.textAndMnemonic=Namn
+FileChooser.fileSizeHeader.textAndMnemonic=Storlek
+FileChooser.fileTypeHeader.textAndMnemonic=Typ
+FileChooser.fileDateHeader.textAndMnemonic=\u00C4ndrad
+FileChooser.fileAttrHeader.textAndMnemonic=Attribut
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/resources/windows_zh_CN.properties	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,47 @@
+# This properties file is used to create a PropertyResourceBundle
+# It contains Locale specific strings used be the Windows Look and Feel.
+# Currently, the following components need this for support:
+#
+#    FileChooser
+#
+# When this file is read in, the strings are put into the 
+# defaults table.  This is an implementation detail of the current
+# workings of Swing.  DO NOT DEPEND ON THIS.  
+# This may change in future versions of Swing as we improve localization 
+# support.
+#
+# Refer to the note in basic.properties for a description as to what
+# the mnemonics correspond to and how to calculate them.
+#
+# @author Steve Wilson
+
+
+############ FILE CHOOSER STRINGS #############
+
+FileChooser.lookInLabel.textAndMnemonic=\u67E5\u627E(&I):
+FileChooser.saveInLabel.textAndMnemonic=\u4FDD\u5B58: 
+FileChooser.fileNameLabel.textAndMnemonic=\u6587\u4EF6\u540D(&N):
+FileChooser.folderNameLabel.textAndMnemonic=\u6587\u4EF6\u5939\u540D(&N):
+FileChooser.filesOfTypeLabel.textAndMnemonic=\u6587\u4EF6\u7C7B\u578B(&T):
+FileChooser.upFolderToolTip.textAndMnemonic=\u5411\u4E0A\u4E00\u7EA7
+FileChooser.upFolderAccessibleName=\u5411\u4E0A
+FileChooser.homeFolderToolTip.textAndMnemonic=\u4E3B\u76EE\u5F55
+FileChooser.homeFolderAccessibleName=\u4E3B\u76EE\u5F55
+FileChooser.newFolderToolTip.textAndMnemonic=\u521B\u5EFA\u65B0\u6587\u4EF6\u5939
+FileChooser.newFolderAccessibleName=\u65B0\u5EFA\u6587\u4EF6\u5939
+FileChooser.newFolderActionLabel.textAndMnemonic=\u65B0\u5EFA\u6587\u4EF6\u5939
+FileChooser.listViewButtonToolTip.textAndMnemonic=\u5217\u8868
+FileChooser.listViewButtonAccessibleName=\u5217\u8868
+FileChooser.listViewActionLabel.textAndMnemonic=\u5217\u8868
+FileChooser.detailsViewButtonToolTip.textAndMnemonic=\u8BE6\u7EC6\u4FE1\u606F
+FileChooser.detailsViewButtonAccessibleName=\u8BE6\u7EC6\u4FE1\u606F
+FileChooser.viewMenuButtonToolTipText = \u67E5\u770B\u83DC\u5355
+FileChooser.viewMenuButtonAccessibleName = \u67E5\u770B\u83DC\u5355
+FileChooser.detailsViewActionLabel.textAndMnemonic=\u8BE6\u7EC6\u4FE1\u606F
+FileChooser.refreshActionLabel.textAndMnemonic=\u5237\u65B0
+FileChooser.viewMenuLabel.textAndMnemonic=\u89C6\u56FE
+FileChooser.fileNameHeader.textAndMnemonic=\u540D\u79F0
+FileChooser.fileSizeHeader.textAndMnemonic=\u5927\u5C0F
+FileChooser.fileTypeHeader.textAndMnemonic=\u7C7B\u578B
+FileChooser.fileDateHeader.textAndMnemonic=\u4FEE\u6539\u65E5\u671F
+FileChooser.fileAttrHeader.textAndMnemonic=\u5C5E\u6027
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/resources/windows_zh_TW.properties	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,47 @@
+# This properties file is used to create a PropertyResourceBundle
+# It contains Locale specific strings used be the Windows Look and Feel.
+# Currently, the following components need this for support:
+#
+#    FileChooser
+#
+# When this file is read in, the strings are put into the 
+# defaults table.  This is an implementation detail of the current
+# workings of Swing.  DO NOT DEPEND ON THIS.  
+# This may change in future versions of Swing as we improve localization 
+# support.
+#
+# Refer to the note in basic.properties for a description as to what
+# the mnemonics correspond to and how to calculate them.
+#
+# @author Steve Wilson
+
+
+############ FILE CHOOSER STRINGS #############
+
+FileChooser.lookInLabel.textAndMnemonic=\u67E5\u8A62(&I):
+FileChooser.saveInLabel.textAndMnemonic=\u5132\u5B58\u65BC: 
+FileChooser.fileNameLabel.textAndMnemonic=\u6A94\u6848\u540D\u7A31(&N):
+FileChooser.folderNameLabel.textAndMnemonic=\u8CC7\u6599\u593E\u540D\u7A31(&N):
+FileChooser.filesOfTypeLabel.textAndMnemonic=\u6A94\u6848\u985E\u578B(&T):
+FileChooser.upFolderToolTip.textAndMnemonic=\u5F80\u4E0A\u4E00\u5C64
+FileChooser.upFolderAccessibleName=\u5F80\u4E0A
+FileChooser.homeFolderToolTip.textAndMnemonic=\u4E3B\u76EE\u9304
+FileChooser.homeFolderAccessibleName=\u4E3B\u76EE\u9304
+FileChooser.newFolderToolTip.textAndMnemonic=\u5EFA\u7ACB\u65B0\u8CC7\u6599\u593E
+FileChooser.newFolderAccessibleName=\u65B0\u8CC7\u6599\u593E
+FileChooser.newFolderActionLabel.textAndMnemonic=\u65B0\u8CC7\u6599\u593E
+FileChooser.listViewButtonToolTip.textAndMnemonic=\u6E05\u55AE
+FileChooser.listViewButtonAccessibleName=\u6E05\u55AE
+FileChooser.listViewActionLabel.textAndMnemonic=\u6E05\u55AE
+FileChooser.detailsViewButtonToolTip.textAndMnemonic=\u8A73\u7D30\u8CC7\u8A0A
+FileChooser.detailsViewButtonAccessibleName=\u8A73\u7D30\u8CC7\u8A0A
+FileChooser.viewMenuButtonToolTipText = \u6AA2\u8996\u529F\u80FD\u8868
+FileChooser.viewMenuButtonAccessibleName = \u6AA2\u8996\u529F\u80FD\u8868
+FileChooser.detailsViewActionLabel.textAndMnemonic=\u8A73\u7D30\u8CC7\u8A0A
+FileChooser.refreshActionLabel.textAndMnemonic=\u91CD\u65B0\u6574\u7406
+FileChooser.viewMenuLabel.textAndMnemonic=\u6AA2\u8996
+FileChooser.fileNameHeader.textAndMnemonic=\u540D\u7A31
+FileChooser.fileSizeHeader.textAndMnemonic=\u5927\u5C0F
+FileChooser.fileTypeHeader.textAndMnemonic=\u985E\u578B
+FileChooser.fileDateHeader.textAndMnemonic=\u4FEE\u6539\u65E5\u671F
+FileChooser.fileAttrHeader.textAndMnemonic=\u5C6C\u6027
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/module-info.java.extra	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,26 @@
+/*
+ * 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.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+opens com.sun.java.swing.plaf.windows to jdk.jconsole;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/windows/classes/sun/swing/plaf/windows/ClassicSortArrowIcon.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package sun.swing.plaf.windows;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Graphics;
+import java.io.Serializable;
+import javax.swing.Icon;
+import javax.swing.UIManager;
+import javax.swing.plaf.UIResource;
+
+/**
+ * Classic sort icons.
+ *
+ */
+@SuppressWarnings("serial") // JDK-implementation class
+public class ClassicSortArrowIcon implements Icon, UIResource, Serializable{
+    private static final int X_OFFSET = 9;
+    private boolean ascending;
+
+    public ClassicSortArrowIcon(boolean ascending) {
+        this.ascending = ascending;
+    }
+
+    public void paintIcon(Component c, Graphics g, int x, int y) {
+        x += X_OFFSET;
+        if (ascending) {
+            g.setColor(UIManager.getColor("Table.sortIconHighlight"));
+            drawSide(g, x + 3, y, -1);
+
+            g.setColor(UIManager.getColor("Table.sortIconLight"));
+            drawSide(g, x + 4, y, 1);
+
+            g.fillRect(x + 1, y + 6, 6, 1);
+        }
+        else {
+            g.setColor(UIManager.getColor("Table.sortIconHighlight"));
+            drawSide(g, x + 3, y + 6, -1);
+            g.fillRect(x + 1, y, 6, 1);
+
+            g.setColor(UIManager.getColor("Table.sortIconLight"));
+            drawSide(g, x + 4, y + 6, 1);
+        }
+    }
+
+    private void drawSide(Graphics g, int x, int y, int xIncrement) {
+        int yIncrement = 2;
+        if (ascending) {
+            g.fillRect(x, y, 1, 2);
+            y++;
+        }
+        else {
+            g.fillRect(x, --y, 1, 2);
+            yIncrement = -2;
+            y -= 2;
+        }
+        x += xIncrement;
+        for (int i = 0; i < 2; i++) {
+            g.fillRect(x, y, 1, 3);
+            x += xIncrement;
+            y += yIncrement;
+        }
+        if (!ascending) {
+            y++;
+        }
+        g.fillRect(x, y, 1, 2);
+    }
+
+    public int getIconWidth() {
+        return X_OFFSET + 8;
+    }
+    public int getIconHeight() {
+        return 9;
+    }
+}
--- a/src/java.desktop/windows/native/libawt/windows/awt_Desktop.cpp	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/windows/native/libawt/windows/awt_Desktop.cpp	Wed Dec 13 10:25:38 2017 -0800
@@ -137,7 +137,7 @@
             fop.hwnd = NULL;
             fop.wFunc = FO_DELETE;
             fop.pFrom = fileBuffer;
-            fop.fFlags = FOF_ALLOWUNDO;
+            fop.fFlags = FOF_ALLOWUNDO | FOF_NOCONFIRMATION | FOF_NOERRORUI;
 
             int res = SHFileOperation(&fop);
 
--- a/src/java.desktop/windows/native/libawt/windows/awt_FileDialog.cpp	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/windows/native/libawt/windows/awt_FileDialog.cpp	Wed Dec 13 10:25:38 2017 -0800
@@ -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,13 +259,7 @@
     OPENFILENAME ofn;
     memset(&ofn, 0, sizeof(ofn));
 
-    /*
-     * There's a situation (see bug 4906972) when InvokeFunction (by which this method is called)
-     * returnes earlier than this method returnes. Probably it's caused due to ReplyMessage system call.
-     * So for the avoidance of this mistiming we need to make new global reference here
-     * (not local as it's used by the hook) and then manage it independently of the calling thread.
-     */
-    peer = env->NewGlobalRef((jobject)p);
+    peer = (jobject)p;
 
     try {
         DASSERT(peer);
--- a/src/java.desktop/windows/native/libawt/windows/awt_TrayIcon.cpp	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/java.desktop/windows/native/libawt/windows/awt_TrayIcon.cpp	Wed Dec 13 10:25:38 2017 -0800
@@ -411,12 +411,15 @@
 
 MsgRouting AwtTrayIcon::WmBalloonUserClick(UINT flags, int x, int y)
 {
-    if (AwtComponent::GetJavaModifiers() & java_awt_event_InputEvent_BUTTON1_DOWN_MASK) {
-        MSG msg;
-        AwtComponent::InitMessage(&msg, lastMessage, flags, MAKELPARAM(x, y), x, y);
-        SendActionEvent(java_awt_event_ActionEvent_ACTION_PERFORMED, ::JVM_CurrentTimeMillis(NULL, 0),
-                        AwtComponent::GetActionModifiers(), &msg);
-    }
+    // The windows api GetKeyState() when read would provide the key state of the requrested key
+    // but it is not guaranteed to receive the same as it is stored in the thread message queue and
+    // unless the thread runs faster.
+    // Event NIN_BALLOONUSERCLICK is received only upon left mouse click. Hence the additional check
+    // is not required.
+    MSG msg;
+    AwtComponent::InitMessage(&msg, lastMessage, flags, MAKELPARAM(x, y), x, y);
+    SendActionEvent(java_awt_event_ActionEvent_ACTION_PERFORMED, ::JVM_CurrentTimeMillis(NULL, 0),
+                    AwtComponent::GetActionModifiers(), &msg);
     return mrConsume;
 }
 
--- a/src/jdk.accessibility/windows/native/jabswitch/jabswitch.cpp	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/jdk.accessibility/windows/native/jabswitch/jabswitch.cpp	Wed Dec 13 10:25:38 2017 -0800
@@ -206,6 +206,7 @@
          len - 1 > sizeof(tempPath) - sizeof(acc_props2) ) {
         printf("The USERPROFILE environment variable is too long.\n");
         printf("It must be no longer than 233 characters.\n");
+        free(profilePath);
         return 123;
      }
     path[0] = 0;
--- a/src/jdk.internal.ed/share/classes/jdk/internal/editor/external/ExternalEditor.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/jdk.internal.ed/share/classes/jdk/internal/editor/external/ExternalEditor.java	Wed Dec 13 10:25:38 2017 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, 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
@@ -29,10 +29,13 @@
 import java.nio.charset.Charset;
 import java.nio.file.ClosedWatchServiceException;
 import java.nio.file.FileSystems;
+import java.nio.file.FileVisitResult;
 import java.nio.file.Files;
 import java.nio.file.Path;
+import java.nio.file.SimpleFileVisitor;
 import java.nio.file.WatchKey;
 import java.nio.file.WatchService;
+import java.nio.file.attribute.BasicFileAttributes;
 import java.util.Arrays;
 import java.util.Scanner;
 import java.util.function.Consumer;
@@ -104,6 +107,8 @@
             launch(cmd);
         } catch (IOException ex) {
             errorHandler.accept(ex.getMessage());
+        } finally {
+            deleteDirectory();
         }
     }
 
@@ -189,4 +194,31 @@
             errorHandler.accept("Failure in read edit file: " + ex.getMessage());
         }
     }
+
+    private void deleteDirectory() {
+        try {
+            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 directory, IOException fail)
+                        throws IOException {
+                    if (fail == null) {
+                        Files.delete(directory);
+                        return FileVisitResult.CONTINUE;
+                    }
+                    throw fail;
+                }
+            });
+        } catch (IOException exc) {
+            // ignore: The end-user will not want to see this, it is in a temp
+            // directory so it will go away eventually, and tests verify that
+            // the deletion is occurring.
+        }
+    }
 }
--- a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ConsoleIOContext.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ConsoleIOContext.java	Wed Dec 13 10:25:38 2017 -0800
@@ -216,7 +216,7 @@
                 int[] anchor = new int[] {-1};
                 List<Suggestion> suggestions;
                 List<String> doc;
-                boolean command = prefix.isEmpty() && text.trim().startsWith("/");
+                boolean command = prefix.isEmpty() && text.startsWith("/");
                 if (command) {
                     suggestions = repl.commandCompletionSuggestions(text, cursor, anchor);
                     doc = repl.commandDocumentation(text, cursor, true);
--- a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java	Wed Dec 13 10:25:38 2017 -0800
@@ -115,6 +115,7 @@
 import jdk.internal.editor.external.ExternalEditor;
 import static java.util.Arrays.asList;
 import static java.util.Arrays.stream;
+import static java.util.Collections.singletonList;
 import static java.util.stream.Collectors.joining;
 import static java.util.stream.Collectors.toList;
 import static jdk.jshell.Snippet.SubKind.TEMP_VAR_EXPRESSION_SUBKIND;
@@ -136,6 +137,9 @@
 
     private static final Pattern LINEBREAK = Pattern.compile("\\R");
     private static final Pattern ID = Pattern.compile("[se]?\\d+([-\\s].*)?");
+    private static final Pattern RERUN_ID = Pattern.compile("/" + ID.pattern());
+    private static final Pattern RERUN_PREVIOUS = Pattern.compile("/\\-\\d+( .*)?");
+    private static final Pattern SET_SUB = Pattern.compile("/?set .*");
             static final String RECORD_SEPARATOR = "\u241E";
     private static final String RB_NAME_PREFIX  = "jdk.internal.jshell.tool.resources";
     private static final String VERSION_RB_NAME = RB_NAME_PREFIX + ".version";
@@ -228,6 +232,8 @@
     static final String BUILTIN_FILE_PATH_FORMAT = "/jdk/jshell/tool/resources/%s.jsh";
     static final String INT_PREFIX = "int $$exit$$ = ";
 
+    static final int OUTPUT_WIDTH = 72;
+
     // match anything followed by whitespace
     private static final Pattern OPTION_PRE_PATTERN =
             Pattern.compile("\\s*(\\S+\\s+)*?");
@@ -1314,8 +1320,8 @@
         Command[] candidates = findCommand(cmd, c -> c.kind.isRealCommand);
         switch (candidates.length) {
             case 0:
-                // not found, it is either a snippet command or an error
-                if (ID.matcher(cmd.substring(1)).matches()) {
+                // not found, it is either a rerun-ID command or an error
+                if (RERUN_ID.matcher(cmd).matches()) {
                     // it is in the form of a snipppet id, see if it is a valid history reference
                     rerunHistoryEntriesById(input);
                 } else {
@@ -1848,7 +1854,7 @@
 
     public List<String> commandDocumentation(String code, int cursor, boolean shortDescription) {
         code = code.substring(0, cursor).replaceAll("\\h+", " ");
-        String stripped = code.replaceFirst("/help ", "");
+        String stripped = code.replaceFirst("/(he(lp?)?|\\?) ", "");
         boolean inHelp = !code.equals(stripped);
         int space = stripped.indexOf(' ');
         String prefix = space != (-1) ? stripped.substring(0, space) : stripped;
@@ -1856,24 +1862,30 @@
 
         List<Entry<String, String>> toShow;
 
-        if (stripped.matches("/set .*") || stripped.matches("set .*")) {
+        if (SET_SUB.matcher(stripped).matches()) {
             String setSubcommand = stripped.replaceFirst("/?set ([^ ]*)($| .*)", "$1");
             toShow =
                 Arrays.stream(SET_SUBCOMMANDS)
                        .filter(s -> s.startsWith(setSubcommand))
-                       .map(s -> new SimpleEntry<>("/set " + s, "help.set." + s))
-                       .collect(Collectors.toList());
+                        .map(s -> new SimpleEntry<>("/set " + s, "help.set." + s))
+                        .collect(toList());
+        } else if (RERUN_ID.matcher(stripped).matches()) {
+            toShow =
+                singletonList(new SimpleEntry<>("/<id>", "help.rerun"));
+        } else if (RERUN_PREVIOUS.matcher(stripped).matches()) {
+            toShow =
+                singletonList(new SimpleEntry<>("/-<n>", "help.rerun"));
         } else {
             toShow =
                 commands.values()
                         .stream()
                         .filter(c -> c.command.startsWith(prefix)
-                                     || c.command.substring(1).startsWith(prefix))
-                        .filter(c -> c.kind.showInHelp ||
-                                     (inHelp && c.kind == CommandKind.HELP_SUBJECT))
+                                  || c.command.substring(1).startsWith(prefix))
+                        .filter(c -> c.kind.showInHelp
+                                  || (inHelp && c.kind == CommandKind.HELP_SUBJECT))
                         .sorted((c1, c2) -> c1.command.compareTo(c2.command))
                         .map(c -> new SimpleEntry<>(c.command, c.helpKey))
-                        .collect(Collectors.toList());
+                        .collect(toList());
         }
 
         if (toShow.size() == 1 && !inHelp) {
@@ -2358,17 +2370,14 @@
                         return false;
                     }
                     if (!which.equals("_blank")) {
-                        hardrb("help.set." + which);
+                        printHelp("/set " + which, "help.set." + which);
                         return true;
                     }
                 }
             }
             if (matches.length > 0) {
                 for (Command c : matches) {
-                    hard("");
-                    hard("%s", c.command);
-                    hard("");
-                    hardrb(c.helpKey);
+                    printHelp(c.command, c.helpKey);
                 }
                 return true;
             } else {
@@ -2379,8 +2388,7 @@
                         .toArray(String[]::new);
                 if (subs.length > 0) {
                     for (String sub : subs) {
-                        hardrb("help.set." + sub);
-                        hard("");
+                        printHelp("/set " + sub, "help.set." + sub);
                     }
                     return true;
                 }
@@ -2402,6 +2410,16 @@
         return true;
     }
 
+    private void printHelp(String name, String key) {
+        int len = name.length();
+        String centered = "%" + ((OUTPUT_WIDTH + len) / 2) + "s";
+        hard("");
+        hard(centered, name);
+        hard(centered, Stream.generate(() -> "=").limit(len).collect(Collectors.joining()));
+        hard("");
+        hardrb(key);
+    }
+
     private boolean cmdHistory() {
         cmdout.println();
         for (String s : input.currentSessionHistory()) {
--- a/test/jdk/ProblemList.txt	Wed Dec 13 16:16:17 2017 +0000
+++ b/test/jdk/ProblemList.txt	Wed Dec 13 10:25:38 2017 -0800
@@ -111,6 +111,52 @@
 
 # jdk_awt
 
+java/awt/event/MouseEvent/MouseClickTest/MouseClickTest.html 8168389 windows-all,macosx-all
+java/awt/Focus/ActualFocusedWindowTest/ActualFocusedWindowBlockingTest.java 8168408 windows-all
+java/awt/Focus/FocusOwnerFrameOnClick/FocusOwnerFrameOnClick.java 8081489 generic-all
+java/awt/Focus/IconifiedFrameFocusChangeTest/IconifiedFrameFocusChangeTest.java 6849364 generic-all
+java/awt/Focus/AutoRequestFocusTest/AutoRequestFocusToFrontTest.java 6848406 generic-all
+java/awt/Focus/AutoRequestFocusTest/AutoRequestFocusSetVisibleTest.java 6848407 generic-all 
+java/awt/Frame/MaximizedUndecorated/MaximizedUndecorated.java 8022302 generic-all
+
+java/awt/FileDialog/FileDialogIconTest/FileDialogIconTest.java 8160558 windows-all
+java/awt/Modal/FileDialog/FileDialogTKModal1Test.java 7186009 windows-all,macosx-all
+java/awt/Modal/FileDialog/FileDialogTKModal2Test.java 7186009 windows-all,macosx-all
+java/awt/Modal/FileDialog/FileDialogTKModal3Test.java 7186009 windows-all,macosx-all
+java/awt/Modal/FileDialog/FileDialogTKModal4Test.java 7186009 windows-all,macosx-all
+java/awt/Modal/FileDialog/FileDialogTKModal5Test.java 7186009 windows-all,macosx-all
+java/awt/Modal/FileDialog/FileDialogTKModal6Test.java 7186009 windows-all,macosx-all
+java/awt/event/MouseWheelEvent/InfiniteRecursion/InfiniteRecursion.java 8060176 windows-all,macosx-all
+java/awt/event/MouseWheelEvent/InfiniteRecursion/InfiniteRecursion_1.java 8060176 windows-all,macosx-all
+java/awt/dnd/BadSerializaionTest/BadSerializationTest.java 8039082 generic-all
+java/awt/Focus/ChoiceFocus/ChoiceFocus.java 8169103 windows-all
+java/awt/event/KeyEvent/CorrectTime/CorrectTime.java 6626492 generic-all
+java/awt/Frame/MaximizedToUnmaximized/MaximizedToUnmaximized.java 8129569 generic-all
+java/awt/EventQueue/6980209/bug6980209.java 8131670 generic-all
+java/awt/event/InputEvent/EventWhenTest/EventWhenTest.java 8168646 generic-all
+java/awt/Mixing/AWT_Mixing/OpaqueOverlappingChoice.java 8048171 generic-all
+java/awt/Focus/ActualFocusedWindowTest/ActualFocusedWindowRetaining.java 6829264 generic-all
+java/awt/datatransfer/DragImage/MultiResolutionDragImageTest.java 8080982 generic-all
+java/awt/Toolkit/ScreenInsetsTest/ScreenInsetsTest.java 6829250 windows-all
+java/awt/LightweightComponent/LightweightEventTest/LightweightEventTest.java 8159252 windows-all
+java/awt/EventDispatchThread/HandleExceptionOnEDT/HandleExceptionOnEDT.java 6990210 generic-all
+java/awt/EventDispatchThread/LoopRobustness/LoopRobustness.html 4931413 windows-all
+java/awt/Focus/8073453/AWTFocusTransitionTest.java 8136517 generic-all
+java/awt/FullScreen/FullScreenInsets/FullScreenInsets.java 7019055 windows-all
+java/awt/Focus/8013611/JDK8013611.java 8175366 windows-all
+java/awt/Focus/6981400/Test1.java 8029675 windows-all
+java/awt/Focus/6981400/Test3.java 8173264 generic-all
+java/awt/Mixing/AWT_Mixing/JSplitPaneOverlapping.java 6986109 windows-all
+java/awt/Mixing/AWT_Mixing/JInternalFrameMoveOverlapping.java 6986109 windows-all
+java/awt/event/KeyEvent/ExtendedKeyCode/ExtendedKeyCodeTest.java 8169476 windows-all
+java/awt/event/KeyEvent/KeyChar/KeyCharTest.java 8169474 windows-all
+java/awt/event/MouseEvent/SpuriousExitEnter/SpuriousExitEnter_3.java 6854300 generic-all
+java/awt/event/KeyEvent/ExtendedModifiersTest/ExtendedModifiersTest.java 8129778 generic-all
+java/awt/event/KeyEvent/KeyMaskTest/KeyMaskTest.java 8129778 generic-all
+java/awt/event/MouseEvent/MouseButtonsAndKeyMasksTest/MouseButtonsAndKeyMasksTest.java 8129778 generic-all
+java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFAppModal2Test.java 8058813 windows-all
+
+
 ############################################################################
 
 # jdk_beans
@@ -223,8 +269,6 @@
 ############################################################################
 
 # jdk_sound
-javax/sound/sampled/AudioInputStream/FrameLengthAfterConversion.java 8178401 windows-all
-
 javax/sound/sampled/DirectAudio/bug6372428.java                      8055097 generic-all
 javax/sound/sampled/Clip/bug5070081.java                             8055097 generic-all
 javax/sound/sampled/DataLine/LongFramePosition.java                  8055097 generic-all
@@ -241,6 +285,19 @@
 
 # jdk_swing
 
+javax/swing/JComponent/7154030/bug7154030.java 7190978 generic-all
+javax/swing/JInternalFrame/8160248/JInternalFrameDraggingTest.java 8186513 generic-all
+javax/swing/JComboBox/ConsumedKeyTest/ConsumedKeyTest.java 8067986 generic-all
+javax/swing/JComponent/6683775/bug6683775.java 8172337 generic-all
+javax/swing/JComboBox/6236162/bug6236162.java 8028707 windows-all
+javax/swing/text/html/parser/Test8017492.java 8022535 generic-all
+javax/swing/JWindow/ShapedAndTranslucentWindows/PerPixelTranslucentCanvas.java 8081476 windows-all
+# The next test below is an intermittent failure
+javax/swing/JComboBox/8033069/bug8033069ScrollBar.java 8163367 generic-all
+javax/swing/JColorChooser/Test6541987.java 8143021 linux-all
+javax/swing/JTable/7124218/SelectEditTableCell.java 8148958 linux-all
+javax/swing/JTree/DnD/LastNodeLowerHalfDrop.java 8159131 linux-all
+
 ############################################################################
 
 # jdk_text
--- a/test/jdk/TEST.groups	Wed Dec 13 16:16:17 2017 +0000
+++ b/test/jdk/TEST.groups	Wed Dec 13 10:25:38 2017 -0800
@@ -354,6 +354,18 @@
 jdk_client_sanity = \
     sanity/client/SwingSet
 
+# This test group represents a subset of tests which are expected to
+# exercise most of the most commonly used code in Swing applications.
+# New failures in this area may be a problem.
+jdk_swing_core = \
+     :jdk_client_sanity \
+     javax/swing
+
+# The most commonly used printing APIs are included here along with swing core.
+jdk_desktop_core = \
+    :jdk_swing_core \
+    java/awt/print
+
 ###############################################################################
 #
 # Serviceability sanity groups
--- a/test/jdk/com/sun/java/swing/plaf/windows/Test8173145.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/test/jdk/com/sun/java/swing/plaf/windows/Test8173145.java	Wed Dec 13 10:25:38 2017 -0800
@@ -23,6 +23,7 @@
 
 /* @test
    @bug 8173145
+   @requires (os.family == "windows")
    @summary Menu is activated after using mnemonic Alt/Key combination
    @modules java.desktop/com.sun.java.swing.plaf.windows
    @run main Test8173145
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/awt/FileDialog/FileDialogMemoryLeak/FileDialogLeakTest.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,72 @@
+/*
+ * 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.awt.*;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @test
+ * @bug 8177758
+ * @requires os.family == "windows"
+ * @summary Regression in java.awt.FileDialog
+ * @run main FileDialogLeakTest
+ */
+
+public class FileDialogLeakTest {
+    static CountDownLatch latch = new CountDownLatch(3);
+    static boolean passed;
+
+    public static void main(String[] args) throws Exception {
+        test();
+        System.gc();
+        System.runFinalization();
+        latch.await(1, TimeUnit.SECONDS);
+        if (!passed) {
+            throw new RuntimeException("Test failed.");
+        }
+    }
+
+    private static void test() throws Exception {
+        FileDialog fd = new FileDialog((Frame) null) {
+            @Override
+            protected void finalize() throws Throwable {
+                System.out.println("Finalize");
+                super.finalize();
+                passed = true;
+                latch.countDown();
+            }
+        };
+
+        new Thread(() -> {
+            latch.countDown();
+            fd.setVisible(true);
+            latch.countDown();
+        }).start();
+        latch.await(1, TimeUnit.SECONDS);
+        fd.dispose();
+        latch.await(1, TimeUnit.SECONDS);
+    }
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/awt/FileDialog/MoveToTrashTest.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,77 @@
+/*
+ * 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 8190515
+  @summary java.awt.Desktop.moveToTrash(File) prompts on Windows 7 but not on Mac.
+  @run main MoveToTrashTest
+*/
+
+import java.io.File;
+import java.awt.Desktop;
+import java.awt.Robot;
+import java.io.IOException;
+import java.awt.AWTException;
+
+public class MoveToTrashTest {
+    private static File file = null;
+    private static boolean fileStatus = false;
+
+    public static void main(String[] args) {
+        try {
+            file = File.createTempFile("TestFile","txt");
+        } catch (IOException ex) {
+            throw new RuntimeException("Test failed. Exception thrown: ", ex);
+        }
+
+        // In case any UI that may pop up while deleting the file would
+        // block this thread until the user actions them. Hence do file
+        // check in a different thread and we assume it takes about sometime
+        // till it deletes the file(or popup) on the main thread.
+        new Thread(null, MoveToTrashTest::checkFileExistence, "FileCheck", 0, false).start();
+        fileStatus = Desktop.getDesktop().moveToTrash(file);
+    }
+
+    private static void checkFileExistence() {
+        Robot robot = null;
+        try {
+            robot = new Robot();
+        } catch (AWTException ex) {
+            throw new RuntimeException("Test failed. Exception thrown: ", ex);
+        }
+
+        robot.delay(1500);
+
+        if(!fileStatus) {
+            throw new RuntimeException("Test failed due to error while deleting the file");
+        } else {
+            if(file.exists()) {
+                throw new RuntimeException("Test failed");
+            } else {
+                System.out.println("Test passed");
+            }
+        }
+    }
+}
+
--- a/test/jdk/java/awt/Toolkit/Headless/HeadlessToolkit.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/test/jdk/java/awt/Toolkit/Headless/HeadlessToolkit.java	Wed Dec 13 10:25:38 2017 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2014, 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
@@ -118,6 +118,15 @@
 
         exceptions = false;
         try {
+            int km = tk.getMenuShortcutKeyMaskEx();
+        } catch (HeadlessException e) {
+            exceptions = true;
+        }
+        if (!exceptions)
+            throw new RuntimeException("HeadlessException did not occur when expected");
+
+        exceptions = false;
+        try {
             boolean state = tk.getLockingKeyState(KeyEvent.VK_CAPS_LOCK);
         } catch (HeadlessException e) {
             exceptions = true;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/awt/TrayIcon/TrayIconPopup/TrayIconPopupClickTest.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,124 @@
+/*
+ * 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.awt.TrayIcon;
+import java.awt.SystemTray;
+import java.awt.EventQueue;
+import java.awt.Point;
+import java.awt.AWTException;
+import java.awt.event.MouseEvent;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.InputEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.image.BufferedImage;
+
+/*
+ * @test
+ * @summary Check if a action performed event is received when TrayIcon display
+ *          message is clicked on.
+ * @author Shashidhara Veerabhadraiah (shashidhara.veerabhadraiah@oracle.com)
+ * @modules java.desktop/java.awt:open
+ * @library /java/awt/patchlib
+ * @library ../../../../lib/testlibrary ../
+ * @build java.desktop/java.awt.Helper
+ * @build ExtendedRobot SystemTrayIconHelper
+ * @run main TrayIconPopupClickTest
+ */
+
+public class TrayIconPopupClickTest {
+
+    TrayIcon icon;
+    ExtendedRobot robot;
+    boolean actionPerformed = false;
+
+    public static void main(String[] args) throws Exception {
+        if (!SystemTray.isSupported()) {
+            System.out.println("SystemTray not supported on the platform under test. " +
+                    "Marking the test passed");
+        } else {
+            if (System.getProperty("os.name").toLowerCase().startsWith("win"))
+                System.err.println("Test can fail if the icon hides to a tray icons pool " +
+                        "in Windows 7/10, which is behavior by default.\n" +
+                        "Set \"Right mouse click\" -> \"Customize notification icons\" -> " +
+                        "\"Always show all icons and notifications on the taskbar\" true " +
+                        "to avoid this problem. Or change behavior only for Java SE " +
+                        "tray icon.");
+            new TrayIconPopupClickTest().doTest();
+        }
+    }
+
+    TrayIconPopupClickTest() throws Exception {
+        robot = new ExtendedRobot();
+        EventQueue.invokeAndWait(this::initializeGUI);
+        robot.waitForIdle(1000);
+    }
+
+    private void initializeGUI() {
+        SystemTray tray = SystemTray.getSystemTray();
+        icon = new TrayIcon(new BufferedImage(20, 20, BufferedImage.TYPE_INT_RGB), "Sample Icon");
+        icon.addMouseListener(new MouseAdapter() {
+            public void mousePressed(MouseEvent event) {
+                icon.displayMessage("Sample Icon", "This is a test message for the tray icon", TrayIcon.MessageType.INFO);
+            }
+        });
+
+        try {
+            tray.add(icon);
+        } catch (AWTException e) {
+            throw new RuntimeException(e);
+        }
+
+        icon.getActionCommand();
+        icon.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                actionPerformed = true;
+            }
+        });
+    }
+
+    void doTest() throws Exception {
+
+        Point iconPosition = SystemTrayIconHelper.getTrayIconLocation(icon);
+        if (iconPosition == null)
+            throw new RuntimeException("Unable to find the icon location!");
+
+        robot.mouseMove(iconPosition.x, iconPosition.y);
+        robot.waitForIdle();
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.delay(50);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+        robot.delay(50);
+
+        robot.mouseMove(iconPosition.x, iconPosition.y + 10);
+        robot.waitForIdle();
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.delay(50);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+        robot.delay(50);
+
+        if (!actionPerformed)
+            throw new RuntimeException("FAIL: ActionEvent not triggered when " +
+                    "tray icon message was clicked on");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/awt/image/FilteredImageSourceTest.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,212 @@
+/*
+ * 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 8188083
+ * @summary The test checks whether applying image filters using
+ *          FilteredImageSource results in a NullPointerException.
+ * @run main FilteredImageSourceTest
+ */
+import java.awt.Graphics;
+import java.awt.Image;
+import java.awt.image.ColorModel;
+import java.awt.image.FilteredImageSource;
+import java.awt.image.ImageConsumer;
+import java.awt.image.ImageFilter;
+import java.awt.image.ImageObserver;
+import java.awt.image.ImageProducer;
+import java.util.Hashtable;
+
+/*
+ * An empty image consumer that will be added to the list of consumers
+ * interested in image data for the filtered image.
+ */
+class EmptyImageConsumer implements ImageConsumer {
+    @Override
+    public void setDimensions(int width, int height) {
+    }
+
+    @Override
+    public void setProperties(Hashtable<?, ?> props) {
+    }
+
+    @Override
+    public void setColorModel(ColorModel colorModel) {
+    }
+
+    @Override
+    public void setHints(int hintFlags) {
+    }
+
+    @Override
+    public void setPixels(int x, int y, int width, int height,
+                          ColorModel colorModel, byte[] pixels,
+                          int offset, int scanSize) {
+    }
+
+    @Override
+    public void setPixels(int x, int y, int width, int height,
+                          ColorModel colorModel, int[] pixels,
+                          int offset, int scanSize) {
+    }
+
+    @Override
+    public void imageComplete(int i) {
+    }
+}
+
+/*
+ * An empty image producer whose sole purpose is to provide stub methods
+ * that will be invoked while preparing filtered image.
+ */
+class EmptyImageProducer implements ImageProducer {
+    @Override
+    public void addConsumer(ImageConsumer imageConsumer) {
+    }
+
+    @Override
+    public boolean isConsumer(ImageConsumer imageConsumer) {
+        return false;
+    }
+
+    @Override
+    public void removeConsumer(ImageConsumer imageConsumer) {
+    }
+
+    @Override
+    public void startProduction(ImageConsumer imageConsumer) {
+    }
+
+    @Override
+    public void requestTopDownLeftRightResend(ImageConsumer imageConsumer) {
+    }
+}
+
+/*
+ * Typically, an Image object will contain an ImageProducer that prepares
+ * image data. FilteredImageSource will be set as image producer for images
+ * that require image filter applied to image data.
+ */
+class EmptyFilteredImage extends Image {
+    ImageFilter filter = null;
+    ImageProducer producer = null;
+
+    public EmptyFilteredImage(ImageProducer imgSource) {
+        filter = new ImageFilter();
+        producer = new FilteredImageSource(imgSource, filter);
+    }
+
+    @Override
+    public int getWidth(ImageObserver observer) {
+        return 100;
+    }
+
+    @Override
+    public int getHeight(ImageObserver observer) {
+        return 100;
+    }
+
+    @Override
+    public ImageProducer getSource() {
+        return producer;
+    }
+
+    @Override
+    public Graphics getGraphics() {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public Object getProperty(String name, ImageObserver observer) {
+        return null;
+    }
+}
+
+public final class FilteredImageSourceTest {
+    // Minimum test duration in ms
+    private static final int TEST_MIN_DURATION = 5000;
+
+    /*
+     * A throwable object that will hold any exception generated while
+     * executing methods on FilteredImageSource. The test passes if the
+     * methods execute without any exception
+     */
+    private static volatile Throwable fail = null;
+
+    public static void main(final String[] args)
+            throws InterruptedException {
+        final ImageConsumer ic = new EmptyImageConsumer();
+        final ImageProducer ip = new EmptyImageProducer();
+        final Image image = new EmptyFilteredImage(ip);
+
+        /*
+         * Simulate the framework's operations on FilteredImageSource by
+         * invoking the concerned methods in multiple threads and observe
+         * whether exceptions are generated.
+         */
+        Thread t1 = new Thread(() -> {
+            try {
+                while (true) {
+                    image.getSource().addConsumer(ic);
+                }
+            } catch (Throwable t) {
+                fail = t;
+            }
+        });
+        t1.setDaemon(true);
+
+        Thread t2 = new Thread(() -> {
+            try {
+                while (true) {
+                    image.getSource().removeConsumer(ic);
+                }
+            } catch (Throwable t) {
+                fail = t;
+            }
+        });
+        t2.setDaemon(true);
+
+        Thread t3 = new Thread(() -> {
+            try {
+                while (true) {
+                    image.getSource().startProduction(ic);
+                }
+            } catch (Throwable t) {
+                fail = t;
+            }
+        });
+        t3.setDaemon(true);
+
+        // Start the threads
+        t1.start();
+        t2.start();
+        t3.start();
+
+        // Wait on one of the threads for a specific duration.
+        t1.join(TEST_MIN_DURATION);
+        if (fail != null) {
+            throw new RuntimeException("Test failed with exception: ", fail);
+        }
+    }
+}
\ No newline at end of file
--- a/test/jdk/java/awt/print/PageFormat/WrongPaperPrintingTest.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/test/jdk/java/awt/print/PageFormat/WrongPaperPrintingTest.java	Wed Dec 13 10:25:38 2017 -0800
@@ -22,9 +22,8 @@
  */
 
 /* @test
-   @bug 8167102
+   @bug 8167102 8181659
    @summary PrintRequestAttributeSet breaks page size set using PageFormat
-   @ignore Exclude the test until 8167102 is resolved by a new reassessed fix
    @run main/manual WrongPaperPrintingTest
  */
 
--- a/test/jdk/javax/sound/sampled/AudioInputStream/FrameLengthAfterConversion.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/test/jdk/javax/sound/sampled/AudioInputStream/FrameLengthAfterConversion.java	Wed Dec 13 10:25:38 2017 -0800
@@ -49,7 +49,7 @@
 
 /**
  * @test
- * @bug 8038139
+ * @bug 8038139 8178401
  */
 public final class FrameLengthAfterConversion {
 
--- a/test/jdk/javax/swing/JButton/4796987/bug4796987.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/test/jdk/javax/swing/JButton/4796987/bug4796987.java	Wed Dec 13 10:25:38 2017 -0800
@@ -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
@@ -24,6 +24,7 @@
 /*
  * @test
  * @bug 4796987
+ * @requires (os.family == "windows")
  * @summary XP Only: JButton.setBorderPainted() does not work with XP L&F
  * @author Alexander Scherbatiy
  * @library ../../regtesthelpers
--- a/test/jdk/javax/swing/JComboBox/4199622/bug4199622.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/test/jdk/javax/swing/JComboBox/4199622/bug4199622.java	Wed Dec 13 10:25:38 2017 -0800
@@ -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
@@ -25,6 +25,7 @@
    @test
    @key headful
    @bug 4199622
+   @requires (os.family == "windows")
    @summary RFE: JComboBox shouldn't send ActionEvents for keyboard navigation
    @author Vladislav Karnaukhov
    @library ../../../../lib/testlibrary
--- a/test/jdk/javax/swing/JComboBox/8015300/Test8015300.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/test/jdk/javax/swing/JComboBox/8015300/Test8015300.java	Wed Dec 13 10:25:38 2017 -0800
@@ -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
@@ -39,6 +39,7 @@
  * @test
  * @key headful
  * @bug 8015300
+   @requires (os.family == "windows")
  * @summary Tests that editable combobox selects all text.
  * @author Sergey Malenkov
  * @library ../../../../lib/testlibrary/
--- a/test/jdk/javax/swing/JFileChooser/4847375/bug4847375.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/test/jdk/javax/swing/JFileChooser/4847375/bug4847375.java	Wed Dec 13 10:25:38 2017 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 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,6 +24,7 @@
 /*
  * @test
  * @bug 4847375 8171363
+ * @requires (os.family == "windows")
  * @summary JFileChooser Create New Folder button is disabled incorrectly
  * @author Pavel Porvatov
  * @modules java.desktop/sun.awt
--- a/test/jdk/javax/swing/JFileChooser/8046391/bug8046391.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/test/jdk/javax/swing/JFileChooser/8046391/bug8046391.java	Wed Dec 13 10:25:38 2017 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2015, 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
@@ -24,6 +24,7 @@
 /*
  * @test
  * @bug 8046391
+ * @requires (os.family == "windows")
  * @summary JFileChooser hangs if displayed in Windows L&F
  * @author Alexey Ivanov
  * @library ../../../../lib/testlibrary
--- a/test/jdk/javax/swing/JInternalFrame/6725409/bug6725409.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/test/jdk/javax/swing/JInternalFrame/6725409/bug6725409.java	Wed Dec 13 10:25:38 2017 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2015, 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
@@ -24,6 +24,7 @@
 /* @test
  * @key headful
  * @bug 6725409
+ * @requires (os.family == "windows")
  * @summary Checks that JInternalFrame's system menu
  *          can be localized during run-time
  * @author Mikhail Lapshin
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/javax/swing/JList/BasicListTest.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,125 @@
+/*
+ * 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 8191639
+ * @headful
+ * @summary  Verifies no NPE is thrown wjen pageup/down is pressed in a JList
+ * @run main BasicListTest
+ */
+
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.Robot;
+import java.awt.event.InputEvent;
+import java.awt.event.KeyEvent;
+import javax.swing.JFrame;
+import javax.swing.JList;
+import javax.swing.JScrollPane;
+import javax.swing.SwingUtilities;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+
+class MyList extends JList {
+    // I need this to be able to unselect when clicking outside list content
+    @Override
+    public int locationToIndex(final Point location) {
+        final int n = super.locationToIndex(location);
+        //return n;
+        final Rectangle q = getCellBounds(n, n);
+        return q != null && q.contains(location)?n:-1;
+    }
+}
+
+public class BasicListTest {
+    private static void initComponents() {
+        f = new JFrame();
+        jScrollPane1 = new JScrollPane();
+        list1 = new MyList();
+
+        f.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
+
+        list1.setModel(new javax.swing.AbstractListModel() {
+            String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
+            @Override
+            public int getSize() { return strings.length; }
+            @Override
+            public Object getElementAt(int i) { return strings[i]; }
+        });
+        jScrollPane1.setViewportView(list1);
+
+        f.getContentPane().add(jScrollPane1, java.awt.BorderLayout.CENTER);
+
+        f.pack();
+        f.setVisible(true);
+        p = list1.getLocationOnScreen();
+    }
+
+    private static void setLookAndFeel(final UIManager.LookAndFeelInfo laf) {
+        try {
+            UIManager.setLookAndFeel(laf.getClassName());
+        } catch (ClassNotFoundException | InstantiationException |
+                 UnsupportedLookAndFeelException | IllegalAccessException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    public static void main(String args[]) throws Exception {
+        for (UIManager.LookAndFeelInfo laf : UIManager.getInstalledLookAndFeels()) {
+            try {
+                SwingUtilities.invokeAndWait(() -> setLookAndFeel(laf));
+                System.out.println("Test for LookAndFeel " + laf.getClassName());
+                SwingUtilities.invokeAndWait(() -> {
+                    initComponents();
+                });
+                System.out.println("Test passed for LookAndFeel " + laf.getClassName());
+            }  catch (Exception e) {
+                throw new RuntimeException(e);
+            }
+
+            Robot robot = new Robot();
+            robot.setAutoDelay(200);
+            robot.mouseMove(p.x, p.y);
+            robot.waitForIdle();
+            robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
+            robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
+            robot.waitForIdle();
+            robot.keyPress(KeyEvent.VK_PAGE_DOWN);
+            robot.keyRelease(KeyEvent.VK_PAGE_DOWN);
+
+            try {
+                Thread.sleep(1000);
+            } catch (InterruptedException ex) {
+            }
+            SwingUtilities.invokeAndWait(() -> {
+                f.dispose();
+            });
+        }
+    }
+
+    private static JScrollPane jScrollPane1;
+    private static MyList list1;
+    private static Point p;
+    private static JFrame f;
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/javax/swing/JList/ListSelectionModelTest.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,128 @@
+/*
+ * 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
+ * @key headful
+ * @bug 8191436
+ * @summary Tests JListSelectionModel setSelection functionality
+ */
+
+import javax.swing.JList;
+import javax.swing.DefaultListModel;
+import javax.swing.ListSelectionModel;
+import javax.swing.SwingUtilities;
+import javax.swing.UIManager.LookAndFeelInfo;
+
+import static javax.swing.UIManager.getInstalledLookAndFeels;
+import static javax.swing.UIManager.setLookAndFeel;
+
+import java.util.Arrays;
+
+public class ListSelectionModelTest {
+
+    public static void main(String[] args) throws Exception {
+
+        final LookAndFeelInfo[] lookAndFeelInfoArray =
+                getInstalledLookAndFeels();
+
+        for (LookAndFeelInfo lookAndFeelInfo : lookAndFeelInfoArray) {
+            SwingUtilities.invokeAndWait(new Runnable() {
+                @Override
+                public void run() {
+                    try {
+                        CreateGUIAndTest(lookAndFeelInfo.getClassName());
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                        throw new RuntimeException("Exception while running test");
+                    }
+                }
+            });
+        }
+    }
+
+    static void CreateGUIAndTest(String lookAndFeel) throws Exception{
+        setLookAndFeel(lookAndFeel);
+        DefaultListModel listModel = new DefaultListModel();
+        for (int j = 0; j < 10; j++) {
+            listModel.add(j, "Item: " + j);
+        }
+
+        JList list = new JList(listModel);
+
+        ListSelectionModel selectionModel = list.getSelectionModel();
+        selectionModel.setSelectionMode(
+                ListSelectionModel.SINGLE_INTERVAL_SELECTION);
+        selectionModel.setSelectionInterval(0, 1);
+        checkSelection(list, new int[]{0, 1}, lookAndFeel);
+
+        selectionModel.setSelectionMode(
+                ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
+        selectionModel.setSelectionInterval(0, 2);
+        checkSelection(list, new int[]{0, 1, 2}, lookAndFeel);
+
+        selectionModel.addSelectionInterval(5, 7);
+        checkSelection(list, new int[]{0, 1, 2, 5, 6, 7}, lookAndFeel);
+
+        selectionModel
+                .setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
+        checkSelection(list, new int[]{0, 1, 2}, lookAndFeel);
+
+        selectionModel.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+        checkSelection(list, new int[]{0}, lookAndFeel);
+
+        selectionModel
+                .setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
+        selectionModel.addSelectionInterval(4, 5);
+        checkSelection(list, new int[]{4, 5}, lookAndFeel);
+
+        selectionModel.addSelectionInterval(0, 2);
+        checkSelection(list, new int[]{0, 1, 2}, lookAndFeel);
+
+        selectionModel.setSelectionMode(
+                ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
+        selectionModel.addSelectionInterval(6, 7);
+        checkSelection(list, new int[]{0, 1, 2, 6, 7}, lookAndFeel);
+
+        System.out.println("Test passed for " + lookAndFeel);
+    }
+
+    static void checkSelection(JList list, int[] selectionArray,
+                               String lookAndFeel) throws RuntimeException {
+        int[] listSelection = list.getSelectedIndices();
+        if (listSelection.length != selectionArray.length) {
+            System.out.println("Expected: " + Arrays.toString(selectionArray));
+            System.out.println("Actual: " + Arrays.toString(listSelection));
+            throw new RuntimeException("Wrong selection for " + lookAndFeel);
+        }
+
+        Arrays.sort(listSelection);
+        Arrays.sort(selectionArray);
+
+        if (!Arrays.equals(listSelection, selectionArray)) {
+            System.out.println("Expected: " + Arrays.toString(selectionArray));
+            System.out.println("Actual: " + Arrays.toString(listSelection));
+            throw new RuntimeException("Wrong selection for " + lookAndFeel);
+        }
+    }
+}
--- a/test/jdk/javax/swing/JProgressBar/7141573/bug7141573.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/test/jdk/javax/swing/JProgressBar/7141573/bug7141573.java	Wed Dec 13 10:25:38 2017 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 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,6 +23,7 @@
 
 /* @test
    @bug 7141573
+   @requires (os.family == "windows")
    @summary JProgressBar resize exception, if setStringPainted in Windows LAF
    @author Pavel Porvatov
 */
--- a/test/jdk/javax/swing/JSlider/6524424/bug6524424.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/test/jdk/javax/swing/JSlider/6524424/bug6524424.java	Wed Dec 13 10:25:38 2017 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2015, 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
@@ -23,6 +23,7 @@
 
 /* @test
  * @bug 6524424
+ * @requires (os.family == "windows")
  * @summary JSlider Clicking In Tracks Behavior Inconsistent For Different Tick Spacings
  * @author Pavel Porvatov
  * @modules java.desktop/com.sun.java.swing.plaf.windows
--- a/test/jdk/javax/swing/JSlider/6579827/bug6579827.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/test/jdk/javax/swing/JSlider/6579827/bug6579827.java	Wed Dec 13 10:25:38 2017 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 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
@@ -23,6 +23,7 @@
 
 /* @test
  * @bug 6579827
+ * @requires (os.family == "windows")
  * @summary vista : JSlider on JColorchooser is not properly render or can't be seen completely
  * @author Pavel Porvatov
  * @library ../../../../lib/testlibrary
--- a/test/jdk/javax/swing/JTree/8004298/bug8004298.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/test/jdk/javax/swing/JTree/8004298/bug8004298.java	Wed Dec 13 10:25:38 2017 -0800
@@ -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
@@ -25,6 +25,7 @@
  * @test
  * @key headful
  * @bug 8004298
+ * @requires (os.family == "windows")
  * @summary NPE in WindowsTreeUI.ensureRowsAreVisible
  * @author Alexander Scherbatiy
  * @library ../../regtesthelpers
--- a/test/jdk/javax/swing/border/Test4856008.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/test/jdk/javax/swing/border/Test4856008.java	Wed Dec 13 10:25:38 2017 -0800
@@ -24,6 +24,7 @@
 /*
  * @test
  * @bug 4856008 7025987
+ * @requires (os.family == "windows")
  * @summary Tests border insets
  * @author Sergey Malenkov
  * @modules java.desktop/com.sun.java.swing.plaf.motif
--- a/test/jdk/javax/swing/border/Test6978482.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/test/jdk/javax/swing/border/Test6978482.java	Wed Dec 13 10:25:38 2017 -0800
@@ -24,6 +24,7 @@
 /*
  * @test
  * @bug 6978482 7025987
+ * @requires (os.family == "windows")
  * @summary Tests unchecked casts
  * @author Sergey Malenkov
  * @modules java.desktop/com.sun.java.swing.plaf.motif
--- a/test/jdk/sanity/client/SwingSet/src/ProgressBarDemoTest.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/test/jdk/sanity/client/SwingSet/src/ProgressBarDemoTest.java	Wed Dec 13 10:25:38 2017 -0800
@@ -29,6 +29,7 @@
 import org.testng.annotations.Test;
 import org.netbeans.jemmy.ClassReference;
 import org.netbeans.jemmy.ComponentChooser;
+import org.netbeans.jemmy.Timeouts;
 import org.netbeans.jemmy.operators.JButtonOperator;
 import org.netbeans.jemmy.operators.JFrameOperator;
 import org.netbeans.jemmy.operators.JProgressBarOperator;
@@ -47,11 +48,13 @@
  *          java.logging
  * @build org.jemmy2ext.JemmyExt
  * @build com.sun.swingset3.demos.progressbar.ProgressBarDemo
- * @run testng ProgressBarDemoTest
+ * @run testng/timeout=240 ProgressBarDemoTest
  */
 @Listeners(GuiTestListener.class)
 public class ProgressBarDemoTest {
 
+    private final static long PROGRESS_BAR_TIMEOUT = 180000;
+
     @Test
     public void test() throws Exception {
 
@@ -147,9 +150,15 @@
 
     // Check progess bar progression and start/stop button disabled/enabled states
     public void checkCompleteProgress(JFrameOperator frame, JButtonOperator startButton, JButtonOperator stopButton, JProgressBarOperator progressBar) throws Exception {
+        Timeouts timeouts = progressBar.getTimeouts();
+        long defaultTimeout = timeouts.getTimeout("ComponentOperator.WaitStateTimeout");
         startButton.pushNoBlock();
 
+        // Set progress bar timeout as 3 minutes as it take long time to reach maximum
+        timeouts.setTimeout("ComponentOperator.WaitStateTimeout", PROGRESS_BAR_TIMEOUT);
         progressBar.waitValue(progressBar.getMaximum());
+        // Reset timeout to default timeout value
+        timeouts.setTimeout("ComponentOperator.WaitStateTimeout", defaultTimeout);
 
         startButton.waitComponentEnabled();
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/sun/java2d/marlin/ClipShapeTest.java	Wed Dec 13 10:25:38 2017 -0800
@@ -0,0 +1,865 @@
+/*
+ * 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.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.awt.Shape;
+import java.awt.Stroke;
+import java.awt.geom.Ellipse2D;
+import java.awt.geom.Path2D;
+import java.awt.geom.PathIterator;
+import java.awt.image.BufferedImage;
+import java.awt.image.DataBufferInt;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.Locale;
+import java.util.Random;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.logging.Handler;
+import java.util.logging.LogRecord;
+import java.util.logging.Logger;
+import javax.imageio.IIOImage;
+import javax.imageio.ImageIO;
+import javax.imageio.ImageWriteParam;
+import javax.imageio.ImageWriter;
+import javax.imageio.stream.ImageOutputStream;
+
+/**
+ * @test
+ * @bug 8191814
+ * @summary Verifies that Marlin rendering generates the same
+ * images with and without clipping optimization with all possible
+ * stroke (cap/join) and fill modes (EO rules)
+ * Note: Use the argument -slow to run more intensive tests (too much time)
+ * @run main/othervm/timeout=120 -Dsun.java2d.renderer=sun.java2d.marlin.MarlinRenderingEngine ClipShapeTest
+ * @run main/othervm/timeout=120 -Dsun.java2d.renderer=sun.java2d.marlin.DMarlinRenderingEngine ClipShapeTest
+ */
+public final class ClipShapeTest {
+
+    static final boolean TEST_STROKER = true;
+    static final boolean TEST_FILLER = true;
+
+    // complementary tests in slow mode:
+    static boolean USE_DASHES = false;
+    static boolean USE_VAR_STROKE = false;
+
+    static int NUM_TESTS = 5000;
+    static final int TESTW = 100;
+    static final int TESTH = 100;
+
+    // shape settings:
+    static final ShapeMode SHAPE_MODE = ShapeMode.NINE_LINE_POLYS;
+    static final boolean SHAPE_REPEAT = true;
+
+    // dump path on console:
+    static final boolean DUMP_SHAPE = true;
+
+    static final boolean SHOW_DETAILS = true;
+    static final boolean SHOW_OUTLINE = true;
+    static final boolean SHOW_POINTS = true;
+    static final boolean SHOW_INFO = false;
+
+    static final int MAX_SHOW_FRAMES = 10;
+
+    // use fixed seed to reproduce always same polygons between tests
+    static final boolean FIXED_SEED = false;
+    static final double RAND_SCALE = 3.0;
+    static final double RANDW = TESTW * RAND_SCALE;
+    static final double OFFW = (TESTW - RANDW) / 2.0;
+    static final double RANDH = TESTH * RAND_SCALE;
+    static final double OFFH = (TESTH - RANDH) / 2.0;
+
+    static enum ShapeMode {
+        TWO_CUBICS,
+        FOUR_QUADS,
+        FIVE_LINE_POLYS,
+        NINE_LINE_POLYS,
+        FIFTY_LINE_POLYS,
+        MIXED
+    }
+
+    static final long SEED = 1666133789L;
+    // Fixed seed to avoid any difference between runs:
+    static final Random RANDOM = new Random(SEED);
+
+    static final File OUTPUT_DIR = new File(".");
+
+    /**
+     * Test
+     * @param args
+     */
+    public static void main(String[] args) {
+        boolean runSlowTests = (args.length != 0 && "-slow".equals(args[0]));
+
+        if (runSlowTests) {
+            NUM_TESTS = 20000; // or 100000 (very slow)
+            USE_DASHES = true;
+            USE_VAR_STROKE = true;
+        }
+
+        Locale.setDefault(Locale.US);
+
+        // Get Marlin runtime state from its log:
+        final AtomicBoolean isMarlin = new AtomicBoolean();
+        final AtomicBoolean isClipRuntime = new AtomicBoolean();
+
+        // initialize j.u.l Looger:
+        final Logger log = Logger.getLogger("sun.java2d.marlin");
+        log.addHandler(new Handler() {
+            @Override
+            public void publish(LogRecord record) {
+                final String msg = record.getMessage();
+                if (msg != null) {
+                    // last space to avoid matching other settings:
+                    if (msg.startsWith("sun.java2d.renderer ")) {
+                        isMarlin.set(msg.contains("MarlinRenderingEngine"));
+                    }
+                    if (msg.startsWith("sun.java2d.renderer.clip.runtime.enable")) {
+                        isClipRuntime.set(msg.contains("true"));
+                    }
+                }
+
+                final Throwable th = record.getThrown();
+                // detect any Throwable:
+                if (th != null) {
+                    System.out.println("Test failed:\n" + record.getMessage());
+                    th.printStackTrace(System.out);
+
+                    throw new RuntimeException("Test failed: ", th);
+                }
+            }
+
+            @Override
+            public void flush() {
+            }
+
+            @Override
+            public void close() throws SecurityException {
+            }
+        });
+
+        // enable Marlin logging & internal checks:
+        System.setProperty("sun.java2d.renderer.log", "true");
+        System.setProperty("sun.java2d.renderer.useLogger", "true");
+
+        // disable static clipping setting:
+        System.setProperty("sun.java2d.renderer.clip", "false");
+        System.setProperty("sun.java2d.renderer.clip.runtime.enable", "true");
+
+        System.out.println("ClipShapeTests: image = " + TESTW + " x " + TESTH);
+
+        int failures = 0;
+        final long start = System.nanoTime();
+        try {
+            // TODO: test affine transforms ?
+
+            if (TEST_STROKER) {
+                final float[][] dashArrays = (USE_DASHES)
+                        ? new float[][]{null, new float[]{1f, 2f}}
+                        : new float[][]{null};
+
+                System.out.println("dashes: " + Arrays.toString(dashArrays));
+
+                final float[] strokeWidths = (USE_VAR_STROKE)
+                        ? new float[5] : new float[]{8f};
+
+                int nsw = 0;
+                if (USE_VAR_STROKE) {
+                    for (float width = 0.1f; width < 110f; width *= 5f) {
+                        strokeWidths[nsw++] = width;
+                    }
+                } else {
+                    nsw = 1;
+                }
+
+                System.out.println("stroke widths: " + Arrays.toString(strokeWidths));
+
+                // Stroker tests:
+                for (int w = 0; w < nsw; w++) {
+                    final float width = strokeWidths[w];
+
+                    for (float[] dashes : dashArrays) {
+
+                        for (int cap = 0; cap <= 2; cap++) {
+
+                            for (int join = 0; join <= 2; join++) {
+
+                                failures += paintPaths(new TestSetup(SHAPE_MODE, false, width, cap, join, dashes));
+                                failures += paintPaths(new TestSetup(SHAPE_MODE, true, width, cap, join, dashes));
+                            }
+                        }
+                    }
+                }
+            }
+
+            if (TEST_FILLER) {
+                // Filler tests:
+                failures += paintPaths(new TestSetup(SHAPE_MODE, false, Path2D.WIND_NON_ZERO));
+                failures += paintPaths(new TestSetup(SHAPE_MODE, true, Path2D.WIND_NON_ZERO));
+
+                failures += paintPaths(new TestSetup(SHAPE_MODE, false, Path2D.WIND_EVEN_ODD));
+                failures += paintPaths(new TestSetup(SHAPE_MODE, true, Path2D.WIND_EVEN_ODD));
+            }
+        } catch (IOException ioe) {
+            throw new RuntimeException(ioe);
+        }
+        System.out.println("main: duration= " + (1e-6 * (System.nanoTime() - start)) + " ms.");
+
+        if (!isMarlin.get()) {
+            throw new RuntimeException("Marlin renderer not used at runtime !");
+        }
+        if (!isClipRuntime.get()) {
+            throw new RuntimeException("Marlin clipping not enabled at runtime !");
+        }
+        if (failures != 0) {
+            throw new RuntimeException("Clip test failures : " + failures);
+        }
+    }
+
+    static int paintPaths(final TestSetup ts) throws IOException {
+        final long start = System.nanoTime();
+
+        if (FIXED_SEED) {
+            // Reset seed for random numbers:
+            RANDOM.setSeed(SEED);
+        }
+
+        System.out.println("paintPaths: " + NUM_TESTS
+                + " paths (" + SHAPE_MODE + ") - setup: " + ts);
+
+        final boolean fill = !ts.isStroke();
+        final Path2D p2d = new Path2D.Double(ts.windingRule);
+
+        final BufferedImage imgOn = newImage(TESTW, TESTH);
+        final Graphics2D g2dOn = initialize(imgOn, ts);
+
+        final BufferedImage imgOff = newImage(TESTW, TESTH);
+        final Graphics2D g2dOff = initialize(imgOff, ts);
+
+        final BufferedImage imgDiff = newImage(TESTW, TESTH);
+
+        final DiffContext globalCtx = new DiffContext("All tests");
+
+        int nd = 0;
+        try {
+            final DiffContext testCtx = new DiffContext("Test");
+            BufferedImage diffImage;
+
+            for (int n = 0; n < NUM_TESTS; n++) {
+                genShape(p2d, ts);
+
+                // Runtime clip setting OFF:
+                paintShape(p2d, g2dOff, fill, false);
+
+                // Runtime clip setting ON:
+                paintShape(p2d, g2dOn, fill, true);
+
+                /* compute image difference if possible */
+                diffImage = computeDiffImage(testCtx, imgOn, imgOff, imgDiff, globalCtx);
+
+                final String testName = "Setup_" + ts.id + "_test_" + n;
+
+                if (diffImage != null) {
+                    nd++;
+
+                    final double ratio = (100.0 * testCtx.histPix.count) / testCtx.histAll.count;
+                    System.out.println("Diff ratio: " + testName + " = " + trimTo3Digits(ratio) + " %");
+
+                    if (false) {
+                        saveImage(diffImage, OUTPUT_DIR, testName + "-diff.png");
+                    }
+
+                    if (DUMP_SHAPE) {
+                        dumpShape(p2d);
+                    }
+                    if (nd < MAX_SHOW_FRAMES) {
+                        if (SHOW_DETAILS) {
+                            paintShapeDetails(g2dOff, p2d);
+                            paintShapeDetails(g2dOn, p2d);
+                        }
+
+                        saveImage(imgOff, OUTPUT_DIR, testName + "-off.png");
+                        saveImage(imgOn, OUTPUT_DIR, testName + "-on.png");
+                        saveImage(diffImage, OUTPUT_DIR, testName + "-diff.png");
+                    }
+                }
+            }
+        } finally {
+            g2dOff.dispose();
+            g2dOn.dispose();
+
+            if (nd != 0) {
+                System.out.println("paintPaths: " + NUM_TESTS + " paths - "
+                        + "Number of differences = " + nd
+                        + " ratio = " + (100f * nd) / NUM_TESTS + " %");
+            }
+
+            globalCtx.dump();
+        }
+        System.out.println("paintPaths: duration= " + (1e-6 * (System.nanoTime() - start)) + " ms.");
+        return nd;
+    }
+
+    private static void paintShape(final Path2D p2d, final Graphics2D g2d,
+                                   final boolean fill, final boolean clip) {
+        reset(g2d);
+
+        setClip(g2d, clip);
+
+        if (fill) {
+            g2d.fill(p2d);
+        } else {
+            g2d.draw(p2d);
+        }
+    }
+
+    private static Graphics2D initialize(final BufferedImage img,
+                                         final TestSetup ts) {
+        final Graphics2D g2d = (Graphics2D) img.getGraphics();
+        g2d.setRenderingHint(RenderingHints.KEY_RENDERING,
+                RenderingHints.VALUE_RENDER_QUALITY);
+        g2d.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL,
+                RenderingHints.VALUE_STROKE_PURE);
+
+        if (ts.isStroke()) {
+            g2d.setStroke(createStroke(ts));
+        }
+        g2d.setColor(Color.GRAY);
+
+        return g2d;
+    }
+
+    private static void reset(final Graphics2D g2d) {
+        // Disable antialiasing:
+        g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
+                RenderingHints.VALUE_ANTIALIAS_OFF);
+        g2d.setBackground(Color.WHITE);
+        g2d.clearRect(0, 0, TESTW, TESTH);
+    }
+
+    private static void setClip(final Graphics2D g2d, final boolean clip) {
+        // Enable antialiasing:
+        g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
+                RenderingHints.VALUE_ANTIALIAS_ON);
+
+        // Enable or Disable clipping:
+        System.setProperty("sun.java2d.renderer.clip.runtime", (clip) ? "true" : "false");
+    }
+
+    static void genShape(final Path2D p2d, final TestSetup ts) {
+        p2d.reset();
+
+        final int end = (SHAPE_REPEAT) ? 2 : 1;
+
+        for (int p = 0; p < end; p++) {
+            p2d.moveTo(randX(), randY());
+
+            switch (ts.shapeMode) {
+                case MIXED:
+                case FIFTY_LINE_POLYS:
+                case NINE_LINE_POLYS:
+                case FIVE_LINE_POLYS:
+                    p2d.lineTo(randX(), randY());
+                    p2d.lineTo(randX(), randY());
+                    p2d.lineTo(randX(), randY());
+                    p2d.lineTo(randX(), randY());
+                    if (ts.shapeMode == ShapeMode.FIVE_LINE_POLYS) {
+                        // And an implicit close makes 5 lines
+                        break;
+                    }
+                    p2d.lineTo(randX(), randY());
+                    p2d.lineTo(randX(), randY());
+                    p2d.lineTo(randX(), randY());
+                    p2d.lineTo(randX(), randY());
+                    if (ts.shapeMode == ShapeMode.NINE_LINE_POLYS) {
+                        // And an implicit close makes 9 lines
+                        break;
+                    }
+                    if (ts.shapeMode == ShapeMode.FIFTY_LINE_POLYS) {
+                        for (int i = 0; i < 41; i++) {
+                            p2d.lineTo(randX(), randY());
+                        }
+                        // And an implicit close makes 50 lines
+                        break;
+                    }
+                case TWO_CUBICS:
+                    p2d.curveTo(randX(), randY(), randX(), randY(), randX(), randY());
+                    p2d.curveTo(randX(), randY(), randX(), randY(), randX(), randY());
+                    if (ts.shapeMode == ShapeMode.TWO_CUBICS) {
+                        break;
+                    }
+                case FOUR_QUADS:
+                    p2d.quadTo(randX(), randY(), randX(), randY());
+                    p2d.quadTo(randX(), randY(), randX(), randY());
+                    p2d.quadTo(randX(), randY(), randX(), randY());
+                    p2d.quadTo(randX(), randY(), randX(), randY());
+                    if (ts.shapeMode == ShapeMode.FOUR_QUADS) {
+                        break;
+                    }
+                default:
+            }
+
+            if (ts.closed) {
+                p2d.closePath();
+            }
+        }
+    }
+
+    static final float POINT_RADIUS = 2f;
+    static final float LINE_WIDTH = 1f;
+
+    static final Stroke OUTLINE_STROKE = new BasicStroke(LINE_WIDTH);
+    static final int COLOR_ALPHA = 128;
+    static final Color COLOR_MOVETO = new Color(255, 0, 0, COLOR_ALPHA);
+    static final Color COLOR_LINETO_ODD = new Color(0, 0, 255, COLOR_ALPHA);
+    static final Color COLOR_LINETO_EVEN = new Color(0, 255, 0, COLOR_ALPHA);
+
+    static final Ellipse2D.Float ELL_POINT = new Ellipse2D.Float();
+
+    private static void paintShapeDetails(final Graphics2D g2d, final Shape shape) {
+
+        final Stroke oldStroke = g2d.getStroke();
+        final Color oldColor = g2d.getColor();
+
+        setClip(g2d, false);
+
+        if (SHOW_OUTLINE) {
+            g2d.setStroke(OUTLINE_STROKE);
+            g2d.setColor(COLOR_LINETO_ODD);
+            g2d.draw(shape);
+        }
+
+        final float[] coords = new float[6];
+        float px, py;
+
+        int nMove = 0;
+        int nLine = 0;
+        int n = 0;
+
+        for (final PathIterator it = shape.getPathIterator(null); !it.isDone(); it.next()) {
+            int type = it.currentSegment(coords);
+            switch (type) {
+                case PathIterator.SEG_MOVETO:
+                    if (SHOW_POINTS) {
+                        g2d.setColor(COLOR_MOVETO);
+                    }
+                    break;
+                case PathIterator.SEG_LINETO:
+                    if (SHOW_POINTS) {
+                        g2d.setColor((nLine % 2 == 0) ? COLOR_LINETO_ODD : COLOR_LINETO_EVEN);
+                    }
+                    nLine++;
+                    break;
+                case PathIterator.SEG_CLOSE:
+                    continue;
+                default:
+                    System.out.println("unsupported segment type= " + type);
+                    continue;
+            }
+            px = coords[0];
+            py = coords[1];
+
+            if (SHOW_INFO) {
+                System.out.println("point[" + (n++) + "|seg=" + type + "]: " + px + " " + py);
+            }
+
+            if (SHOW_POINTS) {
+                ELL_POINT.setFrame(px - POINT_RADIUS, py - POINT_RADIUS,
+                        POINT_RADIUS * 2f, POINT_RADIUS * 2f);
+                g2d.fill(ELL_POINT);
+            }
+        }
+        if (SHOW_INFO) {
+            System.out.println("Path moveTo=" + nMove + ", lineTo=" + nLine);
+            System.out.println("--------------------------------------------------");
+        }
+
+        g2d.setStroke(oldStroke);
+        g2d.setColor(oldColor);
+    }
+
+    private static void dumpShape(final Shape shape) {
+        final float[] coords = new float[6];
+
+        for (final PathIterator it = shape.getPathIterator(null); !it.isDone(); it.next()) {
+            final int type = it.currentSegment(coords);
+            switch (type) {
+                case PathIterator.SEG_MOVETO:
+                    System.out.println("p2d.moveTo(" + coords[0] + ", " + coords[1] + ");");
+                    break;
+                case PathIterator.SEG_LINETO:
+                    System.out.println("p2d.lineTo(" + coords[0] + ", " + coords[1] + ");");
+                    break;
+                case PathIterator.SEG_CLOSE:
+                    System.out.println("p2d.closePath();");
+                    break;
+                default:
+                    System.out.println("// Unsupported segment type= " + type);
+            }
+        }
+        System.out.println("--------------------------------------------------");
+    }
+
+    static double randX() {
+        return RANDOM.nextDouble() * RANDW + OFFW;
+    }
+
+    static double randY() {
+        return RANDOM.nextDouble() * RANDH + OFFH;
+    }
+
+    private static BasicStroke createStroke(final TestSetup ts) {
+        return new BasicStroke(ts.strokeWidth, ts.strokeCap, ts.strokeJoin, 10.0f, ts.dashes, 0.0f);
+    }
+
+    private final static class TestSetup {
+
+        static final AtomicInteger COUNT = new AtomicInteger();
+
+        final int id;
+        final ShapeMode shapeMode;
+        final boolean closed;
+        // stroke
+        final float strokeWidth;
+        final int strokeCap;
+        final int strokeJoin;
+        final float[] dashes;
+        // fill
+        final int windingRule;
+
+        TestSetup(ShapeMode shapeMode, final boolean closed,
+                  final float strokeWidth, final int strokeCap, final int strokeJoin, final float[] dashes) {
+            this.id = COUNT.incrementAndGet();
+            this.shapeMode = shapeMode;
+            this.closed = closed;
+            this.strokeWidth = strokeWidth;
+            this.strokeCap = strokeCap;
+            this.strokeJoin = strokeJoin;
+            this.dashes = dashes;
+            this.windingRule = Path2D.WIND_NON_ZERO;
+        }
+
+        TestSetup(ShapeMode shapeMode, final boolean closed, final int windingRule) {
+            this.id = COUNT.incrementAndGet();
+            this.shapeMode = shapeMode;
+            this.closed = closed;
+            this.strokeWidth = 0f;
+            this.strokeCap = this.strokeJoin = -1; // invalid
+            this.dashes = null;
+            this.windingRule = windingRule;
+        }
+
+        boolean isStroke() {
+            return this.strokeWidth > 0f;
+        }
+
+        @Override
+        public String toString() {
+            return "TestSetup{id=" + id + ", shapeMode=" + shapeMode + ", closed=" + closed
+                    + ", strokeWidth=" + strokeWidth + ", strokeCap=" + strokeCap + ", strokeJoin=" + strokeJoin
+                    + ((dashes != null) ? ", dashes: " + Arrays.toString(dashes) : "")
+                    + ", windingRule=" + windingRule + '}';
+        }
+    }
+
+    // --- utilities ---
+    private static final int DCM_ALPHA_MASK = 0xff000000;
+
+    public static BufferedImage newImage(final int w, final int h) {
+        return new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB_PRE);
+    }
+
+    public static BufferedImage computeDiffImage(final DiffContext localCtx,
+                                                 final BufferedImage tstImage,
+                                                 final BufferedImage refImage,
+                                                 final BufferedImage diffImage,
+                                                 final DiffContext globalCtx) {
+
+        final int[] aRefPix = ((DataBufferInt) refImage.getRaster().getDataBuffer()).getData();
+        final int[] aTstPix = ((DataBufferInt) tstImage.getRaster().getDataBuffer()).getData();
+        final int[] aDifPix = ((DataBufferInt) diffImage.getRaster().getDataBuffer()).getData();
+
+        // reset local diff context:
+        localCtx.reset();
+
+        int ref, tst, dg, v;
+        for (int i = 0, len = aRefPix.length; i < len; i++) {
+            ref = aRefPix[i];
+            tst = aTstPix[i];
+
+            // grayscale diff:
+            dg = (r(ref) + g(ref) + b(ref)) - (r(tst) + g(tst) + b(tst));
+
+            // max difference on grayscale values:
+            v = (int) Math.ceil(Math.abs(dg / 3.0));
+
+            aDifPix[i] = toInt(v, v, v);
+
+            localCtx.add(v);
+            globalCtx.add(v);
+        }
+
+        if (!localCtx.isDiff()) {
+            return null;
+        }
+
+        return diffImage;
+    }
+
+    static void saveImage(final BufferedImage image, final File resDirectory, final String imageFileName) throws IOException {
+        final Iterator<ImageWriter> itWriters = ImageIO.getImageWritersByFormatName("PNG");
+        if (itWriters.hasNext()) {
+            final ImageWriter writer = itWriters.next();
+
+            final ImageWriteParam writerParams = writer.getDefaultWriteParam();
+            writerParams.setProgressiveMode(ImageWriteParam.MODE_DISABLED);
+
+            final File imgFile = new File(resDirectory, imageFileName);
+
+            if (!imgFile.exists() || imgFile.canWrite()) {
+                System.out.println("saveImage: saving image as PNG [" + imgFile + "]...");
+                imgFile.delete();
+
+                // disable cache in temporary files:
+                ImageIO.setUseCache(false);
+
+                final long start = System.nanoTime();
+
+                // PNG uses already buffering:
+                final ImageOutputStream imgOutStream = ImageIO.createImageOutputStream(new FileOutputStream(imgFile));
+
+                writer.setOutput(imgOutStream);
+                try {
+                    writer.write(null, new IIOImage(image, null, null), writerParams);
+                } finally {
+                    imgOutStream.close();
+
+                    final long time = System.nanoTime() - start;
+                    System.out.println("saveImage: duration= " + (time / 1000000l) + " ms.");
+                }
+            }
+        }
+    }
+
+    static int r(final int v) {
+        return (v >> 16 & 0xff);
+    }
+
+    static int g(final int v) {
+        return (v >> 8 & 0xff);
+    }
+
+    static int b(final int v) {
+        return (v & 0xff);
+    }
+
+    static int clamp127(final int v) {
+        return (v < 128) ? (v > -127 ? (v + 127) : 0) : 255;
+    }
+
+    static int toInt(final int r, final int g, final int b) {
+        return DCM_ALPHA_MASK | (r << 16) | (g << 8) | b;
+    }
+
+    /* stats */
+    static class StatInteger {
+
+        public final String name;
+        public long count = 0l;
+        public long sum = 0l;
+        public long min = Integer.MAX_VALUE;
+        public long max = Integer.MIN_VALUE;
+
+        StatInteger(String name) {
+            this.name = name;
+        }
+
+        void reset() {
+            count = 0l;
+            sum = 0l;
+            min = Integer.MAX_VALUE;
+            max = Integer.MIN_VALUE;
+        }
+
+        void add(int val) {
+            count++;
+            sum += val;
+            if (val < min) {
+                min = val;
+            }
+            if (val > max) {
+                max = val;
+            }
+        }
+
+        void add(long val) {
+            count++;
+            sum += val;
+            if (val < min) {
+                min = val;
+            }
+            if (val > max) {
+                max = val;
+            }
+        }
+
+        public final double average() {
+            return ((double) sum) / count;
+        }
+
+        @Override
+        public String toString() {
+            final StringBuilder sb = new StringBuilder(128);
+            toString(sb);
+            return sb.toString();
+        }
+
+        public final StringBuilder toString(final StringBuilder sb) {
+            sb.append(name).append("[n: ").append(count);
+            sb.append("] sum: ").append(sum).append(" avg: ").append(trimTo3Digits(average()));
+            sb.append(" [").append(min).append(" | ").append(max).append("]");
+            return sb;
+        }
+
+    }
+
+    final static class Histogram extends StatInteger {
+
+        static final int BUCKET = 2;
+        static final int MAX = 20;
+        static final int LAST = MAX - 1;
+        static final int[] STEPS = new int[MAX];
+
+        static {
+            STEPS[0] = 0;
+            STEPS[1] = 1;
+
+            for (int i = 2; i < MAX; i++) {
+                STEPS[i] = STEPS[i - 1] * BUCKET;
+            }
+//            System.out.println("Histogram.STEPS = " + Arrays.toString(STEPS));
+        }
+
+        static int bucket(int val) {
+            for (int i = 1; i < MAX; i++) {
+                if (val < STEPS[i]) {
+                    return i - 1;
+                }
+            }
+            return LAST;
+        }
+
+        private final StatInteger[] stats = new StatInteger[MAX];
+
+        public Histogram(String name) {
+            super(name);
+            for (int i = 0; i < MAX; i++) {
+                stats[i] = new StatInteger(String.format("%5s .. %5s", STEPS[i], ((i + 1 < MAX) ? STEPS[i + 1] : "~")));
+            }
+        }
+
+        @Override
+        final void reset() {
+            super.reset();
+            for (int i = 0; i < MAX; i++) {
+                stats[i].reset();
+            }
+        }
+
+        @Override
+        final void add(int val) {
+            super.add(val);
+            stats[bucket(val)].add(val);
+        }
+
+        @Override
+        final void add(long val) {
+            add((int) val);
+        }
+
+        @Override
+        public final String toString() {
+            final StringBuilder sb = new StringBuilder(2048);
+            super.toString(sb).append(" { ");
+
+            for (int i = 0; i < MAX; i++) {
+                if (stats[i].count != 0l) {
+                    sb.append("\n        ").append(stats[i].toString());
+                }
+            }
+
+            return sb.append(" }").toString();
+        }
+    }
+
+    /**
+     * Adjust the given double value to keep only 3 decimal digits
+     * @param value value to adjust
+     * @return double value with only 3 decimal digits
+     */
+    static double trimTo3Digits(final double value) {
+        return ((long) (1e3d * value)) / 1e3d;
+    }
+
+    static final class DiffContext {
+
+        public final Histogram histAll;
+        public final Histogram histPix;
+
+        DiffContext(String name) {
+            histAll = new Histogram("All  Pixels [" + name + "]");
+            histPix = new Histogram("Diff Pixels [" + name + "]");
+        }
+
+        void reset() {
+            histAll.reset();
+            histPix.reset();
+        }
+
+        void dump() {
+            if (isDiff()) {
+                System.out.println("Differences [" + histAll.name + "]:");
+                System.out.println("Total [all pixels]:\n" + histAll.toString());
+                System.out.println("Total [different pixels]:\n" + histPix.toString());
+            } else {
+                System.out.println("No difference for [" + histAll.name + "].");
+            }
+        }
+
+        void add(int val) {
+            histAll.add(val);
+            if (val != 0) {
+                histPix.add(val);
+            }
+        }
+
+        boolean isDiff() {
+            return histAll.sum != 0l;
+        }
+    }
+}
--- a/test/langtools/ProblemList.txt	Wed Dec 13 16:16:17 2017 +0000
+++ b/test/langtools/ProblemList.txt	Wed Dec 13 10:25:38 2017 -0800
@@ -38,9 +38,6 @@
 
 jdk/jshell/UserJdiUserRemoteTest.java                                           8173079    linux-all
 jdk/jshell/UserInputTest.java                                                   8169536    generic-all   
-jdk/jshell/StartOptionTest.java                                                 8191455    windows-all 
-jdk/jshell/ToolProviderTest.java                                                8191455    windows-all
-jdk/jshell/ExternalEditorTest.java                                              8191456    generic-all
 
 ###########################################################################
 #
--- a/test/langtools/jdk/jshell/CustomEditor.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/test/langtools/jdk/jshell/CustomEditor.java	Wed Dec 13 10:25:38 2017 -0800
@@ -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
@@ -39,6 +39,7 @@
     public static final int SOURCE_CODE = 0;
     public static final int GET_SOURCE_CODE = 1;
     public static final int REMOVE_CODE = 2;
+    public static final int GET_FILENAME = 3;
 
     public static final int EXIT_CODE = -1;
     public static final int ACCEPT_CODE = -2;
@@ -68,10 +69,7 @@
                     return;
                 }
                 case GET_SOURCE_CODE: {
-                    byte[] bytes = source.getBytes(StandardCharsets.UTF_8);
-                    output.writeInt(bytes.length);
-                    output.write(bytes);
-                    output.flush();
+                    writeString(output, source);
                     break;
                 }
                 case REMOVE_CODE: {
@@ -79,6 +77,10 @@
                     Files.delete(path);
                     break;
                 }
+                case GET_FILENAME: {
+                    writeString(output, path.toString());
+                    break;
+                }
                 case CANCEL_CODE: {
                     return;
                 }
@@ -97,6 +99,13 @@
         }
     }
 
+    private void writeString(DataOutputStream output, String s) throws IOException {
+        byte[] bytes = s.getBytes(StandardCharsets.UTF_8);
+        output.writeInt(bytes.length);
+        output.write(bytes);
+        output.flush();
+    }
+
     public static void main(String[] args) throws IOException {
         if (args.length != 2) {
             System.err.println("Usage: port file");
--- a/test/langtools/jdk/jshell/EditorTestBase.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/test/langtools/jdk/jshell/EditorTestBase.java	Wed Dec 13 10:25:38 2017 -0800
@@ -49,22 +49,22 @@
         test(defaultStartup, args, tests);
     }
 
-    public abstract void assertEdit(boolean after, String cmd,
+    abstract void assertEdit(boolean after, String cmd,
                                     Consumer<String> checkInput, Consumer<String> checkOutput, Action action);
 
-    public void assertEditInput(boolean after, String cmd, Consumer<String> checkInput, Action action) {
+    void assertEditInput(boolean after, String cmd, Consumer<String> checkInput, Action action) {
         assertEdit(after, cmd, checkInput, s -> {}, action);
     }
 
-    public void assertEditOutput(boolean after, String cmd, Consumer<String> checkOutput, Action action) {
+    void assertEditOutput(boolean after, String cmd, Consumer<String> checkOutput, Action action) {
         assertEdit(after, cmd, s -> {}, checkOutput, action);
     }
 
-    public void assertEditInput(boolean after, String cmd, String input, Action action) {
+    void assertEditInput(boolean after, String cmd, String input, Action action) {
         assertEditInput(after, cmd, s -> assertEquals(s, input, "Input"), action);
     }
 
-    public void assertEditOutput(boolean after, String cmd, String output, Action action) {
+    void assertEditOutput(boolean after, String cmd, String output, Action action) {
         assertEditOutput(after, cmd, s -> assertEquals(s.trim(), output.trim(), "command"), action);
     }
 
@@ -245,7 +245,7 @@
         );
     }
 
-    @Test
+    @Test(enabled = false) // TODO JDK-8191875
     public void testStatementMush() {
         testEditor(
                 a -> assertCommand(a, "System.out.println(\"Hello\")",
--- a/test/langtools/jdk/jshell/ExternalEditorTest.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/test/langtools/jdk/jshell/ExternalEditorTest.java	Wed Dec 13 10:25:38 2017 -0800
@@ -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
@@ -24,7 +24,7 @@
 /*
  * @test
  * @summary Testing external editor.
- * @bug 8143955 8080843 8163816 8143006 8169828 8171130
+ * @bug 8143955 8080843 8163816 8143006 8169828 8171130 8162989
  * @modules jdk.jshell/jdk.internal.jshell.tool
  * @build ReplToolTesting CustomEditor EditorTestBase
  * @run testng ExternalEditorTest
@@ -52,6 +52,8 @@
 import org.testng.annotations.Test;
 
 import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertTrue;
 import static org.testng.Assert.fail;
 
 public class ExternalEditorTest extends EditorTestBase {
@@ -76,15 +78,7 @@
 
     @Override
     public String getSource() {
-        try {
-            outputStream.writeInt(CustomEditor.GET_SOURCE_CODE);
-            int length = inputStream.readInt();
-            byte[] bytes = new byte[length];
-            inputStream.readFully(bytes);
-            return new String(bytes, StandardCharsets.UTF_8);
-        } catch (IOException e) {
-            throw new UncheckedIOException(e);
-        }
+        return readString(CustomEditor.GET_SOURCE_CODE);
     }
 
     private void sendCode(int code) {
@@ -112,6 +106,22 @@
         sendCode(CustomEditor.CANCEL_CODE);
     }
 
+    protected String getFilename() {
+        return readString(CustomEditor.GET_FILENAME);
+    }
+
+    private String readString(int code) {
+        try {
+            outputStream.writeInt(code);
+            int length = inputStream.readInt();
+            byte[] bytes = new byte[length];
+            inputStream.readFully(bytes);
+            return new String(bytes, StandardCharsets.UTF_8);
+        } catch (IOException e) {
+            throw new UncheckedIOException(e);
+        }
+    }
+
     @Override
     public void testEditor(boolean defaultStartup, String[] args, ReplTest... tests) {
         ReplTest[] t = new ReplTest[tests.length + 1];
@@ -143,6 +153,22 @@
         );
     }
 
+    @Test
+    public void testTempFileDeleted() {
+        String[] fna = new String[1];
+        testEditor(
+                a -> assertVariable(a, "int", "a", "0", "0"),
+                a -> assertEditOutput(a, "/ed 1", "a ==> 10", () -> {
+                    fna[0] = getFilename();
+                    assertTrue(Files.exists(Paths.get(fna[0])), "Test set-up failed: " + fna[0]);
+                    writeSource("\n\n\nint a = 10;\n\n\n");
+                    exit();
+                }),
+               a -> assertCommand(a, "if (true) {} else {}", "")
+        );
+        assertFalse(Files.exists(Paths.get(fna[0])), "File not deleted: " + fna[0]);
+    }
+
     private static boolean isWindows() {
         return System.getProperty("os.name").startsWith("Windows");
     }
@@ -171,7 +197,7 @@
 
     private Future<?> task;
     @Override
-    public void assertEdit(boolean after, String cmd,
+    void assertEdit(boolean after, String cmd,
                            Consumer<String> checkInput, Consumer<String> checkOutput, Action action) {
         if (!after) {
             setCommandInput(cmd + "\n");
--- a/test/langtools/jdk/jshell/HistoryUITest.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/test/langtools/jdk/jshell/HistoryUITest.java	Wed Dec 13 10:25:38 2017 -0800
@@ -45,9 +45,9 @@
     public void testPrevNextSnippet() throws Exception {
         doRunTest((inputSink, out) -> {
             inputSink.write("void test1() {\nSystem.err.println(1);\n}\n");
-            waitOutput(out, "\u0005");
+            waitOutput(out, PROMPT);
             inputSink.write("void test2() {\nSystem.err.println(2);\n}\n");
-            waitOutput(out, "\u0005");
+            waitOutput(out, PROMPT);
             inputSink.write(CTRL_UP);
             waitOutput(out, "^void test2\\(\\) \\{");
             inputSink.write(CTRL_UP);
@@ -63,7 +63,7 @@
             inputSink.write(UP);
             waitOutput(out, "^" + clearOut("System.err.println(2);") + "void test2\\(\\) \\{");
             inputSink.write(UP);
-            waitOutput(out, "^\u0007");
+            waitOutput(out, "^" + BELL);
             inputSink.write(DOWN);
             waitOutput(out, "^" + clearOut("void test2() {") + "System.err.println\\(2\\);");
             inputSink.write(DOWN);
@@ -71,7 +71,7 @@
             inputSink.write(DOWN);
             waitOutput(out, "^" + clearOut("}"));
             inputSink.write(DOWN);
-            waitOutput(out, "^\u0007");
+            waitOutput(out, "^" + BELL);
         });
     }
     //where:
--- a/test/langtools/jdk/jshell/PasteAndMeasurementsUITest.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/test/langtools/jdk/jshell/PasteAndMeasurementsUITest.java	Wed Dec 13 10:25:38 2017 -0800
@@ -62,11 +62,11 @@
                             "\u0006\u001b\\[6nSystem.err.println\\(1\\);\n" +
                             "\u0006\u001b\\[6n\\}\n" +
                             "\\|  created method test1\\(\\)\n" +
-                            "\u0005\u001b\\[6nvoid test2\\(\\) \\{\n" +
+                            PROMPT + "\u001b\\[6nvoid test2\\(\\) \\{\n" +
                             "\u0006\u001b\\[6nSystem.err.println\\(1\\);\n" +
                             "\u0006\u001b\\[6n\\}\n" +
                             "\\|  created method test2\\(\\)\n" +
-                            "\u0005\u001b\\[6n");
+                            PROMPT + "\u001b\\[6n");
         });
     }
         private static final String ANSI_SUPPORTED_PROPERTY = "test.terminal.ansi.supported";
--- a/test/langtools/jdk/jshell/StartOptionTest.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/test/langtools/jdk/jshell/StartOptionTest.java	Wed Dec 13 10:25:38 2017 -0800
@@ -138,7 +138,7 @@
     private Consumer<String> assertOrNull(String expected, String label) {
         return expected == null
                 ? null
-                : s -> assertEquals(s.trim(), expected.trim(), label);
+                : s -> assertEquals(s.replaceAll("\\r\\n?", "\n").trim(), expected.trim(), label);
     }
 
     // Start and check the resultant: exit code (Ex), command output (Co),
--- a/test/langtools/jdk/jshell/ToolShiftTabTest.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/test/langtools/jdk/jshell/ToolShiftTabTest.java	Wed Dec 13 10:25:38 2017 -0800
@@ -84,15 +84,15 @@
         doRunTest((inputSink, out) -> {
             inputSink.write("4");
             inputSink.write(FIX + "m");
-            inputSink.write("\u0003 55");
+            inputSink.write(INTERRUPT + " 55");
             inputSink.write(FIX + "m");
-            inputSink.write("\u0003 55");
+            inputSink.write(INTERRUPT + " 55");
             inputSink.write(FIX + "m");
-            inputSink.write("\u0003 55");
+            inputSink.write(INTERRUPT + " 55");
             inputSink.write(FIX + "m");
-            inputSink.write("\u0003 55");
+            inputSink.write(INTERRUPT + " 55");
             inputSink.write(FIX + "m");
-            inputSink.write("\u0003'X'");
+            inputSink.write(INTERRUPT + "'X'");
             inputSink.write(FIX + "m");
             inputSink.write("nl\n");
             waitOutput(out, "|  created method nl()");
--- a/test/langtools/jdk/jshell/ToolSimpleTest.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/test/langtools/jdk/jshell/ToolSimpleTest.java	Wed Dec 13 10:25:38 2017 -0800
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8153716 8143955 8151754 8150382 8153920 8156910 8131024 8160089 8153897 8167128 8154513 8170015 8170368 8172102 8172103  8165405 8173073 8173848 8174041 8173916 8174028 8174262 8174797 8177079 8180508 8177466 8172154
+ * @bug 8153716 8143955 8151754 8150382 8153920 8156910 8131024 8160089 8153897 8167128 8154513 8170015 8170368 8172102 8172103  8165405 8173073 8173848 8174041 8173916 8174028 8174262 8174797 8177079 8180508 8177466 8172154 8192979
  * @summary Simple jshell tool tests
  * @modules jdk.compiler/com.sun.tools.javac.api
  *          jdk.compiler/com.sun.tools.javac.main
@@ -372,6 +372,20 @@
     }
 
     @Test
+    public void testHelpStart() {
+        test(
+                (a) -> assertCommandCheckOutput(a, "/help /exit",
+                        s -> assertTrue(s.replaceAll("\\r\\n?", "\n").startsWith(
+                                "|  \n" +
+                                "|                                   /exit\n" +
+                                "|                                   =====\n" +
+                                "|  "
+                        ))
+                )
+        );
+    }
+
+    @Test
     public void testHelpFormat() {
         test(
                 (a) -> assertCommandCheckOutput(a, "/help", s -> {
--- a/test/langtools/jdk/jshell/ToolTabCommandTest.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/test/langtools/jdk/jshell/ToolTabCommandTest.java	Wed Dec 13 10:25:38 2017 -0800
@@ -23,7 +23,7 @@
 
 /**
  * @test
- * @bug 8177076 8185840 8178109
+ * @bug 8177076 8185840 8178109 8192863
  * @modules
  *     jdk.compiler/com.sun.tools.javac.api
  *     jdk.compiler/com.sun.tools.javac.main
@@ -36,8 +36,6 @@
  * @run testng ToolTabCommandTest
  */
 
-import java.util.regex.Pattern;
-
 import org.testng.annotations.Test;
 
 @Test
@@ -49,79 +47,121 @@
 
         doRunTest((inputSink, out) -> {
             inputSink.write("1\n");
-            waitOutput(out, "\u0005");
-            inputSink.write("/\011");
-            waitOutput(out, ".*/edit.*/list.*\n\n" + Pattern.quote(getResource("jshell.console.see.synopsis")) + "\n\r\u0005/");
-            inputSink.write("\011");
-            waitOutput(out,   ".*\n/edit\n" + Pattern.quote(getResource("help.edit.summary")) +
-                            "\n.*\n/list\n" + Pattern.quote(getResource("help.list.summary")) +
-                            ".*\n\n" + Pattern.quote(getResource("jshell.console.see.full.documentation")) + "\n\r\u0005/");
-            inputSink.write("\011");
+            waitOutput(out, PROMPT);
+            inputSink.write("/" + TAB);
+            waitOutput(out, ".*/edit.*/list.*\n\n" + resource("jshell.console.see.synopsis") +
+                            REDRAW_PROMPT + "/");
+            inputSink.write(TAB);
+            waitOutput(out,   ".*\n/edit\n" + resource("help.edit.summary") +
+                            "\n.*\n/list\n" + resource("help.list.summary") +
+                            ".*\n\n" + resource("jshell.console.see.full.documentation") +
+                            REDRAW_PROMPT + "/");
+            inputSink.write(TAB);
             waitOutput(out,  "/!\n" +
-                            Pattern.quote(getResource("help.bang")) + "\n" +
+                            resource("help.bang") + "\n" +
                             "\n" +
-                            Pattern.quote(getResource("jshell.console.see.next.command.doc")) + "\n" +
-                            "\r\u0005/");
-            inputSink.write("\011");
+                            resource("jshell.console.see.next.command.doc") +
+                            REDRAW_PROMPT + "/");
+            inputSink.write(TAB);
             waitOutput(out,  "/-<n>\n" +
-                            Pattern.quote(getResource("help.previous")) + "\n" +
+                            resource("help.previous") + "\n" +
                             "\n" +
-                            Pattern.quote(getResource("jshell.console.see.next.command.doc")) + "\n" +
-                            "\r\u0005/");
+                            resource("jshell.console.see.next.command.doc") +
+                            REDRAW_PROMPT + "/");
 
-            inputSink.write("ed\011");
+            inputSink.write("ed" + TAB);
             waitOutput(out, "edit $");
 
-            inputSink.write("\011");
+            inputSink.write(TAB);
             waitOutput(out, ".*-all.*" +
-                            "\n\n" + Pattern.quote(getResource("jshell.console.see.synopsis")) + "\n\r\u0005/");
-            inputSink.write("\011");
-            waitOutput(out, Pattern.quote(getResource("help.edit.summary")) + "\n\n" +
-                            Pattern.quote(getResource("jshell.console.see.full.documentation")) + "\n\r\u0005/edit ");
-            inputSink.write("\011");
-            waitOutput(out, Pattern.quote(getResource("help.edit").replaceAll("\t", "    ")));
+                            "\n\n" + resource("jshell.console.see.synopsis") +
+                            REDRAW_PROMPT + "/");
+            inputSink.write(TAB);
+            waitOutput(out, resource("help.edit.summary") + "\n\n" +
+                            resource("jshell.console.see.full.documentation") +
+                            REDRAW_PROMPT + "/edit ");
+            inputSink.write(TAB);
+            waitOutput(out, resource("help.edit"));
 
-            inputSink.write("\u0003/env \011");
-            waitOutput(out, "\u0005/env -\n" +
+            inputSink.write(INTERRUPT + "/env " + TAB);
+            waitOutput(out, PROMPT + "/env -\n" +
                             "-add-exports    -add-modules    -class-path     -module-path    \n" +
                             "\n" +
-                            Pattern.quote(getResource("jshell.console.see.synopsis")) + "\n" +
-                            "\r\u0005/env -");
+                            resource("jshell.console.see.synopsis") +
+                            REDRAW_PROMPT + "/env -");
 
-            inputSink.write("\011");
-            waitOutput(out, Pattern.quote(getResource("help.env.summary")) + "\n\n" +
-                            Pattern.quote(getResource("jshell.console.see.full.documentation")) + "\n" +
-                            "\r\u0005/env -");
+            inputSink.write(TAB);
+            waitOutput(out, resource("help.env.summary") + "\n\n" +
+                            resource("jshell.console.see.full.documentation") +
+                            REDRAW_PROMPT + "/env -");
 
-            inputSink.write("\011");
-            waitOutput(out, Pattern.quote(getResource("help.env").replaceAll("\t", "    ")) + "\n" +
-                            "\r\u0005/env -");
+            inputSink.write(TAB);
+            waitOutput(out, resource("help.env") +
+                            REDRAW_PROMPT + "/env -");
 
-            inputSink.write("\011");
+            inputSink.write(TAB);
             waitOutput(out, "-add-exports    -add-modules    -class-path     -module-path    \n" +
                             "\n" +
-                            Pattern.quote(getResource("jshell.console.see.synopsis")) + "\n" +
-                            "\r\u0005/env -");
+                            resource("jshell.console.see.synopsis") +
+                            REDRAW_PROMPT + "/env -");
 
-            inputSink.write("\u0003/exit \011");
-            waitOutput(out, Pattern.quote(getResource("help.exit.summary")) + "\n\n" +
-                            Pattern.quote(getResource("jshell.console.see.full.documentation")) + "\n\r\u0005/exit ");
-            inputSink.write("\011");
-            waitOutput(out, Pattern.quote(getResource("help.exit").replaceAll("\t", "    ")) + "\n" +
-                            "\r\u0005/exit ");
-            inputSink.write("\011");
-            waitOutput(out, Pattern.quote(getResource("help.exit.summary")) + "\n\n" +
-                            Pattern.quote(getResource("jshell.console.see.full.documentation")) + "\n\r\u0005/exit ");
-            inputSink.write("\u0003");
+            inputSink.write(INTERRUPT + "/exit " + TAB);
+            waitOutput(out, resource("help.exit.summary") + "\n\n" +
+                            resource("jshell.console.see.full.documentation") +
+                            REDRAW_PROMPT + "/exit ");
+            inputSink.write(TAB);
+            waitOutput(out, resource("help.exit") +
+                            REDRAW_PROMPT + "/exit ");
+            inputSink.write(TAB);
+            waitOutput(out, resource("help.exit.summary") + "\n\n" +
+                            resource("jshell.console.see.full.documentation") +
+                            REDRAW_PROMPT + "/exit ");
+            inputSink.write(INTERRUPT);
             inputSink.write("int zebraStripes = 11\n");
             waitOutput(out, "zebraStripes ==> 11\n\u0005");
-            inputSink.write("/exit zeb\011");
+            inputSink.write("/exit zeb" + TAB);
             waitOutput(out, "braStr.*es");
-            inputSink.write("\u0003/doesnotexist\011");
-            waitOutput(out, "\u0005/doesnotexist\n" +
-                            Pattern.quote(getResource("jshell.console.no.such.command")) + "\n" +
-                            "\n" +
-                            "\r\u0005/doesnotexist");
+            inputSink.write(INTERRUPT + "/doesnotexist" + TAB);
+            waitOutput(out, PROMPT + "/doesnotexist\n" +
+                            resource("jshell.console.no.such.command") + "\n" +
+                            REDRAW_PROMPT + "/doesnotexist");
+        });
+    }
+
+    public void testRerunCommands() throws Exception {
+        // set terminal height so that help output won't hit page breaks
+        System.setProperty("test.terminal.height", "1000000");
+
+        doRunTest((inputSink, out) -> {
+            inputSink.write("1\n");
+            waitOutput(out, PROMPT);
+            inputSink.write("2\n");
+            waitOutput(out, PROMPT);
+
+            inputSink.write("/1" + TAB);
+            waitOutput(out, resource("help.rerun.summary") + "\n\n" +
+                            resource("jshell.console.see.full.documentation") +
+                            REDRAW_PROMPT + "/1");
+            inputSink.write(TAB);
+            waitOutput(out, resource("help.rerun") +
+                            REDRAW_PROMPT + "/1");
+            inputSink.write(TAB);
+            waitOutput(out, resource("help.rerun.summary") + "\n\n" +
+                            resource("jshell.console.see.full.documentation") +
+                            REDRAW_PROMPT + "/1");
+
+            inputSink.write(INTERRUPT);
+            inputSink.write("/-1" + TAB);
+            waitOutput(out, resource("help.rerun.summary") + "\n\n" +
+                            resource("jshell.console.see.full.documentation") +
+                            REDRAW_PROMPT + "/-1");
+            inputSink.write(TAB);
+            waitOutput(out, resource("help.rerun") +
+                            REDRAW_PROMPT + "/-1");
+            inputSink.write(TAB);
+            waitOutput(out, resource("help.rerun.summary") + "\n\n" +
+                            resource("jshell.console.see.full.documentation") +
+                            REDRAW_PROMPT + "/-1");
         });
     }
 
@@ -130,62 +170,62 @@
         System.setProperty("test.terminal.height", "1000000");
 
         doRunTest((inputSink, out) -> {
-            inputSink.write("/help \011");
-            waitOutput(out, ".*/edit.*/list.*intro.*\n\n" + Pattern.quote(getResource("jshell.console.see.synopsis")) + "\n" +
-                            "\r\u0005/");
-            inputSink.write("\011");
-            waitOutput(out,   ".*\n/edit\n" + Pattern.quote(getResource("help.edit.summary")) +
-                            "\n.*\n/list\n" + Pattern.quote(getResource("help.list.summary")) +
-                            "\n.*\nintro\n" + Pattern.quote(getResource("help.intro.summary")) +
-                            ".*\n\n" + Pattern.quote(getResource("jshell.console.see.full.documentation")) + "\n" +
-                            "\r\u0005/");
-            inputSink.write("/env\011");
+            inputSink.write("/help " + TAB);
+            waitOutput(out, ".*/edit.*/list.*intro.*\n\n" + resource("jshell.console.see.synopsis") +
+                            REDRAW_PROMPT + "/");
+            inputSink.write(TAB);
+            waitOutput(out,   ".*\n/edit\n" + resource("help.edit.summary") +
+                            "\n.*\n/list\n" + resource("help.list.summary") +
+                            "\n.*\nintro\n" + resource("help.intro.summary") +
+                            ".*\n\n" + resource("jshell.console.see.full.documentation") +
+                            REDRAW_PROMPT + "/");
+            inputSink.write("/env" + TAB);
             waitOutput(out,   "help /env ");
-            inputSink.write("\011");
-            waitOutput(out,   ".*\n/env\n" + Pattern.quote(getResource("help.env.summary")) +
-                            ".*\n\n" + Pattern.quote(getResource("jshell.console.see.full.documentation")) + "\n" +
-                            "\r\u0005/help /env ");
-            inputSink.write("\011");
-            waitOutput(out,   ".*\n/env\n" + Pattern.quote(getResource("help.env").replaceAll("\t", "    ")) + "\n" +
-                            "\r\u0005/help /env ");
-            inputSink.write("\u0003/help intro\011");
+            inputSink.write(TAB);
+            waitOutput(out,   ".*\n/env\n" + resource("help.env.summary") +
+                            ".*\n\n" + resource("jshell.console.see.full.documentation") +
+                            REDRAW_PROMPT + "/help /env ");
+            inputSink.write(TAB);
+            waitOutput(out,   ".*\n/env\n" + resource("help.env") +
+                            REDRAW_PROMPT + "/help /env ");
+            inputSink.write(INTERRUPT + "/help intro" + TAB);
             waitOutput(out,   "help intro ");
-            inputSink.write("\011");
-            waitOutput(out,   ".*\nintro\n" + Pattern.quote(getResource("help.intro.summary")) +
-                            ".*\n\n" + Pattern.quote(getResource("jshell.console.see.full.documentation")) + "\n" +
-                            "\r\u0005/help intro ");
-            inputSink.write("\011");
-            waitOutput(out,   ".*\nintro\n" + Pattern.quote(getResource("help.intro").replaceAll("\t", "    ")) + "\n" +
-                            "\r\u0005/help intro ");
-            inputSink.write("\u0003/help /set \011");
-            waitOutput(out, ".*format.*truncation.*\n\n" + Pattern.quote(getResource("jshell.console.see.synopsis")) + "\n" +
-                            "\r\u0005/help /set ");
-            inputSink.write("\011");
-            waitOutput(out,   ".*\n/set format\n" + Pattern.quote(getResource("help.set.format.summary")) +
-                            "\n.*\n/set truncation\n" + Pattern.quote(getResource("help.set.truncation.summary")) +
-                            ".*\n\n" + Pattern.quote(getResource("jshell.console.see.full.documentation")) + "\n" +
-                            "\r\u0005/help /set ");
-            inputSink.write("truncation\011");
-            waitOutput(out,   ".*truncation\n" + Pattern.quote(getResource("jshell.console.see.synopsis")) + "\n" +
-                            "\r\u0005/help /set truncation");
-            inputSink.write("\011");
-            waitOutput(out,   ".*/set truncation\n" + Pattern.quote(getResource("help.set.truncation.summary")) + "\n" +
-                            "\n" + Pattern.quote(getResource("jshell.console.see.full.documentation")) + "\n" +
-                            "\r\u0005/help /set truncation");
-            inputSink.write("\011");
-            waitOutput(out,   ".*/set truncation\n" + Pattern.quote(getResource("help.set.truncation").replaceAll("\t", "    ")) +
-                            "\r\u0005/help /set truncation");
-            inputSink.write("\u0003/help env \011");
-            waitOutput(out,   ".*\n/env\n" + Pattern.quote(getResource("help.env.summary")) +
-                            ".*\n\n" + Pattern.quote(getResource("jshell.console.see.full.documentation")) + "\n" +
-                            "\r\u0005/help env ");
-            inputSink.write("\u0003/help set truncation\011");
-            waitOutput(out,   ".*truncation\n" + Pattern.quote(getResource("jshell.console.see.synopsis")) + "\n" +
-                            "\r\u0005/help set truncation");
-            inputSink.write("\011");
-            waitOutput(out,   ".*\n/set truncation\n" + Pattern.quote(getResource("help.set.truncation.summary")) +
-                            ".*\n\n" + Pattern.quote(getResource("jshell.console.see.full.documentation")) + "\n" +
-                            "\r\u0005/help set truncation");
+            inputSink.write(TAB);
+            waitOutput(out,   ".*\nintro\n" + resource("help.intro.summary") +
+                            ".*\n\n" + resource("jshell.console.see.full.documentation") +
+                            REDRAW_PROMPT + "/help intro ");
+            inputSink.write(TAB);
+            waitOutput(out,   ".*\nintro\n" + resource("help.intro") +
+                            REDRAW_PROMPT + "/help intro ");
+            inputSink.write(INTERRUPT + "/help /set " + TAB);
+            waitOutput(out, ".*format.*truncation.*\n\n" + resource("jshell.console.see.synopsis") +
+                            REDRAW_PROMPT + "/help /set ");
+            inputSink.write(TAB);
+            waitOutput(out,   ".*\n/set format\n" + resource("help.set.format.summary") +
+                            "\n.*\n/set truncation\n" + resource("help.set.truncation.summary") +
+                            ".*\n\n" + resource("jshell.console.see.full.documentation") +
+                            REDRAW_PROMPT + "/help /set ");
+            inputSink.write("truncation" + TAB);
+            waitOutput(out,   ".*truncation\n" + resource("jshell.console.see.synopsis") +
+                            REDRAW_PROMPT + "/help /set truncation");
+            inputSink.write(TAB);
+            waitOutput(out,   ".*/set truncation\n" + resource("help.set.truncation.summary") + "\n" +
+                            "\n" + resource("jshell.console.see.full.documentation") +
+                            REDRAW_PROMPT + "/help /set truncation");
+            inputSink.write(TAB);
+            waitOutput(out,   ".*/set truncation\n" + resource("help.set.truncation") +
+                           "\r" + PROMPT + "/help /set truncation");
+            inputSink.write(INTERRUPT + "/help env " + TAB);
+            waitOutput(out,   ".*\n/env\n" + resource("help.env.summary") +
+                            ".*\n\n" + resource("jshell.console.see.full.documentation") +
+                            REDRAW_PROMPT + "/help env ");
+            inputSink.write(INTERRUPT + "/help set truncation" + TAB);
+            waitOutput(out,   ".*truncation\n" + resource("jshell.console.see.synopsis") +
+                            REDRAW_PROMPT + "/help set truncation");
+            inputSink.write(TAB);
+            waitOutput(out,   ".*\n/set truncation\n" + resource("help.set.truncation.summary") +
+                            ".*\n\n" + resource("jshell.console.see.full.documentation") +
+                            REDRAW_PROMPT + "/help set truncation");
         });
     }
 }
--- a/test/langtools/jdk/jshell/ToolTabSnippetTest.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/test/langtools/jdk/jshell/ToolTabSnippetTest.java	Wed Dec 13 10:25:38 2017 -0800
@@ -46,7 +46,6 @@
 import java.util.concurrent.CountDownLatch;
 import java.util.jar.JarEntry;
 import java.util.jar.JarOutputStream;
-import java.util.regex.Pattern;
 
 import jdk.internal.jshell.tool.ConsoleIOContextTestSupport;
 import org.testng.annotations.Test;
@@ -58,143 +57,148 @@
         Path classes = prepareZip();
         doRunTest((inputSink, out) -> {
             inputSink.write("/env -class-path " + classes.toString() + "\n");
-            waitOutput(out, Pattern.quote(getResource("jshell.msg.set.restore")) + "\n\u0005");
+            waitOutput(out, resource("jshell.msg.set.restore") + "\n\u0005");
             inputSink.write("import jshelltest.*;\n");
             waitOutput(out, "\n\u0005");
 
             //-> <tab>
-            inputSink.write("\011");
+            inputSink.write(TAB);
             waitOutput(out, getMessage("jshell.console.completion.all.completions.number", "[0-9]+"));
-            inputSink.write("\011");
-            waitOutput(out, ".*String.*StringBuilder.*\n\r\u0005");
+            inputSink.write(TAB);
+            waitOutput(out, ".*String.*StringBuilder.*" +
+                            REDRAW_PROMPT + "");
 
             //new JShellTes<tab>
-            inputSink.write("new JShellTes\011");
-            waitOutput(out, "t\nJShellTest\\(      JShellTestAux\\(   \n\r\u0005new JShellTest");
+            inputSink.write("new JShellTes" + TAB);
+            waitOutput(out, "t\nJShellTest\\(      JShellTestAux\\(   " +
+                            REDRAW_PROMPT + "new JShellTest");
 
             //new JShellTest<tab>
-            inputSink.write("\011");
+            inputSink.write(TAB);
             waitOutput(out, "JShellTest\\(      JShellTestAux\\(   \n" +
                             "\n" +
-                            Pattern.quote(getResource("jshell.console.completion.current.signatures")) + "\n" +
+                            resource("jshell.console.completion.current.signatures") + "\n" +
                             "jshelltest.JShellTest\n" +
                             "\n" +
-                            Pattern.quote(getResource("jshell.console.see.documentation")) + "\n" +
-                            "\r\u0005new JShellTest");
-            inputSink.write("\011");
+                            resource("jshell.console.see.documentation") +
+                            REDRAW_PROMPT + "new JShellTest");
+            inputSink.write(TAB);
             waitOutput(out, "jshelltest.JShellTest\n" +
-                            "JShellTest 0\n" +
-                            "\r\u0005new JShellTest");
-            inputSink.write("\011");
+                            "JShellTest 0" +
+                            REDRAW_PROMPT + "new JShellTest");
+            inputSink.write(TAB);
             waitOutput(out, "JShellTest\\(      JShellTestAux\\(   \n" +
                             "\n" +
-                            Pattern.quote(getResource("jshell.console.completion.current.signatures")) + "\n" +
+                            resource("jshell.console.completion.current.signatures") + "\n" +
                             "jshelltest.JShellTest\n" +
                             "\n" +
-                            Pattern.quote(getResource("jshell.console.see.documentation")) + "\n" +
-                            "\r\u0005new JShellTest");
+                            resource("jshell.console.see.documentation") +
+                            REDRAW_PROMPT + "new JShellTest");
 
             //new JShellTest(<tab>
-            inputSink.write("(\011");
+            inputSink.write("(" + TAB);
             waitOutput(out, "\\(\n" +
-                            Pattern.quote(getResource("jshell.console.completion.current.signatures")) + "\n" +
+                            resource("jshell.console.completion.current.signatures") + "\n" +
                             "JShellTest\\(String str\\)\n" +
                             "JShellTest\\(String str, int i\\)\n" +
                             "\n" +
-                            Pattern.quote(getResource("jshell.console.see.documentation")) + "\n" +
-                            "\r\u0005new JShellTest\\(");
-            inputSink.write("\011");
+                            resource("jshell.console.see.documentation") +
+                            REDRAW_PROMPT + "new JShellTest\\(");
+            inputSink.write(TAB);
             waitOutput(out, "JShellTest\\(String str\\)\n" +
                             "JShellTest 1\n" +
                             "1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n" +
                             "\n" +
-                            Pattern.quote(getResource("jshell.console.see.next.page")) + "\n" +
-                            "\r\u0005new JShellTest\\(");
-            inputSink.write("\011");
+                            resource("jshell.console.see.next.page") +
+                            REDRAW_PROMPT + "new JShellTest\\(");
+            inputSink.write(TAB);
             waitOutput(out, "1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n" +
                             "\n" +
-                            Pattern.quote(getResource("jshell.console.see.next.javadoc")) + "\n" +
-                            "\r\u0005new JShellTest\\(");
-            inputSink.write("\011");
+                            resource("jshell.console.see.next.javadoc") +
+                            REDRAW_PROMPT + "new JShellTest\\(");
+            inputSink.write(TAB);
             waitOutput(out, "JShellTest\\(String str, int i\\)\n" +
                             "JShellTest 2\n" +
                             "\n" +
-                            getMessage("jshell.console.completion.all.completions.number", "[0-9]+") + "\n" +
-                            "\r\u0005new JShellTest\\(");
-            inputSink.write("\011");
-            waitOutput(out, ".*String.*StringBuilder.*\n\r\u0005new JShellTest\\(");
+                            getMessage("jshell.console.completion.all.completions.number", "[0-9]+") +
+                            REDRAW_PROMPT + "new JShellTest\\(");
+            inputSink.write(TAB);
+            waitOutput(out, ".*String.*StringBuilder.*" +
+                            REDRAW_PROMPT + "new JShellTest\\(");
 
-            inputSink.write("\u0003String str = \"\";\nnew JShellTest(");
-            waitOutput(out, "\u0005new JShellTest\\(");
+            inputSink.write(INTERRUPT + "String str = \"\";\nnew JShellTest(");
+            waitOutput(out, PROMPT + "new JShellTest\\(");
 
-            inputSink.write("\011");
+            inputSink.write(TAB);
             waitOutput(out, "\n" +
                             "str   \n" +
                             "\n" +
-                            Pattern.quote(getResource("jshell.console.completion.current.signatures")) + "\n" +
+                            resource("jshell.console.completion.current.signatures") + "\n" +
                             "JShellTest\\(String str\\)\n" +
                             "JShellTest\\(String str, int i\\)\n" +
                             "\n" +
-                            Pattern.quote(getResource("jshell.console.see.documentation")) + "\n" +
-                            "\r\u0005new JShellTest\\(");
-            inputSink.write("\011");
+                            resource("jshell.console.see.documentation") +
+                            REDRAW_PROMPT + "new JShellTest\\(");
+            inputSink.write(TAB);
             waitOutput(out, "JShellTest\\(String str\\)\n" +
                             "JShellTest 1\n" +
                             "1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n" +
                             "\n" +
-                            Pattern.quote(getResource("jshell.console.see.next.page")) + "\n" +
-                            "\r\u0005new JShellTest\\(");
-            inputSink.write("\011");
+                            resource("jshell.console.see.next.page") +
+                            REDRAW_PROMPT + "new JShellTest\\(");
+            inputSink.write(TAB);
             waitOutput(out, "1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n" +
                             "\n" +
-                            Pattern.quote(getResource("jshell.console.see.next.javadoc")) + "\n" +
-                            "\r\u0005new JShellTest\\(");
-            inputSink.write("\011");
+                            resource("jshell.console.see.next.javadoc") +
+                            REDRAW_PROMPT + "new JShellTest\\(");
+            inputSink.write(TAB);
             waitOutput(out, "JShellTest\\(String str, int i\\)\n" +
                             "JShellTest 2\n" +
                             "\n" +
-                            getMessage("jshell.console.completion.all.completions.number", "[0-9]+") + "\n" +
-                            "\r\u0005new JShellTest\\(");
-            inputSink.write("\011");
-            waitOutput(out, ".*String.*StringBuilder.*\n\r\u0005new JShellTest\\(");
+                            getMessage("jshell.console.completion.all.completions.number", "[0-9]+") +
+                            REDRAW_PROMPT + "new JShellTest\\(");
+            inputSink.write(TAB);
+            waitOutput(out, ".*String.*StringBuilder.*" +
+                            REDRAW_PROMPT + "new JShellTest\\(");
 
-            inputSink.write("\u0003JShellTest t = new JShellTest\011");
-            waitOutput(out, "\u0005JShellTest t = new JShellTest\n" +
+            inputSink.write(INTERRUPT + "JShellTest t = new JShellTest" + TAB);
+            waitOutput(out, PROMPT + "JShellTest t = new JShellTest\n" +
                             "JShellTest\\(   \n" +
                             "\n" +
-                            Pattern.quote(getResource("jshell.console.completion.current.signatures")) + "\n" +
+                            resource("jshell.console.completion.current.signatures") + "\n" +
                             "jshelltest.JShellTest\n" +
                             "\n" +
-                            Pattern.quote(getResource("jshell.console.completion.all.completions")) + "\n" +
-                            "\r\u0005JShellTest t = new JShellTest");
-            inputSink.write("\011");
+                            resource("jshell.console.completion.all.completions") +
+                            REDRAW_PROMPT + "JShellTest t = new JShellTest");
+            inputSink.write(TAB);
             waitOutput(out, "JShellTest\\(      JShellTestAux\\(   \n" +
                             "\n" +
-                            Pattern.quote(getResource("jshell.console.see.documentation")) + "\n" +
-                            "\r\u0005JShellTest t = new JShellTest");
+                            resource("jshell.console.see.documentation") +
+                            REDRAW_PROMPT + "JShellTest t = new JShellTest");
 
-            inputSink.write("\u0003JShellTest t = new \011");
-            waitOutput(out, "\u0005JShellTest t = new \n" +
+            inputSink.write(INTERRUPT + "JShellTest t = new " + TAB);
+            waitOutput(out, PROMPT + "JShellTest t = new \n" +
                             "JShellTest\\(   \n" +
                             "\n" +
-                            getMessage("jshell.console.completion.all.completions.number", "[0-9]+") + "\n" +
-                            "\r\u0005JShellTest t = new ");
-            inputSink.write("\011");
-            waitOutput(out, ".*String.*StringBuilder.*\n\r\u0005JShellTest t = new ");
+                            getMessage("jshell.console.completion.all.completions.number", "[0-9]+") +
+                            REDRAW_PROMPT + "JShellTest t = new ");
+            inputSink.write(TAB);
+            waitOutput(out, ".*String.*StringBuilder.*" +
+                            REDRAW_PROMPT + "JShellTest t = new ");
 
-            inputSink.write("\u0003class JShelX{}\n");
-            inputSink.write("new JShel\011");
-            waitOutput(out, "\u0005new JShel\n" +
-                            "JShelX\\(\\)         JShellTest\\(      JShellTestAux\\(   \n" +
-                            "\r\u0005new JShel");
+            inputSink.write(INTERRUPT + "class JShelX{}\n");
+            inputSink.write("new JShel" + TAB);
+            waitOutput(out, PROMPT + "new JShel\n" +
+                            "JShelX\\(\\)         JShellTest\\(      JShellTestAux\\(   " +
+                            REDRAW_PROMPT + "new JShel");
 
             //no crash:
-            inputSink.write("\u0003new Stringbuil\011");
-            waitOutput(out, "\u0005new Stringbuil\u0007");
+            inputSink.write(INTERRUPT + "new Stringbuil" + TAB);
+            waitOutput(out, PROMPT + "new Stringbuil" + BELL);
 
             //no crash: 8188072
-            inputSink.write("\u0003for (int:\011");
-            waitOutput(out, "\u0005for \\(int:\u0007");
+            inputSink.write(INTERRUPT + "for (int:" + TAB);
+            waitOutput(out, PROMPT + "for \\(int:" + BELL);
         });
     }
 
@@ -218,15 +222,15 @@
                 }
             };
             //-> <tab>
-            inputSink.write("\011");
+            inputSink.write(TAB);
             testCompleteComputationStarted.await();
             //-> <tab><tab>
-            inputSink.write("\011\011");
+            inputSink.write(TAB + TAB);
             testCompleteComputationContinue.countDown();
-            waitOutput(out, "\u0005");
+            waitOutput(out, PROMPT);
             //-> <tab>
-            inputSink.write("\011");
-            waitOutput(out, "\u0005");
+            inputSink.write(TAB);
+            waitOutput(out, PROMPT);
             ConsoleIOContextTestSupport.IMPL = null;
         });
     }
@@ -234,24 +238,24 @@
     public void testNoRepeat() throws Exception {
         doRunTest((inputSink, out) -> {
             inputSink.write("String xyzAA;\n");
-            waitOutput(out, "\u0005");
+            waitOutput(out, PROMPT);
 
             //xyz<tab>
-            inputSink.write("String s = xyz\011");
+            inputSink.write("String s = xyz" + TAB);
             waitOutput(out, "^String s = xyzAA");
             inputSink.write(".");
             waitOutput(out, "^\\.");
 
-            inputSink.write("\u0003");
-            waitOutput(out, "\u0005");
+            inputSink.write(INTERRUPT);
+            waitOutput(out, PROMPT);
 
             inputSink.write("double xyzAB;\n");
-            waitOutput(out, "\u0005");
+            waitOutput(out, PROMPT);
 
             //xyz<tab>
-            inputSink.write("String s = xyz\011");
+            inputSink.write("String s = xyz" + TAB);
             String allCompletions =
-                    Pattern.quote(getResource("jshell.console.completion.all.completions"));
+                    resource("jshell.console.completion.all.completions");
             waitOutput(out, ".*xyzAA.*" + allCompletions + ".*\u0005String s = xyzA");
         });
     }
--- a/test/langtools/jdk/jshell/UITesting.java	Wed Dec 13 16:16:17 2017 +0000
+++ b/test/langtools/jdk/jshell/UITesting.java	Wed Dec 13 10:25:38 2017 -0800
@@ -41,6 +41,11 @@
 
 public class UITesting {
 
+    protected static final String TAB = "\011";
+    protected static final String INTERRUPT = "\u0003";
+    protected static final String BELL = "\u0007";
+    protected static final String PROMPT = "\u0005";
+    protected static final String REDRAW_PROMPT = "\n\r" + PROMPT;
     private final boolean laxLineEndings;
 
     public UITesting() {
@@ -100,10 +105,10 @@
         runner.start();
 
         try {
-            waitOutput(out, "\u0005");
+            waitOutput(out, PROMPT);
             test.test(inputSink, out);
         } finally {
-            inputSink.write("\003\003/exit");
+            inputSink.write(INTERRUPT + INTERRUPT + "/exit");
 
             runner.join(1000);
             if (runner.isAlive()) {
@@ -198,6 +203,10 @@
         return resources.getString(key);
     }
 
+    protected String resource(String key) {
+        return Pattern.quote(getResource(key).replaceAll("\t", "    "));
+    }
+
     protected String getMessage(String key, Object... args) {
         return MessageFormat.format(resources.getString(key), args);
     }