Merge
authorlana
Sun, 20 Jan 2013 23:38:27 -0800
changeset 15285 c4e057665d7c
parent 15280 d9e473e85f3c (current diff)
parent 15140 87c70ee15c73 (diff)
child 15286 f170b800d6ce
Merge
jdk/make/tools/swing-beans/beaninfo/BeanInfoUtils.java
jdk/make/tools/swing-beans/beaninfo/SwingBeanInfoBase.java
jdk/src/share/demo/jfc/CodePointIM/CodePointInputMethod.java
jdk/src/share/demo/jfc/CodePointIM/CodePointInputMethodDescriptor.java
--- a/jdk/.hgtags	Mon Jan 21 12:04:55 2013 +0900
+++ b/jdk/.hgtags	Sun Jan 20 23:38:27 2013 -0800
@@ -194,3 +194,4 @@
 a996b57e554198f4592a5f3c30f2f9f4075e545d jdk8-b70
 2a5af0f766d0acd68a81fb08fe11fd66795f86af jdk8-b71
 32a57e645e012a1f0665c075969ca598e0dbb948 jdk8-b72
+733885f57e14cc27f5a5ff0dffe641d2fa3c704a jdk8-b73
--- a/jdk/make/common/shared/Defs-windows.gmk	Mon Jan 21 12:04:55 2013 +0900
+++ b/jdk/make/common/shared/Defs-windows.gmk	Sun Jan 20 23:38:27 2013 -0800
@@ -549,7 +549,10 @@
   _WSCRIPT2 :=$(DEVTOOLS_PATH)wscript.exe
   WSCRIPT  :=$(call FileExists,$(_WSCRIPT1),$(_WSCRIPT2))
 endif
+# If CONFIGURE_BUILD is defined, checks were already done by configure.
+ifndef CONFIGURE_BUILD
 WSCRIPT:=$(call AltCheckSpaces,WSCRIPT)
+endif #! CONFIGURE_BUILD
 # batch mode no modal dialogs on errors, please.
 WSCRIPT += -B
 
@@ -562,7 +565,10 @@
   _CSCRIPT2 :=$(DEVTOOLS_PATH)cscript.exe
   CSCRIPT  :=$(call FileExists,$(_CSCRIPT1),$(_CSCRIPT2))
 endif
+# If CONFIGURE_BUILD is defined, checks were already done by configure.
+ifndef CONFIGURE_BUILD
 CSCRIPT:=$(call AltCheckSpaces,CSCRIPT)
+endif #! CONFIGURE_BUILD
 
 # CABARC: path to cabarc.exe (used in creating install bundles)
 ifdef ALT_CABARC
@@ -584,7 +590,10 @@
   _MSICERT2 :=$(DEVTOOLS_PATH)msicert.exe
   MSICERT   :=$(call FileExists,$(_MSICERT1),$(_MSICERT2))
 endif
+# If CONFIGURE_BUILD is defined, checks were already done by configure.
+ifndef CONFIGURE_BUILD
 MSICERT:=$(call AltCheckSpaces,MSICERT)
+endif #! CONFIGURE_BUILD
 
 # Import JDK images allow for partial builds, components not built are
 #    imported (or copied from) these import areas when needed.
--- a/jdk/make/javax/swing/beaninfo/SwingBeans.gmk	Mon Jan 21 12:04:55 2013 +0900
+++ b/jdk/make/javax/swing/beaninfo/SwingBeans.gmk	Sun Jan 20 23:38:27 2013 -0800
@@ -124,10 +124,10 @@
 $(BEANSRCDIR)/%BeanInfo.java: $(FAKESRC)/$(SWINGPKG)/%.java
 	@$(ECHO) $< >> $(TEMPDIR)/.beans.list
 
-$(BEANSRCDIR)/SwingBeanInfoBase.java: $(DOCLETSRC)/beaninfo/SwingBeanInfoBase.java
+$(BEANSRCDIR)/SwingBeanInfoBase.java: $(DOCLETSRC)/javax/swing/SwingBeanInfoBase.java
 	$(CP) $< $@
 
-$(BEANSRCDIR)/BeanInfoUtils.java: $(DOCLETSRC)/beaninfo/BeanInfoUtils.java
+$(BEANSRCDIR)/BeanInfoUtils.java: $(DOCLETSRC)/sun/swing/BeanInfoUtils.java
 	$(CP) $< $@
 
 #
--- a/jdk/make/tools/swing-beans/beaninfo/BeanInfoUtils.java	Mon Jan 21 12:04:55 2013 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,293 +0,0 @@
-/*
- * Copyright (c) 1998, 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 sun.swing;
-
-import java.beans.*;
-import java.lang.reflect.Method;
-
-public class BeanInfoUtils
-{
-    /* The values of these createPropertyDescriptor() and
-     * createBeanDescriptor() keywords are the names of the
-     * properties they're used to set.
-     */
-    public static final String BOUND = "bound";
-    public static final String CONSTRAINED = "constrained";
-    public static final String PROPERTYEDITORCLASS = "propertyEditorClass";
-    public static final String READMETHOD = "readMethod";
-    public static final String WRITEMETHOD = "writeMethod";
-    public static final String DISPLAYNAME = "displayName";
-    public static final String EXPERT = "expert";
-    public static final String HIDDEN = "hidden";
-    public static final String PREFERRED = "preferred";
-    public static final String SHORTDESCRIPTION = "shortDescription";
-    public static final String CUSTOMIZERCLASS = "customizerClass";
-
-    static private void initFeatureDescriptor(FeatureDescriptor fd, String key, Object value)
-    {
-        if (DISPLAYNAME.equals(key)) {
-            fd.setDisplayName((String)value);
-        }
-
-        if (EXPERT.equals(key)) {
-            fd.setExpert(((Boolean)value).booleanValue());
-        }
-
-        if (HIDDEN.equals(key)) {
-            fd.setHidden(((Boolean)value).booleanValue());
-        }
-
-        if (PREFERRED.equals(key)) {
-            fd.setPreferred(((Boolean)value).booleanValue());
-        }
-
-        else if (SHORTDESCRIPTION.equals(key)) {
-            fd.setShortDescription((String)value);
-        }
-
-        /* Otherwise assume that we have an arbitrary FeatureDescriptor
-         * "attribute".
-         */
-        else {
-            fd.setValue(key, value);
-        }
-    }
-
-    /**
-     * Create a beans PropertyDescriptor given an of keyword/value
-     * arguments.  The following sample call shows all of the supported
-     * keywords:
-     *<pre>
-     *      createPropertyDescriptor("contentPane", new Object[] {
-     *                     BOUND, Boolean.TRUE,
-     *               CONSTRAINED, Boolean.TRUE,
-     *       PROPERTYEDITORCLASS, package.MyEditor.class,
-     *                READMETHOD, "getContentPane",
-     *               WRITEMETHOD, "setContentPane",
-     *               DISPLAYNAME, "contentPane",
-     *                    EXPERT, Boolean.FALSE,
-     *                    HIDDEN, Boolean.FALSE,
-     *                 PREFERRED, Boolean.TRUE,
-     *          SHORTDESCRIPTION, "A top level window with a window manager border",
-     *         "random attribute","random object value"
-     *        }
-     *     );
-     * </pre>
-     * The keywords correspond to <code>java.beans.PropertyDescriptor</code> and
-     * <code>java.beans.FeatureDescriptor</code> properties, e.g. providing a value
-     * for displayName is comparable to <code>FeatureDescriptor.setDisplayName()</code>.
-     * Using createPropertyDescriptor instead of the PropertyDescriptor
-     * constructor and set methods is preferrable in that it regularizes
-     * the code in a <code>java.beans.BeanInfo.getPropertyDescriptors()</code>
-     * method implementation.  One can use <code>createPropertyDescriptor</code>
-     * to set <code>FeatureDescriptor</code> attributes, as in "random attribute"
-     * "random object value".
-     * <p>
-     * All properties should provide a reasonable value for the
-     * <code>SHORTDESCRIPTION</code> keyword and should set <code>BOUND</code>
-     * to <code>Boolean.TRUE</code> if neccessary.  The remaining keywords
-     * are optional.  There's no need to provide values for keywords like
-     * READMETHOD if the correct value can be computed, i.e. if the properties
-     * get/is method follows the standard beans pattern.
-     * <p>
-     * The PREFERRED keyword is not supported by the JDK1.1 java.beans package.
-     * It's still worth setting it to true for properties that are most
-     * likely to be interested to the average developer, e.g. AbstractButton.title
-     * is a preferred property, AbstractButton.focusPainted is not.
-     *
-     * @see java.beans#BeanInfo
-     * @see java.beans#PropertyDescriptor
-     * @see java.beans#FeatureDescriptor
-     */
-    public static PropertyDescriptor createPropertyDescriptor(Class cls, String name, Object[] args)
-    {
-        PropertyDescriptor pd = null;
-        try {
-            pd = new PropertyDescriptor(name, cls);
-        } catch (IntrospectionException e) {
-            // Try creating a read-only property, in case setter isn't defined.
-            try {
-                pd = createReadOnlyPropertyDescriptor(name, cls);
-            } catch (IntrospectionException ie) {
-                throwError(ie, "Can't create PropertyDescriptor for " + name + " ");
-            }
-        }
-
-        for(int i = 0; i < args.length; i += 2) {
-            String key = (String)args[i];
-            Object value = args[i + 1];
-
-            if (BOUND.equals(key)) {
-                pd.setBound(((Boolean)value).booleanValue());
-            }
-
-            else if (CONSTRAINED.equals(key)) {
-                pd.setConstrained(((Boolean)value).booleanValue());
-            }
-
-            else if (PROPERTYEDITORCLASS.equals(key)) {
-                pd.setPropertyEditorClass((Class)value);
-            }
-
-            else if (READMETHOD.equals(key)) {
-                String methodName = (String)value;
-                Method method;
-                try {
-                    method = cls.getMethod(methodName, new Class[0]);
-                    pd.setReadMethod(method);
-                }
-                catch(Exception e) {
-                    throwError(e, cls + " no such method as \"" + methodName + "\"");
-                }
-            }
-
-            else if (WRITEMETHOD.equals(key)) {
-                String methodName = (String)value;
-                Method method;
-                try {
-                    Class type = pd.getPropertyType();
-                    method = cls.getMethod(methodName, new Class[]{type});
-                    pd.setWriteMethod(method);
-                }
-                catch(Exception e) {
-                    throwError(e, cls + " no such method as \"" + methodName + "\"");
-                }
-            }
-
-            else {
-                initFeatureDescriptor(pd, key, value);
-            }
-        }
-
-        return pd;
-    }
-
-
-    /**
-     * Create a BeanDescriptor object given an of keyword/value
-     * arguments.  The following sample call shows all of the supported
-     * keywords:
-     *<pre>
-     *      createBeanDescriptor(JWindow..class, new Object[] {
-     *           CUSTOMIZERCLASS, package.MyCustomizer.class,
-     *               DISPLAYNAME, "JFrame",
-     *                    EXPERT, Boolean.FALSE,
-     *                    HIDDEN, Boolean.FALSE,
-     *                 PREFERRED, Boolean.TRUE,
-     *          SHORTDESCRIPTION, "A top level window with a window manager border",
-     *         "random attribute","random object value"
-     *        }
-     *     );
-     * </pre>
-     * The keywords correspond to <code>java.beans.BeanDescriptor</code> and
-     * <code>java.beans.FeatureDescriptor</code> properties, e.g. providing a value
-     * for displayName is comparable to <code>FeatureDescriptor.setDisplayName()</code>.
-     * Using createBeanDescriptor instead of the BeanDescriptor
-     * constructor and set methods is preferrable in that it regularizes
-     * the code in a <code>java.beans.BeanInfo.getBeanDescriptor()</code>
-     * method implementation.  One can use <code>createBeanDescriptor</code>
-     * to set <code>FeatureDescriptor</code> attributes, as in "random attribute"
-     * "random object value".
-     *
-     * @see java.beans#BeanInfo
-     * @see java.beans#PropertyDescriptor
-     */
-    public static BeanDescriptor createBeanDescriptor(Class cls, Object[] args)
-    {
-        Class customizerClass = null;
-
-        /* For reasons I don't understand, customizerClass is a
-         * readOnly property.  So we have to find it and pass it
-         * to the constructor here.
-         */
-        for(int i = 0; i < args.length; i += 2) {
-            if (CUSTOMIZERCLASS.equals((String)args[i])) {
-                customizerClass = (Class)args[i + 1];
-                break;
-            }
-        }
-
-        BeanDescriptor bd = new BeanDescriptor(cls, customizerClass);
-
-        for(int i = 0; i < args.length; i += 2) {
-            String key = (String)args[i];
-            Object value = args[i + 1];
-            initFeatureDescriptor(bd, key, value);
-        }
-
-        return bd;
-    }
-
-    static private PropertyDescriptor createReadOnlyPropertyDescriptor(
-        String name, Class cls) throws IntrospectionException {
-
-        Method readMethod = null;
-        String base = capitalize(name);
-        Class[] parameters = new Class[0];
-
-        // Is it a boolean?
-        try {
-            readMethod = cls.getMethod("is" + base, parameters);
-        } catch (Exception ex) {}
-        if (readMethod == null) {
-            try {
-                // Try normal accessor pattern.
-                readMethod = cls.getMethod("get" + base, parameters);
-            } catch (Exception ex2) {}
-        }
-        if (readMethod != null) {
-            return new PropertyDescriptor(name, readMethod, null);
-        }
-
-        try {
-            // Try indexed accessor pattern.
-            parameters = new Class[1];
-            parameters[0] = int.class;
-            readMethod = cls.getMethod("get" + base, parameters);
-        } catch (NoSuchMethodException nsme) {
-            throw new IntrospectionException(
-                "cannot find accessor method for " + name + " property.");
-        }
-        return new IndexedPropertyDescriptor(name, null, null, readMethod, null);
-    }
-
-    // Modified methods from java.beans.Introspector
-    private static String capitalize(String s) {
-        if (s.length() == 0) {
-            return s;
-        }
-        char chars[] = s.toCharArray();
-        chars[0] = Character.toUpperCase(chars[0]);
-        return new String(chars);
-    }
-
-    /**
-     * Fatal errors are handled by calling this method.
-     */
-    public static void throwError(Exception e, String s) {
-        throw new Error(e.toString() + " " + s);
-    }
-}
--- a/jdk/make/tools/swing-beans/beaninfo/SwingBeanInfoBase.java	Mon Jan 21 12:04:55 2013 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +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 javax.swing;
-
-import java.beans.*;
-import java.lang.reflect.*;
-import java.awt.Image;
-
-/**
- * The superclass for all Swing BeanInfo classes.  It provides
- * default implementations of <code>getIcon</code> and
- * <code>getDefaultPropertyIndex</code> as well as utility
- * methods, like createPropertyDescriptor, for writing BeanInfo
- * implementations.  This classes is intended to be used along
- * with <code>GenSwingBeanInfo</code> a BeanInfo class code generator.
- *
- * @see GenSwingBeanInfo
- * @author Hans Muller
- */
-public class SwingBeanInfoBase extends SimpleBeanInfo
-{
-    /**
-     * The default index is always 0.  In other words the first property
-     * listed in the getPropertyDescriptors() method is the one
-     * to show a (JFC builder) user in a situation where just a single
-     * property will be shown.
-     */
-    public int getDefaultPropertyIndex() {
-        return 0;
-    }
-
-    /**
-     * Returns a generic Swing icon, all icon "kinds" are supported.
-     * Subclasses should defer to this method when they don't have
-     * a particular beans icon kind.
-     */
-    public Image getIcon(int kind) {
-        // PENDING(hmuller) need generic swing icon images.
-        return null;
-    }
-
-    /**
-     * Returns the BeanInfo for the superclass of our bean, so that
-     * its PropertyDescriptors will be included.
-     */
-    public BeanInfo[] getAdditionalBeanInfo() {
-        Class superClass = getBeanDescriptor().getBeanClass().getSuperclass();
-        BeanInfo superBeanInfo = null;
-        try {
-            superBeanInfo = Introspector.getBeanInfo(superClass);
-        } catch (IntrospectionException ie) {}
-        if (superBeanInfo != null) {
-            BeanInfo[] ret = new BeanInfo[1];
-            ret[0] = superBeanInfo;
-            return ret;
-        }
-        return null;
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/make/tools/swing-beans/javax/swing/SwingBeanInfoBase.java	Sun Jan 20 23:38:27 2013 -0800
@@ -0,0 +1,82 @@
+/*
+ * 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 javax.swing;
+
+import java.beans.*;
+import java.lang.reflect.*;
+import java.awt.Image;
+
+/**
+ * The superclass for all Swing BeanInfo classes.  It provides
+ * default implementations of <code>getIcon</code> and
+ * <code>getDefaultPropertyIndex</code> as well as utility
+ * methods, like createPropertyDescriptor, for writing BeanInfo
+ * implementations.  This classes is intended to be used along
+ * with <code>GenSwingBeanInfo</code> a BeanInfo class code generator.
+ *
+ * @see GenSwingBeanInfo
+ * @author Hans Muller
+ */
+public class SwingBeanInfoBase extends SimpleBeanInfo
+{
+    /**
+     * The default index is always 0.  In other words the first property
+     * listed in the getPropertyDescriptors() method is the one
+     * to show a (JFC builder) user in a situation where just a single
+     * property will be shown.
+     */
+    public int getDefaultPropertyIndex() {
+        return 0;
+    }
+
+    /**
+     * Returns a generic Swing icon, all icon "kinds" are supported.
+     * Subclasses should defer to this method when they don't have
+     * a particular beans icon kind.
+     */
+    public Image getIcon(int kind) {
+        // PENDING(hmuller) need generic swing icon images.
+        return null;
+    }
+
+    /**
+     * Returns the BeanInfo for the superclass of our bean, so that
+     * its PropertyDescriptors will be included.
+     */
+    public BeanInfo[] getAdditionalBeanInfo() {
+        Class superClass = getBeanDescriptor().getBeanClass().getSuperclass();
+        BeanInfo superBeanInfo = null;
+        try {
+            superBeanInfo = Introspector.getBeanInfo(superClass);
+        } catch (IntrospectionException ie) {}
+        if (superBeanInfo != null) {
+            BeanInfo[] ret = new BeanInfo[1];
+            ret[0] = superBeanInfo;
+            return ret;
+        }
+        return null;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/make/tools/swing-beans/sun/swing/BeanInfoUtils.java	Sun Jan 20 23:38:27 2013 -0800
@@ -0,0 +1,293 @@
+/*
+ * Copyright (c) 1998, 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 sun.swing;
+
+import java.beans.*;
+import java.lang.reflect.Method;
+
+public class BeanInfoUtils
+{
+    /* The values of these createPropertyDescriptor() and
+     * createBeanDescriptor() keywords are the names of the
+     * properties they're used to set.
+     */
+    public static final String BOUND = "bound";
+    public static final String CONSTRAINED = "constrained";
+    public static final String PROPERTYEDITORCLASS = "propertyEditorClass";
+    public static final String READMETHOD = "readMethod";
+    public static final String WRITEMETHOD = "writeMethod";
+    public static final String DISPLAYNAME = "displayName";
+    public static final String EXPERT = "expert";
+    public static final String HIDDEN = "hidden";
+    public static final String PREFERRED = "preferred";
+    public static final String SHORTDESCRIPTION = "shortDescription";
+    public static final String CUSTOMIZERCLASS = "customizerClass";
+
+    static private void initFeatureDescriptor(FeatureDescriptor fd, String key, Object value)
+    {
+        if (DISPLAYNAME.equals(key)) {
+            fd.setDisplayName((String)value);
+        }
+
+        if (EXPERT.equals(key)) {
+            fd.setExpert(((Boolean)value).booleanValue());
+        }
+
+        if (HIDDEN.equals(key)) {
+            fd.setHidden(((Boolean)value).booleanValue());
+        }
+
+        if (PREFERRED.equals(key)) {
+            fd.setPreferred(((Boolean)value).booleanValue());
+        }
+
+        else if (SHORTDESCRIPTION.equals(key)) {
+            fd.setShortDescription((String)value);
+        }
+
+        /* Otherwise assume that we have an arbitrary FeatureDescriptor
+         * "attribute".
+         */
+        else {
+            fd.setValue(key, value);
+        }
+    }
+
+    /**
+     * Create a beans PropertyDescriptor given an of keyword/value
+     * arguments.  The following sample call shows all of the supported
+     * keywords:
+     *<pre>
+     *      createPropertyDescriptor("contentPane", new Object[] {
+     *                     BOUND, Boolean.TRUE,
+     *               CONSTRAINED, Boolean.TRUE,
+     *       PROPERTYEDITORCLASS, package.MyEditor.class,
+     *                READMETHOD, "getContentPane",
+     *               WRITEMETHOD, "setContentPane",
+     *               DISPLAYNAME, "contentPane",
+     *                    EXPERT, Boolean.FALSE,
+     *                    HIDDEN, Boolean.FALSE,
+     *                 PREFERRED, Boolean.TRUE,
+     *          SHORTDESCRIPTION, "A top level window with a window manager border",
+     *         "random attribute","random object value"
+     *        }
+     *     );
+     * </pre>
+     * The keywords correspond to <code>java.beans.PropertyDescriptor</code> and
+     * <code>java.beans.FeatureDescriptor</code> properties, e.g. providing a value
+     * for displayName is comparable to <code>FeatureDescriptor.setDisplayName()</code>.
+     * Using createPropertyDescriptor instead of the PropertyDescriptor
+     * constructor and set methods is preferrable in that it regularizes
+     * the code in a <code>java.beans.BeanInfo.getPropertyDescriptors()</code>
+     * method implementation.  One can use <code>createPropertyDescriptor</code>
+     * to set <code>FeatureDescriptor</code> attributes, as in "random attribute"
+     * "random object value".
+     * <p>
+     * All properties should provide a reasonable value for the
+     * <code>SHORTDESCRIPTION</code> keyword and should set <code>BOUND</code>
+     * to <code>Boolean.TRUE</code> if neccessary.  The remaining keywords
+     * are optional.  There's no need to provide values for keywords like
+     * READMETHOD if the correct value can be computed, i.e. if the properties
+     * get/is method follows the standard beans pattern.
+     * <p>
+     * The PREFERRED keyword is not supported by the JDK1.1 java.beans package.
+     * It's still worth setting it to true for properties that are most
+     * likely to be interested to the average developer, e.g. AbstractButton.title
+     * is a preferred property, AbstractButton.focusPainted is not.
+     *
+     * @see java.beans#BeanInfo
+     * @see java.beans#PropertyDescriptor
+     * @see java.beans#FeatureDescriptor
+     */
+    public static PropertyDescriptor createPropertyDescriptor(Class cls, String name, Object[] args)
+    {
+        PropertyDescriptor pd = null;
+        try {
+            pd = new PropertyDescriptor(name, cls);
+        } catch (IntrospectionException e) {
+            // Try creating a read-only property, in case setter isn't defined.
+            try {
+                pd = createReadOnlyPropertyDescriptor(name, cls);
+            } catch (IntrospectionException ie) {
+                throwError(ie, "Can't create PropertyDescriptor for " + name + " ");
+            }
+        }
+
+        for(int i = 0; i < args.length; i += 2) {
+            String key = (String)args[i];
+            Object value = args[i + 1];
+
+            if (BOUND.equals(key)) {
+                pd.setBound(((Boolean)value).booleanValue());
+            }
+
+            else if (CONSTRAINED.equals(key)) {
+                pd.setConstrained(((Boolean)value).booleanValue());
+            }
+
+            else if (PROPERTYEDITORCLASS.equals(key)) {
+                pd.setPropertyEditorClass((Class)value);
+            }
+
+            else if (READMETHOD.equals(key)) {
+                String methodName = (String)value;
+                Method method;
+                try {
+                    method = cls.getMethod(methodName, new Class[0]);
+                    pd.setReadMethod(method);
+                }
+                catch(Exception e) {
+                    throwError(e, cls + " no such method as \"" + methodName + "\"");
+                }
+            }
+
+            else if (WRITEMETHOD.equals(key)) {
+                String methodName = (String)value;
+                Method method;
+                try {
+                    Class type = pd.getPropertyType();
+                    method = cls.getMethod(methodName, new Class[]{type});
+                    pd.setWriteMethod(method);
+                }
+                catch(Exception e) {
+                    throwError(e, cls + " no such method as \"" + methodName + "\"");
+                }
+            }
+
+            else {
+                initFeatureDescriptor(pd, key, value);
+            }
+        }
+
+        return pd;
+    }
+
+
+    /**
+     * Create a BeanDescriptor object given an of keyword/value
+     * arguments.  The following sample call shows all of the supported
+     * keywords:
+     *<pre>
+     *      createBeanDescriptor(JWindow..class, new Object[] {
+     *           CUSTOMIZERCLASS, package.MyCustomizer.class,
+     *               DISPLAYNAME, "JFrame",
+     *                    EXPERT, Boolean.FALSE,
+     *                    HIDDEN, Boolean.FALSE,
+     *                 PREFERRED, Boolean.TRUE,
+     *          SHORTDESCRIPTION, "A top level window with a window manager border",
+     *         "random attribute","random object value"
+     *        }
+     *     );
+     * </pre>
+     * The keywords correspond to <code>java.beans.BeanDescriptor</code> and
+     * <code>java.beans.FeatureDescriptor</code> properties, e.g. providing a value
+     * for displayName is comparable to <code>FeatureDescriptor.setDisplayName()</code>.
+     * Using createBeanDescriptor instead of the BeanDescriptor
+     * constructor and set methods is preferrable in that it regularizes
+     * the code in a <code>java.beans.BeanInfo.getBeanDescriptor()</code>
+     * method implementation.  One can use <code>createBeanDescriptor</code>
+     * to set <code>FeatureDescriptor</code> attributes, as in "random attribute"
+     * "random object value".
+     *
+     * @see java.beans#BeanInfo
+     * @see java.beans#PropertyDescriptor
+     */
+    public static BeanDescriptor createBeanDescriptor(Class cls, Object[] args)
+    {
+        Class customizerClass = null;
+
+        /* For reasons I don't understand, customizerClass is a
+         * readOnly property.  So we have to find it and pass it
+         * to the constructor here.
+         */
+        for(int i = 0; i < args.length; i += 2) {
+            if (CUSTOMIZERCLASS.equals((String)args[i])) {
+                customizerClass = (Class)args[i + 1];
+                break;
+            }
+        }
+
+        BeanDescriptor bd = new BeanDescriptor(cls, customizerClass);
+
+        for(int i = 0; i < args.length; i += 2) {
+            String key = (String)args[i];
+            Object value = args[i + 1];
+            initFeatureDescriptor(bd, key, value);
+        }
+
+        return bd;
+    }
+
+    static private PropertyDescriptor createReadOnlyPropertyDescriptor(
+        String name, Class cls) throws IntrospectionException {
+
+        Method readMethod = null;
+        String base = capitalize(name);
+        Class[] parameters = new Class[0];
+
+        // Is it a boolean?
+        try {
+            readMethod = cls.getMethod("is" + base, parameters);
+        } catch (Exception ex) {}
+        if (readMethod == null) {
+            try {
+                // Try normal accessor pattern.
+                readMethod = cls.getMethod("get" + base, parameters);
+            } catch (Exception ex2) {}
+        }
+        if (readMethod != null) {
+            return new PropertyDescriptor(name, readMethod, null);
+        }
+
+        try {
+            // Try indexed accessor pattern.
+            parameters = new Class[1];
+            parameters[0] = int.class;
+            readMethod = cls.getMethod("get" + base, parameters);
+        } catch (NoSuchMethodException nsme) {
+            throw new IntrospectionException(
+                "cannot find accessor method for " + name + " property.");
+        }
+        return new IndexedPropertyDescriptor(name, null, null, readMethod, null);
+    }
+
+    // Modified methods from java.beans.Introspector
+    private static String capitalize(String s) {
+        if (s.length() == 0) {
+            return s;
+        }
+        char chars[] = s.toCharArray();
+        chars[0] = Character.toUpperCase(chars[0]);
+        return new String(chars);
+    }
+
+    /**
+     * Fatal errors are handled by calling this method.
+     */
+    public static void throwError(Exception e, String s) {
+        throw new Error(e.toString() + " " + s);
+    }
+}
--- a/jdk/makefiles/BuildJdk.gmk	Mon Jan 21 12:04:55 2013 +0900
+++ b/jdk/makefiles/BuildJdk.gmk	Sun Jan 20 23:38:27 2013 -0800
@@ -39,10 +39,7 @@
 # Setup the java compilers for the JDK build.
 include Setup.gmk
 
-# Setup the build tools.
-include Tools.gmk
-
-import: $(BUILD_TOOLS) import-only
+import: import-only
 import-only:
 #       Import (corba jaxp jaxws langtools hotspot)
 	+$(MAKE) -f Import.gmk
@@ -91,17 +88,19 @@
 # into packages, or installed.
 images:
 	+$(MAKE) -f CreateJars.gmk
-	+$(MAKE) -f Images.gmk 
+	+$(MAKE) -f Images.gmk
+ifeq ($(OPENJDK_TARGET_OS), macosx)
+	+$(MAKE) -f Bundles.gmk
+endif
 
 overlay-images:
 	+$(MAKE) -f CompileLaunchers.gmk OVERLAY_IMAGES=true
 	+$(MAKE) -f Images.gmk overlay-images
 
-# Create platform specific image layouts
-bundles:
-	+$(MAKE) -f Bundles.gmk
+sign-jars:
+	+$(MAKE) -f SignJars.gmk
 
-BINARIES:=$(notdir $(wildcard $(IMAGES_OUTPUTDIR)/j2sdk-image/bin/*))
+BINARIES:=$(notdir $(wildcard $(JDK_IMAGE_DIR)/bin/*))
 INSTALLDIR:=openjdk-$(RELEASE)
 
 # Install the jdk image, in a very crude way. Not taking into
@@ -111,7 +110,7 @@
 	echo and creating $(words $(BINARIES)) links from $(INSTALL_PREFIX)/bin into the jdk.
 	$(MKDIR) -p $(INSTALL_PREFIX)/jvm/$(INSTALLDIR)
 	$(RM) -r $(INSTALL_PREFIX)/jvm/$(INSTALLDIR)/*
-	$(CP) -rp $(IMAGES_OUTPUTDIR)/j2sdk-image/* $(INSTALL_PREFIX)/jvm/$(INSTALLDIR)
+	$(CP) -rp $(JDK_IMAGE_DIR)/* $(INSTALL_PREFIX)/jvm/$(INSTALLDIR)
 	$(MKDIR) -p $(INSTALL_PREFIX)/bin
 	$(RM) $(addprefix $(INSTALL_PREFIX)/bin/,$(BINARIES))
 	$(foreach b,$(BINARIES),$(LN) -s $(INSTALL_PREFIX)/jvm/$(INSTALLDIR)/bin/$b $(INSTALL_PREFIX)/bin/$b &&) true
--- a/jdk/makefiles/Bundles.gmk	Mon Jan 21 12:04:55 2013 +0900
+++ b/jdk/makefiles/Bundles.gmk	Sun Jan 20 23:38:27 2013 -0800
@@ -33,9 +33,7 @@
 
 bundles: jre-bundle jdk-bundle
 
-
-JDK_BUNDLE_DIR := $(IMAGES_OUTPUTDIR)/j2sdk-bundle/jdk$(JDK_VERSION).jdk/Contents
-JRE_BUNDLE_DIR := $(IMAGES_OUTPUTDIR)/j2re-bundle/jre$(JDK_VERSION).jre/Contents
+# JDK_BUNDLE_DIR and JRE_BUNDLE_DIR are defined in SPEC.
 
 MACOSX_SRC := $(JDK_TOPDIR)/src/macosx
 
@@ -70,21 +68,21 @@
 endif
 
 
-JDK_FILE_LIST := $(shell $(FIND) $(IMAGES_OUTPUTDIR)/j2sdk-image ! -type d)
-JRE_FILE_LIST := $(shell $(FIND) $(IMAGES_OUTPUTDIR)/j2re-image ! -type d)
+JDK_FILE_LIST := $(shell $(FIND) $(JDK_IMAGE_DIR) ! -type d)
+JRE_FILE_LIST := $(shell $(FIND) $(JRE_IMAGE_DIR) ! -type d)
 
-JDK_TARGET_LIST := $(subst $(IMAGES_OUTPUTDIR)/j2sdk-image,$(JDK_BUNDLE_DIR)/Home,$(JDK_FILE_LIST))
-JRE_TARGET_LIST := $(subst $(IMAGES_OUTPUTDIR)/j2re-image,$(JRE_BUNDLE_DIR)/Home,$(JRE_FILE_LIST))
+JDK_TARGET_LIST := $(subst $(JDK_IMAGE_DIR),$(JDK_BUNDLE_DIR)/Home,$(JDK_FILE_LIST))
+JRE_TARGET_LIST := $(subst $(JRE_IMAGE_DIR),$(JRE_BUNDLE_DIR)/Home,$(JRE_FILE_LIST))
 
 # The old builds implementation of this did not preserve symlinks so
 # make sure they are followed and the contents copied instead.
 # To fix this, just replace copy with install-file macro.
-$(JDK_BUNDLE_DIR)/Home/%: $(IMAGES_OUTPUTDIR)/j2sdk-image/%
+$(JDK_BUNDLE_DIR)/Home/%: $(JDK_IMAGE_DIR)/%
 	$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
 	$(MKDIR) -p $(@D)
 	$(CP) -f -R -L '$<' '$@'
 
-$(JRE_BUNDLE_DIR)/Home/%: $(IMAGES_OUTPUTDIR)/j2re-image/%
+$(JRE_BUNDLE_DIR)/Home/%: $(JRE_IMAGE_DIR)/%
 	$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
 	$(MKDIR) -p $(@D)
 	$(CP) -f -R -L '$<' '$@'
@@ -93,7 +91,7 @@
 	$(ECHO) Creating link $(patsubst $(OUTPUT_ROOT)/%,%,$@)
 	$(MKDIR) -p $(@D)
 	$(RM) $@
-	$(LN) -s ../Home/lib/jli/libjli.dylib $@
+	$(LN) -s ../Home/jre/lib/jli/libjli.dylib $@
 
 $(JRE_BUNDLE_DIR)/MacOS/libjli.dylib:
 	$(ECHO) Creating link $(patsubst $(OUTPUT_ROOT)/%,%,$@)
--- a/jdk/makefiles/CompileDemos.gmk	Mon Jan 21 12:04:55 2013 +0900
+++ b/jdk/makefiles/CompileDemos.gmk	Sun Jan 20 23:38:27 2013 -0800
@@ -33,6 +33,9 @@
 # Setup the java compilers for the JDK build.
 include Setup.gmk
 
+# Prepare the find cache. Only used if running on windows.
+$(eval $(call FillCacheFind,$(JDK_TOPDIR)/src))
+
 # Append demo goals to this variable.
 BUILD_DEMOS=
 
@@ -185,7 +188,7 @@
 
     BUILD_DEMOS += $(patsubst $(JDK_TOPDIR)/src/closed/share/demo/nbproject/%,\
 			$(JDK_OUTPUTDIR)/demo/nbproject/%,\
-			$(shell $(FIND) $(JDK_TOPDIR)/src/closed/share/demo/nbproject/ -type f))
+			$(call CacheFind,$(JDK_TOPDIR)/src/closed/share/demo/nbproject))
     $(JDK_OUTPUTDIR)/demo/nbproject/% : $(JDK_TOPDIR)/src/closed/share/demo/nbproject/%
 		$(MKDIR) -p $(@D)
 		$(CP) $< $@
@@ -317,7 +320,7 @@
 
 # The jpda demo (com/sun/tools/example) is oddly enough stored in src/share/classes.
 # At least, we do not need to compile the jpda demo, just jar/zip up the sources.
-JPDA_SOURCES:=$(shell $(FIND) $(JDK_TOPDIR)/src/share/classes/com/sun/tools/example -type f)
+JPDA_SOURCES:=$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/com/sun/tools/example)
 # The number of files are few enough so that we can use echo safely below to list them.
 JPDA_FILES:=$(subst $(JDK_TOPDIR)/src/share/classes/,,$(JPDA_SOURCES))
 
@@ -363,7 +366,7 @@
 # The netbeans project files are copied into the demo directory.
 BUILD_DEMOS += $(patsubst $(JDK_TOPDIR)/src/share/demo/nbproject/%,\
 		$(JDK_OUTPUTDIR)/demo/nbproject/%,\
-		$(shell $(FIND) $(JDK_TOPDIR)/src/share/demo/nbproject/ -type f))
+		$(call CacheFind,$(JDK_TOPDIR)/src/share/demo/nbproject))
 
 $(JDK_OUTPUTDIR)/demo/nbproject/% : $(JDK_TOPDIR)/src/share/demo/nbproject/%
 	$(MKDIR) -p $(@D)
@@ -439,7 +442,7 @@
 ##################################################################################################
 
 ifndef OPENJDK
-    DB_DEMO_ZIPFILE := $(shell $(FIND) $(JDK_TOPDIR)/src/closed/share/db -name "*demo*.zip")
+    DB_DEMO_ZIPFILE := $(wildcard $(JDK_TOPDIR)/src/closed/share/db/*demo*.zip)
 
     $(JDK_OUTPUTDIR)/demo/_the.db.unzipped: $(DB_DEMO_ZIPFILE)
 	$(MKDIR) -p $(@D)
--- a/jdk/makefiles/CompileJavaClasses.gmk	Mon Jan 21 12:04:55 2013 +0900
+++ b/jdk/makefiles/CompileJavaClasses.gmk	Sun Jan 20 23:38:27 2013 -0800
@@ -42,8 +42,7 @@
 		com/sun/tools/example/trace\
 		com/sun/tools/example/debug/bdi\
 		com/sun/tools/example/debug/event\
-		com/sun/tools/example/debug/gui \
-		com/oracle/security
+		com/sun/tools/example/debug/gui
 
 ifdef OPENJDK
     EXCLUDES+=	sun/dc \
@@ -86,6 +85,8 @@
         sun/nio/ch/SolarisEventPort.java \
 	sun/tools/attach/SolarisAttachProvider.java \
 	sun/tools/attach/SolarisVirtualMachine.java
+
+   EXCLUDES += com/oracle/security
 endif
 
 # In the old build, this isn't excluded on macosx, even though it probably
@@ -227,14 +228,20 @@
 	sun/nio/ch/SimpleAsynchronousFileChannelImpl.java
 endif
 
-# Exclude nimbus files from rt.jar
+# These files do not appear in the build result of the old build. This
+# is because they are generated sources, but the AUTO_JAVA_FILES won't
+# pick them up since they aren't generated when the source dirs are 
+# searched and they aren't referenced by any other classes so they won't
+# be picked up by implicit compilation. On a rebuild, they are picked up
+# and compiled. Exclude them here to produce the same rt.jar as the old 
+# build does when building just once.
 EXFILES+=javax/swing/plaf/nimbus/InternalFrameTitlePanePainter.java \
-				 javax/swing/plaf/nimbus/OptionPaneMessageAreaPainter.java \
-				 javax/swing/plaf/nimbus/ScrollBarPainter.java \
-				 javax/swing/plaf/nimbus/SliderPainter.java \
-				 javax/swing/plaf/nimbus/SpinnerPainter.java \
-				 javax/swing/plaf/nimbus/SplitPanePainter.java \
-				 javax/swing/plaf/nimbus/TabbedPanePainter.java
+	 javax/swing/plaf/nimbus/OptionPaneMessageAreaPainter.java \
+	 javax/swing/plaf/nimbus/ScrollBarPainter.java \
+	 javax/swing/plaf/nimbus/SliderPainter.java \
+	 javax/swing/plaf/nimbus/SpinnerPainter.java \
+	 javax/swing/plaf/nimbus/SplitPanePainter.java \
+	 javax/swing/plaf/nimbus/TabbedPanePainter.java
 
 # Acquire a list of files that should be copied straight over to the classes.
 include CopyIntoClasses.gmk
@@ -285,6 +292,7 @@
 		     $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes \
 		     $(MACOSX_SRC_DIRS) \
 		     $(JDK_OUTPUTDIR)/gensrc \
+		     $(JDK_OUTPUTDIR)/gensrc_no_srczip \
 		     $(CLOSED_SRC_DIRS),\
 		INCLUDES:=$(JDK_USER_DEFINED_FILTER),\
 		EXCLUDES:=$(EXCLUDES),\
@@ -295,35 +303,6 @@
 		HEADERS:=$(JDK_OUTPUTDIR)/gensrc_headers))
 
 ##########################################################################################
-# Special handling of header file generation for classes in the jigsaw base module which
-# currently can't add the annotaion GenerateNativeHeaders. For these specific classes the
-# java file and the class have the same names which enables shortcutting the dependencies.
-
-JDK_BASE_HEADER_CLASSES:=java.lang.Integer \
-			 java.lang.Long \
-			 java.net.SocketOptions \
-			 sun.nio.ch.IOStatus \
-			 java.io.FileSystem
-
-JDK_BASE_HEADER_JAVA_FILES:=$(patsubst %,$(JDK_TOPDIR)/src/share/classes/%.java,\
-				$(subst .,/,$(JDK_BASE_HEADER_CLASSES)))
-
-ifeq ($(OPENJDK_TARGET_OS),windows)
-    JDK_BASE_HEADER_CLASSES_WINDOWS:=sun.nio.ch.PollArrayWrapper
-    JDK_BASE_HEADER_CLASSES+=$(JDK_BASE_HEADER_CLASSES_WINDOWS)
-    JDK_BASE_HEADER_JAVA_FILES+=$(patsubst %,$(JDK_TOPDIR)/src/windows/classes/%.java,\
-				$(subst .,/,$(JDK_BASE_HEADER_CLASSES_WINDOWS)))
-endif
-
-# Set prereqs to the java files since make doesn't know about the class files. Add BUILD_JDK
-# as an order only dependency to avoid race with the java compilation.
-$(JDK_OUTPUTDIR)/gensrc_headers/_the.jdk.base.headers: $(JDK_BASE_HEADER_JAVA_FILES) | $(BUILD_JDK)
-	$(ECHO) Generating headers for jdk base classes
-	$(JAVAH) -bootclasspath $(JDK_OUTPUTDIR)/classes -d $(JDK_OUTPUTDIR)/gensrc_headers \
-		$(JDK_BASE_HEADER_CLASSES)
-	$(TOUCH) $@
-
-##########################################################################################
 
 ifndef OPENJDK
 
@@ -387,7 +366,6 @@
 
 # copy with -a to preserve timestamps so dependencies down the line aren't messed up
 all: $(BUILD_JDK) $(BUILD_ALTCLASSES) $(BUILD_JOBJC) $(BUILD_JOBJC_HEADERS) $(COPY_EXTRA) \
-	$(JDK_OUTPUTDIR)/classes/META-INF/services/com.sun.tools.xjc.Plugin \
-	$(JDK_OUTPUTDIR)/gensrc_headers/_the.jdk.base.headers
+	$(JDK_OUTPUTDIR)/classes/META-INF/services/com.sun.tools.xjc.Plugin
 
 .PHONY: all
--- a/jdk/makefiles/CompileLaunchers.gmk	Mon Jan 21 12:04:55 2013 +0900
+++ b/jdk/makefiles/CompileLaunchers.gmk	Sun Jan 20 23:38:27 2013 -0800
@@ -32,6 +32,9 @@
 # Setup the java compilers for the JDK build.
 include Setup.gmk
 
+# Prepare the find cache. Only used on windows.
+$(eval $(call FillCacheFind,$(JDK_TOPDIR)/src/share/bin))
+
 # Build tools
 include Tools.gmk
 
--- a/jdk/makefiles/CompileNativeLibraries.gmk	Mon Jan 21 12:04:55 2013 +0900
+++ b/jdk/makefiles/CompileNativeLibraries.gmk	Sun Jan 20 23:38:27 2013 -0800
@@ -35,6 +35,9 @@
 # Copy files (can now depend on $(COPY_FILES))
 include CopyFiles.gmk
 
+# Prepare the find cache. Only used if running on windows.
+$(eval $(call FillCacheFind,$(JDK_TOPDIR)/src))
+
 # Build tools
 include Tools.gmk
 
@@ -2607,7 +2610,6 @@
 		LIBRARY:=sunmscapi,\
                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
 		SRC:=$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/mscapi,\
-		INCLUDE_FILES:=security.cpp, \
 		LANG:=C++,\
 		OPTIMIZATION:=LOW, \
 		CFLAGS:=$(CFLAGS_JDKLIB) \
--- a/jdk/makefiles/CopyIntoClasses.gmk	Mon Jan 21 12:04:55 2013 +0900
+++ b/jdk/makefiles/CopyIntoClasses.gmk	Sun Jan 20 23:38:27 2013 -0800
@@ -169,7 +169,7 @@
 # are uncommented and the configuration file is stored in the output META-INF directory.
 
 # Make sure the output directory is created.
-$(shell $(MKDIR) -p $(JDK_OUTPUTDIR)/classes/META-INF/services)
+$(eval $(call MakeDir,$(JDK_OUTPUTDIR)/classes/META-INF/services))
 # Find all META-INF/services/* files
 ALL_META-INF_DIRS_share:=$(shell $(FIND) $(JDK_TOPDIR)/src/share/classes -type d -a -name META-INF)
 ALL_META-INF_DIRS_targetapi:=$(shell $(FIND) $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes -type d -a -name META-INF)
--- a/jdk/makefiles/CreateJars.gmk	Mon Jan 21 12:04:55 2013 +0900
+++ b/jdk/makefiles/CreateJars.gmk	Sun Jan 20 23:38:27 2013 -0800
@@ -30,6 +30,9 @@
 
 default: all
 
+# Prepare the find cache. Only used if running on windows.
+$(eval $(call FillCacheFind,$(JDK_OUTPUTDIR)/classes))
+
 include Tools.gmk
 
 #
@@ -126,81 +129,22 @@
 
 # Exclude list for rt.jar and resources.jar
 RT_JAR_EXCLUDES := \
+	com/oracle/security \
+	com/sun/codemodel \
+	com/sun/crypto/provider \
+	com/sun/istack/internal/tools \
+	com/sun/jarsigner \
 	com/sun/javadoc \
 	com/sun/jdi \
-	com/sun/jarsigner \
+	com/sun/net/ssl/internal/ssl \
 	com/sun/source \
-	com/sun/istack/internal/tools \
-	META-INF/services/com.sun.jdi.connect.Connector \
-	META-INF/services/com.sun.jdi.connect.spi.TransportService \
-	META-INF/services/com.sun.tools.xjc.Plugin \
 	com/sun/tools \
-	sun/jvmstat \
-	sun/nio/cs/ext \
-	sun/awt/HKSCS.class \
-	sun/awt/motif/X11GB2312\$$$$Decoder.class \
-	sun/awt/motif/X11GB2312\$$$$Encoder.class \
-	sun/awt/motif/X11GB2312.class \
-	sun/awt/motif/X11GBK\$$$$Encoder.class \
-	sun/awt/motif/X11GBK.class \
-	sun/awt/motif/X11KSC5601\$$$$Decoder.class \
-	sun/awt/motif/X11KSC5601\$$$$Encoder.class \
-	sun/awt/motif/X11KSC5601.class \
-	META-INF/services/java.nio.charset.spi.CharsetProvider \
-	sun/rmi/rmic \
-	sun/tools/asm \
-	sun/tools/java \
-	sun/tools/javac \
-	com/sun/tools/classfile \
-	com/sun/tools/javap \
-	sun/tools/jcmd \
-	sun/tools/jconsole \
-	sun/tools/jps \
-	sun/tools/jstat \
-	sun/tools/jstatd \
-	sun/tools/native2ascii \
-	sun/tools/serialver \
-	sun/tools/tree \
-	sun/tools/util \
-	sun/security/tools/jarsigner \
-	sun/security/provider/Sun.class \
-	sun/security/rsa/SunRsaSign.class \
-	sun/security/ssl \
-	sun/security/ec/ECDHKeyAgreement.class \
-	sun/security/ec/ECDSASignature\$$$$Raw.class \
-	sun/security/ec/ECDSASignature\$$$$SHA1.class \
-	sun/security/ec/ECDSASignature\$$$$SHA224.class \
-	sun/security/ec/ECDSASignature\$$$$SHA256.class \
-	sun/security/ec/ECDSASignature\$$$$SHA384.class \
-	sun/security/ec/ECDSASignature\$$$$SHA512.class \
-	sun/security/ec/ECDSASignature.class \
-	sun/security/ec/ECKeyFactory.class \
-	sun/security/ec/ECKeyPairGenerator.class \
-	sun/security/ec/SunEC\$$$$1.class \
-	sun/security/ec/SunEC.class \
-	sun/security/ec/SunECEntries.class \
-	sun/security/mscapi \
-	sun/security/pkcs11 \
-	com/sun/net/ssl/internal/ssl \
-	javax/crypto \
-	sun/security/internal \
-	com/sun/crypto/provider \
-	META-INF/services/com.sun.tools.attach.spi.AttachProvider \
-	com/sun/tools/attach \
-	org/relaxng/datatype \
-	com/sun/codemodel \
 	com/sun/xml/internal/dtdparser \
 	com/sun/xml/internal/rngom \
 	com/sun/xml/internal/xsom \
-	com/sun/tools/script/shell \
-	sun/tools/attach \
-	sun/tools/jstack \
-	sun/tools/jinfo \
-	sun/tools/jmap \
-	sun/net/spi/nameservice/dns \
-	META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor \
+	javax/crypto \
+	javax/swing/AbstractButtonBeanInfo.class \
 	javax/swing/beaninfo \
-	javax/swing/AbstractButtonBeanInfo.class \
 	javax/swing/BoxBeanInfo.class \
 	javax/swing/JAppletBeanInfo.class \
 	javax/swing/JButtonBeanInfo.class \
@@ -246,11 +190,67 @@
 	javax/swing/JWindowBeanInfo.class \
 	javax/swing/SwingBeanInfoBase.class \
 	javax/swing/text/JTextComponentBeanInfo.class \
+	META-INF/services/com.sun.jdi.connect.Connector \
+	META-INF/services/com.sun.jdi.connect.spi.TransportService \
+	META-INF/services/com.sun.tools.attach.spi.AttachProvider \
+	META-INF/services/com.sun.tools.xjc.Plugin \
+	META-INF/services/java.nio.charset.spi.CharsetProvider \
+	META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor \
+	org/relaxng/datatype \
+	sun/awt/HKSCS.class \
+	sun/awt/motif/X11GB2312.class \
+	sun/awt/motif/X11GB2312\$$$$Decoder.class \
+	sun/awt/motif/X11GB2312\$$$$Encoder.class \
+	sun/awt/motif/X11GBK.class \
+	sun/awt/motif/X11GBK\$$$$Encoder.class \
+	sun/awt/motif/X11KSC5601.class \
+	sun/awt/motif/X11KSC5601\$$$$Decoder.class \
+	sun/awt/motif/X11KSC5601\$$$$Encoder.class \
+	sun/jvmstat \
+	sun/net/spi/nameservice/dns \
+	sun/nio/cs/ext \
+	sun/rmi/rmic \
+	sun/security/ec/ECDHKeyAgreement.class \
+	sun/security/ec/ECDSASignature.class \
+	sun/security/ec/ECDSASignature\$$$$Raw.class \
+	sun/security/ec/ECDSASignature\$$$$SHA1.class \
+	sun/security/ec/ECDSASignature\$$$$SHA224.class \
+	sun/security/ec/ECDSASignature\$$$$SHA256.class \
+	sun/security/ec/ECDSASignature\$$$$SHA384.class \
+	sun/security/ec/ECDSASignature\$$$$SHA512.class \
+	sun/security/ec/ECKeyFactory.class \
+	sun/security/ec/ECKeyPairGenerator.class \
+	sun/security/ec/SunEC\$$$$1.class \
+	sun/security/ec/SunEC.class \
+	sun/security/ec/SunECEntries.class \
+	sun/security/internal \
+	sun/security/mscapi \
+	sun/security/pkcs11 \
+	sun/security/provider/Sun.class \
+	sun/security/rsa/SunRsaSign.class \
+	sun/security/ssl \
+	sun/security/tools/jarsigner \
 	sun/swing/BeanInfoUtils.class \
-	$(LOCALEDATA_INCLUDES) \
 	sun/text/resources/cldr \
+	sun/tools/asm \
+	sun/tools/attach \
+	sun/tools/java \
+	sun/tools/javac \
+	sun/tools/jcmd \
+	sun/tools/jconsole \
+	sun/tools/jinfo \
+	sun/tools/jmap \
+	sun/tools/jps \
+	sun/tools/jstack \
+	sun/tools/jstat \
+	sun/tools/jstatd \
+	sun/tools/native2ascii \
+	sun/tools/serialver \
+	sun/tools/tree \
+	sun/tools/util \
+	sun/util/cldr/CLDRLocaleDataMetaInfo.class \
 	sun/util/resources/cldr \
-	sun/util/cldr/CLDRLocaleDataMetaInfo.class
+	$(LOCALEDATA_INCLUDES)
 
 # These files should never be put into rt.jar
 # but due to a misstake...some are put there if embedded
@@ -275,8 +275,8 @@
 endif
 
 # Find all files in the classes dir to use as dependencies. This could be more fine granular.
-ALL_FILES_IN_CLASSES := $(shell $(FIND) $(JDK_OUTPUTDIR)/classes -type f \
-			| $(GREP) -v -e '/_the\.*' -e '^_the\.*' -e 'javac_state')
+ALL_FILES_IN_CLASSES := $(call not-containing,_the.,$(filter-out %javac_state,\
+                        $(call CacheFind,$(JDK_OUTPUTDIR)/classes)))
 
 RT_JAR_MANIFEST_FILE := $(IMAGES_OUTPUTDIR)/lib/_the.rt.jar_manifest
 RESOURCE_JAR_MANIFEST_FILE := $(IMAGES_OUTPUTDIR)/lib/_the.resources.jar_manifest
@@ -437,60 +437,61 @@
 	$(MV) $@.tmp $@
 
 ##########################################################################################
+# For all security jars, always build the jar, but for closed, install the prebuilt signed
+# version instead of the newly built jar. For open, signing is not needed. See SignJars.gmk
+# for more information.
 
 SUNPKCS11_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/ext/sunpkcs11.jar
+SUNPKCS11_JAR_UNSIGNED := $(IMAGES_OUTPUTDIR)/unsigned/sunpkcs11.jar
+
+$(eval $(call SetupArchive,BUILD_SUNPKCS11_JAR,,\
+	SRCS:=$(JDK_OUTPUTDIR)/classes, \
+	SUFFIXES:=.class,\
+	INCLUDES:=sun/security/pkcs11,\
+	JAR:=$(SUNPKCS11_JAR_UNSIGNED), \
+        MANIFEST:=$(JCE_MANIFEST), \
+	SKIP_METAINF := true))
+
+$(SUNPKCS11_JAR_UNSIGNED): $(JCE_MANIFEST)
 
 ifndef OPENJDK
-
     SUNPKCS11_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/pkcs11/sunpkcs11.jar
-
     $(SUNPKCS11_JAR_DST) : $(SUNPKCS11_JAR_SRC)
 	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunPKCS11 provider..."
 	$(install-file)
-
 else
-
-    $(eval $(call SetupArchive,BUILD_SUNPKCS11_JAR,,\
-	SRCS:=$(JDK_OUTPUTDIR)/classes, \
-	SUFFIXES:=.class,\
-	INCLUDES:=sun/security/pkcs11,\
-	JAR:=$(SUNPKCS11_JAR_DST), \
-        MANIFEST:=$(JCE_MANIFEST), \
-	SKIP_METAINF := true))
-
-    $(SUNPKCS11_JAR_DST): $(JCE_MANIFEST)
-
+    $(SUNPKCS11_JAR_DST) : $(SUNPKCS11_JAR_UNSIGNED)
+	$(install-file)
 endif
 
-JARS += $(SUNPKCS11_JAR_DST)
+JARS += $(SUNPKCS11_JAR_DST) $(SUNPKCS11_JAR_UNSIGNED)
 
 ##########################################################################################
 
 SUNEC_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/ext/sunec.jar
+SUNEC_JAR_UNSIGNED := $(IMAGES_OUTPUTDIR)/unsigned/sunec.jar
+
+$(eval $(call SetupArchive,BUILD_SUNEC_JAR,,\
+		SRCS:=$(JDK_OUTPUTDIR)/classes, \
+		SUFFIXES:=.class,\
+		INCLUDES:=sun/security/ec,\
+		JAR:=$(SUNEC_JAR_UNSIGNED), \
+                MANIFEST:=$(JCE_MANIFEST), \
+		SKIP_METAINF := true))
+
+$(SUNEC_JAR_UNSIGNED): $(JCE_MANIFEST)
 
 ifndef OPENJDK
-
     SUNEC_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/ec/sunec.jar
-
     $(SUNEC_JAR_DST) : $(SUNEC_JAR_SRC)
 	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunEC provider..."
 	$(install-file)
-
 else
-
-    $(eval $(call SetupArchive,BUILD_SUNEC_JAR,,\
-		SRCS:=$(JDK_OUTPUTDIR)/classes, \
-		SUFFIXES:=.class,\
-		INCLUDES:=sun/security/ec,\
-		JAR:=$(SUNEC_JAR_DST), \
-                MANIFEST:=$(JCE_MANIFEST), \
-		SKIP_METAINF := true))
-
-    $(SUNEC_JAR_DST): $(JCE_MANIFEST)
-
+    $(SUNEC_JAR_DST) : $(SUNEC_JAR_UNSIGNED)
+	$(install-file)
 endif
 
-JARS += $(SUNEC_JAR_DST)
+JARS += $(SUNEC_JAR_DST) $(SUNEC_JAR_UNSIGNED)
 
 ##########################################################################################
 
@@ -508,162 +509,166 @@
 ##########################################################################################
 
 SUNJCE_PROVIDER_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/ext/sunjce_provider.jar
-
-ifndef OPENJDK
-    SUNJCE_PROVIDER_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/jce/sunjce_provider.jar
+SUNJCE_PROVIDER_JAR_UNSIGNED := $(IMAGES_OUTPUTDIR)/unsigned/sunjce_provider.jar
 
-    $(SUNJCE_PROVIDER_JAR_DST) : $(SUNJCE_PROVIDER_JAR_SRC)
-	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunJCE provider..."
-	$(install-file)
-
-else
-
-    $(eval $(call SetupArchive,BUILD_SUNJCE_PROVIDER_JAR,,\
+$(eval $(call SetupArchive,BUILD_SUNJCE_PROVIDER_JAR,,\
 		SRCS:=$(JDK_OUTPUTDIR)/classes, \
 		SUFFIXES:=.class,\
 		INCLUDES:= com/sun/crypto/provider,\
-		JAR:=$(SUNJCE_PROVIDER_JAR_DST), \
+		JAR:=$(SUNJCE_PROVIDER_JAR_UNSIGNED), \
                 MANIFEST:=$(JCE_MANIFEST), \
 		SKIP_METAINF := true))
 
-    $(SUNJCE_PROVIDER_JAR_DST): $(JCE_MANIFEST)
+$(SUNJCE_PROVIDER_JAR_UNSIGNED): $(JCE_MANIFEST)
 
+ifndef OPENJDK
+    SUNJCE_PROVIDER_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/jce/sunjce_provider.jar
+    $(SUNJCE_PROVIDER_JAR_DST) : $(SUNJCE_PROVIDER_JAR_SRC)
+	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunJCE provider..."
+	$(install-file)
+else
+    $(SUNJCE_PROVIDER_JAR_DST) : $(SUNJCE_PROVIDER_JAR_UNSIGNED)
+	$(install-file)
 endif
 
-JARS += $(SUNJCE_PROVIDER_JAR_DST)
+JARS += $(SUNJCE_PROVIDER_JAR_DST) $(SUNJCE_PROVIDER_JAR_UNSIGNED)
+
+##########################################################################################
 
 JCE_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/jce.jar
+JCE_JAR_UNSIGNED := $(IMAGES_OUTPUTDIR)/unsigned/jce.jar
+
+$(eval $(call SetupArchive,BUILD_JCE_JAR,,\
+		SRCS:=$(JDK_OUTPUTDIR)/classes, \
+		SUFFIXES:=.class,\
+		INCLUDES:= javax/crypto sun/security/internal,\
+		JAR:=$(JCE_JAR_UNSIGNED), \
+                MANIFEST:=$(JCE_MANIFEST), \
+		SKIP_METAINF := true))
+
+$(JCE_JAR_UNSIGNED): $(JCE_MANIFEST)
 
 ifndef OPENJDK
-
     JCE_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/jce/jce.jar
-
     $(JCE_JAR_DST) : $(JCE_JAR_SRC)
 	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt jce.jar..."
 	$(install-file)
-
 else
-
-    $(eval $(call SetupArchive,BUILD_JCE_JAR,,\
-		SRCS:=$(JDK_OUTPUTDIR)/classes, \
-		SUFFIXES:=.class,\
-		INCLUDES:= javax/crypto sun/security/internal,\
-		JAR:=$(JCE_JAR_DST), \
-                MANIFEST:=$(JCE_MANIFEST), \
-		SKIP_METAINF := true))
-
-    $(JCE_JAR_DST): $(JCE_MANIFEST)
-
+    $(JCE_JAR_DST) : $(JCE_JAR_UNSIGNED)
+	$(install-file)
 endif
 
-JARS += $(JCE_JAR_DST)
+JARS += $(JCE_JAR_DST) $(JCE_JAR_UNSIGNED)
 
 ##########################################################################################
 
 US_EXPORT_POLICY_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/security/US_export_policy.jar
+US_EXPORT_POLICY_JAR_UNSIGNED := $(IMAGES_OUTPUTDIR)/unsigned/US_export_policy.jar
+
+#
+# TODO fix so that SetupArchive does not write files into SRCS
+#   then we don't need this extra copying
+#
+# NOTE:  We currently do not place restrictions on our limited export
+# policy.  This was not a typo.
+#
+US_EXPORT_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/javax/crypto/policy/unlimited
+US_EXPORT_POLICY_JAR_TMP := $(IMAGES_OUTPUTDIR)/US_export_policy_jar.tmp
+
+$(US_EXPORT_POLICY_JAR_TMP)/% : $(US_EXPORT_POLICY_JAR_SRC_DIR)/%
+	$(install-file)
+
+US_EXPORT_POLICY_JAR_DEPS := $(US_EXPORT_POLICY_JAR_TMP)/default_US_export.policy
+
+$(eval $(call SetupArchive,BUILD_US_EXPORT_POLICY_JAR,$(US_EXPORT_POLICY_JAR_DEPS),\
+		SRCS:=$(US_EXPORT_POLICY_JAR_TMP), \
+		SUFFIXES:= .policy,\
+		JAR:=$(US_EXPORT_POLICY_JAR_UNSIGNED), \
+		EXTRA_MANIFEST_ATTR := Crypto-Strength: unlimited, \
+		SKIP_METAINF := true))
 
 ifndef OPENJDK
-
-
     $(US_EXPORT_POLICY_JAR_DST): $(JDK_TOPDIR)/make/closed/tools/crypto/jce/US_export_policy.jar
 	$(ECHO) $(LOG_INFO) Copying $(@F)
 	$(install-file)
-
 else
-
-    #
-    # TODO fix so that SetupArchive does not write files into SRCS
-    #   then we don't need this extra copying
-    #
-    # NOTE:  We currently do not place restrictions on our limited export
-    # policy.  This was not a typo.
-    #
-    US_EXPORT_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/javax/crypto/policy/unlimited
-    US_EXPORT_POLICY_JAR_TMP := $(IMAGES_OUTPUTDIR)/US_export_policy_jar.tmp
-
-    $(US_EXPORT_POLICY_JAR_TMP)/% : $(US_EXPORT_POLICY_JAR_SRC_DIR)/%
+    $(US_EXPORT_POLICY_JAR_DST): $(US_EXPORT_POLICY_JAR_UNSIGNED)
 	$(install-file)
-
-    US_EXPORT_POLICY_JAR_DEPS := $(US_EXPORT_POLICY_JAR_TMP)/default_US_export.policy
-
-    $(eval $(call SetupArchive,BUILD_US_EXPORT_POLICY_JAR,$(US_EXPORT_POLICY_JAR_DEPS),\
-		SRCS:=$(US_EXPORT_POLICY_JAR_TMP), \
-		SUFFIXES:= .policy,\
-		JAR:=$(US_EXPORT_POLICY_JAR_DST), \
-		EXTRA_MANIFEST_ATTR := Crypto-Strength: unlimited, \
-		SKIP_METAINF := true))
-
 endif
 
-JARS += $(US_EXPORT_POLICY_JAR_DST)
+JARS += $(US_EXPORT_POLICY_JAR_DST) $(US_EXPORT_POLICY_JAR_UNSIGNED)
 
 ##########################################################################################
 
 LOCAL_POLICY_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/security/local_policy.jar
+LOCAL_POLICY_JAR_UNSIGNED := $(IMAGES_OUTPUTDIR)/unsigned/local_policy.jar
+
+#
+# TODO fix so that SetupArchive does not write files into SRCS
+#   then we don't need this extra copying
+#
+LOCAL_POLICY_JAR_TMP := $(IMAGES_OUTPUTDIR)/local_policy_jar.tmp
+
+ifeq ($(UNLIMITED_CRYPTO), true)
+    LOCAL_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/javax/crypto/policy/unlimited
+    LOCAL_POLICY_JAR_DEPS := $(LOCAL_POLICY_JAR_TMP)/default_local.policy
+    LOCAL_POLICY_JAR_ATTR := Crypto-Strength: unlimited
+else
+    LOCAL_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/javax/crypto/policy/limited
+    LOCAL_POLICY_JAR_DEPS := $(LOCAL_POLICY_JAR_TMP)/exempt_local.policy \
+                             $(LOCAL_POLICY_JAR_TMP)/default_local.policy
+    LOCAL_POLICY_JAR_ATTR := Crypto-Strength: limited
+endif
+
+$(LOCAL_POLICY_JAR_TMP)/% : $(LOCAL_POLICY_JAR_SRC_DIR)/%
+	$(install-file)
+
+$(eval $(call SetupArchive,BUILD_LOCAL_POLICY_JAR,$(LOCAL_POLICY_JAR_DEPS),\
+		SRCS:=$(LOCAL_POLICY_JAR_TMP),\
+		SUFFIXES:= .policy,\
+		JAR:=$(LOCAL_POLICY_JAR_UNSIGNED), \
+		EXTRA_MANIFEST_ATTR := $(LOCAL_POLICY_JAR_ATTR), \
+		SKIP_METAINF := true))
 
 ifndef OPENJDK
-
     $(LOCAL_POLICY_JAR_DST): $(JDK_TOPDIR)/make/closed/tools/crypto/jce/local_policy.jar
 	$(ECHO) $(LOG_INFO) Copying $(@F)
 	$(install-file)
-
 else
-
-    #
-    # TODO fix so that SetupArchive does not write files into SRCS
-    #   then we don't need this extra copying
-    #
-    LOCAL_POLICY_JAR_TMP := $(IMAGES_OUTPUTDIR)/local_policy_jar.tmp
-
-    ifeq ($(UNLIMITED_CRYPTO), true)
-        LOCAL_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/javax/crypto/policy/unlimited
-        LOCAL_POLICY_JAR_DEPS := $(LOCAL_POLICY_JAR_TMP)/default_local.policy
-        LOCAL_POLICY_JAR_ATTR := Crypto-Strength: unlimited
-    else
-        LOCAL_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/javax/crypto/policy/limited
-        LOCAL_POLICY_JAR_DEPS := $(LOCAL_POLICY_JAR_TMP)/exempt_local.policy \
-                                 $(LOCAL_POLICY_JAR_TMP)/default_local.policy
-        LOCAL_POLICY_JAR_ATTR := Crypto-Strength: limited
-    endif
-
-    $(LOCAL_POLICY_JAR_TMP)/% : $(LOCAL_POLICY_JAR_SRC_DIR)/%
+    $(LOCAL_POLICY_JAR_DST): $(LOCAL_POLICY_JAR_UNSIGNED)
 	$(install-file)
-
-    $(eval $(call SetupArchive,BUILD_LOCAL_POLICY_JAR,$(LOCAL_POLICY_JAR_DEPS),\
-		SRCS:=$(LOCAL_POLICY_JAR_TMP),\
-		SUFFIXES:= .policy,\
-		JAR:=$(LOCAL_POLICY_JAR_DST), \
-		EXTRA_MANIFEST_ATTR := $(LOCAL_POLICY_JAR_ATTR), \
-		SKIP_METAINF := true))
-
 endif
 
-JARS += $(LOCAL_POLICY_JAR_DST)
+JARS += $(LOCAL_POLICY_JAR_DST) $(LOCAL_POLICY_JAR_UNSIGNED)
 
 ##########################################################################################
 
 ifeq ($(OPENJDK_TARGET_OS),windows)
 
 SUNMSCAPI_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/ext/sunmscapi.jar
-
-ifndef OPENJDK
-SUNMSCAPI_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/mscapi/sunmscapi.jar
-
-$(SUNMSCAPI_JAR_DST) : $(SUNMSCAPI_JAR_SRC)
-	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunMSCAPI provider..."
-	$(install-file)
-
-else
+SUNMSCAPI_JAR_UNSIGNED := $(IMAGES_OUTPUTDIR)/unsigned/sunmscapi.jar
 
 $(eval $(call SetupArchive,BUILD_SUNMSCAPI_JAR,,\
 		SRCS:=$(JDK_OUTPUTDIR)/classes, \
 		SUFFIXES:=.class,\
 		INCLUDES:= sun/security/mscapi,\
-		JAR:=$(SUNMSCAPI_JAR_DST), \
+		JAR:=$(SUNMSCAPI_JAR_UNSIGNED), \
+		MANIFEST:=$(JCE_MANIFEST), \
 		SKIP_METAINF:=true))
+
+$(SUNMSCAPI_JAR_UNSIGNED): $(JCE_MANIFEST)
+
+ifndef OPENJDK
+    SUNMSCAPI_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/mscapi/sunmscapi.jar
+    $(SUNMSCAPI_JAR_DST) : $(SUNMSCAPI_JAR_SRC)
+	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunMSCAPI provider..."
+	$(install-file)
+else
+    $(SUNMSCAPI_JAR_DST) : $(SUNMSCAPI_JAR_UNSIGNED)
+	$(install-file)
 endif
 
-JARS += $(SUNMSCAPI_JAR_DST)
+JARS += $(SUNMSCAPI_JAR_DST) $(SUNMSCAPI_JAR_UNSIGNED)
 
 endif
 
@@ -673,13 +678,24 @@
 ifndef OPENJDK
 
 UCRYPTO_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/ext/ucrypto.jar
+UCRYPTO_JAR_UNSIGNED := $(IMAGES_OUTPUTDIR)/unsigned/ucrypto.jar
 UCRYPTO_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/ucrypto/ucrypto.jar
 
+$(eval $(call SetupArchive,BUILD_UCRYPTO_JAR,,\
+		SRCS:=$(JDK_OUTPUTDIR)/classes, \
+		SUFFIXES:=.class,\
+		INCLUDES:=com/oracle/security/ucrypto,\
+		JAR:=$(UCRYPTO_JAR_UNSIGNED), \
+		MANIFEST:=$(JCE_MANIFEST), \
+		SKIP_METAINF:=true))
+
+$(UCRYPTO_JAR_UNSIGNED): $(JCE_MANIFEST)
+
 $(UCRYPTO_JAR_DST) : $(UCRYPTO_JAR_SRC)
 	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt OracleUcrypto provider..."
 	$(install-file)
 
-JARS += $(UCRYPTO_JAR_DST)
+JARS += $(UCRYPTO_JAR_DST) $(UCRYPTO_JAR_UNSIGNED)
 
 endif
 endif
@@ -707,57 +723,57 @@
 ##########################################################################################
 
 TOOLS_JAR_INCLUDES := \
-	sun/tools/asm		\
-	sun/tools/jar		\
-	sun/tools/java		\
-	sun/tools/javac		\
-	sun/tools/jcmd		\
-	sun/tools/jps		\
-	sun/tools/jstat		\
-	sun/tools/jstatd	\
-	sun/tools/native2ascii	\
-	sun/tools/serialver	\
-	sun/tools/tree		\
-	sun/tools/util		\
-	sun/security/tools/jarsigner \
-	sun/rmi/rmic		\
-	sun/applet		\
-	sun/jvmstat		\
+        com/sun/codemodel       \
+	com/sun/istack/internal/tools       \
+	com/sun/jarsigner	\
 	com/sun/javadoc		\
 	com/sun/jdi		\
-	com/sun/jarsigner	\
 	com/sun/source          \
+	com/sun/tools/attach	\
 	com/sun/tools/classfile \
+	com/sun/tools/corba     \
 	com/sun/tools/doclets   \
 	com/sun/tools/doclint   \
 	com/sun/tools/example/debug/expr \
 	com/sun/tools/example/debug/tty  \
 	com/sun/tools/extcheck  \
 	com/sun/tools/hat       \
+        com/sun/tools/internal/jxc             \
+	com/sun/tools/internal/jxc/ap   \
+	com/sun/tools/internal/ws       \
+	com/sun/tools/internal/ws/wscompile/plugin/at_generated \
+	com/sun/tools/internal/xjc       \
 	com/sun/tools/javac     \
 	com/sun/tools/javadoc   \
 	com/sun/tools/javah     \
 	com/sun/tools/javap     \
 	com/sun/tools/jdeps	\
-	com/sun/tools/corba     \
-	com/sun/tools/internal/xjc       \
-	com/sun/tools/internal/ws       \
-	com/sun/istack/internal/tools       \
-	com/sun/tools/internal/jxc/ap   \
-	com/sun/tools/internal/ws/wscompile/plugin/at_generated \
-        com/sun/codemodel       \
-        com/sun/tools/internal/jxc             \
+	com/sun/tools/jdi	\
+	com/sun/tools/script/shell	\
+	com/sun/xml/internal/dtdparser \
         com/sun/xml/internal/rngom       \
         com/sun/xml/internal/xsom       \
         org/relaxng/datatype   \
-	com/sun/xml/internal/dtdparser \
-	com/sun/tools/jdi	\
-	com/sun/tools/script/shell	\
-	com/sun/tools/attach	\
+	sun/applet		\
+	sun/jvmstat		\
+	sun/rmi/rmic		\
+	sun/security/tools/jarsigner \
+	sun/tools/asm		\
 	sun/tools/attach	\
-	sun/tools/jstack        \
+	sun/tools/jar		\
+	sun/tools/java		\
+	sun/tools/javac		\
+	sun/tools/jcmd		\
 	sun/tools/jinfo         \
-	sun/tools/jmap
+	sun/tools/jmap		\
+	sun/tools/jps		\
+	sun/tools/jstack        \
+	sun/tools/jstat		\
+	sun/tools/jstatd	\
+	sun/tools/native2ascii	\
+	sun/tools/serialver	\
+	sun/tools/tree		\
+	sun/tools/util
 
 # The sjavac tools is not ready for public consumption.
 TOOLS_JAR_EXCLUDES=com/sun/tools/sjavac
@@ -821,7 +837,7 @@
 	    $(CORE_PKGS) $(NON_CORE_PKGS) $(EXCLUDE_PROPWARN_PKGS) $(EXPORTED_PRIVATE_PKGS)
 	$(TOUCH) $@
 
-$(shell $(MKDIR) -p $(IMAGES_OUTPUTDIR)/symbols)
+$(eval $(call MakeDir,$(IMAGES_OUTPUTDIR)/symbols))
 $(eval $(call SetupArchive,BUILD_CT_SYM,$(IMAGES_OUTPUTDIR)/symbols/_the.symbols,\
 		SRCS:=$(IMAGES_OUTPUTDIR)/symbols,\
 		INCLUDES:=META-INF/sym,\
@@ -833,6 +849,19 @@
 ##########################################################################################
 
 SRC_ZIP_INCLUDES = \
+	com/sun/corba			\
+	com/sun/image/codec/jpeg	\
+	com/sun/imageio                 \
+	com/sun/java_cup		\
+	com/sun/javadoc			\
+	com/sun/java/swing		\
+	com/sun/jlex	        	\
+	com/sun/jmx			\
+	com/sun/naming			\
+	com/sun/org/apache		\
+	com/sun/security/auth		\
+	com/sun/security/jgss		\
+	com/sun/source			\
 	java/applet			\
 	java/awt			\
 	java/beans			\
@@ -846,34 +875,21 @@
 	java/sql			\
 	java/text			\
 	java/util			\
-	com/sun/corba			\
-	com/sun/image/codec/jpeg	\
-	com/sun/imageio                 \
-	com/sun/java/swing		\
-	com/sun/javadoc			\
-	com/sun/jmx			\
-	com/sun/source			\
-	com/sun/naming			\
-	com/sun/security/auth		\
-	com/sun/security/jgss		\
 	javax/accessibility		\
 	javax/annotation		\
-	javax/script			\
 	javax/imageio			\
 	javax/lang			\
 	javax/management		\
 	javax/naming			\
 	javax/print			\
 	javax/rmi			\
+	javax/script			\
 	javax/security			\
 	javax/sound			\
 	javax/sql			\
 	javax/swing			\
 	javax/tools			\
 	javax/xml			\
-	com/sun/org/apache		\
-	com/sun/java_cup		\
-	com/sun/jlex	        	\
 	org/ietf			\
 	org/omg				\
 	org/w3c/dom			\
@@ -966,6 +982,62 @@
 JARS += $(IMAGES_OUTPUTDIR)/lib/sa-jdi.jar
 
 ##########################################################################################
+#
+# sec-bin.zip is used by builds where the corresponding sources are not available
+#
+$(eval $(call SetupZipArchive,BUILD_SEC_BIN_ZIP,\
+		SRC:=$(JDK_OUTPUTDIR),\
+		INCLUDES:=classes/javax/net \
+			  classes/javax/security/cert \
+			  classes/com/sun/net/ssl \
+			  classes/com/sun/security/cert \
+			  classes/sun/net/www/protocol/https \
+			  classes/sun/security/pkcs12 \
+			  classes/sun/security/ssl \
+			  classes/sun/security/krb5 \
+			  classes/sun/security/krb5/internal \
+			  classes/sun/security/krb5/internal/ccache \
+			  classes/sun/security/krb5/internal/crypto \
+			  classes/sun/security/krb5/internal/ktab \
+			  classes/sun/security/krb5/internal/rcache \
+			  classes/sun/security/krb5/internal/util,\
+		INCLUDE_FILES:=classes/sun/security/jgss/spi/GSSContextSpi.class,\
+		EXCLUDES:=classes/sun/security/krb5/internal/tools,\
+		ZIP:=$(IMAGES_OUTPUTDIR)/sec-bin.zip))
+
+JARS += $(IMAGES_OUTPUTDIR)/sec-bin.zip
+
+##########################################################################################
+#
+# Windows specific binary security packages.
+#
+ifeq ($(OPENJDK_TARGET_OS),windows)
+    # sec-windows-bin.zip is used by builds where the corresponding sources are not available
+    $(eval $(call SetupZipArchive,BUILD_SEC_WINDOWS_BIN_ZIP,\
+		SRC:=$(JDK_OUTPUTDIR),\
+		INCLUDES:=classes/sun/security/krb5/internal/tools,\
+		ZIP:=$(IMAGES_OUTPUTDIR)/sec-windows-bin.zip))
+
+    JARS += $(IMAGES_OUTPUTDIR)/sec-windows-bin.zip
+
+    # JGSS files contain the native Kerberos library
+    ifeq ($(OPENJDK_TARGET_CPU),x86_64)
+        JGSS_ZIP_NAME=jgss-windows-x64-bin.zip
+    else
+        JGSS_ZIP_NAME=jgss-windows-i586-bin.zip
+    endif
+
+    $(eval $(call SetupZipArchive,BUILD_JGSS_BIN_ZIP,\
+		SRC:=$(JDK_OUTPUTDIR),\
+		INCLUDE_FILES:=bin/w2k_lsa_auth.dll \
+			       bin/w2k_lsa_auth.map \
+			       bin/w2k_lsa_auth.pdb,\
+		ZIP:=$(IMAGES_OUTPUTDIR)/$(JGSS_ZIP_NAME)))
+
+    JARS += $(IMAGES_OUTPUTDIR)/$(JGSS_ZIP_NAME)
+endif
+
+##########################################################################################
 
 -include $(CUSTOM_MAKE_DIR)/CreateJars.gmk
 
--- a/jdk/makefiles/GensrcProperties.gmk	Mon Jan 21 12:04:55 2013 +0900
+++ b/jdk/makefiles/GensrcProperties.gmk	Sun Jan 20 23:38:27 2013 -0800
@@ -23,6 +23,9 @@
 # questions.
 #
 
+# Prepare the find cache. This is only used on windows.
+$(eval $(call FillCacheFind,$(JDK_TOPDIR)/src/share/classes $(JDK_TOPDIR)/src/windows/classes))
+
 # All .properties files to be compiled are appended to this variable.
 ALL_COMPILED_PROPSOURCES:=
 # All generated .java files from compilation are appended to this variable.
@@ -117,44 +120,54 @@
 #com/apple/laf/resources
 ifeq ($(OPENJDK_TARGET_OS),macosx)
     $(eval $(call add_properties_to_compile,COM_APPLE_LAF,\
-	$(shell find $(JDK_TOPDIR)/src/macosx/classes/com/apple/laf/resources -name "*.properties"),\
-		ListResourceBundle))
+	$(filter %.properties,\
+	$(call CacheFind,$(JDK_TOPDIR)/src/macosx/classes/com/apple/laf/resources)),\
+	ListResourceBundle))
 endif
 
 #com/sun/accessibility/internal/resources
 $(eval $(call add_properties_to_compile,COM_SUN_ACCESSIBILITY,\
-	$(shell find $(JDK_TOPDIR)/src/share/classes/com/sun/accessibility/internal/resources -name "*.properties"),\
-		ListResourceBundle))
+	$(filter %.properties,\
+	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/com/sun/accessibility/internal/resources)),\
+	ListResourceBundle))
 $(eval $(call add_properties_to_compile,COM_SUN_ACCESSIBILITY_HK,\
-	$(shell find $(JDK_TOPDIR)/src/share/classes/com/sun/accessibility/internal/resources -name "*.properties"),\
-		ListResourceBundle,%zh_TW,%zh_HK))
+	$(filter %.properties,\
+	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/com/sun/accessibility/internal/resources)),\
+	ListResourceBundle,%zh_TW,%zh_HK))
 #com/sun/imageio/plugins/common
 $(eval $(call add_properties_to_clean,COM_SUN_IMAGEIO,\
-	$(shell find $(JDK_TOPDIR)/src/share/classes/com/sun/imageio -name "*.properties")))
+	$(filter %.properties,\
+	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/com/sun/imageio))))
 #com/sun/java/swing/plaf/gtk/resources
 ifneq ($(OPENJDK_TARGET_OS), windows)
 # Only compile GTK resource bundles on Solaris/Linux
 $(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_GTK,\
-	$(shell find $(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/gtk/resources -name "*.properties"),\
-		ListResourceBundle))
+	$(filter %.properties,\
+	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/gtk/resources)),\
+	ListResourceBundle))
 $(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_GTK_HK,\
-	$(shell find $(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/gtk/resources -name "*.properties"),\
-		ListResourceBundle,%zh_TW,%zh_HK))
+	$(filter %.properties,\
+	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/gtk/resources)),\
+	ListResourceBundle,%zh_TW,%zh_HK))
 endif
 #com/sun/java/swing/plaf/motif/resources
 $(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_MOTIF,\
-	$(shell find $(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/motif/resources -name "*.properties"),\
-		ListResourceBundle))
+	$(filter %.properties,\
+	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/motif/resources)),\
+	ListResourceBundle))
 $(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_MOTIF_HK,\
-	$(shell find $(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/motif/resources -name "*.properties"),\
-		ListResourceBundle,%zh_TW,%zh_HK))
+	$(filter %.properties,\
+	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/motif/resources)),\
+	ListResourceBundle,%zh_TW,%zh_HK))
 #com/sun/java/swing/plaf/windows/resources
 $(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_WINDOWS,\
-	$(shell find $(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/windows/resources -name "*.properties"),\
-		ListResourceBundle))
+	$(filter %.properties,\
+	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/windows/resources)),\
+	ListResourceBundle))
 $(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_WINDOWS_HK,\
-	$(shell find $(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/windows/resources -name "*.properties"),\
-		ListResourceBundle,%zh_TW,%zh_HK))
+	$(filter %.properties,\
+	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/windows/resources)),\
+	ListResourceBundle,%zh_TW,%zh_HK))
 #com/sun/java/util/jar/pack
 $(eval $(call add_properties_to_clean,JNDI_COSNAMING,\
 	$(JDK_TOPDIR)/src/share/classes/com/sun/java/util/jar/pack/intrinsic.properties))
@@ -169,138 +182,171 @@
 #FIXME: The "xmlsecurity*.properties" pattern is not ideal; we might want to find
 #a better way to select the properties files that are needed.
 $(eval $(call add_properties_to_clean,XML_SECURITY,\
-	$(shell find $(JDK_TOPDIR)/src/share/classes/com/sun/org/apache/xml/internal/security/resource -name "xmlsecurity*.properties")))
+	$(filter $(JDK_TOPDIR)/src/share/classes/com/sun/org/apache/xml/internal/security/resource/xmlsecurity%.properties,\
+	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/com/sun/org/apache/xml/internal/security/resource))))
 
 #com/sun/rowset
 $(eval $(call add_properties_to_clean,COM_SUN_ROWSET,\
-	$(shell find $(JDK_TOPDIR)/src/share/classes/com/sun/rowset -name "*.properties")))
+	$(filter %.properties,\
+	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/com/sun/rowset))))
 $(eval $(call add_properties_to_clean,COM_SUN_ROWSET_HK,\
-	$(shell find $(JDK_TOPDIR)/src/share/classes/com/sun/rowset -name "*zh_TW.properties"),\
+	$(filter %zh_TW.properties,\
+	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/com/sun/rowset)),\
 	%zh_TW,%zh_HK))
 
 #com/sun/servicetag/resources
 #com/sun/swing/internal/plaf/basic/resources
 $(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_BASIC,\
-	$(shell find $(JDK_TOPDIR)/src/share/classes/com/sun/swing/internal/plaf/basic/resources -name "*.properties"),\
-		ListResourceBundle))
+	$(filter %.properties,\
+	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/com/sun/swing/internal/plaf/basic/resources)),\
+	ListResourceBundle))
 $(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_BASIC_HK,\
-	$(shell find $(JDK_TOPDIR)/src/share/classes/com/sun/swing/internal/plaf/basic/resources -name "*.properties"),\
-		ListResourceBundle,%zh_TW,%zh_HK))
+	$(filter %.properties,\
+	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/com/sun/swing/internal/plaf/basic/resources)),\
+	ListResourceBundle,%zh_TW,%zh_HK))
 #com/sun/swing/internal/plaf/metal/resources
 $(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_METAL,\
-	$(shell find $(JDK_TOPDIR)/src/share/classes/com/sun/swing/internal/plaf/metal/resources -name "*.properties"),\
-		ListResourceBundle))
+	$(filter %.properties,\
+	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/com/sun/swing/internal/plaf/metal/resources)),\
+	ListResourceBundle))
 $(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_METAL_HK,\
-	$(shell find $(JDK_TOPDIR)/src/share/classes/com/sun/swing/internal/plaf/metal/resources -name "*.properties"),\
-		ListResourceBundle,%zh_TW,%zh_HK))
+	$(filter %.properties,$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/com/sun/swing/internal/plaf/metal/resources)),\
+	ListResourceBundle,%zh_TW,%zh_HK))
 #com/sun/swing/internal/plaf/synth/resources
 $(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_SYNTH,\
-	$(shell find $(JDK_TOPDIR)/src/share/classes/com/sun/swing/internal/plaf/synth/resources -name "*.properties"),\
-		ListResourceBundle))
+	$(filter %.properties,\
+	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/com/sun/swing/internal/plaf/synth/resources)),\
+	ListResourceBundle))
 $(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_SYNTH_HK,\
-	$(shell find $(JDK_TOPDIR)/src/share/classes/com/sun/swing/internal/plaf/synth/resources -name "*.properties"),\
-		ListResourceBundle,%zh_TW,%zh_HK))
+	$(filter %.properties,\
+	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/com/sun/swing/internal/plaf/synth/resources)),\
+	ListResourceBundle,%zh_TW,%zh_HK))
 
 #com/sun/tools/jdi/resources
 $(eval $(call add_properties_to_compile,COM_SUN_TOOLS_JDI,\
-	$(shell find $(JDK_TOPDIR)/src/share/classes/com/sun/tools/jdi/resources -name "*.properties"),\
-		ListResourceBundle))
+	$(filter %.properties,\
+	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/com/sun/tools/jdi/resources)),\
+	ListResourceBundle))
 
 #com/sun/tools/script/shell
 #java/util
 #javax/sql/rowset
 $(eval $(call add_properties_to_clean,JAVAX_SQL_ROWSET,\
-	$(shell find $(JDK_TOPDIR)/src/share/classes/javax/sql/rowset -name "*.properties")))
+	$(filter %.properties,\
+	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/javax/sql/rowset))))
 #sun/awt/resources
 $(eval $(call add_properties_to_compile,SUN_AWT,\
-	$(shell find $(JDK_TOPDIR)/src/share/classes/sun/awt/resources -name "*.properties"),\
-		ListResourceBundle))
+	$(filter %.properties,\
+	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/sun/awt/resources)),\
+	ListResourceBundle))
 $(eval $(call add_properties_to_compile,SUN_AWT_HK,\
-	$(shell find $(JDK_TOPDIR)/src/share/classes/sun/awt/resources -name "*.properties"),\
-		ListResourceBundle,%zh_TW,%zh_HK))
+	$(filter %.properties,\
+	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/sun/awt/resources)),\
+	ListResourceBundle,%zh_TW,%zh_HK))
 #sun/awt/windows/
 ifeq ($(OPENJDK_TARGET_OS),windows)
     $(eval $(call add_properties_to_compile,SUN_AWT,\
-	$(shell find $(JDK_TOPDIR)/src/windows/classes/sun/awt/windows -name "awtLocalization*.properties"),\
-		ListResourceBundle))
+	$(filter $(JDK_TOPDIR)/src/windows/classes/sun/awt/windows/awtLocalization%.properties,\
+	$(call CacheFind,$(JDK_TOPDIR)/src/windows/classes/sun/awt/windows)),\
+	ListResourceBundle))
     $(eval $(call add_properties_to_compile,SUN_AWT_HK,\
-	$(shell find $(JDK_TOPDIR)/src/windows/classes/sun/awt/windows -name "awtLocalization*.properties"),\
-		ListResourceBundle,%zh_TW,%zh_HK))
+	$(filter $(JDK_TOPDIR)/src/windows/classes/sun/awt/windows/awtLocalization%.properties,\
+	$(call CacheFind,$(JDK_TOPDIR)/src/windows/classes/sun/awt/windows)),\
+	ListResourceBundle,%zh_TW,%zh_HK))
 endif
 
 #sun/launcher/resources
 $(eval $(call add_properties_to_compile,SUN_LAUNCHER,\
-	$(shell find $(JDK_TOPDIR)/src/share/classes/sun/launcher/resources -name "*.properties"),\
-		ListResourceBundle))
+	$(filter %.properties,\
+	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/sun/launcher/resources)),\
+	ListResourceBundle))
 $(eval $(call add_properties_to_compile,SUN_LAUNCHER_HK,\
-	$(shell find $(JDK_TOPDIR)/src/share/classes/sun/launcher/resources -name "*.properties"),\
-		ListResourceBundle,%zh_TW,%zh_HK))
+	$(filter %.properties,\
+	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/sun/launcher/resources)),\
+	ListResourceBundle,%zh_TW,%zh_HK))
 #sun/management/resources
 $(eval $(call add_properties_to_compile,SUN_MANAGEMENT,\
-	$(shell find $(JDK_TOPDIR)/src/share/classes/sun/management/resources -name "*.properties"),\
-		ListResourceBundle))
+	$(filter %.properties,\
+	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/sun/management/resources)),\
+	ListResourceBundle))
 $(eval $(call add_properties_to_compile,SUN_MANAGEMENT_KH,\
-	$(shell find $(JDK_TOPDIR)/src/share/classes/sun/management/resources -name "*.properties"),\
-		ListResourceBundle,%zh_TW,%zh_HK))
+	$(filter %.properties,\
+	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/sun/management/resources)),\
+	ListResourceBundle,%zh_TW,%zh_HK))
 #sun/print
 #sun/print/resources
 $(eval $(call add_properties_to_compile,SUN_PRINT,\
-	$(shell find $(JDK_TOPDIR)/src/share/classes/sun/print/resources -name "*.properties"),\
-		ListResourceBundle))
+	$(filter %.properties,\
+	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/sun/print/resources)),\
+	ListResourceBundle))
 $(eval $(call add_properties_to_compile,SUN_PRINT_HK,\
-	$(shell find $(JDK_TOPDIR)/src/share/classes/sun/print/resources -name "*.properties"),\
-		ListResourceBundle,%zh_TW,%zh_HK))
+	$(filter %.properties,\
+	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/sun/print/resources)),\
+	ListResourceBundle,%zh_TW,%zh_HK))
 #sun/rmi/registry/resources
 $(eval $(call add_properties_to_clean,SUN_RMI_REGISTRY,\
-	$(shell find $(JDK_TOPDIR)/src/share/classes/sun/rmi/registry/resources -name "*.properties")))
+	$(filter %.properties,\
+	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/sun/rmi/registry/resources))))
 $(eval $(call add_properties_to_clean,SUN_RMI_REGISTRY_HK,\
-	$(shell find $(JDK_TOPDIR)/src/share/classes/sun/rmi/registry/resources -name "*zh_TW.properties"),\
+	$(filter %zh_TW.properties,\
+	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/sun/rmi/registry/resources)),\
 	%zh_TW,%zh_HK))
 
 #sun/rmi/rmic/resources
 $(eval $(call add_properties_to_clean,SUN_RMI_RMIC,\
-	$(shell find $(JDK_TOPDIR)/src/share/classes/sun/rmi/rmic/resources -name "*.properties")))
+	$(filter %.properties,\
+	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/sun/rmi/rmic/resources))))
 
 #sun/rmi/server/resources
 $(eval $(call add_properties_to_clean,SUN_RMI_SERVER,\
-	$(shell find $(JDK_TOPDIR)/src/share/classes/sun/rmi/server/resources -name "*.properties")))
+	$(filter %.properties,\
+	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/sun/rmi/server/resources))))
 $(eval $(call add_properties_to_clean,SUN_RMI_SERVER_HK,\
-	$(shell find $(JDK_TOPDIR)/src/share/classes/sun/rmi/server/resources -name "*zh_TW.properties"),\
+	$(filter %zh_TW.properties,\
+	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/sun/rmi/server/resources)),\
 	%zh_TW,%zh_HK))
 
 # sun/tools/jar/resources
 $(eval $(call add_properties_to_compile,SUN_TOOLS_JAR,\
-	$(shell find $(JDK_TOPDIR)/src/share/classes/sun/tools/jar/resources -name "*.properties"),\
-		ListResourceBundle))
+	$(filter %.properties,\
+	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/sun/tools/jar/resources)),\
+	ListResourceBundle))
 $(eval $(call add_properties_to_compile,SUN_TOOLS_JAR_HK,\
-	$(shell find $(JDK_TOPDIR)/src/share/classes/sun/tools/jar/resources -name "*.properties"),\
-		ListResourceBundle,%zh_TW,%zh_HK))
+	$(filter %.properties,\
+	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/sun/tools/jar/resources)),\
+	ListResourceBundle,%zh_TW,%zh_HK))
 
 #sun/tools/javac/resources
 # It's unclear if the other localized property files here are supposed to be copied or not
 # but the old build system didn't copy them.
 $(eval $(call add_properties_to_clean,SUN_TOOLS_SERIALVER,\
-	$(shell find $(JDK_TOPDIR)/src/share/classes/sun/tools/javac/resources -name "javac.properties")))
+	$(filter %javac.properties,\
+	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/sun/tools/javac/resources))))
 
 #sun/tools/jconsole/resources
 $(eval $(call add_properties_to_clean,SUN_TOOLS_JCONSOLE,\
-	$(shell find $(JDK_TOPDIR)/src/share/classes/sun/tools/jconsole/resources -name "*.properties")))
+	$(filter %.properties,\
+	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/sun/tools/jconsole/resources))))
 
 #sun/tools/serialver
 $(eval $(call add_properties_to_clean,SUN_TOOLS_SERIALVER,\
-	$(shell find $(JDK_TOPDIR)/src/share/classes/sun/tools/serialver -name "*.properties"),,,resources))
+	$(filter %.properties,\
+	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/sun/tools/serialver)),,,resources))
 
 #sun/util/logging/resources
 $(eval $(call add_properties_to_compile,SUN_UTIL_LOGGING,\
-	$(shell find $(JDK_TOPDIR)/src/share/classes/sun/util/logging/resources -name "*.properties"),\
-		ListResourceBundle))
+	$(filter %.properties,\
+	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/sun/util/logging/resources)),\
+	ListResourceBundle))
 $(eval $(call add_properties_to_compile,SUN_UTIL_LOGGING_HK,\
-	$(shell find $(JDK_TOPDIR)/src/share/classes/sun/util/logging/resources -name "*.properties"),\
-		ListResourceBundle,%zh_TW,%zh_HK))
+	$(filter %.properties,\
+	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/sun/util/logging/resources)),\
+	ListResourceBundle,%zh_TW,%zh_HK))
 # sun/util/resources
 $(eval $(call add_properties_to_compile,SUN_UTIL,\
-	$(shell find $(JDK_TOPDIR)/src/share/classes/sun/util/resources -name "*.properties"),\
-		sun.util.resources.LocaleNamesBundle))
+	$(filter %.properties,\
+	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/sun/util/resources)),\
+	sun.util.resources.LocaleNamesBundle))
 
 # Now setup the rule for the generation of the resource bundles.
 $(JDK_OUTPUTDIR)/gensrc/_the.compiled_properties : $(ALL_COMPILED_PROPSOURCES) $(BUILD_TOOLS)
--- a/jdk/makefiles/GensrcSwing.gmk	Mon Jan 21 12:04:55 2013 +0900
+++ b/jdk/makefiles/GensrcSwing.gmk	Sun Jan 20 23:38:27 2013 -0800
@@ -45,7 +45,6 @@
 # Generate beaninfo java files
 #
 
-BEAN_GENSRC_DIR = $(JDK_OUTPUTDIR)/gensrc/javax/swing/beaninfo
 DOCLETSRC_DIR = $(JDK_TOPDIR)/make/tools/swing-beans
 
 # javax.swing package
@@ -69,25 +68,31 @@
 # Dummy variable so far, in the old build system it was false by default
 SWINGBEAN_DEBUG_FLAG = false
 # GenDocletBeanInfo is compiled in Tools.gmk and picks up from $(JDK_OUTPUTDIR)/btclasses
-$(JDK_OUTPUTDIR)/gensrc/_the.generated_beaninfo: $(BEANS_SRC) $(BEAN_GENSRC_DIR)/SwingBeanInfoBase.java $(BEAN_GENSRC_DIR)/BeanInfoUtils.java $(BUILD_TOOLS)
+$(JDK_OUTPUTDIR)/gensrc_no_srczip/_the.generated_beaninfo: $(BEANS_SRC) $(JDK_OUTPUTDIR)/gensrc/javax/swing/SwingBeanInfoBase.java $(JDK_OUTPUTDIR)/gensrc/sun/swing/BeanInfoUtils.java $(BUILD_TOOLS)
 	$(ECHO) Generating beaninfo
-	$(JAVA) -Djava.awt.headless=true -jar $(JAVADOC_JARS) -doclet GenDocletBeanInfo -x $(SWINGBEAN_DEBUG_FLAG) -d $(BEAN_GENSRC_DIR) -t $(DOCLETSRC_DIR)/SwingBeanInfo.template -docletpath $(JDK_OUTPUTDIR)/btclasses \
+	$(MKDIR) -p $(JDK_OUTPUTDIR)/gensrc_no_srczip/javax/swing
+	$(JAVA) -Djava.awt.headless=true -jar $(JAVADOC_JARS) -doclet GenDocletBeanInfo \
+	-x $(SWINGBEAN_DEBUG_FLAG) -d $(JDK_OUTPUTDIR)/gensrc_no_srczip/javax/swing \
+	-t $(DOCLETSRC_DIR)/SwingBeanInfo.template -docletpath $(JDK_OUTPUTDIR)/btclasses \
 	-XDignore.symbol.file=true \
 	-classpath $(JDK_OUTPUTDIR)/btclasses $(BEANS_SRC) $(LOG_INFO)
+#       Move the JTextComponent into its proper package directory.
+	$(MKDIR) -p $(JDK_OUTPUTDIR)/gensrc_no_srczip/javax/swing/text
+	$(MV) $(JDK_OUTPUTDIR)/gensrc_no_srczip/javax/swing/JTextComponentBeanInfo.java $(JDK_OUTPUTDIR)/gensrc_no_srczip/javax/swing/text/JTextComponentBeanInfo.java 
 	$(TOUCH) $@
 
 # This file is the part of dt.jar
-# For some reason it is under $(JDK_TOPDIR)/make/tools/swing-beans/beaninfo
+# For some reason it is under $(JDK_TOPDIR)/make/tools/swing-beans/javax/swing
 # Should it be moved under $(JDK_TOPDIR)/src/share/classes/javax/swing instead?
-$(BEAN_GENSRC_DIR)/SwingBeanInfoBase.java: $(DOCLETSRC_DIR)/beaninfo/SwingBeanInfoBase.java
+$(JDK_OUTPUTDIR)/gensrc/javax/swing/SwingBeanInfoBase.java: $(DOCLETSRC_DIR)/javax/swing/SwingBeanInfoBase.java
 	$(MKDIR) -p $(@D)
 	$(CP) $< $@
 
 # This file is the part of dt.jar 
-# For some reason it is under $(JDK_TOPDIR)/make/tools/swing-beans/beaninfo
+# For some reason it is under $(JDK_TOPDIR)/make/tools/swing-beans/sun/swing
 # Should it be moved under $(JDK_TOPDIR)/src/share/classes/sun/swing instead?
-$(BEAN_GENSRC_DIR)/BeanInfoUtils.java: $(DOCLETSRC_DIR)/beaninfo/BeanInfoUtils.java
+$(JDK_OUTPUTDIR)/gensrc/sun/swing/BeanInfoUtils.java: $(DOCLETSRC_DIR)/sun/swing/BeanInfoUtils.java
 	$(MKDIR) -p $(@D)
 	$(CP) $< $@
 
-GENSRC_SWING_BEANINFO = $(JDK_OUTPUTDIR)/gensrc/_the.generated_beaninfo
+GENSRC_SWING_BEANINFO = $(JDK_OUTPUTDIR)/gensrc_no_srczip/_the.generated_beaninfo
--- a/jdk/makefiles/GensrcX11Wrappers.gmk	Mon Jan 21 12:04:55 2013 +0900
+++ b/jdk/makefiles/GensrcX11Wrappers.gmk	Sun Jan 20 23:38:27 2013 -0800
@@ -54,7 +54,7 @@
 
 ##########################################################################################
 
-$(GENSRC_X11WRAPPERS_TMP)/sizer/sizer.%.c : $(GENSRC_SIZER_SRC)/xlibtypes.txt
+$(GENSRC_X11WRAPPERS_TMP)/sizer/sizer.%.c : $(GENSRC_SIZER_SRC)/xlibtypes.txt $(BUILD_TOOLS)
 	$(ECHO) "Generating X11 wrapper ($*-bit version)"
 	$(MKDIR) -p $(@D)
 	$(RM) $@
@@ -92,7 +92,7 @@
 	$(CP) $< $@
 endif
 
-$(GENSRC_X11WRAPPERS_DST)/_the.generated.x11 : $(foreach S,$(GENSRC_SIZES),$(GENSRC_X11WRAPPERS_TMP)/sizer/$(S))
+$(GENSRC_X11WRAPPERS_DST)/_the.generated.x11 : $(foreach S,$(GENSRC_SIZES),$(GENSRC_X11WRAPPERS_TMP)/sizer/$(S)) $(BUILD_TOOLS)
 	$(RM) $@
 	$(MKDIR) -p $(@D)/sun/awt/X11
 	$(TOOL_WRAPPERGENERATOR) $(@D)/sun/awt/X11 $(GENSRC_SIZER_SRC)/xlibtypes.txt "gen" $(GENSRC_X11WRAPPERS_TMP)/sizer/sizes
--- a/jdk/makefiles/Images.gmk	Mon Jan 21 12:04:55 2013 +0900
+++ b/jdk/makefiles/Images.gmk	Sun Jan 20 23:38:27 2013 -0800
@@ -30,6 +30,15 @@
 
 default: images
 
+# Prepare the find cache. Only used if running on windows.
+$(eval $(call FillCacheFind,\
+    $(wildcard $(JDK_OUTPUTDIR)/bin \
+               $(JDK_OUTPUTDIR)/lib \
+               $(IMAGES_OUTPUTDIR)/lib \
+               $(JDK_OUTPUTDIR)/include \
+               $(JDK_OUTPUTDIR)/sample \
+               $(JDK_OUTPUTDIR)/demo)))
+
 include Tools.gmk
 
 # Note: This double-colon rule is intentional, to support
@@ -68,12 +77,6 @@
   $4 += $2/$$($2_$3_FILE)
 endef
 
-JDK_IMAGE_DIR:=$(IMAGES_OUTPUTDIR)/j2sdk-image
-JRE_IMAGE_DIR:=$(IMAGES_OUTPUTDIR)/j2re-image
-
-JDK_OVERLAY_IMAGE_DIR:=$(IMAGES_OUTPUTDIR)/j2sdk-overlay-image
-JRE_OVERLAY_IMAGE_DIR:=$(IMAGES_OUTPUTDIR)/j2re-overlay-image
-
 ################################################################################
 #
 # JRE and JDK build rules
@@ -133,7 +136,7 @@
 	$(SALIB_NAME)
 
 # Find all files in bin dir
-ALL_BIN_LIST := $(shell $(FIND) $(JDK_OUTPUTDIR)/bin -type f)
+ALL_BIN_LIST := $(call CacheFind,$(JDK_OUTPUTDIR)/bin)
 
 # Prevent sjavac from entering the images.
 ALL_BIN_LIST := $(filter-out %/sjavac,$(ALL_BIN_LIST))
@@ -145,7 +148,7 @@
 else
 # On windows, the libraries are in the bin dir, only filter out debuginfo files
 # for executables. "java" is both a library and executable.
-    ALL_BIN_EXEC_FILES := $(filter-out java.exe,$(notdir $(shell $(FIND) $(JDK_OUTPUTDIR)/bin -type f -name "*.exe")))
+    ALL_BIN_EXEC_FILES := $(filter-out java.exe,$(notdir $(filter %.exe,$(ALL_BIN_LIST))))
     ALL_BIN_DEBUG_FILTER := $(addprefix %,$(patsubst %.exe,%.debuginfo,$(ALL_BIN_EXEC_FILES)) \
 					   $(patsubst %.exe,%.diz,$(ALL_BIN_EXEC_FILES))) %.pdb
     ALL_BIN_LIST := $(filter-out $(ALL_BIN_DEBUG_FILTER),$(ALL_BIN_LIST))
@@ -213,13 +216,13 @@
 
 # Find all files to copy from $(JDK_OUTPUTDIR)/lib
 # Jar files are not expected to be here
-ALL_JDKOUT_LIB_LIST := $(shell $(FIND) $(JDK_OUTPUTDIR)/lib \( -type f -o -type l \) -a ! \
-                       \( -name "_the*" -o -name "javac_state " -o -name "*.jar" \) )
+ALL_JDKOUT_LIB_LIST := $(call not-containing,_the.,$(filter-out %.jar,\
+                            $(call CacheFind,$(JDK_OUTPUTDIR)/lib)))
 # Find all files to copy from $(IMAGES_OUTPUTDIR)/lib
 # This is were the jar files are and might not exist if building overlay-images
 ifneq ($(wildcard $(IMAGES_OUTPUTDIR)/lib),)
-    ALL_IMAGES_LIB_LIST := $(shell $(FIND) $(IMAGES_OUTPUTDIR)/lib \( -type f -o -type l \) -a ! \
-                       \( -name "_the*" -o -name "javac_state " \) )
+    ALL_IMAGES_LIB_LIST := $(call not-containing,_the.,\
+                            $(call CacheFind,$(IMAGES_OUTPUTDIR)/lib))
 endif
 
 # Filter files to copy for each destination
@@ -494,13 +497,13 @@
 
     JDK_OVERLAY_DEMO_TARGETS += $$($1_TARGET)
 endef
-JDK_OVERLAY_DEMO_SOURCES := $(shell $(FIND) $(JDK_OUTPUTDIR)/demo -name "*$(SHARED_LIBRARY_SUFFIX)")
+JDK_OVERLAY_DEMO_SOURCES := $(filter %$(SHARED_LIBRARY_SUFFIX),$(call CacheFind,$(JDK_OUTPUTDIR)/demo))
 $(foreach lib,$(JDK_OVERLAY_DEMO_SOURCES),$(eval $(call CreateOverlayDemoRule,$(lib))))
 
 ################################################################################
 # /sample dir
 
-$(foreach f,$(shell $(FIND) $(JDK_OUTPUTDIR)/sample -type f),\
+$(foreach f,$(call CacheFind,$(JDK_OUTPUTDIR)/sample),\
     $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_IMAGE_DIR),$f,JDK_SAMPLE_TARGETS)))
 
 ################################################################################
@@ -519,7 +522,7 @@
 	$(install-file)
 
     JDK_DB_TARGETS := $(patsubst $(JDK_TOPDIR)/src/closed/share/db/%,$(IMAGES_OUTPUTDIR)/_unzip/%.unzipped,\
-			$(shell $(FIND) $(JDK_TOPDIR)/src/closed/share/db -name "*.zip" ! -name "*demo*")) \
+			$(call not-containing,demo,$(wildcard $(JDK_TOPDIR)/src/closed/share/db/*.zip))) \
 		      $(JDK_IMAGE_DIR)/db/README-JDK.html
 
 endif
@@ -527,7 +530,7 @@
 ################################################################################
 # /include dir
 
-$(foreach f,$(shell $(FIND) $(JDK_OUTPUTDIR)/include -type f),\
+$(foreach f,$(call CacheFind,$(JDK_OUTPUTDIR)/include),\
     $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_IMAGE_DIR),$f,JDK_INCLUDE_TARGETS)))
 
 ################################################################################
@@ -626,8 +629,7 @@
 
 ifneq ($(POST_STRIP_CMD),)
     ifeq ($(OPENJDK_TARGET_OS), windows)
-        EXEC_LIST_BIN:=$(shell $(FIND) $(JDK_OUTPUTDIR)/bin -type f -name \*.exe \
-		-o -name \*.dll | $(EGREP) -v -i "$(MSVCR_DLL)")
+        EXEC_LIST_BIN:=$(filter-out %$(notdir $(MSVCR_DLL)),$(filter %.exe %.dll,$(ALL_BIN_LIST)))
     else
         # Find all executables in JDK_OUTPUTDIR since they exist when this makefile is parsed
         EXEC_LIST_BIN:=$(shell $(FILE) `$(FIND) $(JDK_OUTPUTDIR)/bin -type f -name \*$(EXE_SUFFIX)` \
--- a/jdk/makefiles/Import.gmk	Mon Jan 21 12:04:55 2013 +0900
+++ b/jdk/makefiles/Import.gmk	Sun Jan 20 23:38:27 2013 -0800
@@ -170,18 +170,11 @@
 $(INSTALL_LIBRARIES_HERE)/server/%.diz : $(INSTALL_LIBRARIES_HERE)/%.diz
 	$(MKDIR) -p $(@D)
 	$(RM) $@
-ifeq (REALLY_WEIRD,1)
-	$(LN) -s ../$(@F) $@
-else
-#
-# TODO: Check if this is what they really want...a zip containing a symlink
-#
 	$(RM) $@.tmp $(basename $@).debuginfo
 	$(LN) -s ../$(basename $(@F)).debuginfo $(basename $@).debuginfo
-	$(ZIP) -q -y $@.tmp $(basename $@).debuginfo
+	$(CD) $(@D) && $(ZIP) -q -y $@.tmp $(basename $(@F)).debuginfo
 	$(RM) $(basename $@).debuginfo
 	$(MV) $@.tmp $@
-endif
 
 $(INSTALL_LIBRARIES_HERE)/client/%$(SHARED_LIBRARY_SUFFIX) : $(INSTALL_LIBRARIES_HERE)/%$(SHARED_LIBRARY_SUFFIX)
 	$(MKDIR) -p $(@D)
@@ -196,18 +189,11 @@
 $(INSTALL_LIBRARIES_HERE)/client/%.diz : $(INSTALL_LIBRARIES_HERE)/%.diz
 	$(MKDIR) -p $(@D)
 	$(RM) $@
-ifeq (REALLY_WEIRD,1)
-	$(LN) -s ../$(@F) $@
-else
-#
-# TODO: Check if this is what they really want...a zip containing a symlink
-#
 	$(RM) $@.tmp $(basename $@).debuginfo
 	$(LN) -s ../$(basename $(@F)).debuginfo $(basename $@).debuginfo
-	$(ZIP) -q -y $@.tmp $(basename $@).debuginfo
+	$(CD) $(@D) && $(ZIP) -q -y $@.tmp $(basename $(@F)).debuginfo
 	$(RM) $(basename $@).debuginfo
 	$(MV) $@.tmp $@
-endif
 
 #######
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/makefiles/SignJars.gmk	Sun Jan 20 23:38:27 2013 -0800
@@ -0,0 +1,104 @@
+#
+# Copyright (c) 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.
+#
+
+include $(SPEC)
+include MakeBase.gmk
+
+# (The terms "OpenJDK" and "JDK" below refer to OpenJDK and Oracle JDK 
+# builds respectively.)
+#
+# JCE builds are very different between OpenJDK and JDK.  The OpenJDK JCE
+# jar files do not require signing, but those for JDK do.  If an unsigned
+# jar file is installed into JDK, things will break when the crypto
+# routines are called.
+#
+# All jars are created in CreateJars.gmk. This Makefile does the signing
+# of the jars for JDK.
+#
+# For JDK, the binaries use pre-built/pre-signed binary files stored in
+# the closed workspace that are not shipped in the OpenJDK workspaces.
+# We still build the JDK files to verify the files compile, and in
+# preparation for possible signing.  Developers working on JCE in JDK
+# must sign the JCE files before testing.  The JCE signing key is kept
+# separate from the JDK workspace to prevent its disclosure.
+#
+# SPECIAL NOTE TO JCE/JDK developers:  The source files must eventually
+# be built, signed, and then the resulting jar files MUST BE CHECKED
+# INTO THE CLOSED PART OF THE WORKSPACE*.  This separate step *MUST NOT
+# BE FORGOTTEN*, otherwise a bug fixed in the source code will not be
+# reflected in the shipped binaries.  The "sign-jars" target in the top
+# level Makefile should be used to generate the required files.
+#
+
+# Default target
+all:
+
+ifndef OPENJDK
+
+README-MAKEFILE_WARNING := \
+    "\nPlease read makefiles/SignJars.gmk for further build instructions.\n"
+
+#
+# Location for JCE codesigning key.
+#
+SIGNING_KEY_DIR    := /security/ws/JCE-signing/src
+SIGNING_KEYSTORE   := $(SIGNING_KEY_DIR)/KeyStore.jks
+SIGNING_PASSPHRASE := $(SIGNING_KEY_DIR)/passphrase.txt
+SIGNING_ALIAS      := oracle_jce_rsa
+
+#
+# Defines for signing the various jar files.
+#
+check-keystore:
+	@if [ ! -f $(SIGNING_KEYSTORE) -o ! -f $(SIGNING_PASSPHRASE) ]; then \
+	    $(PRINTF) "\n$(SIGNING_KEYSTORE): Signing mechanism *NOT* available..."; \
+	    $(PRINTF) $(README-MAKEFILE_WARNING); \
+	    exit 2; \
+	fi
+
+$(JCE_OUTPUTDIR)/%: $(IMAGES_OUTPUTDIR)/unsigned/%
+	$(MKDIR) -p $(@D)
+	$(CP) $< $@
+	$(JARSIGNER) -keystore $(SIGNING_KEYSTORE) \
+	    $@ $(SIGNING_ALIAS) < $(SIGNING_PASSPHRASE)
+	@$(PRINTF) "\nJar codesigning finished.\n"
+
+JAR_LIST := jce.jar \
+            local_policy.jar \
+            sunec.jar \
+            sunjce_provider.jar \
+            sunpkcs11.jar \
+            US_export_policy.jar
+
+SIGNED_JARS := $(addprefix $(JCE_OUTPUTDIR)/,$(JAR_LIST))
+
+$(SIGNED_JARS): check-keystore
+
+all: $(SIGNED_JARS)
+	@$(PRINTF) "\n***The jar files built by the 'jar-sign' target must***"
+	@$(PRINTF) "\n***still be checked into the closed workspace!     ***"
+	@$(PRINTF)  $(README-MAKEFILE_WARNING)
+
+endif  # !OPENJDK
--- a/jdk/makefiles/Tools.gmk	Mon Jan 21 12:04:55 2013 +0900
+++ b/jdk/makefiles/Tools.gmk	Sun Jan 20 23:38:27 2013 -0800
@@ -23,15 +23,25 @@
 # questions.
 #
 
+# Cache all finds needed for this file. Only used on windows.
+$(eval $(call FillCacheFind,$(JDK_TOPDIR)/make/tools \
+    $(JDK_TOPDIR)/src/solaris/classes \
+    $(JDK_TOPDIR)/makefiles/sun))
+
+TOOLS_SRC:=$(JDK_TOPDIR)/make/tools/src \
+           $(JDK_TOPDIR)/makefiles/sun/awt/X11 \
+           $(JDK_TOPDIR)/makefiles/sun/osxapp \
+           $(JDK_TOPDIR)/make/tools/swing-beans
+
+ifneq ($(OPENJDK_TARGET_OS),windows)
+  TOOLS_SRC+=$(JDK_TOPDIR)/src/solaris/classes/sun/awt/X11/generator
+endif
+
 # The exception handling of swing beaninfo which have the own tool directory
 ifeq (,$(BUILD_TOOLS))
 $(eval $(call SetupJavaCompilation,BUILD_TOOLS,\
                 SETUP:=GENERATE_OLDBYTECODE,\
-		SRC:=$(JDK_TOPDIR)/make/tools/src \
-                     $(JDK_TOPDIR)/src/solaris/classes/sun/awt/X11/generator \
-                     $(JDK_TOPDIR)/makefiles/sun/awt/X11 \
-                     $(JDK_TOPDIR)/makefiles/sun/osxapp \
-                     $(JDK_TOPDIR)/make/tools/swing-beans,\
+		SRC:=$(TOOLS_SRC),\
 		BIN:=$(JDK_OUTPUTDIR)/btclasses))
 
 endif
--- a/jdk/src/share/classes/java/io/FileSystem.java	Mon Jan 21 12:04:55 2013 +0900
+++ b/jdk/src/share/classes/java/io/FileSystem.java	Sun Jan 20 23:38:27 2013 -0800
@@ -25,6 +25,7 @@
 
 package java.io;
 
+import java.lang.annotation.Native;
 
 /**
  * Package-private abstract class for the local filesystem abstraction.
@@ -98,10 +99,10 @@
     /* -- Attribute accessors -- */
 
     /* Constants for simple boolean attributes */
-    public static final int BA_EXISTS    = 0x01;
-    public static final int BA_REGULAR   = 0x02;
-    public static final int BA_DIRECTORY = 0x04;
-    public static final int BA_HIDDEN    = 0x08;
+    @Native public static final int BA_EXISTS    = 0x01;
+    @Native public static final int BA_REGULAR   = 0x02;
+    @Native public static final int BA_DIRECTORY = 0x04;
+    @Native public static final int BA_HIDDEN    = 0x08;
 
     /**
      * Return the simple boolean attributes for the file or directory denoted
@@ -110,9 +111,9 @@
      */
     public abstract int getBooleanAttributes(File f);
 
-    public static final int ACCESS_READ    = 0x04;
-    public static final int ACCESS_WRITE   = 0x02;
-    public static final int ACCESS_EXECUTE = 0x01;
+    @Native public static final int ACCESS_READ    = 0x04;
+    @Native public static final int ACCESS_WRITE   = 0x02;
+    @Native public static final int ACCESS_EXECUTE = 0x01;
 
     /**
      * Check whether the file or directory denoted by the given abstract
@@ -203,9 +204,9 @@
     public abstract File[] listRoots();
 
     /* -- Disk usage -- */
-    public static final int SPACE_TOTAL  = 0;
-    public static final int SPACE_FREE   = 1;
-    public static final int SPACE_USABLE = 2;
+    @Native public static final int SPACE_TOTAL  = 0;
+    @Native public static final int SPACE_FREE   = 1;
+    @Native public static final int SPACE_USABLE = 2;
 
     public abstract long getSpace(File f, int t);
 
--- a/jdk/src/share/classes/java/lang/Integer.java	Mon Jan 21 12:04:55 2013 +0900
+++ b/jdk/src/share/classes/java/lang/Integer.java	Sun Jan 20 23:38:27 2013 -0800
@@ -25,6 +25,7 @@
 
 package java.lang;
 
+import java.lang.annotation.Native;
 import java.util.Properties;
 
 /**
@@ -54,13 +55,13 @@
      * A constant holding the minimum value an {@code int} can
      * have, -2<sup>31</sup>.
      */
-    public static final int   MIN_VALUE = 0x80000000;
+    @Native public static final int   MIN_VALUE = 0x80000000;
 
     /**
      * A constant holding the maximum value an {@code int} can
      * have, 2<sup>31</sup>-1.
      */
-    public static final int   MAX_VALUE = 0x7fffffff;
+    @Native public static final int   MAX_VALUE = 0x7fffffff;
 
     /**
      * The {@code Class} instance representing the primitive type
@@ -1295,7 +1296,7 @@
      *
      * @since 1.5
      */
-    public static final int SIZE = 32;
+    @Native public static final int SIZE = 32;
 
     /**
      * The number of bytes used to represent a {@code int} value in two's
@@ -1513,5 +1514,5 @@
     }
 
     /** use serialVersionUID from JDK 1.0.2 for interoperability */
-    private static final long serialVersionUID = 1360826667806852920L;
+    @Native private static final long serialVersionUID = 1360826667806852920L;
 }
--- a/jdk/src/share/classes/java/lang/Long.java	Mon Jan 21 12:04:55 2013 +0900
+++ b/jdk/src/share/classes/java/lang/Long.java	Sun Jan 20 23:38:27 2013 -0800
@@ -25,6 +25,7 @@
 
 package java.lang;
 
+import java.lang.annotation.Native;
 import java.math.*;
 
 /**
@@ -54,13 +55,13 @@
      * A constant holding the minimum value a {@code long} can
      * have, -2<sup>63</sup>.
      */
-    public static final long MIN_VALUE = 0x8000000000000000L;
+    @Native public static final long MIN_VALUE = 0x8000000000000000L;
 
     /**
      * A constant holding the maximum value a {@code long} can
      * have, 2<sup>63</sup>-1.
      */
-    public static final long MAX_VALUE = 0x7fffffffffffffffL;
+    @Native public static final long MAX_VALUE = 0x7fffffffffffffffL;
 
     /**
      * The {@code Class} instance representing the primitive type
@@ -1317,7 +1318,7 @@
      *
      * @since 1.5
      */
-    public static final int SIZE = 64;
+    @Native public static final int SIZE = 64;
 
     /**
      * The number of bytes used to represent a {@code long} value in two's
@@ -1540,5 +1541,5 @@
     }
 
     /** use serialVersionUID from JDK 1.0.2 for interoperability */
-    private static final long serialVersionUID = 4290774380558885855L;
+    @Native private static final long serialVersionUID = 4290774380558885855L;
 }
--- a/jdk/src/share/classes/java/net/SocketOptions.java	Mon Jan 21 12:04:55 2013 +0900
+++ b/jdk/src/share/classes/java/net/SocketOptions.java	Sun Jan 20 23:38:27 2013 -0800
@@ -25,6 +25,8 @@
 
 package java.net;
 
+import java.lang.annotation.Native;
+
 /**
  * Interface of methods to get/set socket options.  This interface is
  * implemented by: <B>SocketImpl</B> and  <B>DatagramSocketImpl</B>.
@@ -137,7 +139,7 @@
      * @see Socket#getTcpNoDelay
      */
 
-    public final static int TCP_NODELAY = 0x0001;
+    @Native public final static int TCP_NODELAY = 0x0001;
 
     /**
      * Fetch the local address binding of a socket (this option cannot
@@ -158,7 +160,7 @@
      * @see DatagramSocket#getLocalAddress
      */
 
-    public final static int SO_BINDADDR = 0x000F;
+    @Native public final static int SO_BINDADDR = 0x000F;
 
     /** Sets SO_REUSEADDR for a socket.  This is used only for MulticastSockets
      * in java, and it is set by default for MulticastSockets.
@@ -166,7 +168,7 @@
      * Valid for: DatagramSocketImpl
      */
 
-    public final static int SO_REUSEADDR = 0x04;
+    @Native public final static int SO_REUSEADDR = 0x04;
 
     /**
      * Sets SO_BROADCAST for a socket. This option enables and disables
@@ -177,7 +179,7 @@
      * @since 1.4
      */
 
-    public final static int SO_BROADCAST = 0x0020;
+    @Native public final static int SO_BROADCAST = 0x0020;
 
     /** Set which outgoing interface on which to send multicast packets.
      * Useful on hosts with multiple network interfaces, where applications
@@ -189,7 +191,7 @@
      * @see MulticastSocket#getInterface()
      */
 
-    public final static int IP_MULTICAST_IF = 0x10;
+    @Native public final static int IP_MULTICAST_IF = 0x10;
 
     /** Same as above. This option is introduced so that the behaviour
      *  with IP_MULTICAST_IF will be kept the same as before, while
@@ -201,7 +203,7 @@
      * @see MulticastSocket#getNetworkInterface()
      * @since 1.4
      */
-    public final static int IP_MULTICAST_IF2 = 0x1f;
+    @Native public final static int IP_MULTICAST_IF2 = 0x1f;
 
     /**
      * This option enables or disables local loopback of multicast datagrams.
@@ -209,7 +211,7 @@
      * @since 1.4
      */
 
-    public final static int IP_MULTICAST_LOOP = 0x12;
+    @Native public final static int IP_MULTICAST_LOOP = 0x12;
 
     /**
      * This option sets the type-of-service or traffic class field
@@ -217,7 +219,7 @@
      * @since 1.4
      */
 
-    public final static int IP_TOS = 0x3;
+    @Native public final static int IP_TOS = 0x3;
 
     /**
      * Specify a linger-on-close timeout.  This option disables/enables
@@ -235,7 +237,7 @@
      * @see Socket#setSoLinger
      * @see Socket#getSoLinger
      */
-    public final static int SO_LINGER = 0x0080;
+    @Native public final static int SO_LINGER = 0x0080;
 
     /** Set a timeout on blocking Socket operations:
      * <PRE>
@@ -256,7 +258,7 @@
      * @see ServerSocket#setSoTimeout
      * @see DatagramSocket#setSoTimeout
      */
-    public final static int SO_TIMEOUT = 0x1006;
+    @Native public final static int SO_TIMEOUT = 0x1006;
 
     /**
      * Set a hint the size of the underlying buffers used by the
@@ -273,7 +275,7 @@
      * @see DatagramSocket#setSendBufferSize
      * @see DatagramSocket#getSendBufferSize
      */
-    public final static int SO_SNDBUF = 0x1001;
+    @Native public final static int SO_SNDBUF = 0x1001;
 
     /**
      * Set a hint the size of the underlying buffers used by the
@@ -291,7 +293,7 @@
      * @see DatagramSocket#setReceiveBufferSize
      * @see DatagramSocket#getReceiveBufferSize
      */
-    public final static int SO_RCVBUF = 0x1002;
+    @Native public final static int SO_RCVBUF = 0x1002;
 
     /**
      * When the keepalive option is set for a TCP socket and no data
@@ -314,7 +316,7 @@
      * @see Socket#setKeepAlive
      * @see Socket#getKeepAlive
      */
-    public final static int SO_KEEPALIVE = 0x0008;
+    @Native public final static int SO_KEEPALIVE = 0x0008;
 
     /**
      * When the OOBINLINE option is set, any TCP urgent data received on
@@ -325,5 +327,5 @@
      * @see Socket#setOOBInline
      * @see Socket#getOOBInline
      */
-    public final static int SO_OOBINLINE = 0x1003;
+    @Native public final static int SO_OOBINLINE = 0x1003;
 }
--- a/jdk/src/share/classes/sun/nio/ch/IOStatus.java	Mon Jan 21 12:04:55 2013 +0900
+++ b/jdk/src/share/classes/sun/nio/ch/IOStatus.java	Sun Jan 20 23:38:27 2013 -0800
@@ -25,6 +25,7 @@
 
 package sun.nio.ch;
 
+import java.lang.annotation.Native;
 
 // Constants for reporting I/O status
 
@@ -32,12 +33,12 @@
 
     private IOStatus() { }
 
-    public static final int EOF = -1;              // End of file
-    public static final int UNAVAILABLE = -2;      // Nothing available (non-blocking)
-    public static final int INTERRUPTED = -3;      // System call interrupted
-    public static final int UNSUPPORTED = -4;      // Operation not supported
-    public static final int THROWN = -5;           // Exception thrown in JNI code
-    public static final int UNSUPPORTED_CASE = -6; // This case not supported
+    @Native public static final int EOF = -1;              // End of file
+    @Native public static final int UNAVAILABLE = -2;      // Nothing available (non-blocking)
+    @Native public static final int INTERRUPTED = -3;      // System call interrupted
+    @Native public static final int UNSUPPORTED = -4;      // Operation not supported
+    @Native public static final int THROWN = -5;           // Exception thrown in JNI code
+    @Native public static final int UNSUPPORTED_CASE = -6; // This case not supported
 
     // The following two methods are for use in try/finally blocks where a
     // status value needs to be normalized before being returned to the invoker
--- a/jdk/src/share/demo/jfc/CodePointIM/CodePointInputMethod.java	Mon Jan 21 12:04:55 2013 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,499 +0,0 @@
-/*
- * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- *   - Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- *
- *   - Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- *   - Neither the name of Oracle nor the names of its
- *     contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
- * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-package com.sun.inputmethods.internal.codepointim;
-
-
-import java.awt.AWTEvent;
-import java.awt.Toolkit;
-import java.awt.Rectangle;
-import java.awt.event.InputMethodEvent;
-import java.awt.event.KeyEvent;
-import java.awt.font.TextAttribute;
-import java.awt.font.TextHitInfo;
-import java.awt.im.InputMethodHighlight;
-import java.awt.im.spi.InputMethod;
-import java.awt.im.spi.InputMethodContext;
-import java.io.IOException;
-import java.text.AttributedString;
-import java.util.Locale;
-
-
-/**
- * The Code Point Input Method is a simple input method that allows Unicode
- * characters to be entered using their code point or code unit values. See the
- * accompanying file README.txt for more information.
- *
- * @author Brian Beck
- */
-public class CodePointInputMethod implements InputMethod {
-
-    private static final int UNSET = 0;
-    private static final int ESCAPE = 1; // \u0000       - \uFFFF
-    private static final int SPECIAL_ESCAPE = 2; // \U000000     - \U10FFFF
-    private static final int SURROGATE_PAIR = 3; // \uD800\uDC00 - \uDBFF\uDFFF
-    private InputMethodContext context;
-    private Locale locale;
-    private StringBuffer buffer;
-    private int insertionPoint;
-    private int format = UNSET;
-
-    public CodePointInputMethod() throws IOException {
-    }
-
-    /**
-     * This is the input method's main routine.  The composed text is stored
-     * in buffer.
-     */
-    public void dispatchEvent(AWTEvent event) {
-        // This input method handles KeyEvent only.
-        if (!(event instanceof KeyEvent)) {
-            return;
-        }
-
-        KeyEvent e = (KeyEvent) event;
-        int eventID = event.getID();
-        boolean notInCompositionMode = buffer.length() == 0;
-
-        if (eventID == KeyEvent.KEY_PRESSED) {
-            // If we are not in composition mode, pass through
-            if (notInCompositionMode) {
-                return;
-            }
-
-            switch (e.getKeyCode()) {
-                case KeyEvent.VK_LEFT:
-                    moveCaretLeft();
-                    break;
-                case KeyEvent.VK_RIGHT:
-                    moveCaretRight();
-                    break;
-            }
-        } else if (eventID == KeyEvent.KEY_TYPED) {
-            char c = e.getKeyChar();
-
-            // If we are not in composition mode, wait a back slash
-            if (notInCompositionMode) {
-                // If the type character is not a back slash, pass through
-                if (c != '\\') {
-                    return;
-                }
-
-                startComposition();     // Enter to composition mode
-            } else {
-                switch (c) {
-                    case ' ':       // Exit from composition mode
-                        finishComposition();
-                        break;
-                    case '\u007f':  // Delete
-                        deleteCharacter();
-                        break;
-                    case '\b':      // BackSpace
-                        deletePreviousCharacter();
-                        break;
-                    case '\u001b':  // Escape
-                        cancelComposition();
-                        break;
-                    case '\n':      // Return
-                    case '\t':      // Tab
-                        sendCommittedText();
-                        break;
-                    default:
-                        composeUnicodeEscape(c);
-                        break;
-                }
-            }
-        } else {  // KeyEvent.KEY_RELEASED
-            // If we are not in composition mode, pass through
-            if (notInCompositionMode) {
-                return;
-            }
-        }
-
-        e.consume();
-    }
-
-    private void composeUnicodeEscape(char c) {
-        switch (buffer.length()) {
-            case 1:  // \\
-                waitEscapeCharacter(c);
-                break;
-            case 2:  // \\u or \\U
-            case 3:  // \\ux or \\Ux
-            case 4:  // \\uxx or \\Uxx
-                waitDigit(c);
-                break;
-            case 5:  // \\uxxx or \\Uxxx
-                if (format == SPECIAL_ESCAPE) {
-                    waitDigit(c);
-                } else {
-                    waitDigit2(c);
-                }
-                break;
-            case 6:  // \\uxxxx or \\Uxxxx
-                if (format == SPECIAL_ESCAPE) {
-                    waitDigit(c);
-                } else if (format == SURROGATE_PAIR) {
-                    waitBackSlashOrLowSurrogate(c);
-                } else {
-                    beep();
-                }
-                break;
-            case 7:  // \\Uxxxxx
-                // Only SPECIAL_ESCAPE format uses this state.
-                // Since the second "\\u" of SURROGATE_PAIR format is inserted
-                // automatically, users don't have to type these keys.
-                waitDigit(c);
-                break;
-            case 8:  // \\uxxxx\\u
-            case 9:  // \\uxxxx\\ux
-            case 10: // \\uxxxx\\uxx
-            case 11: // \\uxxxx\\uxxx
-                if (format == SURROGATE_PAIR) {
-                    waitDigit(c);
-                } else {
-                    beep();
-                }
-                break;
-            default:
-                beep();
-                break;
-        }
-    }
-
-    private void waitEscapeCharacter(char c) {
-        if (c == 'u' || c == 'U') {
-            buffer.append(c);
-            insertionPoint++;
-            sendComposedText();
-            format = (c == 'u') ? ESCAPE : SPECIAL_ESCAPE;
-        } else {
-            if (c != '\\') {
-                buffer.append(c);
-                insertionPoint++;
-            }
-            sendCommittedText();
-        }
-    }
-
-    private void waitDigit(char c) {
-        if (Character.digit(c, 16) != -1) {
-            buffer.insert(insertionPoint++, c);
-            sendComposedText();
-        } else {
-            beep();
-        }
-    }
-
-    private void waitDigit2(char c) {
-        if (Character.digit(c, 16) != -1) {
-            buffer.insert(insertionPoint++, c);
-            char codePoint = (char) getCodePoint(buffer, 2, 5);
-            if (Character.isHighSurrogate(codePoint)) {
-                format = SURROGATE_PAIR;
-                buffer.append("\\u");
-                insertionPoint = 8;
-            } else {
-                format = ESCAPE;
-            }
-            sendComposedText();
-        } else {
-            beep();
-        }
-    }
-
-    private void waitBackSlashOrLowSurrogate(char c) {
-        if (insertionPoint == 6) {
-            if (c == '\\') {
-                buffer.append(c);
-                buffer.append('u');
-                insertionPoint = 8;
-                sendComposedText();
-            } else if (Character.digit(c, 16) != -1) {
-                buffer.append("\\u");
-                buffer.append(c);
-                insertionPoint = 9;
-                sendComposedText();
-            } else {
-                beep();
-            }
-        } else {
-            beep();
-        }
-    }
-
-    /**
-     * Send the composed text to the client.
-     */
-    private void sendComposedText() {
-        AttributedString as = new AttributedString(buffer.toString());
-        as.addAttribute(TextAttribute.INPUT_METHOD_HIGHLIGHT,
-                InputMethodHighlight.SELECTED_RAW_TEXT_HIGHLIGHT);
-        context.dispatchInputMethodEvent(
-                InputMethodEvent.INPUT_METHOD_TEXT_CHANGED,
-                as.getIterator(), 0,
-                TextHitInfo.leading(insertionPoint), null);
-    }
-
-    /**
-     * Send the committed text to the client.
-     */
-    private void sendCommittedText() {
-        AttributedString as = new AttributedString(buffer.toString());
-        context.dispatchInputMethodEvent(
-                InputMethodEvent.INPUT_METHOD_TEXT_CHANGED,
-                as.getIterator(), buffer.length(),
-                TextHitInfo.leading(insertionPoint), null);
-
-        buffer.setLength(0);
-        insertionPoint = 0;
-        format = UNSET;
-    }
-
-    /**
-     * Move the insertion point one position to the left in the composed text.
-     * Do not let the caret move to the left of the "\\u" or "\\U".
-     */
-    private void moveCaretLeft() {
-        int len = buffer.length();
-        if (--insertionPoint < 2) {
-            insertionPoint++;
-            beep();
-        } else if (format == SURROGATE_PAIR && insertionPoint == 7) {
-            insertionPoint = 8;
-            beep();
-        }
-
-        context.dispatchInputMethodEvent(
-                InputMethodEvent.CARET_POSITION_CHANGED,
-                null, 0,
-                TextHitInfo.leading(insertionPoint), null);
-    }
-
-    /**
-     * Move the insertion point one position to the right in the composed text.
-     */
-    private void moveCaretRight() {
-        int len = buffer.length();
-        if (++insertionPoint > len) {
-            insertionPoint = len;
-            beep();
-        }
-
-        context.dispatchInputMethodEvent(
-                InputMethodEvent.CARET_POSITION_CHANGED,
-                null, 0,
-                TextHitInfo.leading(insertionPoint), null);
-    }
-
-    /**
-     * Delete the character preceding the insertion point in the composed text.
-     * If the insertion point is not at the end of the composed text and the
-     * preceding text is "\\u" or "\\U", ring the bell.
-     */
-    private void deletePreviousCharacter() {
-        if (insertionPoint == 2) {
-            if (buffer.length() == 2) {
-                cancelComposition();
-            } else {
-                // Do not allow deletion of the leading "\\u" or "\\U" if there
-                // are other digits in the composed text.
-                beep();
-            }
-        } else if (insertionPoint == 8) {
-            if (buffer.length() == 8) {
-                if (format == SURROGATE_PAIR) {
-                    buffer.deleteCharAt(--insertionPoint);
-                }
-                buffer.deleteCharAt(--insertionPoint);
-                sendComposedText();
-            } else {
-                // Do not allow deletion of the second "\\u" if there are other
-                // digits in the composed text.
-                beep();
-            }
-        } else {
-            buffer.deleteCharAt(--insertionPoint);
-            if (buffer.length() == 0) {
-                sendCommittedText();
-            } else {
-                sendComposedText();
-            }
-        }
-    }
-
-    /**
-     * Delete the character following the insertion point in the composed text.
-     * If the insertion point is at the end of the composed text, ring the bell.
-     */
-    private void deleteCharacter() {
-        if (insertionPoint < buffer.length()) {
-            buffer.deleteCharAt(insertionPoint);
-            sendComposedText();
-        } else {
-            beep();
-        }
-    }
-
-    private void startComposition() {
-        buffer.append('\\');
-        insertionPoint = 1;
-        sendComposedText();
-    }
-
-    private void cancelComposition() {
-        buffer.setLength(0);
-        insertionPoint = 0;
-        sendCommittedText();
-    }
-
-    private void finishComposition() {
-        int len = buffer.length();
-        if (len == 6 && format != SPECIAL_ESCAPE) {
-            char codePoint = (char) getCodePoint(buffer, 2, 5);
-            if (Character.isValidCodePoint(codePoint) && codePoint != 0xFFFF) {
-                buffer.setLength(0);
-                buffer.append(codePoint);
-                sendCommittedText();
-                return;
-            }
-        } else if (len == 8 && format == SPECIAL_ESCAPE) {
-            int codePoint = getCodePoint(buffer, 2, 7);
-            if (Character.isValidCodePoint(codePoint) && codePoint != 0xFFFF) {
-                buffer.setLength(0);
-                buffer.appendCodePoint(codePoint);
-                sendCommittedText();
-                return;
-            }
-        } else if (len == 12 && format == SURROGATE_PAIR) {
-            char[] codePoint = {
-                (char) getCodePoint(buffer, 2, 5),
-                (char) getCodePoint(buffer, 8, 11)
-            };
-            if (Character.isHighSurrogate(codePoint[0]) && Character.
-                    isLowSurrogate(codePoint[1])) {
-                buffer.setLength(0);
-                buffer.append(codePoint);
-                sendCommittedText();
-                return;
-            }
-        }
-
-        beep();
-    }
-
-    private int getCodePoint(StringBuffer sb, int from, int to) {
-        int value = 0;
-        for (int i = from; i <= to; i++) {
-            value = (value << 4) + Character.digit(sb.charAt(i), 16);
-        }
-        return value;
-    }
-
-    private static void beep() {
-        Toolkit.getDefaultToolkit().beep();
-    }
-
-    public void activate() {
-        if (buffer == null) {
-            buffer = new StringBuffer(12);
-            insertionPoint = 0;
-        }
-    }
-
-    public void deactivate(boolean isTemporary) {
-        if (!isTemporary) {
-            buffer = null;
-        }
-    }
-
-    public void dispose() {
-    }
-
-    public Object getControlObject() {
-        return null;
-    }
-
-    public void endComposition() {
-        sendCommittedText();
-    }
-
-    public Locale getLocale() {
-        return locale;
-    }
-
-    public void hideWindows() {
-    }
-
-    public boolean isCompositionEnabled() {
-        // always enabled
-        return true;
-    }
-
-    public void notifyClientWindowChange(Rectangle location) {
-    }
-
-    public void reconvert() {
-        // not supported yet
-        throw new UnsupportedOperationException();
-    }
-
-    public void removeNotify() {
-    }
-
-    public void setCharacterSubsets(Character.Subset[] subsets) {
-    }
-
-    public void setCompositionEnabled(boolean enable) {
-        // not supported yet
-        throw new UnsupportedOperationException();
-    }
-
-    public void setInputMethodContext(InputMethodContext context) {
-        this.context = context;
-    }
-
-    /*
-     * The Code Point Input Method supports all locales.
-     */
-    public boolean setLocale(Locale locale) {
-        this.locale = locale;
-        return true;
-    }
-}
--- a/jdk/src/share/demo/jfc/CodePointIM/CodePointInputMethodDescriptor.java	Mon Jan 21 12:04:55 2013 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,94 +0,0 @@
-/*
- * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- *   - Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- *
- *   - Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- *   - Neither the name of Oracle nor the names of its
- *     contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
- * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-package com.sun.inputmethods.internal.codepointim;
-
-
-import java.awt.Image;
-import java.awt.im.spi.InputMethodDescriptor;
-import java.awt.im.spi.InputMethod;
-import java.util.Locale;
-
-
-/**
- * The CodePointInputMethod is a simple input method that allows Unicode
- * characters to be entered via their hexadecimal code point values.
- *
- * The class, CodePointInputMethodDescriptor, provides information about the
- * CodePointInputMethod which allows it to be selected and loaded by the
- * Input Method Framework.
- */
-public class CodePointInputMethodDescriptor implements InputMethodDescriptor {
-
-    public CodePointInputMethodDescriptor() {
-    }
-
-    /**
-     * Creates a new instance of the Code Point input method.
-     *
-     * @return a new instance of the Code Point input method
-     * @exception Exception any exception that may occur while creating the
-     * input method instance
-     */
-    public InputMethod createInputMethod() throws Exception {
-        return new CodePointInputMethod();
-    }
-
-    /**
-     * This input method can be used by any locale.
-     */
-    public Locale[] getAvailableLocales() {
-        Locale[] locales = {
-            new Locale("", "", ""), };
-        return locales;
-    }
-
-    public synchronized String getInputMethodDisplayName(Locale inputLocale,
-            Locale displayLanguage) {
-        return "CodePoint Input Method";
-    }
-
-    public Image getInputMethodIcon(Locale inputLocale) {
-        return null;
-    }
-
-    public boolean hasDynamicLocaleList() {
-        return false;
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/demo/jfc/CodePointIM/com/sun/inputmethods/internal/codepointim/CodePointInputMethod.java	Sun Jan 20 23:38:27 2013 -0800
@@ -0,0 +1,499 @@
+/*
+ * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ *   - Neither the name of Oracle nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This source code is provided to illustrate the usage of a given feature
+ * or technique and has been deliberately simplified. Additional steps
+ * required for a production-quality application, such as security checks,
+ * input validation and proper error handling, might not be present in
+ * this sample code.
+ */
+
+package com.sun.inputmethods.internal.codepointim;
+
+
+import java.awt.AWTEvent;
+import java.awt.Toolkit;
+import java.awt.Rectangle;
+import java.awt.event.InputMethodEvent;
+import java.awt.event.KeyEvent;
+import java.awt.font.TextAttribute;
+import java.awt.font.TextHitInfo;
+import java.awt.im.InputMethodHighlight;
+import java.awt.im.spi.InputMethod;
+import java.awt.im.spi.InputMethodContext;
+import java.io.IOException;
+import java.text.AttributedString;
+import java.util.Locale;
+
+
+/**
+ * The Code Point Input Method is a simple input method that allows Unicode
+ * characters to be entered using their code point or code unit values. See the
+ * accompanying file README.txt for more information.
+ *
+ * @author Brian Beck
+ */
+public class CodePointInputMethod implements InputMethod {
+
+    private static final int UNSET = 0;
+    private static final int ESCAPE = 1; // \u0000       - \uFFFF
+    private static final int SPECIAL_ESCAPE = 2; // \U000000     - \U10FFFF
+    private static final int SURROGATE_PAIR = 3; // \uD800\uDC00 - \uDBFF\uDFFF
+    private InputMethodContext context;
+    private Locale locale;
+    private StringBuffer buffer;
+    private int insertionPoint;
+    private int format = UNSET;
+
+    public CodePointInputMethod() throws IOException {
+    }
+
+    /**
+     * This is the input method's main routine.  The composed text is stored
+     * in buffer.
+     */
+    public void dispatchEvent(AWTEvent event) {
+        // This input method handles KeyEvent only.
+        if (!(event instanceof KeyEvent)) {
+            return;
+        }
+
+        KeyEvent e = (KeyEvent) event;
+        int eventID = event.getID();
+        boolean notInCompositionMode = buffer.length() == 0;
+
+        if (eventID == KeyEvent.KEY_PRESSED) {
+            // If we are not in composition mode, pass through
+            if (notInCompositionMode) {
+                return;
+            }
+
+            switch (e.getKeyCode()) {
+                case KeyEvent.VK_LEFT:
+                    moveCaretLeft();
+                    break;
+                case KeyEvent.VK_RIGHT:
+                    moveCaretRight();
+                    break;
+            }
+        } else if (eventID == KeyEvent.KEY_TYPED) {
+            char c = e.getKeyChar();
+
+            // If we are not in composition mode, wait a back slash
+            if (notInCompositionMode) {
+                // If the type character is not a back slash, pass through
+                if (c != '\\') {
+                    return;
+                }
+
+                startComposition();     // Enter to composition mode
+            } else {
+                switch (c) {
+                    case ' ':       // Exit from composition mode
+                        finishComposition();
+                        break;
+                    case '\u007f':  // Delete
+                        deleteCharacter();
+                        break;
+                    case '\b':      // BackSpace
+                        deletePreviousCharacter();
+                        break;
+                    case '\u001b':  // Escape
+                        cancelComposition();
+                        break;
+                    case '\n':      // Return
+                    case '\t':      // Tab
+                        sendCommittedText();
+                        break;
+                    default:
+                        composeUnicodeEscape(c);
+                        break;
+                }
+            }
+        } else {  // KeyEvent.KEY_RELEASED
+            // If we are not in composition mode, pass through
+            if (notInCompositionMode) {
+                return;
+            }
+        }
+
+        e.consume();
+    }
+
+    private void composeUnicodeEscape(char c) {
+        switch (buffer.length()) {
+            case 1:  // \\
+                waitEscapeCharacter(c);
+                break;
+            case 2:  // \\u or \\U
+            case 3:  // \\ux or \\Ux
+            case 4:  // \\uxx or \\Uxx
+                waitDigit(c);
+                break;
+            case 5:  // \\uxxx or \\Uxxx
+                if (format == SPECIAL_ESCAPE) {
+                    waitDigit(c);
+                } else {
+                    waitDigit2(c);
+                }
+                break;
+            case 6:  // \\uxxxx or \\Uxxxx
+                if (format == SPECIAL_ESCAPE) {
+                    waitDigit(c);
+                } else if (format == SURROGATE_PAIR) {
+                    waitBackSlashOrLowSurrogate(c);
+                } else {
+                    beep();
+                }
+                break;
+            case 7:  // \\Uxxxxx
+                // Only SPECIAL_ESCAPE format uses this state.
+                // Since the second "\\u" of SURROGATE_PAIR format is inserted
+                // automatically, users don't have to type these keys.
+                waitDigit(c);
+                break;
+            case 8:  // \\uxxxx\\u
+            case 9:  // \\uxxxx\\ux
+            case 10: // \\uxxxx\\uxx
+            case 11: // \\uxxxx\\uxxx
+                if (format == SURROGATE_PAIR) {
+                    waitDigit(c);
+                } else {
+                    beep();
+                }
+                break;
+            default:
+                beep();
+                break;
+        }
+    }
+
+    private void waitEscapeCharacter(char c) {
+        if (c == 'u' || c == 'U') {
+            buffer.append(c);
+            insertionPoint++;
+            sendComposedText();
+            format = (c == 'u') ? ESCAPE : SPECIAL_ESCAPE;
+        } else {
+            if (c != '\\') {
+                buffer.append(c);
+                insertionPoint++;
+            }
+            sendCommittedText();
+        }
+    }
+
+    private void waitDigit(char c) {
+        if (Character.digit(c, 16) != -1) {
+            buffer.insert(insertionPoint++, c);
+            sendComposedText();
+        } else {
+            beep();
+        }
+    }
+
+    private void waitDigit2(char c) {
+        if (Character.digit(c, 16) != -1) {
+            buffer.insert(insertionPoint++, c);
+            char codePoint = (char) getCodePoint(buffer, 2, 5);
+            if (Character.isHighSurrogate(codePoint)) {
+                format = SURROGATE_PAIR;
+                buffer.append("\\u");
+                insertionPoint = 8;
+            } else {
+                format = ESCAPE;
+            }
+            sendComposedText();
+        } else {
+            beep();
+        }
+    }
+
+    private void waitBackSlashOrLowSurrogate(char c) {
+        if (insertionPoint == 6) {
+            if (c == '\\') {
+                buffer.append(c);
+                buffer.append('u');
+                insertionPoint = 8;
+                sendComposedText();
+            } else if (Character.digit(c, 16) != -1) {
+                buffer.append("\\u");
+                buffer.append(c);
+                insertionPoint = 9;
+                sendComposedText();
+            } else {
+                beep();
+            }
+        } else {
+            beep();
+        }
+    }
+
+    /**
+     * Send the composed text to the client.
+     */
+    private void sendComposedText() {
+        AttributedString as = new AttributedString(buffer.toString());
+        as.addAttribute(TextAttribute.INPUT_METHOD_HIGHLIGHT,
+                InputMethodHighlight.SELECTED_RAW_TEXT_HIGHLIGHT);
+        context.dispatchInputMethodEvent(
+                InputMethodEvent.INPUT_METHOD_TEXT_CHANGED,
+                as.getIterator(), 0,
+                TextHitInfo.leading(insertionPoint), null);
+    }
+
+    /**
+     * Send the committed text to the client.
+     */
+    private void sendCommittedText() {
+        AttributedString as = new AttributedString(buffer.toString());
+        context.dispatchInputMethodEvent(
+                InputMethodEvent.INPUT_METHOD_TEXT_CHANGED,
+                as.getIterator(), buffer.length(),
+                TextHitInfo.leading(insertionPoint), null);
+
+        buffer.setLength(0);
+        insertionPoint = 0;
+        format = UNSET;
+    }
+
+    /**
+     * Move the insertion point one position to the left in the composed text.
+     * Do not let the caret move to the left of the "\\u" or "\\U".
+     */
+    private void moveCaretLeft() {
+        int len = buffer.length();
+        if (--insertionPoint < 2) {
+            insertionPoint++;
+            beep();
+        } else if (format == SURROGATE_PAIR && insertionPoint == 7) {
+            insertionPoint = 8;
+            beep();
+        }
+
+        context.dispatchInputMethodEvent(
+                InputMethodEvent.CARET_POSITION_CHANGED,
+                null, 0,
+                TextHitInfo.leading(insertionPoint), null);
+    }
+
+    /**
+     * Move the insertion point one position to the right in the composed text.
+     */
+    private void moveCaretRight() {
+        int len = buffer.length();
+        if (++insertionPoint > len) {
+            insertionPoint = len;
+            beep();
+        }
+
+        context.dispatchInputMethodEvent(
+                InputMethodEvent.CARET_POSITION_CHANGED,
+                null, 0,
+                TextHitInfo.leading(insertionPoint), null);
+    }
+
+    /**
+     * Delete the character preceding the insertion point in the composed text.
+     * If the insertion point is not at the end of the composed text and the
+     * preceding text is "\\u" or "\\U", ring the bell.
+     */
+    private void deletePreviousCharacter() {
+        if (insertionPoint == 2) {
+            if (buffer.length() == 2) {
+                cancelComposition();
+            } else {
+                // Do not allow deletion of the leading "\\u" or "\\U" if there
+                // are other digits in the composed text.
+                beep();
+            }
+        } else if (insertionPoint == 8) {
+            if (buffer.length() == 8) {
+                if (format == SURROGATE_PAIR) {
+                    buffer.deleteCharAt(--insertionPoint);
+                }
+                buffer.deleteCharAt(--insertionPoint);
+                sendComposedText();
+            } else {
+                // Do not allow deletion of the second "\\u" if there are other
+                // digits in the composed text.
+                beep();
+            }
+        } else {
+            buffer.deleteCharAt(--insertionPoint);
+            if (buffer.length() == 0) {
+                sendCommittedText();
+            } else {
+                sendComposedText();
+            }
+        }
+    }
+
+    /**
+     * Delete the character following the insertion point in the composed text.
+     * If the insertion point is at the end of the composed text, ring the bell.
+     */
+    private void deleteCharacter() {
+        if (insertionPoint < buffer.length()) {
+            buffer.deleteCharAt(insertionPoint);
+            sendComposedText();
+        } else {
+            beep();
+        }
+    }
+
+    private void startComposition() {
+        buffer.append('\\');
+        insertionPoint = 1;
+        sendComposedText();
+    }
+
+    private void cancelComposition() {
+        buffer.setLength(0);
+        insertionPoint = 0;
+        sendCommittedText();
+    }
+
+    private void finishComposition() {
+        int len = buffer.length();
+        if (len == 6 && format != SPECIAL_ESCAPE) {
+            char codePoint = (char) getCodePoint(buffer, 2, 5);
+            if (Character.isValidCodePoint(codePoint) && codePoint != 0xFFFF) {
+                buffer.setLength(0);
+                buffer.append(codePoint);
+                sendCommittedText();
+                return;
+            }
+        } else if (len == 8 && format == SPECIAL_ESCAPE) {
+            int codePoint = getCodePoint(buffer, 2, 7);
+            if (Character.isValidCodePoint(codePoint) && codePoint != 0xFFFF) {
+                buffer.setLength(0);
+                buffer.appendCodePoint(codePoint);
+                sendCommittedText();
+                return;
+            }
+        } else if (len == 12 && format == SURROGATE_PAIR) {
+            char[] codePoint = {
+                (char) getCodePoint(buffer, 2, 5),
+                (char) getCodePoint(buffer, 8, 11)
+            };
+            if (Character.isHighSurrogate(codePoint[0]) && Character.
+                    isLowSurrogate(codePoint[1])) {
+                buffer.setLength(0);
+                buffer.append(codePoint);
+                sendCommittedText();
+                return;
+            }
+        }
+
+        beep();
+    }
+
+    private int getCodePoint(StringBuffer sb, int from, int to) {
+        int value = 0;
+        for (int i = from; i <= to; i++) {
+            value = (value << 4) + Character.digit(sb.charAt(i), 16);
+        }
+        return value;
+    }
+
+    private static void beep() {
+        Toolkit.getDefaultToolkit().beep();
+    }
+
+    public void activate() {
+        if (buffer == null) {
+            buffer = new StringBuffer(12);
+            insertionPoint = 0;
+        }
+    }
+
+    public void deactivate(boolean isTemporary) {
+        if (!isTemporary) {
+            buffer = null;
+        }
+    }
+
+    public void dispose() {
+    }
+
+    public Object getControlObject() {
+        return null;
+    }
+
+    public void endComposition() {
+        sendCommittedText();
+    }
+
+    public Locale getLocale() {
+        return locale;
+    }
+
+    public void hideWindows() {
+    }
+
+    public boolean isCompositionEnabled() {
+        // always enabled
+        return true;
+    }
+
+    public void notifyClientWindowChange(Rectangle location) {
+    }
+
+    public void reconvert() {
+        // not supported yet
+        throw new UnsupportedOperationException();
+    }
+
+    public void removeNotify() {
+    }
+
+    public void setCharacterSubsets(Character.Subset[] subsets) {
+    }
+
+    public void setCompositionEnabled(boolean enable) {
+        // not supported yet
+        throw new UnsupportedOperationException();
+    }
+
+    public void setInputMethodContext(InputMethodContext context) {
+        this.context = context;
+    }
+
+    /*
+     * The Code Point Input Method supports all locales.
+     */
+    public boolean setLocale(Locale locale) {
+        this.locale = locale;
+        return true;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/demo/jfc/CodePointIM/com/sun/inputmethods/internal/codepointim/CodePointInputMethodDescriptor.java	Sun Jan 20 23:38:27 2013 -0800
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ *   - Neither the name of Oracle nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This source code is provided to illustrate the usage of a given feature
+ * or technique and has been deliberately simplified. Additional steps
+ * required for a production-quality application, such as security checks,
+ * input validation and proper error handling, might not be present in
+ * this sample code.
+ */
+
+package com.sun.inputmethods.internal.codepointim;
+
+
+import java.awt.Image;
+import java.awt.im.spi.InputMethodDescriptor;
+import java.awt.im.spi.InputMethod;
+import java.util.Locale;
+
+
+/**
+ * The CodePointInputMethod is a simple input method that allows Unicode
+ * characters to be entered via their hexadecimal code point values.
+ *
+ * The class, CodePointInputMethodDescriptor, provides information about the
+ * CodePointInputMethod which allows it to be selected and loaded by the
+ * Input Method Framework.
+ */
+public class CodePointInputMethodDescriptor implements InputMethodDescriptor {
+
+    public CodePointInputMethodDescriptor() {
+    }
+
+    /**
+     * Creates a new instance of the Code Point input method.
+     *
+     * @return a new instance of the Code Point input method
+     * @exception Exception any exception that may occur while creating the
+     * input method instance
+     */
+    public InputMethod createInputMethod() throws Exception {
+        return new CodePointInputMethod();
+    }
+
+    /**
+     * This input method can be used by any locale.
+     */
+    public Locale[] getAvailableLocales() {
+        Locale[] locales = {
+            new Locale("", "", ""), };
+        return locales;
+    }
+
+    public synchronized String getInputMethodDisplayName(Locale inputLocale,
+            Locale displayLanguage) {
+        return "CodePoint Input Method";
+    }
+
+    public Image getInputMethodIcon(Locale inputLocale) {
+        return null;
+    }
+
+    public boolean hasDynamicLocaleList() {
+        return false;
+    }
+}
--- a/jdk/src/windows/classes/sun/nio/ch/PollArrayWrapper.java	Mon Jan 21 12:04:55 2013 +0900
+++ b/jdk/src/windows/classes/sun/nio/ch/PollArrayWrapper.java	Sun Jan 20 23:38:27 2013 -0800
@@ -28,6 +28,8 @@
 
 package sun.nio.ch;
 
+import java.lang.annotation.Native;
+
 /**
  * Manipulates a native array of structs corresponding to (fd, events) pairs.
  *
@@ -46,19 +48,19 @@
 
     long pollArrayAddress; // pollArrayAddress
 
-    private static final short FD_OFFSET     = 0; // fd offset in pollfd
-    private static final short EVENT_OFFSET  = 4; // events offset in pollfd
+    @Native private static final short FD_OFFSET     = 0; // fd offset in pollfd
+    @Native private static final short EVENT_OFFSET  = 4; // events offset in pollfd
 
     static short SIZE_POLLFD = 8; // sizeof pollfd struct
 
     // events masks
-    static final short POLLIN     = AbstractPollArrayWrapper.POLLIN;
-    static final short POLLOUT    = AbstractPollArrayWrapper.POLLOUT;
-    static final short POLLERR    = AbstractPollArrayWrapper.POLLERR;
-    static final short POLLHUP    = AbstractPollArrayWrapper.POLLHUP;
-    static final short POLLNVAL   = AbstractPollArrayWrapper.POLLNVAL;
-    static final short POLLREMOVE = AbstractPollArrayWrapper.POLLREMOVE;
-    static final short POLLCONN   = 0x0002;
+    @Native static final short POLLIN     = AbstractPollArrayWrapper.POLLIN;
+    @Native static final short POLLOUT    = AbstractPollArrayWrapper.POLLOUT;
+    @Native static final short POLLERR    = AbstractPollArrayWrapper.POLLERR;
+    @Native static final short POLLHUP    = AbstractPollArrayWrapper.POLLHUP;
+    @Native static final short POLLNVAL   = AbstractPollArrayWrapper.POLLNVAL;
+    @Native static final short POLLREMOVE = AbstractPollArrayWrapper.POLLREMOVE;
+    @Native static final short POLLCONN   = 0x0002;
 
     private int size; // Size of the pollArray