Merge
authorschien
Mon, 20 Jun 2011 17:38:27 -0700
changeset 10038 7e2b1564cf05
parent 10037 2e0abfab6089 (current diff)
parent 9903 cbb1e8472921 (diff)
child 10040 8ccf113a66e7
child 10068 5be904b6a4cc
Merge
langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/inherit.gif
--- a/.hgtags	Wed Jun 08 10:24:10 2011 -0700
+++ b/.hgtags	Mon Jun 20 17:38:27 2011 -0700
@@ -119,3 +119,4 @@
 92bf0655022d4187e9b49c1400f98fb3392a4630 jdk7-b142
 4a05062d8c4dfa3edec3faf1052af28baba5adff jdk7-b143
 07a8728ad49ef6dfa469c3a8bf5ab1e9c80bed5c jdk7-b144
+8294c99e685a1f6d1d37c45cd97854cf74be771e jdk7-b145
--- a/.hgtags-top-repo	Wed Jun 08 10:24:10 2011 -0700
+++ b/.hgtags-top-repo	Mon Jun 20 17:38:27 2011 -0700
@@ -119,3 +119,4 @@
 cfbbdb77eac0397b03eb99ee2e07ea00e0a7b81e jdk7-b142
 14b8e7eee1058fd4ed5a2700a2ce14b3616278f1 jdk7-b143
 7203965666a4fe63bf82f5e4204f41ce6285e716 jdk7-b144
+55e9ebf032186c333e5964ed044419830ac02693 jdk7-b145
--- a/corba/.hgtags	Wed Jun 08 10:24:10 2011 -0700
+++ b/corba/.hgtags	Mon Jun 20 17:38:27 2011 -0700
@@ -119,3 +119,4 @@
 a2f340a048c88d10cbedc0504f5cf03d39925a40 jdk7-b142
 51ed32f6f4de56f16e910ac54ba6c6f6606f4f17 jdk7-b143
 7033a5756ad552d88114594d8e2d2e4dc2c05963 jdk7-b144
+77ec0541aa2aa4da27e9e385a118a2e51e7fca24 jdk7-b145
--- a/jaxp/.hgtags	Wed Jun 08 10:24:10 2011 -0700
+++ b/jaxp/.hgtags	Mon Jun 20 17:38:27 2011 -0700
@@ -119,3 +119,4 @@
 7d067af4b25e4b7e6b28bef48527d67f8650e6c5 jdk7-b142
 16b847e9bbd747f9d27785b2fc20d4d720cca893 jdk7-b143
 39bf6dcaab2336326b21743cef7042d0a2de9ba0 jdk7-b144
+10ca7570f47f2ae4132648f7e8da1a05f1a98a15 jdk7-b145
--- a/jaxws/.hgtags	Wed Jun 08 10:24:10 2011 -0700
+++ b/jaxws/.hgtags	Mon Jun 20 17:38:27 2011 -0700
@@ -119,3 +119,4 @@
 0ef3ef823c39eee3d670e58027c3219cb66f0283 jdk7-b142
 569d1e7ea980d172046c4aba79d96b5c3afabbba jdk7-b143
 6bd683f2d527c9afd47beac1cbf614506929598d jdk7-b144
+42bfba80beb7d3260b7b135b9a39202b512eb8c2 jdk7-b145
--- a/jdk/.hgtags	Wed Jun 08 10:24:10 2011 -0700
+++ b/jdk/.hgtags	Mon Jun 20 17:38:27 2011 -0700
@@ -120,3 +120,4 @@
 efbf75c24b0f31847c9c403f6dc07dc80551908d jdk7-b143
 23bdcede4e3945894574892e80b848bd9f15b5f3 jdk7-b144
 1e04b38b3824a4a1d197ef681a302e6813e53f8b jdk7-b145
+539e576793a8e64aaf160e0d6ab0b9723cd0bef0 jdk7-b146
--- a/jdk/make/com/sun/tools/attach/Makefile	Wed Jun 08 10:24:10 2011 -0700
+++ b/jdk/make/com/sun/tools/attach/Makefile	Mon Jun 20 17:38:27 2011 -0700
@@ -48,6 +48,9 @@
 ifeq ($(PLATFORM), solaris)
 OTHER_LDLIBS += -ldoor
 endif
+ifeq ($(PLATFORM), windows)
+EXTRA_LIBS += psapi.lib
+endif
 
 vpath %.c $(PLATFORM_SRC)/native/sun/tools/attach
 
--- a/jdk/make/common/Release.gmk	Wed Jun 08 10:24:10 2011 -0700
+++ b/jdk/make/common/Release.gmk	Mon Jun 20 17:38:27 2011 -0700
@@ -900,8 +900,10 @@
 	for d in $(DB_ZIP_LIST); do \
           ($(CD) $(JDK_IMAGE_DIR)/db && $(UNZIP) -o $$d); \
 	done
+	$(CP) $(ABS_DB_PATH)/README-JDK.html $(JDK_IMAGE_DIR)/db
 	$(RM) -rf $(DEMODIR)/db
 	$(MV) $(JDK_IMAGE_DIR)/db/demo $(DEMODIR)/db
+	$(CP) $(ABS_DB_PATH)/README-JDK-DEMOS.html $(DEMODIR)/db/
 	$(RM) $(JDK_IMAGE_DIR)/db/index.html $(JDK_IMAGE_DIR)/db/register.html
 endif
 
--- a/jdk/make/sun/security/pkcs11/Makefile	Wed Jun 08 10:24:10 2011 -0700
+++ b/jdk/make/sun/security/pkcs11/Makefile	Mon Jun 20 17:38:27 2011 -0700
@@ -147,7 +147,7 @@
 # Rules
 #
 CLASSDESTDIR = $(TEMPDIR)/classes
-JAVAHFLAGS += -classpath $(CLASSDESTDIR)
+JAVAHFLAGS += -Xbootclasspath/p:$(CLASSDESTDIR)
 
 include $(BUILDDIR)/common/Mapfile-vers.gmk
 
--- a/jdk/src/share/classes/java/lang/invoke/AdapterMethodHandle.java	Wed Jun 08 10:24:10 2011 -0700
+++ b/jdk/src/share/classes/java/lang/invoke/AdapterMethodHandle.java	Mon Jun 20 17:38:27 2011 -0700
@@ -405,13 +405,13 @@
                 insertStackMove(stackMove)
                 );
     }
-    private static long makeSwapConv(int convOp, int srcArg, byte type, int destSlot) {
+    private static long makeSwapConv(int convOp, int srcArg, byte srcType, int destSlot, byte destType) {
         // more complex argument motion, requiring two slots to specify
         assert(convOp == OP_SWAP_ARGS || convOp == OP_ROT_ARGS);
         return ((long) srcArg << 32 |
                 (long) convOp << CONV_OP_SHIFT |
-                (int)  type   << CONV_SRC_TYPE_SHIFT |
-                (int)  type   << CONV_DEST_TYPE_SHIFT |
+                (int)  srcType << CONV_SRC_TYPE_SHIFT |
+                (int)  destType << CONV_DEST_TYPE_SHIFT |
                 (int)  destSlot << CONV_VMINFO_SHIFT
                 );
     }
@@ -943,24 +943,27 @@
         if (type2size(newType.parameterType(swapArg1)) !=
             type2size(newType.parameterType(swapArg2))) {
             // turn a swap into a pair of rotates:
-            // [x a b c y] => [a b c y x] => [y a b c x]
+            // [x a b c y] rot2(-1,argc=5) => [a b c y x] rot1(+1,argc=4) => target[y a b c x]
             int argc = swapArg2 - swapArg1 + 1;
             final int ROT = 1;
             ArrayList<Class<?>> rot1Params = new ArrayList<Class<?>>(target.type().parameterList());
             Collections.rotate(rot1Params.subList(swapArg1, swapArg1 + argc), -ROT);
             MethodType rot1Type = MethodType.methodType(target.type().returnType(), rot1Params);
             MethodHandle rot1 = makeRotateArguments(rot1Type, target, swapArg1, argc, +ROT);
+            assert(rot1 != null);
             if (argc == 2)  return rot1;
             MethodHandle rot2 = makeRotateArguments(newType, rot1, swapArg1, argc-1, -ROT);
+            assert(rot2 != null);
             return rot2;
         }
         if (!canSwapArguments(newType, target.type(), swapArg1, swapArg2))
             return null;
-        Class<?> swapType = newType.parameterType(swapArg1);
+        Class<?> type1 = newType.parameterType(swapArg1);
+        Class<?> type2 = newType.parameterType(swapArg2);
         // in  arglist: [0: ...keep1 | pos1: a1 | pos1+1: keep2... | pos2: a2 | pos2+1: keep3... ]
         // out arglist: [0: ...keep1 | pos1: a2 | pos1+1: keep2... | pos2: a1 | pos2+1: keep3... ]
         int swapSlot2  = newType.parameterSlotDepth(swapArg2 + 1);
-        long conv = makeSwapConv(OP_SWAP_ARGS, swapArg1, basicType(swapType), swapSlot2);
+        long conv = makeSwapConv(OP_SWAP_ARGS, swapArg1, basicType(type1), swapSlot2, basicType(type2));
         return new AdapterMethodHandle(target, newType, conv);
     }
 
@@ -1029,16 +1032,16 @@
         assert(MAX_ARG_ROTATION == 1);
         int srcArg, dstArg;
         int dstSlot;
-        byte basicType;
-        if (chunk2Slots <= chunk1Slots) {
+        int moveChunk;
+        if (rotateBy == 1) {
             // Rotate right/down N (rotateBy = +N, N small, c2 small):
             // in  arglist: [0: ...keep1 | arg1: c1...  | limit-N: c2 | limit: keep2... ]
             // out arglist: [0: ...keep1 | arg1: c2 | arg1+N: c1...   | limit: keep2... ]
             srcArg = limit-1;
             dstArg = firstArg;
-            dstSlot = depth0 - chunk2Slots;
-            basicType = basicType(newType.parameterType(srcArg));
-            assert(chunk2Slots == type2size(basicType));
+            //dstSlot = depth0 - chunk2Slots;  //chunk2Slots is not relevant
+            dstSlot = depth0 + MethodHandleNatives.OP_ROT_ARGS_DOWN_LIMIT_BIAS;
+            moveChunk = chunk2Slots;
         } else {
             // Rotate left/up N (rotateBy = -N, N small, c1 small):
             // in  arglist: [0: ...keep1 | arg1: c1 | arg1+N: c2...   | limit: keep2... ]
@@ -1046,10 +1049,12 @@
             srcArg = firstArg;
             dstArg = limit-1;
             dstSlot = depth2;
-            basicType = basicType(newType.parameterType(srcArg));
-            assert(chunk1Slots == type2size(basicType));
+            moveChunk = chunk1Slots;
         }
-        long conv = makeSwapConv(OP_ROT_ARGS, srcArg, basicType, dstSlot);
+        byte srcType = basicType(newType.parameterType(srcArg));
+        byte dstType = basicType(newType.parameterType(dstArg));
+        assert(moveChunk == type2size(srcType));
+        long conv = makeSwapConv(OP_ROT_ARGS, srcArg, srcType, dstSlot, dstType);
         return new AdapterMethodHandle(target, newType, conv);
     }
 
--- a/jdk/src/share/classes/java/lang/invoke/MethodHandleImpl.java	Wed Jun 08 10:24:10 2011 -0700
+++ b/jdk/src/share/classes/java/lang/invoke/MethodHandleImpl.java	Mon Jun 20 17:38:27 2011 -0700
@@ -788,6 +788,7 @@
                 .insertParameterTypes(keepPosArgs, arrayType);
         return spreadArguments(target, newType, keepPosArgs, arrayType, arrayLength);
     }
+    // called internally only
     static MethodHandle spreadArgumentsFromPos(MethodHandle target, MethodType newType, int spreadArgPos) {
         int arrayLength = target.type().parameterCount() - spreadArgPos;
         return spreadArguments(target, newType, spreadArgPos, Object[].class, arrayLength);
@@ -849,6 +850,12 @@
         MethodType ttype = target.type();
         MethodType ftype = filter.type();
         assert(ftype.parameterCount() == 1);
+        MethodHandle result = null;
+        if (AdapterMethodHandle.canCollectArguments(ttype, ftype, pos, false)) {
+            result = AdapterMethodHandle.makeCollectArguments(target, filter, pos, false);
+            if (result != null)  return result;
+        }
+        assert(MethodHandleNatives.workaroundWithoutRicochetFrames());  // this code is deprecated
         MethodType rtype = ttype.changeParameterType(pos, ftype.parameterType(0));
         MethodType gttype = ttype.generic();
         if (ttype != gttype) {
@@ -860,18 +867,11 @@
             filter = convertArguments(filter, gftype, ftype, 0);
             ftype = gftype;
         }
-        MethodHandle result = null;
-        if (AdapterMethodHandle.canCollectArguments(ttype, ftype, pos, false)) {
-            result = AdapterMethodHandle.makeCollectArguments(target, filter, pos, false);
-        }
-        if (result == null) {
-            assert(MethodHandleNatives.workaroundWithoutRicochetFrames());  // this code is deprecated
-            if (ftype == ttype) {
+        if (ftype == ttype) {
             // simple unary case
-                result = FilterOneArgument.make(filter, target);
-            } else {
-                result = FilterGeneric.makeArgumentFilter(pos, filter, target);
-            }
+            result = FilterOneArgument.make(filter, target);
+        } else {
+            result = FilterGeneric.makeArgumentFilter(pos, filter, target);
         }
         if (result.type() != rtype)
             result = result.asType(rtype);
@@ -920,7 +920,7 @@
             this.fallback = fallback;
         }
         static boolean preferRicochetFrame(MethodType type) {
-            return (type.parameterCount() >= INVOKES.length || type.hasPrimitives());
+            return true;  // always use RF if available
         }
         static MethodHandle make(MethodHandle test, MethodHandle target, MethodHandle fallback) {
             MethodType type = target.type();
@@ -931,12 +931,13 @@
                 MethodHandle invoke = INVOKES[nargs];
                 MethodType gtype = type.generic();
                 assert(invoke.type().dropParameterTypes(0,1) == gtype);
-                MethodHandle gtest = convertArguments(test, gtype.changeReturnType(boolean.class), test.type(), 0);
-                MethodHandle gtarget = convertArguments(target, gtype, type, 0);
-                MethodHandle gfallback = convertArguments(fallback, gtype, type, 0);
+                // Note: convertArguments(...2) avoids interface casts present in convertArguments(...0)
+                MethodHandle gtest = convertArguments(test, gtype.changeReturnType(boolean.class), test.type(), 2);
+                MethodHandle gtarget = convertArguments(target, gtype, type, 2);
+                MethodHandle gfallback = convertArguments(fallback, gtype, type, 2);
                 if (gtest == null || gtarget == null || gfallback == null)  return null;
                 MethodHandle gguard = new GuardWithTest(invoke, gtest, gtarget, gfallback);
-                return convertArguments(gguard, type, gtype, 0);
+                return convertArguments(gguard, type, gtype, 2);
             } else {
                 assert(MethodHandleNatives.workaroundWithoutRicochetFrames());  // this code is deprecated
                 MethodHandle invoke = VARARGS_INVOKE;
@@ -1221,11 +1222,12 @@
         if (nargs < GuardWithCatch.INVOKES.length) {
             MethodType gtype = type.generic();
             MethodType gcatchType = gtype.insertParameterTypes(0, Throwable.class);
-            MethodHandle gtarget = convertArguments(target, gtype, type, 0);
-            MethodHandle gcatcher = convertArguments(catcher, gcatchType, ctype, 0);
+            // Note: convertArguments(...2) avoids interface casts present in convertArguments(...0)
+            MethodHandle gtarget = convertArguments(target, gtype, type, 2);
+            MethodHandle gcatcher = convertArguments(catcher, gcatchType, ctype, 2);
             MethodHandle gguard = new GuardWithCatch(gtarget, exType, gcatcher);
             if (gtarget == null || gcatcher == null || gguard == null)  return null;
-            return convertArguments(gguard, type, gtype, 0);
+            return convertArguments(gguard, type, gtype, 2);
         } else {
             MethodType gtype = MethodType.genericMethodType(0, true);
             MethodType gcatchType = gtype.insertParameterTypes(0, Throwable.class);
--- a/jdk/src/share/classes/java/lang/invoke/MethodHandleNatives.java	Wed Jun 08 10:24:10 2011 -0700
+++ b/jdk/src/share/classes/java/lang/invoke/MethodHandleNatives.java	Mon Jun 20 17:38:27 2011 -0700
@@ -118,32 +118,20 @@
     /** Derived mode flag.  Only false on some old JVM implementations. */
     static final boolean HAVE_RICOCHET_FRAMES;
 
+    static final int OP_ROT_ARGS_DOWN_LIMIT_BIAS;
+
     private static native void registerNatives();
     static {
-        int     JVM_PUSH_LIMIT_;
-        int     JVM_STACK_MOVE_UNIT_;
-        int     CONV_OP_IMPLEMENTED_MASK_;
-        try {
-            registerNatives();
-            JVM_PUSH_LIMIT_ = getConstant(Constants.GC_JVM_PUSH_LIMIT);
-            JVM_STACK_MOVE_UNIT_ = getConstant(Constants.GC_JVM_STACK_MOVE_UNIT);
-            CONV_OP_IMPLEMENTED_MASK_ = getConstant(Constants.GC_CONV_OP_IMPLEMENTED_MASK);
-            //sun.reflect.Reflection.registerMethodsToFilter(MethodHandleImpl.class, "init");
-        } catch (UnsatisfiedLinkError ee) {
-            // ignore; if we use init() methods later we'll see linkage errors
-            JVM_PUSH_LIMIT_ = 3;  // arbitrary
-            JVM_STACK_MOVE_UNIT_ = -1;  // arbitrary
-            CONV_OP_IMPLEMENTED_MASK_ = 0;
-            JVM_PUSH_LIMIT = JVM_PUSH_LIMIT_;
-            JVM_STACK_MOVE_UNIT = JVM_STACK_MOVE_UNIT_;
-            throw ee;  // just die; hopeless to try to run with an older JVM
-        }
-        JVM_PUSH_LIMIT = JVM_PUSH_LIMIT_;
-        JVM_STACK_MOVE_UNIT = JVM_STACK_MOVE_UNIT_;
-        if (CONV_OP_IMPLEMENTED_MASK_ == 0)
-            CONV_OP_IMPLEMENTED_MASK_ = DEFAULT_CONV_OP_IMPLEMENTED_MASK;
-        CONV_OP_IMPLEMENTED_MASK = CONV_OP_IMPLEMENTED_MASK_;
-        HAVE_RICOCHET_FRAMES = (CONV_OP_IMPLEMENTED_MASK & (1<<OP_COLLECT_ARGS)) != 0;
+        registerNatives();
+        int k;
+        JVM_PUSH_LIMIT              = getConstant(Constants.GC_JVM_PUSH_LIMIT);
+        JVM_STACK_MOVE_UNIT         = getConstant(Constants.GC_JVM_STACK_MOVE_UNIT);
+        k                           = getConstant(Constants.GC_CONV_OP_IMPLEMENTED_MASK);
+        CONV_OP_IMPLEMENTED_MASK    = (k != 0) ? k : DEFAULT_CONV_OP_IMPLEMENTED_MASK;
+        k                           = getConstant(Constants.GC_OP_ROT_ARGS_DOWN_LIMIT_BIAS);
+        OP_ROT_ARGS_DOWN_LIMIT_BIAS = (k != 0) ? (byte)k : -1;
+        HAVE_RICOCHET_FRAMES        = (CONV_OP_IMPLEMENTED_MASK & (1<<OP_COLLECT_ARGS)) != 0;
+        //sun.reflect.Reflection.registerMethodsToFilter(MethodHandleImpl.class, "init");
     }
 
     // All compile-time constants go here.
@@ -154,7 +142,8 @@
         static final int // for getConstant
                 GC_JVM_PUSH_LIMIT = 0,
                 GC_JVM_STACK_MOVE_UNIT = 1,
-                GC_CONV_OP_IMPLEMENTED_MASK = 2;
+                GC_CONV_OP_IMPLEMENTED_MASK = 2,
+                GC_OP_ROT_ARGS_DOWN_LIMIT_BIAS = 3;
         static final int
                 ETF_HANDLE_OR_METHOD_NAME = 0, // all available data (immediate MH or method)
                 ETF_DIRECT_HANDLE         = 1, // ultimate method handle (will be a DMH, may be self)
--- a/jdk/src/share/classes/java/lang/invoke/SwitchPoint.java	Wed Jun 08 10:24:10 2011 -0700
+++ b/jdk/src/share/classes/java/lang/invoke/SwitchPoint.java	Mon Jun 20 17:38:27 2011 -0700
@@ -134,7 +134,7 @@
      * to return true for {@code hasBeenInvalidated},
      * it will always do so in the future.
      * On the other hand, a valid switch point visible to other threads may
-     * invalidated at any moment, due to a request by another thread.
+     * be invalidated at any moment, due to a request by another thread.
      * <p style="font-size:smaller;">
      * Since invalidation is a global and immediate operation,
      * the execution of this query, on a valid switchpoint,
--- a/jdk/src/share/classes/java/net/NetworkInterface.java	Wed Jun 08 10:24:10 2011 -0700
+++ b/jdk/src/share/classes/java/net/NetworkInterface.java	Mon Jun 20 17:38:27 2011 -0700
@@ -547,13 +547,8 @@
         if (displayName != null) {
             result += " (" + displayName + ")";
         }
-        result += " index: "+index+" addresses:\n";
-        for (Enumeration e = getInetAddresses(); e.hasMoreElements(); ) {
-            InetAddress addr = (InetAddress)e.nextElement();
-            result += addr+";\n";
-        }
         return result;
     }
+
     private static native void init();
-
 }
--- a/jdk/src/share/classes/java/security/SignedObject.java	Wed Jun 08 10:24:10 2011 -0700
+++ b/jdk/src/share/classes/java/security/SignedObject.java	Mon Jun 20 17:38:27 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -249,10 +249,10 @@
      * a stream.
      */
     private void readObject(java.io.ObjectInputStream s)
-         throws java.io.IOException, ClassNotFoundException
-    {
-        s.defaultReadObject();
-        content = content.clone();
-        signature = signature.clone();
+        throws java.io.IOException, ClassNotFoundException {
+            java.io.ObjectInputStream.GetField fields = s.readFields();
+            content = ((byte[])fields.get("content", null)).clone();
+            signature = ((byte[])fields.get("signature", null)).clone();
+            thealgorithm = (String)fields.get("thealgorithm", null);
     }
 }
--- a/jdk/src/share/classes/javax/swing/ImageIcon.java	Wed Jun 08 10:24:10 2011 -0700
+++ b/jdk/src/share/classes/javax/swing/ImageIcon.java	Mon Jun 20 17:38:27 2011 -0700
@@ -40,8 +40,7 @@
 
 import sun.awt.AppContext;
 import java.lang.reflect.Field;
-import java.security.PrivilegedAction;
-import java.security.AccessController;
+import java.security.*;
 
 /**
  * An implementation of the Icon interface that paints Icons
@@ -81,32 +80,51 @@
     ImageObserver imageObserver;
     String description = null;
 
+    // Fields for twisted backward compatibility only. DO NOT USE.
     protected final static Component component;
     protected final static MediaTracker tracker;
 
     static {
-        component = new Component() {};
-        AccessController.doPrivileged(new PrivilegedAction<Object>() {
-            public Object run() {
+        component = AccessController.doPrivileged(new PrivilegedAction<Component>() {
+            public Component run() {
                 try {
+                    final Component component = createNoPermsComponent();
+
                     // 6482575 - clear the appContext field so as not to leak it
                     Field appContextField =
-                                 Component.class.getDeclaredField("appContext");
+
+                            Component.class.getDeclaredField("appContext");
                     appContextField.setAccessible(true);
                     appContextField.set(component, null);
-                }
-                catch (NoSuchFieldException e) {
+
+                    return component;
+                } catch (Throwable e) {
+                    // We don't care about component.
+                    // So don't prevent class initialisation.
                     e.printStackTrace();
+                    return null;
                 }
-                catch (IllegalAccessException e) {
-                    e.printStackTrace();
-                }
-                return null;
             }
         });
         tracker = new MediaTracker(component);
     }
 
+    private static Component createNoPermsComponent() {
+        // 7020198 - set acc field to no permissions and no subject
+        // Note, will have appContext set.
+        return AccessController.doPrivileged(
+                new PrivilegedAction<Component>() {
+                    public Component run() {
+                        return new Component() {
+                        };
+                    }
+                },
+                new AccessControlContext(new ProtectionDomain[]{
+                        new ProtectionDomain(null, null)
+                })
+        );
+    }
+
     /**
      * Id used in loading images from MediaTracker.
      */
--- a/jdk/src/share/classes/sun/java2d/pipe/DrawImage.java	Wed Jun 08 10:24:10 2011 -0700
+++ b/jdk/src/share/classes/sun/java2d/pipe/DrawImage.java	Mon Jun 20 17:38:27 2011 -0700
@@ -509,6 +509,9 @@
          * edges thus has to be h*2+2 in length
          */
         int edges[] = new int[(dy2-dy1)*2+2];
+        // It is important that edges[0]=edges[1]=0 when we call
+        // Transform in case it must return early and we would
+        // not want to render anything on an error condition.
         helper.Transform(tmpmaskblit, srcData, tmpData,
                          AlphaComposite.Src, null,
                          itx, interpType,
--- a/jdk/src/share/classes/sun/misc/URLClassPath.java	Wed Jun 08 10:24:10 2011 -0700
+++ b/jdk/src/share/classes/sun/misc/URLClassPath.java	Mon Jun 20 17:38:27 2011 -0700
@@ -532,15 +532,11 @@
                 uc = url.openConnection();
                 InputStream in = uc.getInputStream();
                 if (uc instanceof JarURLConnection) {
-                    /* JarURLConnection.getInputStream() returns a separate
-                     * instance on each call. So we have to close this here.
-                     * The jar file cache will keep the file open.
-                     * Also, need to remember the jar file so it can be closed
+                    /* Need to remember the jar file so it can be closed
                      * in a hurry.
                      */
                     JarURLConnection juc = (JarURLConnection)uc;
                     jarfile = juc.getJarFile();
-                    in.close();
                 }
             } catch (Exception e) {
                 return null;
--- a/jdk/src/share/classes/sun/security/pkcs11/Config.java	Wed Jun 08 10:24:10 2011 -0700
+++ b/jdk/src/share/classes/sun/security/pkcs11/Config.java	Mon Jun 20 17:38:27 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -653,6 +653,13 @@
             }
         }
         debug(keyword + ": " + lib);
+
+        // Check to see if full path is specified to prevent the DLL
+        // preloading attack
+        if (!(new File(lib)).isAbsolute()) {
+            throw new ConfigurationException(
+                "Absolute path required for library value: " + lib);
+        }
         return lib;
     }
 
--- a/jdk/src/share/classes/sun/security/pkcs11/Secmod.java	Wed Jun 08 10:24:10 2011 -0700
+++ b/jdk/src/share/classes/sun/security/pkcs11/Secmod.java	Mon Jun 20 17:38:27 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -236,7 +236,8 @@
             throw new IllegalStateException(e);
         }
         if (modules == null) {
-            List<Module> modules = (List<Module>)nssGetModuleList(nssHandle);
+            List<Module> modules = (List<Module>)nssGetModuleList(nssHandle,
+                nssLibDir);
             this.modules = Collections.unmodifiableList(modules);
         }
         return modules;
@@ -358,7 +359,7 @@
      * A representation of one PKCS#11 slot in a PKCS#11 module.
      */
     public static final class Module {
-        // name of the native library
+        // path of the native library
         final String libraryName;
         // descriptive name used by NSS
         final String commonName;
@@ -371,8 +372,10 @@
         // trust attributes. Used for the KEYSTORE and TRUSTANCHOR modules only
         private Map<Bytes,TrustAttributes> trust;
 
-        Module(String libraryName, String commonName, boolean fips, int slot) {
+        Module(String libraryDir, String libraryName, String commonName,
+                boolean fips, int slot) {
             ModuleType type;
+
             if ((libraryName == null) || (libraryName.length() == 0)) {
                 // must be softtoken
                 libraryName = System.mapLibraryName(SOFTTOKEN_LIB_NAME);
@@ -397,7 +400,7 @@
                         + "module: " + libraryName + ", " + commonName);
                 }
             }
-            this.libraryName = libraryName;
+            this.libraryName = (new File(libraryDir, libraryName)).getPath();
             this.commonName = commonName;
             this.slot = slot;
             this.type = type;
@@ -752,6 +755,6 @@
 
     private static native boolean nssInit(String functionName, long handle, String configDir);
 
-    private static native Object nssGetModuleList(long handle);
+    private static native Object nssGetModuleList(long handle, String libDir);
 
 }
--- a/jdk/src/share/native/common/jdk_util.h	Wed Jun 08 10:24:10 2011 -0700
+++ b/jdk/src/share/native/common/jdk_util.h	Mon Jun 20 17:38:27 2011 -0700
@@ -28,6 +28,7 @@
 
 #include "jni.h"
 #include "jvm.h"
+#include "jdk_util_md.h"
 
 #ifdef __cplusplus
 extern "C" {
--- a/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c	Wed Jun 08 10:24:10 2011 -0700
+++ b/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c	Mon Jun 20 17:38:27 2011 -0700
@@ -1971,6 +1971,13 @@
         return data->abortFlag;
     }
 
+    if (cinfo->output_components <= 0 ||
+        cinfo->image_width > (0xffffffffu / (unsigned int)cinfo->output_components))
+    {
+        JNU_ThrowByName(env, "javax/imageio/IIOException",
+                        "Invalid number of output components");
+        return data->abortFlag;
+    }
 
     // Allocate a 1-scanline buffer
     scanLinePtr = (JSAMPROW)malloc(cinfo->image_width*cinfo->output_components);
--- a/jdk/src/share/native/sun/font/layout/SunLayoutEngine.cpp	Wed Jun 08 10:24:10 2011 -0700
+++ b/jdk/src/share/native/sun/font/layout/SunLayoutEngine.cpp	Mon Jun 20 17:38:27 2011 -0700
@@ -186,7 +186,11 @@
   jchar buffer[256];
   jchar* chars = buffer;
   if (len > 256) {
-    chars = (jchar*)malloc(len * sizeof(jchar));
+    size_t size = len * sizeof(jchar);
+    if (size / sizeof(jchar) != len) {
+      return;
+    }
+    chars = (jchar*)malloc(size);
     if (chars == 0) {
       return;
     }
--- a/jdk/src/share/native/sun/java2d/loops/TransformHelper.c	Wed Jun 08 10:24:10 2011 -0700
+++ b/jdk/src/share/native/sun/java2d/loops/TransformHelper.c	Mon Jun 20 17:38:27 2011 -0700
@@ -75,6 +75,94 @@
 TransformInterpFunc *pBicubicFunc = BicubicInterp;
 
 /*
+ * The dxydxy parameters of the inverse transform determine how
+ * quickly we step through the source image.  For tiny scale
+ * factors (on the order of 1E-16 or so) the stepping distances
+ * are huge.  The image has been scaled so small that stepping
+ * a single pixel in device space moves the sampling point by
+ * billions (or more) pixels in the source image space.  These
+ * huge stepping values can overflow the whole part of the longs
+ * we use for the fixed point stepping equations and so we need
+ * a more robust solution.  We could simply iterate over every
+ * device pixel, use the inverse transform to transform it back
+ * into the source image coordinate system and then test it for
+ * being in range and sample pixel-by-pixel, but that is quite
+ * a bit more expensive.  Fortunately, if the scale factors are
+ * so tiny that we overflow our long values then the number of
+ * pixels we are planning to visit should be very tiny.  The only
+ * exception to that rule is if the scale factor along one
+ * dimension is tiny (creating the huge stepping values), and
+ * the scale factor along the other dimension is fairly regular
+ * or an up-scale.  In that case we have a lot of pixels along
+ * the direction of the larger axis to sample, but few along the
+ * smaller axis.  Though, pessimally, with an added shear factor
+ * such a linearly tiny image could have bounds that cover a large
+ * number of pixels.  Such odd transformations should be very
+ * rare and the absolute limit on calculations would involve a
+ * single reverse transform of every pixel in the output image
+ * which is not fast, but it should not cause an undue stall
+ * of the rendering software.
+ *
+ * The specific test we will use is to calculate the inverse
+ * transformed values of every corner of the destination bounds
+ * (in order to be user-clip independent) and if we can
+ * perform a fixed-point-long inverse transform of all of
+ * those points without overflowing we will use the fast
+ * fixed point algorithm.  Otherwise we will use the safe
+ * per-pixel transform algorithm.
+ * The 4 corners are 0,0, 0,dsth, dstw,0, dstw,dsth
+ * Transformed they are:
+ *     tx,               ty
+ *     tx       +dxdy*H, ty       +dydy*H
+ *     tx+dxdx*W,        ty+dydx*W
+ *     tx+dxdx*W+dxdy*H, ty+dydx*W+dydy*H
+ */
+/* We reject coordinates not less than 1<<30 so that the distance between */
+/* any 2 of them is less than 1<<31 which would overflow into the sign */
+/* bit of a signed long value used to represent fixed point coordinates. */
+#define TX_FIXED_UNSAFE(v)  (fabs(v) >= (1<<30))
+static jboolean
+checkOverflow(jint dxoff, jint dyoff,
+              SurfaceDataBounds *pBounds,
+              TransformInfo *pItxInfo,
+              jdouble *retx, jdouble *rety)
+{
+    jdouble x, y;
+
+    x = dxoff+pBounds->x1+0.5; /* Center of pixel x1 */
+    y = dyoff+pBounds->y1+0.5; /* Center of pixel y1 */
+    Transform_transform(pItxInfo, &x, &y);
+    *retx = x;
+    *rety = y;
+    if (TX_FIXED_UNSAFE(x) || TX_FIXED_UNSAFE(y)) {
+        return JNI_TRUE;
+    }
+
+    x = dxoff+pBounds->x2-0.5; /* Center of pixel x2-1 */
+    y = dyoff+pBounds->y1+0.5; /* Center of pixel y1 */
+    Transform_transform(pItxInfo, &x, &y);
+    if (TX_FIXED_UNSAFE(x) || TX_FIXED_UNSAFE(y)) {
+        return JNI_TRUE;
+    }
+
+    x = dxoff+pBounds->x1+0.5; /* Center of pixel x1 */
+    y = dyoff+pBounds->y2-0.5; /* Center of pixel y2-1 */
+    Transform_transform(pItxInfo, &x, &y);
+    if (TX_FIXED_UNSAFE(x) || TX_FIXED_UNSAFE(y)) {
+        return JNI_TRUE;
+    }
+
+    x = dxoff+pBounds->x2-0.5; /* Center of pixel x2-1 */
+    y = dyoff+pBounds->y2-0.5; /* Center of pixel y2-1 */
+    Transform_transform(pItxInfo, &x, &y);
+    if (TX_FIXED_UNSAFE(x) || TX_FIXED_UNSAFE(y)) {
+        return JNI_TRUE;
+    }
+
+    return JNI_FALSE;
+}
+
+/*
  * Fill the edge buffer with pairs of coordinates representing the maximum
  * left and right pixels of the destination surface that should be processed
  * on each scanline, clipped to the bounds parameter.
@@ -82,21 +170,19 @@
  * Only pixels that map back through the specified (inverse) transform to a
  * source coordinate that falls within the (0, 0, sw, sh) bounds of the
  * source image should be processed.
- * pEdgeBuf points to an array of jints that holds MAXEDGES*2 values.
- * If more storage is needed, then this function allocates a new buffer.
- * In either case, a pointer to the buffer actually used to store the
- * results is returned.
- * The caller is responsible for freeing the buffer if the return value
- * is not the same as the original pEdgeBuf passed in.
+ * pEdges points to an array of jints that holds 2 + numedges*2 values where
+ * numedges should match (pBounds->y2 - pBounds->y1).
+ * The first two jints in pEdges should be set to y1 and y2 and every pair
+ * of jints after that represent the xmin,xmax of all pixels in range of
+ * the transformed blit for the corresponding scanline.
  */
-static jint *
-calculateEdges(jint *pEdgeBuf,
+static void
+calculateEdges(jint *pEdges,
                SurfaceDataBounds *pBounds,
                TransformInfo *pItxInfo,
                jlong xbase, jlong ybase,
                juint sw, juint sh)
 {
-    jint *pEdges;
     jlong dxdxlong, dydxlong;
     jlong dxdylong, dydylong;
     jlong drowxlong, drowylong;
@@ -111,10 +197,8 @@
     dy1 = pBounds->y1;
     dx2 = pBounds->x2;
     dy2 = pBounds->y2;
-    if ((dy2-dy1) > MAXEDGES) {
-        pEdgeBuf = malloc(2 * (dy2-dy1) * sizeof (*pEdges));
-    }
-    pEdges = pEdgeBuf;
+    *pEdges++ = dy1;
+    *pEdges++ = dy2;
 
     drowxlong = (dx2-dx1-1) * dxdxlong;
     drowylong = (dx2-dx1-1) * dydxlong;
@@ -155,9 +239,21 @@
         ybase += dydylong;
         dy1++;
     }
+}
 
-    return pEdgeBuf;
-}
+static void
+Transform_SafeHelper(JNIEnv *env,
+                     SurfaceDataOps *srcOps,
+                     SurfaceDataOps *dstOps,
+                     SurfaceDataRasInfo *pSrcInfo,
+                     SurfaceDataRasInfo *pDstInfo,
+                     NativePrimitive *pMaskBlitPrim,
+                     CompositeInfo *pCompInfo,
+                     TransformHelperFunc *pHelperFunc,
+                     TransformInterpFunc *pInterpFunc,
+                     RegionData *pClipInfo, TransformInfo *pItxInfo,
+                     jint *pData, jint *pEdges,
+                     jint dxoff, jint dyoff, jint sw, jint sh);
 
 /*
  * Class:     sun_java2d_loops_TransformHelper
@@ -187,12 +283,14 @@
     jint maxlinepix;
     TransformHelperFunc *pHelperFunc;
     TransformInterpFunc *pInterpFunc;
-    jint edgebuf[MAXEDGES * 2];
+    jdouble xorig, yorig;
+    jint numedges;
     jint *pEdges;
-    jdouble x, y;
-    jlong xbase, ybase;
-    jlong dxdxlong, dydxlong;
-    jlong dxdylong, dydylong;
+    jint edgebuf[2 + MAXEDGES * 2];
+    union {
+        jlong align;
+        jint data[LINE_SIZE];
+    } rgb;
 
 #ifdef MAKE_STUBS
     static int th_initialized;
@@ -269,39 +367,62 @@
     if (srcOps->Lock(env, srcOps, &srcInfo, pHelperPrim->srcflags)
         != SD_SUCCESS)
     {
+        /* edgeArray should already contain zeros for min/maxy */
         return;
     }
     if (dstOps->Lock(env, dstOps, &dstInfo, pMaskBlitPrim->dstflags)
         != SD_SUCCESS)
     {
         SurfaceData_InvokeUnlock(env, srcOps, &srcInfo);
+        /* edgeArray should already contain zeros for min/maxy */
         return;
     }
     Region_IntersectBounds(&clipInfo, &dstInfo.bounds);
 
+    numedges = (dstInfo.bounds.y2 - dstInfo.bounds.y1);
+    if (numedges > MAXEDGES) {
+        pEdges = malloc((2 + 2 * numedges) * sizeof (*pEdges));
+        if (pEdges == NULL) {
+            SurfaceData_InvokeUnlock(env, dstOps, &dstInfo);
+            SurfaceData_InvokeUnlock(env, srcOps, &srcInfo);
+            /* edgeArray should already contain zeros for min/maxy */
+            return;
+        }
+    } else {
+        pEdges = edgebuf;
+    }
+
     Transform_GetInfo(env, itxform, &itxInfo);
-    dxdxlong = DblToLong(itxInfo.dxdx);
-    dydxlong = DblToLong(itxInfo.dydx);
-    dxdylong = DblToLong(itxInfo.dxdy);
-    dydylong = DblToLong(itxInfo.dydy);
-    x = dxoff+dstInfo.bounds.x1+0.5; /* Center of pixel x1 */
-    y = dyoff+dstInfo.bounds.y1+0.5; /* Center of pixel y1 */
-    Transform_transform(&itxInfo, &x, &y);
-    xbase = DblToLong(x);
-    ybase = DblToLong(y);
-
-    pEdges = calculateEdges(edgebuf, &dstInfo.bounds, &itxInfo,
-                            xbase, ybase, sx2-sx1, sy2-sy1);
 
     if (!Region_IsEmpty(&clipInfo)) {
         srcOps->GetRasInfo(env, srcOps, &srcInfo);
         dstOps->GetRasInfo(env, dstOps, &dstInfo);
-        if (srcInfo.rasBase && dstInfo.rasBase) {
-            union {
-                jlong align;
-                jint data[LINE_SIZE];
-            } rgb;
+        if (srcInfo.rasBase == NULL || dstInfo.rasBase == NULL) {
+            pEdges[0] = pEdges[1] = 0;
+        } else if (checkOverflow(dxoff, dyoff, &dstInfo.bounds,
+                                 &itxInfo, &xorig, &yorig))
+        {
+            Transform_SafeHelper(env, srcOps, dstOps,
+                                 &srcInfo, &dstInfo,
+                                 pMaskBlitPrim, &compInfo,
+                                 pHelperFunc, pInterpFunc,
+                                 &clipInfo, &itxInfo, rgb.data, pEdges,
+                                 dxoff, dyoff, sx2-sx1, sy2-sy1);
+        } else {
             SurfaceDataBounds span;
+            jlong dxdxlong, dydxlong;
+            jlong dxdylong, dydylong;
+            jlong xbase, ybase;
+
+            dxdxlong = DblToLong(itxInfo.dxdx);
+            dydxlong = DblToLong(itxInfo.dydx);
+            dxdylong = DblToLong(itxInfo.dxdy);
+            dydylong = DblToLong(itxInfo.dydy);
+            xbase = DblToLong(xorig);
+            ybase = DblToLong(yorig);
+
+            calculateEdges(pEdges, &dstInfo.bounds, &itxInfo,
+                           xbase, ybase, sx2-sx1, sy2-sy1);
 
             Region_StartIteration(env, &clipInfo);
             while (Region_NextIteration(&clipInfo, &span)) {
@@ -318,8 +439,8 @@
 
                     /* Note - process at most one scanline at a time. */
 
-                    dx1 = pEdges[(dy1 - dstInfo.bounds.y1) * 2];
-                    dx2 = pEdges[(dy1 - dstInfo.bounds.y1) * 2 + 1];
+                    dx1 = pEdges[(dy1 - dstInfo.bounds.y1) * 2 + 2];
+                    dx2 = pEdges[(dy1 - dstInfo.bounds.y1) * 2 + 3];
                     if (dx1 < span.x1) dx1 = span.x1;
                     if (dx2 > span.x2) dx2 = span.x2;
 
@@ -376,21 +497,124 @@
         }
         SurfaceData_InvokeRelease(env, dstOps, &dstInfo);
         SurfaceData_InvokeRelease(env, srcOps, &srcInfo);
+    } else {
+        pEdges[0] = pEdges[1] = 0;
     }
     SurfaceData_InvokeUnlock(env, dstOps, &dstInfo);
     SurfaceData_InvokeUnlock(env, srcOps, &srcInfo);
     if (!JNU_IsNull(env, edgeArray)) {
-        (*env)->SetIntArrayRegion(env, edgeArray, 0, 1, &dstInfo.bounds.y1);
-        (*env)->SetIntArrayRegion(env, edgeArray, 1, 1, &dstInfo.bounds.y2);
-        (*env)->SetIntArrayRegion(env, edgeArray,
-                                  2, (dstInfo.bounds.y2 - dstInfo.bounds.y1)*2,
-                                  pEdges);
+        (*env)->SetIntArrayRegion(env, edgeArray, 0, 2+numedges*2, pEdges);
     }
     if (pEdges != edgebuf) {
         free(pEdges);
     }
 }
 
+static void
+Transform_SafeHelper(JNIEnv *env,
+                     SurfaceDataOps *srcOps,
+                     SurfaceDataOps *dstOps,
+                     SurfaceDataRasInfo *pSrcInfo,
+                     SurfaceDataRasInfo *pDstInfo,
+                     NativePrimitive *pMaskBlitPrim,
+                     CompositeInfo *pCompInfo,
+                     TransformHelperFunc *pHelperFunc,
+                     TransformInterpFunc *pInterpFunc,
+                     RegionData *pClipInfo, TransformInfo *pItxInfo,
+                     jint *pData, jint *pEdges,
+                     jint dxoff, jint dyoff, jint sw, jint sh)
+{
+    SurfaceDataBounds span;
+    jint dx1, dx2;
+    jint dy1, dy2;
+    jint i, iy;
+
+    dy1 = pDstInfo->bounds.y1;
+    dy2 = pDstInfo->bounds.y2;
+    dx1 = pDstInfo->bounds.x1;
+    dx2 = pDstInfo->bounds.x2;
+    pEdges[0] = dy1;
+    pEdges[1] = dy2;
+    for (iy = dy1; iy < dy2; iy++) {
+        jint i = (iy - dy1) * 2;
+        /* row spans are set to max,min until we find a pixel in range below */
+        pEdges[i + 2] = dx2;
+        pEdges[i + 3] = dx1;
+    }
+
+    Region_StartIteration(env, pClipInfo);
+    while (Region_NextIteration(pClipInfo, &span)) {
+        dy1 = span.y1;
+        dy2 = span.y2;
+        while (dy1 < dy2) {
+            dx1 = span.x1;
+            dx2 = span.x2;
+            i = (dy1 - pDstInfo->bounds.y1) * 2;
+            while (dx1 < dx2) {
+                jdouble x, y;
+                jlong xlong, ylong;
+
+                x = dxoff + dx1 + 0.5;
+                y = dyoff + dy1 + 0.5;
+                Transform_transform(pItxInfo, &x, &y);
+                xlong = DblToLong(x);
+                ylong = DblToLong(y);
+
+                /* Process only pixels with centers in bounds
+                 * Test double values to avoid overflow in conversion
+                 * to long values and then also test the long values
+                 * in case they rounded up and out of bounds during
+                 * the conversion.
+                 */
+                if (x >= 0 && y >= 0 && x < sw && y < sh &&
+                    WholeOfLong(xlong) < sw &&
+                    WholeOfLong(ylong) < sh)
+                {
+                    void *pDst;
+
+                    if (pEdges[i + 2] > dx1) {
+                        pEdges[i + 2] = dx1;
+                    }
+                    if (pEdges[i + 3] <= dx1) {
+                        pEdges[i + 3] = dx1 + 1;
+                    }
+
+                    /* Get IntArgbPre pixel data from source */
+                    (*pHelperFunc)(pSrcInfo,
+                                   pData, 1,
+                                   xlong, 0,
+                                   ylong, 0);
+
+                    /* Interpolate result pixels if needed */
+                    if (pInterpFunc) {
+                        (*pInterpFunc)(pData, 1,
+                                       FractOfLong(xlong-LongOneHalf), 0,
+                                       FractOfLong(ylong-LongOneHalf), 0);
+                    }
+
+                    /* Store/Composite interpolated pixels into dest */
+                    pDst = PtrCoord(pDstInfo->rasBase,
+                                    dx1, pDstInfo->pixelStride,
+                                    dy1, pDstInfo->scanStride);
+                    (*pMaskBlitPrim->funcs.maskblit)(pDst, pData,
+                                                     0, 0, 0,
+                                                     1, 1,
+                                                     pDstInfo, pSrcInfo,
+                                                     pMaskBlitPrim,
+                                                     pCompInfo);
+                }
+
+                /* Increment to next input pixel */
+                dx1++;
+            }
+
+            /* Increment to next scanline */
+            dy1++;
+        }
+    }
+    Region_EndIteration(env, pClipInfo);
+}
+
 #define BL_INTERP_V1_to_V2_by_F(v1, v2, f) \
     (((v1)<<8) + ((v2)-(v1))*(f))
 
--- a/jdk/src/share/native/sun/security/pkcs11/j2secmod.c	Wed Jun 08 10:24:10 2011 -0700
+++ b/jdk/src/share/native/sun/security/pkcs11/j2secmod.c	Mon Jun 20 17:38:27 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -74,7 +74,7 @@
 }
 
 JNIEXPORT jobject JNICALL Java_sun_security_pkcs11_Secmod_nssGetModuleList
-  (JNIEnv *env, jclass thisClass, jlong jHandle)
+  (JNIEnv *env, jclass thisClass, jlong jHandle, jstring jLibDir)
 {
     FPTR_GetDBModuleList getModuleList =
         (FPTR_GetDBModuleList)findFunction(env, jHandle, "SECMOD_GetDefaultModuleList");
@@ -104,8 +104,8 @@
     jList = (*env)->NewObject(env, jListClass, jListConstructor);
 
     jModuleClass = (*env)->FindClass(env, "sun/security/pkcs11/Secmod$Module");
-    jModuleConstructor = (*env)->GetMethodID
-        (env, jModuleClass, "<init>", "(Ljava/lang/String;Ljava/lang/String;ZI)V");
+    jModuleConstructor = (*env)->GetMethodID(env, jModuleClass, "<init>",
+        "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZI)V");
 
     while (list != NULL) {
         module = list->module;
@@ -124,7 +124,8 @@
         }
         jFIPS = module->isFIPS;
         for (i = 0; i < module->slotCount; i++ ) {
-            jModule = (*env)->NewObject(env, jModuleClass, jModuleConstructor, jDllName, jCommonName, jFIPS, i);
+            jModule = (*env)->NewObject(env, jModuleClass, jModuleConstructor,
+                jLibDir, jDllName, jCommonName, jFIPS, i);
             (*env)->CallVoidMethod(env, jList, jAdd, jModule);
         }
         list = list->next;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/native/common/jdk_util_md.h	Mon Jun 20 17:38:27 2011 -0700
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ */
+
+// Currently, there are no unix specific functions defined.
--- a/jdk/src/windows/classes/sun/tools/attach/WindowsAttachProvider.java	Wed Jun 08 10:24:10 2011 -0700
+++ b/jdk/src/windows/classes/sun/tools/attach/WindowsAttachProvider.java	Mon Jun 20 17:38:27 2011 -0700
@@ -126,16 +126,6 @@
      * of the process list.
      */
     private List<VirtualMachineDescriptor> listJavaProcesses() {
-        // ensure that process status helper is loaded (psapi.dll)
-        if (!isProcessStatusHelperInitialized) {
-            synchronized (WindowsAttachProvider.class) {
-                if (!isProcessStatusHelperInitialized) {
-                    initializeProcessStatusHelper();
-                    isProcessStatusHelperInitialized = true;
-                }
-            }
-        }
-
         ArrayList<VirtualMachineDescriptor> list =
             new ArrayList<VirtualMachineDescriptor>();
 
@@ -172,12 +162,6 @@
         return list;
     }
 
-    // indicates if psapi.dll has been initialized
-    private static volatile boolean isProcessStatusHelperInitialized;
-
-    // loads psapi
-    private static native void initializeProcessStatusHelper();
-
     // enumerates processes using psapi's EnumProcesses
     private static native int enumProcesses(int[] processes, int max);
 
--- a/jdk/src/windows/native/common/jdk_util_md.c	Wed Jun 08 10:24:10 2011 -0700
+++ b/jdk/src/windows/native/common/jdk_util_md.c	Mon Jun 20 17:38:27 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,3 +38,25 @@
 void* JDK_FindJvmEntry(const char* name) {
     return (void*) GetProcAddress(jvm_handle, name);
 }
+
+JNIEXPORT HMODULE JDK_LoadSystemLibrary(const char* name) {
+    HMODULE handle = NULL;
+    char path[MAX_PATH];
+    int ret;
+
+    if (GetSystemDirectory(path, sizeof(path)) != 0) {
+        strcat(path, "\\");
+        strcat(path, name);
+        handle = LoadLibrary(path);
+    }
+
+    if (handle == NULL) {
+        if (GetWindowsDirectory(path, sizeof(path)) != 0) {
+            strcat(path, "\\");
+            strcat(path, name);
+            handle = LoadLibrary(path);
+        }
+    }
+    return handle;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/windows/native/common/jdk_util_md.h	Mon Jun 20 17:38:27 2011 -0700
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ */
+
+
+#ifndef JDK_UTIL_MD_H
+#define JDK_UTIL_MD_H
+
+#include "jni.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+JNIEXPORT HMODULE JDK_LoadSystemLibrary(const char* name);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif /* __cplusplus */
+
+#endif /* JDK_UTIL_MD_H */
--- a/jdk/src/windows/native/sun/java2d/d3d/D3DPipelineManager.cpp	Wed Jun 08 10:24:10 2011 -0700
+++ b/jdk/src/windows/native/sun/java2d/d3d/D3DPipelineManager.cpp	Mon Jun 20 17:38:27 2011 -0700
@@ -117,7 +117,7 @@
 {
     typedef IDirect3D9 * WINAPI FnDirect3DCreate9(UINT SDKVersion);
 
-    hLibD3D9 = ::LoadLibrary(TEXT("d3d9.dll"));
+    hLibD3D9 = JDK_LoadSystemLibrary("d3d9.dll");
     if (hLibD3D9 == NULL) {
         J2dRlsTraceLn(J2D_TRACE_ERROR, "InitD3D: no d3d9.dll");
         return E_FAIL;
--- a/jdk/src/windows/native/sun/java2d/opengl/OGLFuncs_md.h	Wed Jun 08 10:24:10 2011 -0700
+++ b/jdk/src/windows/native/sun/java2d/opengl/OGLFuncs_md.h	Mon Jun 20 17:38:27 2011 -0700
@@ -29,6 +29,7 @@
 #include <windows.h>
 #include "J2D_GL/wglext.h"
 #include "OGLFuncMacros.h"
+#include <jdk_util.h>
 
 /**
  * Core WGL functions
@@ -60,7 +61,7 @@
 #define OGL_LIB_IS_UNINITIALIZED() \
     (OGL_LIB_HANDLE == 0)
 #define OGL_OPEN_LIB() \
-    OGL_LIB_HANDLE = LoadLibrary(L"opengl32.dll")
+    OGL_LIB_HANDLE = JDK_LoadSystemLibrary("opengl32.dll")
 #define OGL_CLOSE_LIB() \
     FreeLibrary(OGL_LIB_HANDLE)
 #define OGL_GET_PROC_ADDRESS(f) \
--- a/jdk/src/windows/native/sun/nio/ch/WindowsAsynchronousSocketChannelImpl.c	Wed Jun 08 10:24:10 2011 -0700
+++ b/jdk/src/windows/native/sun/nio/ch/WindowsAsynchronousSocketChannelImpl.c	Mon Jun 20 17:38:27 2011 -0700
@@ -44,7 +44,7 @@
 #define SO_UPDATE_CONNECT_CONTEXT 0x7010
 #endif
 
-typedef BOOL (*ConnectEx_t)
+typedef BOOL (PASCAL *ConnectEx_t)
 (
     SOCKET s,
     const struct sockaddr* name,
--- a/jdk/src/windows/native/sun/tools/attach/WindowsAttachProvider.c	Wed Jun 08 10:24:10 2011 -0700
+++ b/jdk/src/windows/native/sun/tools/attach/WindowsAttachProvider.c	Mon Jun 20 17:38:27 2011 -0700
@@ -25,6 +25,7 @@
 #include <windows.h>
 #include <stdlib.h>
 #include <string.h>
+#include <Psapi.h>
 
 #include "jni.h"
 #include "jni_util.h"
@@ -97,41 +98,6 @@
 
 
 /*
- * Process status helper library functions
- */
-static BOOL  (WINAPI *_EnumProcesses)     (DWORD *, DWORD, DWORD *);
-static BOOL  (WINAPI *_EnumProcessModules)(HANDLE, HMODULE *, DWORD, LPDWORD);
-static DWORD (WINAPI *_GetModuleBaseName) (HANDLE, HMODULE, LPTSTR, DWORD);
-
-
-/*
- * Class:     sun_tools_attach_WindowsAttachProvider
- * Method:    initializeProcessStatusHelper
- * Signature: ()V
- */
-JNIEXPORT void JNICALL
-Java_sun_tools_attach_WindowsAttachProvider_initializeProcessStatusHelper(JNIEnv *env, jclass cls)
-{
-    HINSTANCE psapi = LoadLibrary("PSAPI.DLL") ;
-    if (psapi != NULL) {
-        _EnumProcesses = (BOOL(WINAPI *)(DWORD *, DWORD, DWORD *))
-            GetProcAddress(psapi, "EnumProcesses") ;
-        _EnumProcessModules = (BOOL(WINAPI *)(HANDLE, HMODULE *, DWORD, LPDWORD))
-            GetProcAddress(psapi, "EnumProcessModules");
-        _GetModuleBaseName = (DWORD(WINAPI *)(HANDLE, HMODULE, LPTSTR, DWORD))
-            GetProcAddress(psapi, "GetModuleBaseNameA");
-    }
-
-    if ((_EnumProcesses == NULL) ||
-        (_EnumProcessModules == NULL) ||
-        (_GetModuleBaseName == NULL))
-    {
-        JNU_ThrowInternalError(env, "Unable to initialize process status helper library");
-    }
-}
-
-
-/*
  * Class:     sun_tools_attach_WindowsAttachProvider
  * Method:    enumProcesses
  * Signature: ([JI)I
@@ -147,7 +113,7 @@
     size = max * sizeof(DWORD);
     ptr = (DWORD*)malloc(size);
     if (ptr != NULL) {
-        BOOL res = (*_EnumProcesses)(ptr, size, &bytesReturned);
+        BOOL res = EnumProcesses(ptr, size, &bytesReturned);
         if (res != 0) {
             result = (jint)(bytesReturned / sizeof(DWORD));
             (*env)->SetIntArrayRegion(env, arr, 0, (jsize)result, (jint*)ptr);
@@ -192,13 +158,13 @@
     size = 1024 * sizeof(HMODULE);
     ptr = (HMODULE*)malloc(size);
     if (ptr != NULL) {
-        BOOL res = (*_EnumProcessModules)(hProcess, ptr, size, &bytesReturned);
+        BOOL res = EnumProcessModules(hProcess, ptr, size, &bytesReturned);
         if (res != 0) {
             int count = bytesReturned / sizeof(HMODULE);
             int i = 0;
             while (i < count) {
                 char base[256];
-                BOOL res = (*_GetModuleBaseName)(hProcess, ptr[i], base, sizeof(base));
+                BOOL res = GetModuleBaseName(hProcess, ptr[i], base, sizeof(base));
                 if (res != 0) {
                     if (strcmp(base, lib) == 0) {
                       result = JNI_TRUE;
--- a/jdk/src/windows/native/sun/tools/attach/WindowsVirtualMachine.c	Wed Jun 08 10:24:10 2011 -0700
+++ b/jdk/src/windows/native/sun/tools/attach/WindowsVirtualMachine.c	Mon Jun 20 17:38:27 2011 -0700
@@ -32,13 +32,13 @@
 
 
 /* kernel32 */
-typedef HINSTANCE (WINAPI* LoadLibraryFunc) (LPCTSTR);
+typedef HINSTANCE (WINAPI* GetModuleHandleFunc) (LPCTSTR);
 typedef FARPROC (WINAPI* GetProcAddressFunc)(HMODULE, LPCSTR);
 
 /* only on Windows 64-bit or 32-bit application running under WOW64 */
 typedef BOOL (WINAPI *IsWow64ProcessFunc) (HANDLE, PBOOL);
 
-static LoadLibraryFunc _LoadLibrary;
+static GetModuleHandleFunc _GetModuleHandle;
 static GetProcAddressFunc _GetProcAddress;
 static IsWow64ProcessFunc _IsWow64Process;
 
@@ -70,7 +70,7 @@
 #define MAX_PIPE_NAME_LENGTH    256
 
 typedef struct {
-   LoadLibraryFunc _LoadLibrary;
+   GetModuleHandleFunc _GetModuleHandle;
    GetProcAddressFunc _GetProcAddress;
    char jvmLib[MAX_LIBNAME_LENGTH];         /* "jvm.dll" */
    char func1[MAX_FUNC_LENGTH];
@@ -96,7 +96,7 @@
     HINSTANCE h;
     EnqueueOperationFunc addr;
 
-    h = pData->_LoadLibrary(pData->jvmLib);
+    h = pData->_GetModuleHandle(pData->jvmLib);
     if (h == NULL) {
         return ERR_OPEN_JVM_FAIL;
     }
@@ -131,15 +131,10 @@
 JNIEXPORT void JNICALL Java_sun_tools_attach_WindowsVirtualMachine_init
   (JNIEnv *env, jclass cls)
 {
-    HINSTANCE h = LoadLibrary("kernel32");
-    if (h != NULL) {
-        _LoadLibrary = (LoadLibraryFunc) GetProcAddress(h, "LoadLibraryA");
-        _GetProcAddress = (GetProcAddressFunc)GetProcAddress(h, "GetProcAddress");
-        _IsWow64Process = (IsWow64ProcessFunc)GetProcAddress(h, "IsWow64Process");
-    }
-    if (_LoadLibrary == NULL || _GetProcAddress == NULL) {
-        JNU_ThrowInternalError(env, "Unable to get address of LoadLibraryA or GetProcAddress");
-    }
+    // All following APIs exist on Windows XP with SP2/Windows Server 2008
+    _GetModuleHandle = (GetModuleHandleFunc)GetModuleHandle;
+    _GetProcAddress = (GetProcAddressFunc)GetProcAddress;
+    _IsWow64Process = (IsWow64ProcessFunc)IsWow64Process;
 }
 
 
@@ -375,7 +370,7 @@
     /*
      * Setup data to copy to target process
      */
-    data._LoadLibrary = _LoadLibrary;
+    data._GetModuleHandle = _GetModuleHandle;
     data._GetProcAddress = _GetProcAddress;
 
     strcpy(data.jvmLib, "jvm");
--- a/jdk/src/windows/native/sun/tracing/dtrace/jvm_symbols_md.c	Wed Jun 08 10:24:10 2011 -0700
+++ b/jdk/src/windows/native/sun/tracing/dtrace/jvm_symbols_md.c	Mon Jun 20 17:38:27 2011 -0700
@@ -35,7 +35,7 @@
 JvmSymbols* lookupJvmSymbols() {
     JvmSymbols* syms = (JvmSymbols*)malloc(sizeof(JvmSymbols));
     if (syms != NULL) {
-        HINSTANCE jvm = LoadLibrary("jvm.dll");
+        HINSTANCE jvm = GetModuleHandle("jvm.dll");
         if (jvm == NULL) {
             free(syms);
             return NULL;
--- a/jdk/src/windows/native/sun/windows/DllUtil.cpp	Wed Jun 08 10:24:10 2011 -0700
+++ b/jdk/src/windows/native/sun/windows/DllUtil.cpp	Mon Jun 20 17:38:27 2011 -0700
@@ -25,6 +25,7 @@
 
 
 #include "DllUtil.h"
+#include <jdk_util.h>
 
 // Disable warning about using this in the initializer list.
 #pragma warning( disable : 4355)
@@ -40,7 +41,7 @@
 HMODULE DllUtil::GetModule()
 {
     if (!module) {
-        module = ::LoadLibrary(name);
+        module = JDK_LoadSystemLibrary(name);
     }
     return module;
 }
@@ -60,7 +61,7 @@
 }
 
 DwmAPI::DwmAPI() :
-    DllUtil(_T("DWMAPI.DLL")),
+    DllUtil("DWMAPI.DLL"),
     DwmIsCompositionEnabledFunction((DllUtil*)this, "DwmIsCompositionEnabled"),
     DwmGetWindowAttributeFunction((DllUtil*)this, "DwmGetWindowAttribute")
 {
--- a/jdk/src/windows/native/sun/windows/DllUtil.h	Wed Jun 08 10:24:10 2011 -0700
+++ b/jdk/src/windows/native/sun/windows/DllUtil.h	Mon Jun 20 17:38:27 2011 -0700
@@ -43,7 +43,7 @@
         FARPROC GetProcAddress(LPCSTR name);
 
     protected:
-        DllUtil(const TCHAR * name) : name(name), module(NULL) {}
+        DllUtil(const char * name) : name(name), module(NULL) {}
         virtual ~DllUtil();
 
         HMODULE GetModule();
@@ -68,7 +68,7 @@
         };
 
     private:
-        const TCHAR * const name;
+        const char * const name;
         HMODULE module;
 };
 
--- a/jdk/src/windows/native/sun/windows/ShellFolder2.cpp	Wed Jun 08 10:24:10 2011 -0700
+++ b/jdk/src/windows/native/sun/windows/ShellFolder2.cpp	Mon Jun 20 17:38:27 2011 -0700
@@ -120,15 +120,15 @@
         return TRUE;
     }
     // Load libraries
-    libShell32 = LoadLibrary(TEXT("shell32.dll"));
+    libShell32 = JDK_LoadSystemLibrary("shell32.dll");
     if (libShell32 == NULL) {
         return FALSE;
     }
-    libUser32 = LoadLibrary(TEXT("user32.dll"));
+    libUser32 = JDK_LoadSystemLibrary("user32.dll");
     if (libUser32 == NULL) {
         return FALSE;
     }
-    libComCtl32 = LoadLibrary(TEXT("comctl32.dll"));
+    libComCtl32 = JDK_LoadSystemLibrary("comctl32.dll");
     if (libComCtl32 == NULL) {
         return FALSE;
     }
@@ -1021,7 +1021,8 @@
     (JNIEnv* env, jclass cls, jstring libName, jint iconID,
      jint cxDesired, jint cyDesired, jboolean useVGAColors)
 {
-    HINSTANCE libHandle = LoadLibrary(JNU_GetStringPlatformChars(env, libName, NULL));
+    const char *pLibName = env->GetStringUTFChars(libName, NULL);
+    HINSTANCE libHandle = (HINSTANCE)JDK_LoadSystemLibrary(pLibName);
     if (libHandle != NULL) {
         UINT fuLoad = (useVGAColors && !IS_WINXP) ? LR_VGACOLOR : 0;
         return ptr_to_jlong(LoadImage(libHandle, MAKEINTRESOURCE(iconID),
--- a/jdk/src/windows/native/sun/windows/ThemeReader.cpp	Wed Jun 08 10:24:10 2011 -0700
+++ b/jdk/src/windows/native/sun/windows/ThemeReader.cpp	Mon Jun 20 17:38:27 2011 -0700
@@ -150,7 +150,7 @@
 
 BOOL InitThemes() {
     static HMODULE hModThemes = NULL;
-    hModThemes = LoadLibrary(TEXT("UXTHEME.DLL"));
+    hModThemes = JDK_LoadSystemLibrary("UXTHEME.DLL");
     DTRACE_PRINTLN1("InitThemes hModThemes = %x\n", hModThemes);
     if(hModThemes) {
         DTRACE_PRINTLN("Loaded UxTheme.dll\n");
--- a/jdk/src/windows/native/sun/windows/awt_FileDialog.cpp	Wed Jun 08 10:24:10 2011 -0700
+++ b/jdk/src/windows/native/sun/windows/awt_FileDialog.cpp	Mon Jun 20 17:38:27 2011 -0700
@@ -284,7 +284,7 @@
         file = (jstring)env->GetObjectField(target, AwtFileDialog::fileID);
         if (file != NULL) {
             LPCTSTR tmp = JNU_GetStringPlatformChars(env, file, NULL);
-            _tcscpy(fileBuffer, tmp);
+            _tcsncpy(fileBuffer, tmp, bufferLimit - 2); // the fileBuffer is double null terminated string
             JNU_ReleaseStringPlatformChars(env, file, tmp);
         } else {
             fileBuffer[0] = _T('\0');
--- a/jdk/src/windows/native/sun/windows/awt_Mlib.cpp	Wed Jun 08 10:24:10 2011 -0700
+++ b/jdk/src/windows/native/sun/windows/awt_Mlib.cpp	Mon Jun 20 17:38:27 2011 -0700
@@ -43,12 +43,13 @@
         mlibSysFnS_t tempSysFns;
         mlib_status ret = MLIB_SUCCESS;
 
-        /* Try to load library. Routine should find the library successfully
-         * because this library is already loaded to the process space by
-         * the System.loadLibrary() call. Here we just need to get handle to
-         * initialize the pointers to required mlib routines.
+        /* Try to receive handle for the library. Routine should find
+         * the library successfully because this library is already
+         * loaded to the process space by the System.loadLibrary() call.
+         * Here we just need to get handle to initialize the pointers to
+         * required mlib routines.
          */
-        hDLL = ::LoadLibrary(TEXT("mlib_image.dll"));
+        hDLL = ::GetModuleHandle(TEXT("mlib_image.dll"));
 
         if (hDLL == NULL) {
             return MLIB_FAILURE;
@@ -94,9 +95,6 @@
             i++;
         }
 
-        if (ret != MLIB_SUCCESS) {
-            ::FreeLibrary(hDLL);
-        }
         return ret;
     }
 
--- a/jdk/src/windows/native/sun/windows/awt_TextArea.cpp	Wed Jun 08 10:24:10 2011 -0700
+++ b/jdk/src/windows/native/sun/windows/awt_TextArea.cpp	Mon Jun 20 17:38:27 2011 -0700
@@ -77,7 +77,7 @@
 LPCTSTR AwtTextArea::GetClassName() {
     static BOOL richedLibraryLoaded = FALSE;
     if (!richedLibraryLoaded) {
-        ::LoadLibrary(TEXT("RICHED20.DLL"));
+        JDK_LoadSystemLibrary("RICHED20.DLL");
         richedLibraryLoaded = TRUE;
     }
     return RICHEDIT_CLASS;
--- a/jdk/src/windows/native/sun/windows/awt_TrayIcon.cpp	Wed Jun 08 10:24:10 2011 -0700
+++ b/jdk/src/windows/native/sun/windows/awt_TrayIcon.cpp	Mon Jun 20 17:38:27 2011 -0700
@@ -185,7 +185,7 @@
     int shellVersion = 5; // WIN_2000
     // MSDN: DllGetVersion should not be implicitly called, but rather
     // loaded using GetProcAddress
-    HMODULE hShell = LoadLibrary(TEXT("Shell32.dll"));
+    HMODULE hShell = JDK_LoadSystemLibrary("Shell32.dll");
     if (hShell != NULL) {
         DLLGETVERSIONPROC proc = (DLLGETVERSIONPROC)GetProcAddress(hShell, "DllGetVersion");
         if (proc != NULL) {
--- a/jdk/src/windows/native/sun/windows/awt_Win32GraphicsDevice.cpp	Wed Jun 08 10:24:10 2011 -0700
+++ b/jdk/src/windows/native/sun/windows/awt_Win32GraphicsDevice.cpp	Mon Jun 20 17:38:27 2011 -0700
@@ -673,6 +673,12 @@
  */
 void AwtWin32GraphicsDevice::ResetAllMonitorInfo()
 {
+    //IE in some circumstances generates WM_SETTINGCHANGE message on appearance
+    //and thus triggers this method
+    //but we may not have the devices list initialized yet.
+    if (!Devices::GetInstance()){
+        return;
+    }
     Devices::InstanceAccess devices;
     int devicesNum = devices->GetNumDevices();
     for (int deviceIndex = 0; deviceIndex < devicesNum; deviceIndex++) {
--- a/jdk/src/windows/native/sun/windows/awt_Win32GraphicsEnv.cpp	Wed Jun 08 10:24:10 2011 -0700
+++ b/jdk/src/windows/native/sun/windows/awt_Win32GraphicsEnv.cpp	Mon Jun 20 17:38:27 2011 -0700
@@ -63,7 +63,7 @@
 
     bAlreadySet = TRUE;
 
-    HMODULE hLibUser32Dll = ::LoadLibrary(TEXT("user32.dll"));
+    HMODULE hLibUser32Dll = JDK_LoadSystemLibrary("user32.dll");
 
     if (hLibUser32Dll != NULL) {
         SetProcessDPIAwareFunc *lpSetProcessDPIAware =
--- a/jdk/src/windows/native/sun/windows/stdhdrs.h	Wed Jun 08 10:24:10 2011 -0700
+++ b/jdk/src/windows/native/sun/windows/stdhdrs.h	Mon Jun 20 17:38:27 2011 -0700
@@ -47,6 +47,7 @@
 // standard Java headers
 #include <jni.h>
 #include <jni_util.h>
+#include <jdk_util.h>
 
 } // extern "C"
 
--- a/jdk/src/windows/npt/npt_md.h	Wed Jun 08 10:24:10 2011 -0700
+++ b/jdk/src/windows/npt/npt_md.h	Mon Jun 20 17:38:27 2011 -0700
@@ -47,7 +47,7 @@
         _handle =  NULL;                                                \
         *(pnpt) = NULL;                                                 \
         buf[0] = 0;                                                     \
-        jvm = LoadLibrary("jvm.dll");                                   \
+        jvm = GetModuleHandle("jvm.dll");                               \
         if ( jvm == NULL ) NPT_ERROR("Cannot find jvm.dll");            \
         GetModuleFileName(jvm, buf, FILENAME_MAX);                      \
         lastSlash = strrchr(buf, '\\');                                 \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/image/BufferedImage/TinyScale.java	Mon Jun 20 17:38:27 2011 -0700
@@ -0,0 +1,68 @@
+/*
+ * @test %W% %E%
+ * @bug 7016495
+ * @summary Test tiny scales of BufferedImage
+ */
+
+import java.awt.*;
+import java.awt.geom.*;
+import java.awt.image.*;
+
+public class TinyScale {
+    static double tinyscales[] = {
+        1E-0,
+        1E-1,
+        1E-2,
+        1E-3,
+        1E-4,
+        1E-5,
+        1E-6,
+        1E-7,
+        1E-8,
+        1E-9,
+        1E-10,
+        1E-11,
+        1E-12,
+        1E-13,
+        1E-14,
+        1E-15,
+        1E-16,
+        1E-17,
+        1E-18,
+        1E-19,
+        1E-20,
+        1E-21,
+        1E-22,
+        1E-23,
+        1E-24,
+        1E-25,
+        1E-26,
+        1E-27,
+        1E-28,
+        1E-29,
+    };
+
+    static void test(BufferedImage rendImg, BufferedImage drawImg, double s) {
+        Graphics2D g = drawImg.createGraphics();
+        g.transform(new AffineTransform(s, 0.0, -1.0, 1.0, 0.0, 0.0));
+        g.drawImage(rendImg,
+                    -rendImg.getWidth() / 2,
+                    -rendImg.getHeight() / 2,
+                    null);
+        g.drawImage(rendImg, 0, 0, null);
+        g.dispose();
+    }
+
+    public static void main(String[] args) {
+        BufferedImage rendImg =
+            new BufferedImage(100, 100, BufferedImage.TYPE_3BYTE_BGR);
+        BufferedImage drawImg =
+            new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB);
+        for (double s: tinyscales) {
+            test(rendImg, drawImg, s);
+            for (int i = 0; args.length > 0 && i < 10; i++) {
+                test(rendImg, drawImg, Math.random()*s);
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/invoke/PermuteArgsTest.java	Mon Jun 20 17:38:27 2011 -0700
@@ -0,0 +1,372 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ */
+
+/* @test
+ * @summary unit tests for method handles which permute their arguments
+ * @run junit/othervm -ea -esa -DPermuteArgsTest.MAX_ARITY=8 test.java.lang.invoke.PermuteArgsTest
+ */
+/* Examples of manual runs:
+ * java -DPermuteArgsTest.{DRY_RUN=true,MAX_ARITY=253} test.java.lang.invoke.PermuteArgsTest
+ * java -DPermuteArgsTest.{VERBOSE=true,MAX_ARITY=5} test.java.lang.invoke.PermuteArgsTest
+ * java test.java.lang.invoke.PermuteArgsTest list3I[2,0,1] listJLJ[2,0,1]
+ */
+
+package test.java.lang.invoke;
+
+import org.junit.*;
+
+import java.util.*;
+import java.lang.reflect.*;
+
+import java.lang.invoke.*;
+import static java.lang.invoke.MethodHandles.*;
+import static java.lang.invoke.MethodType.*;
+
+public class PermuteArgsTest {
+    private static final Class CLASS = PermuteArgsTest.class;
+    private static final int MAX_ARITY = Integer.getInteger(CLASS.getSimpleName()+".MAX_ARITY", 8);
+    private static final boolean DRY_RUN = Boolean.getBoolean(CLASS.getSimpleName()+".DRY_RUN");
+    private static final boolean VERBOSE = Boolean.getBoolean(CLASS.getSimpleName()+".VERBOSE") || DRY_RUN;
+
+    static Object list2I(int x, int y) {
+        return Arrays.asList(x, y);
+    }
+    static Object list3I(int x, int y, int z) {
+        return Arrays.asList(x, y, z);
+    }
+    static Object list4I(int w, int x, int y, int z) {
+        return Arrays.asList(w, x, y, z);
+    }
+    static Object list2J(long x, long y) {
+        return Arrays.asList(x, y);
+    }
+    static Object list3J(long x, long y, long z) {
+        return Arrays.asList(x, y, z);
+    }
+    static Object list4J(long w, long x, long y, long z) {
+        return Arrays.asList(w, x, y, z);
+    }
+    static Object list2I2J(int w, int x, long y, long z) {
+        return Arrays.asList(w, x, y, z);
+    }
+    static Object list2J2I(long w, long x, int y, int z) {
+        return Arrays.asList(w, x, y, z);
+    }
+    static Object listLJJ(Object x, long y, long z) {
+        return Arrays.asList(x, y, z);
+    }
+    static Object listJLJ(long x, Object y, long z) {
+        return Arrays.asList(x, y, z);
+    }
+    static Object listJJL(long x, long y, Object z) {
+        return Arrays.asList(x, y, z);
+    }
+    static Object listJLL(long x, Object y, Object z) {
+        return Arrays.asList(x, y, z);
+    }
+    static Object listLJL(Object x, long y, Object z) {
+        return Arrays.asList(x, y, z);
+    }
+    static Object listLLJ(Object x, Object y, long z) {
+        return Arrays.asList(x, y, z);
+    }
+    static Object listJLLJ(long w, Object x, Object y, long z) {
+        return Arrays.asList(w, x, y, z);
+    }
+    static Object listLJJL(Object w, long x, long y, Object z) {
+        return Arrays.asList(w, x, y, z);
+    }
+    static Object listI_etc(int... va) {
+        ArrayList<Object> res = new ArrayList<Object>();
+        for (int x : va)  res.add(x);
+        return res;
+    }
+    static Object listIJL_etc(int x, long y, Object z, Object... va) {
+        ArrayList<Object> res = new ArrayList<Object>();
+        res.addAll(Arrays.asList(x, y, z));
+        res.addAll(Arrays.asList(va));
+        return res;
+    }
+
+    public static void main(String argv[]) throws Throwable {
+        if (argv.length > 0) {
+            for (String arg : argv) {
+                // arg ::= name[n,...]
+                int k = arg.indexOf('[');
+                String mhName = arg.substring(0, k).trim();
+                String permString = arg.substring(k);
+                testOnePermutation(mhName, permString);
+            }
+            return;
+        }
+        new PermuteArgsTest().test();
+    }
+    static int testCases;
+    @Test
+    public void test() throws Throwable {
+        testCases = 0;
+        Lookup lookup = lookup();
+        for (Method m : lookup.lookupClass().getDeclaredMethods()) {
+            if (m.getName().startsWith("list") &&
+                Modifier.isStatic(m.getModifiers())) {
+                test(m.getName(), lookup.unreflect(m));
+            }
+        }
+        System.out.println("ran a total of "+testCases+" test cases");
+    }
+
+    static int jump(int i, int min, int max) {
+        if (i >= min && i <= max-1) {
+            // jump faster
+            int len = max-min;
+            if (i < min + len/2)
+                i = min + len/2;
+            else
+                i = max-1;
+        }
+        return i;
+    }
+
+    static void test(String name, MethodHandle mh) throws Throwable {
+        if (VERBOSE)
+            System.out.println("mh = "+name+" : "+mh+" { "
+                               +Arrays.toString(junkArgs(mh.type().parameterArray())));
+        int testCases0 = testCases;
+        if (!mh.isVarargsCollector()) {
+            // normal case
+            testPermutations(mh);
+        } else {
+            // varargs case; add params up to MAX_ARITY
+            MethodType mt = mh.type();
+            int posArgs = mt.parameterCount() - 1;
+            int arity0 = Math.max(3, posArgs);
+            for (int arity = arity0; arity <= MAX_ARITY; arity++) {
+                MethodHandle mh1;
+                try {
+                    mh1 = adjustArity(mh, arity);
+                } catch (IllegalArgumentException ex) {
+                    System.out.println("*** mh = "+name+" : "+mh+"; arity = "+arity+" => "+ex);
+                    ex.printStackTrace();
+                    break;  // cannot get this arity for this type
+                }
+                test("("+arity+")"+name, mh1);
+                arity = jump(arity, arity0*2, MAX_ARITY);
+            }
+        }
+        if (VERBOSE)
+            System.out.println("ran "+(testCases - testCases0)+" test cases for "+name+" }");
+    }
+
+    static MethodHandle adjustArity(MethodHandle mh, int arity) {
+        MethodType mt = mh.type();
+        int posArgs = mt.parameterCount() - 1;
+        Class<?> reptype = mt.parameterType(posArgs).getComponentType();
+        MethodType mt1 = mt.dropParameterTypes(posArgs, posArgs+1);
+        while (mt1.parameterCount() < arity) {
+            Class<?> pt = reptype;
+            if (pt == Object.class && posArgs > 0)
+                // repeat types cyclically if possible:
+                pt = mt1.parameterType(mt1.parameterCount() - posArgs);
+            mt1 = mt1.appendParameterTypes(pt);
+        }
+        return mh.asType(mt1);
+    }
+    static MethodHandle findTestMH(String name, int[] perm) throws ReflectiveOperationException {
+        int arity = perm.length;
+        Lookup lookup = lookup();
+        for (Method m : lookup.lookupClass().getDeclaredMethods()) {
+            if (m.getName().equals(name) &&
+                Modifier.isStatic(m.getModifiers())) {
+                MethodHandle mh = lookup.unreflect(m);
+                int mhArity = mh.type().parameterCount();
+                if (mh.isVarargsCollector()) {
+                    if (mhArity-1 <= arity)
+                        return adjustArity(mh, arity);
+                } else if (mhArity == arity) {
+                    return mh;
+                }
+            }
+        }
+        throw new RuntimeException("no such method for arity "+arity+": "+name);
+    }
+
+    static void testPermutations(MethodHandle mh) throws Throwable {
+        HashSet<String> done = new HashSet<String>();
+        MethodType mt = mh.type();
+        int[] perm = nullPerm(mt.parameterCount());
+        final int MARGIN = (perm.length <= 10 ? 2 : 0);
+        int testCases0 = testCases;
+        for (int j = 0; j <= 1; j++) {
+            int maxStart = perm.length-1;
+            if (j != 0)  maxStart /= 2;
+            for (int start = 0; start <= maxStart; start++) {
+                int maxOmit = (maxStart - start) / 2;
+                if (start != 0)  maxOmit = 2;
+                if (j != 0)  maxOmit = 1;
+                for (int omit = 0; omit <= maxOmit; omit++) {
+                    int end = perm.length - omit;
+                    if (end - start >= 2) {
+                        //System.out.println("testPermutations"+Arrays.asList(start, end)+(j == 0 ? "" : " (reverse)"));
+                        testPermutations(mh, perm, start, end, done);
+                    }
+                    omit = jump(omit, (start == 0 && j == 0 ? MARGIN : 0), maxOmit);
+                }
+                start = jump(start, (j == 0 ? MARGIN : 0), maxStart);
+            }
+            // do everything in reverse:
+            reverse(perm, 0, perm.length);
+        }
+        switch (perm.length) {
+        case 2: assert(testCases - testCases0 == 2); break;
+        case 3: assert(testCases - testCases0 == 6); break;
+        case 4: assert(testCases - testCases0 == 24); break;
+        case 5: assert(testCases - testCases0 == 120); break;
+        case 6: assert(testCases - testCases0 > 720/3); break;
+        }
+    }
+
+    static void testPermutations(MethodHandle mh, int[] perm, int start, int end, Set<String> done) throws Throwable {
+        if (end - start <= 1)  return;
+        for (int j = 0; j <= 1; j++) {
+            testRotations(mh, perm, start, end, done);
+            if (end - start <= 2)  return;
+            reverse(perm, start, end);
+        }
+        if (end - start <= 3)  return;
+        int excess4 = (end - start) - 4;
+        // composed rotations:
+        int start2 = start + 1 + excess4/3;
+        int end2   = end       - excess4/3;
+        end2 = start2 + Math.min(start == 0 ? 4 : 3, end2 - start2);
+        int skips = (perm.length+3)/5;
+        for (int i = start; i < end; i++) {
+            rotate(perm, start, end);
+            if (skips > 1 && ((i-start) + (i-start)/7) % skips != 0)  continue;
+            for (int j = 0; j <= 1; j++) {
+                testPermutations(mh, perm, start2, end2, done);
+                reverse(perm, start, end);
+            }
+        }
+    }
+
+    static void testRotations(MethodHandle mh, int[] perm, int start, int end, Set<String> done) throws Throwable {
+        Object[] args = junkArgs(mh.type().parameterArray());
+        for (int i = start; i < end; i++) {
+            if (done.add(Arrays.toString(perm)))
+                testOnePermutation(mh, perm, args);
+            rotate(perm, start, end);
+        }
+    }
+
+    static void testOnePermutation(MethodHandle mh, int[] perm, Object[] args) throws Throwable {
+        MethodType mt = mh.type();
+        MethodType pmt = methodType(mt.returnType(), unpermuteArgs(perm, mt.parameterArray(), Class[].class));
+        if (VERBOSE)
+            System.out.println(Arrays.toString(perm));
+        testCases += 1;
+        if (DRY_RUN)
+            return;
+        Object res = permuteArguments(mh, pmt, perm).invokeWithArguments(unpermuteArgs(perm, args));
+        String str = String.valueOf(res);
+        if (!Arrays.toString(args).equals(str)) {
+            System.out.println(Arrays.toString(perm)+" "+str+" *** WRONG ***");
+        }
+    }
+
+    // For reproducing failures:
+    static void testOnePermutation(String mhName, String permString) throws Throwable {
+        String s = permString;
+        s = s.replace('[', ' ').replace(']', ' ').replace(',', ' ');  // easier to trim spaces
+        s = s.trim();
+        int[] perm = new int[s.length()];
+        int arity = 0;
+        while (!s.isEmpty()) {
+            int k = s.indexOf(' ');
+            if (k < 0)  k = s.length();
+            perm[arity++] = Integer.parseInt(s.substring(0, k));
+            s = s.substring(k).trim();
+        }
+        perm = Arrays.copyOf(perm, arity);
+        testOnePermutation(mhName, perm);
+    }
+    static void testOnePermutation(String mhName, int[] perm) throws Throwable {
+        MethodHandle mh = findTestMH(mhName, perm);
+        System.out.println("mh = "+mhName+" : "+mh+" { "
+                           +Arrays.toString(junkArgs(mh.type().parameterArray())));
+        Object[] args = junkArgs(mh.type().parameterArray());
+        testOnePermutation(mh, perm, args);
+        System.out.println("}");
+    }
+
+    static Object[] junkArgs(Class<?>[] ptypes) {
+        Object[] args = new Object[ptypes.length];
+        for (int i = 0; i < ptypes.length; i++) {
+            Class<?> pt = ptypes[i];
+            Object arg;
+            if (pt == Void.class)       arg = null;
+            else if (pt == int.class)   arg = (int)  i + 101;
+            else if (pt == long.class)  arg = (long) i + 10_000_000_001L;
+            else                        arg = "#" + (i + 1);
+            args[i] = arg;
+        }
+        return args;
+    }
+
+    static int[] nullPerm(int len) {
+        int[] perm = new int[len];
+        for (int i = 0; i < len; i++)
+            perm[i] = i;
+        return perm;
+    }
+    static void rotate(int[] perm) {
+        rotate(perm, 0, perm.length);
+    }
+    static void rotate(int[] perm, int start, int end) {
+        int x = perm[end-1];
+        for (int j = start; j < end; j++) {
+            int y = perm[j]; perm[j] = x; x = y;
+        }
+    }
+    static void reverse(int[] perm) {
+        reverse(perm, 0, perm.length);
+    }
+    static void reverse(int[] perm, int start, int end) {
+        int mid = start + (end - start)/2;
+        for (int j = start; j < mid; j++) {
+            int k = (end-1) - j;
+            int x = perm[j]; perm[j] = perm[k]; perm[k] = x;
+        }
+    }
+    // Permute the args according to the inverse of perm.
+    static Object[] unpermuteArgs(int[] perm, Object[] args) {
+        return unpermuteArgs(perm, args, Object[].class);
+    }
+    static <T> T[] unpermuteArgs(int[] perm, T[] args, Class<T[]> Tclass) {
+        T[] res = Arrays.copyOf(new Object[0], perm.length, Tclass);
+        for (int i = 0; i < perm.length; i++)
+            res[perm[i]] = args[i];
+        return res;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/net/URLClassLoader/B7050028.java	Mon Jun 20 17:38:27 2011 -0700
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.net.URLConnection;
+import java.util.zip.CRC32;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipOutputStream;
+
+/**
+ * @test
+ * @bug 7050028
+ * @summary  ISE "zip file closed" from JarURLConnection.getInputStream on JDK 7 when !useCaches
+ * @run main/othervm B7050028
+ */
+
+public class B7050028 {
+    public static void main(String[] args) throws Exception {
+        URLConnection conn = B7050028.class.getResource("B7050028.class").openConnection();
+        int len = conn.getContentLength();
+        byte[] data = new byte[len];
+        InputStream is = conn.getInputStream();
+        is.read(data);
+        is.close();
+        conn.setDefaultUseCaches(false);
+        File jar = File.createTempFile("B7050028", ".jar");
+        jar.deleteOnExit();
+        OutputStream os = new FileOutputStream(jar);
+        ZipOutputStream zos = new ZipOutputStream(os);
+        ZipEntry ze = new ZipEntry("B7050028.class");
+        ze.setMethod(ZipEntry.STORED);
+        ze.setSize(len);
+        CRC32 crc = new CRC32();
+        crc.update(data);
+        ze.setCrc(crc.getValue());
+        zos.putNextEntry(ze);
+        zos.write(data, 0, len);
+        zos.closeEntry();
+        zos.finish();
+        zos.close();
+        os.close();
+        System.out.println(new URLClassLoader(new URL[] {new URL("jar:" + jar.toURI() + "!/")}, ClassLoader.getSystemClassLoader().getParent()).loadClass(B7050028.class.getName()));
+    }
+    private B7050028() {}
+}
--- a/jdk/test/java/security/Security/NoInstalledProviders.java	Wed Jun 08 10:24:10 2011 -0700
+++ b/jdk/test/java/security/Security/NoInstalledProviders.java	Mon Jun 20 17:38:27 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,8 +23,9 @@
 
 /*
  * @test
- * @bug 4273454
+ * @bug 4273454 7052537
  * @summary Make sure getProviders(filter) doesn't throw NPE
+ * @run main/othervm NoInstalledProviders
  */
 
 import java.security.*;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/security/SignedObject/Correctness.java	Mon Jun 20 17:38:27 2011 -0700
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 6618658
+ * @summary Deserialization allows creation of mutable SignedObject
+ */
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.security.KeyPair;
+import java.security.KeyPairGenerator;
+import java.security.Signature;
+import java.security.SignedObject;
+
+
+public class Correctness {
+
+    public static void main(String[] args) throws Exception {
+
+        String SIGALG = "SHA1withRSA";
+        KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA");
+        KeyPair kp = kpg.generateKeyPair();
+
+        SignedObject so1 = new SignedObject("Hello", kp.getPrivate(),
+                Signature.getInstance(SIGALG));
+
+        ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
+        ObjectOutputStream out = new ObjectOutputStream(byteOut);
+        out.writeObject(so1);
+        out.close();
+
+        byte[] data = byteOut.toByteArray();
+
+        SignedObject so2 = (SignedObject)new ObjectInputStream(
+                new ByteArrayInputStream(data)).readObject();
+
+        if (!so2.getObject().equals("Hello")) {
+            throw new Exception("Content changed");
+        }
+        if (!so2.getAlgorithm().equals(SIGALG)) {
+            throw new Exception("Signature algorithm unknown");
+        }
+        if (!so2.verify(kp.getPublic(), Signature.getInstance(SIGALG))) {
+            throw new Exception("Not verified");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/pkcs11/Provider/Absolute.cfg	Mon Jun 20 17:38:27 2011 -0700
@@ -0,0 +1,10 @@
+#
+# Configuration file to allow the SunPKCS11 provider to utilize
+# the Solaris Cryptographic Framework, if it is available
+#
+
+name = Absolute
+
+description = SunPKCS11 using a relative path
+
+library = ./libpkcs11.so
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/pkcs11/Provider/Absolute.java	Mon Jun 20 17:38:27 2011 -0700
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/**
+ * @test
+ * @bug 7003952
+ * @summary load DLLs and launch executables using fully qualified path
+ */
+import java.security.*;
+import java.lang.reflect.*;
+import sun.security.pkcs11.*;
+
+public class Absolute {
+
+    public static void main(String[] args) throws Exception {
+        Constructor cons;
+        try {
+            Class clazz = Class.forName("sun.security.pkcs11.SunPKCS11");
+            cons = clazz.getConstructor(new Class[] {String.class});
+        } catch (Exception ex) {
+            System.out.println("Skipping test - no PKCS11 provider available");
+            return;
+        }
+
+        String config =
+            System.getProperty("test.src", ".") + "/Absolute.cfg";
+
+        try {
+            Object obj = cons.newInstance(new Object[] {config});
+        } catch (InvocationTargetException ite) {
+            Throwable cause = ite.getCause();
+            if (cause instanceof ProviderException) {
+                Throwable cause2 = cause.getCause();
+                if ((cause2 == null) ||
+                    !cause2.getMessage().startsWith(
+                         "Absolute path required for library value:")) {
+                    // rethrow
+                    throw (ProviderException) cause;
+                }
+                System.out.println("Caught expected Exception: \n" + cause2);
+            }
+        }
+    }
+}
--- a/langtools/.hgtags	Wed Jun 08 10:24:10 2011 -0700
+++ b/langtools/.hgtags	Mon Jun 20 17:38:27 2011 -0700
@@ -119,3 +119,4 @@
 7476b164194c1814704153e74d5ff7e965c6fdbf jdk7-b142
 5faa9eedc44e201f2b13ad837e9077668b823d28 jdk7-b143
 8eb952f43b117d538f6ca5e9e43ff9ce7646c7ee jdk7-b144
+c455e2ae5c93014ae3fc475aba4509b5f70465f7 jdk7-b145
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDoclet.java	Wed Jun 08 10:24:10 2011 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDoclet.java	Mon Jun 20 17:38:27 2011 -0700
@@ -110,7 +110,10 @@
         String configstylefile = configuration.stylesheetfile;
         performCopy(configdestdir, confighelpfile);
         performCopy(configdestdir, configstylefile);
-        Util.copyResourceFile(configuration, "inherit.gif", false);
+        Util.copyResourceFile(configuration, "background.gif", false);
+        Util.copyResourceFile(configuration, "tab.gif", false);
+        Util.copyResourceFile(configuration, "titlebar.gif", false);
+        Util.copyResourceFile(configuration, "titlebar_end.gif", false);
         // do early to reduce memory footprint
         if (configuration.classuse) {
             ClassUseWriter.generate(configuration, classtree);
Binary file langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/background.gif has changed
Binary file langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/inherit.gif has changed
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css	Wed Jun 08 10:24:10 2011 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css	Mon Jun 20 17:38:27 2011 -0700
@@ -3,187 +3,290 @@
 Overall document style
 */
 body {
-    font-family:Helvetica, Arial, sans-serif;
-    color:#000000;
+    background-color:#ffffff;
+    color:#353833;
+    font-family:Arial, Helvetica, sans-serif;
+    font-size:76%;
+    margin:0;
+}
+a:link, a:visited {
+    text-decoration:none;
+    color:#4c6b87;
+}
+a:hover, a:focus {
+    text-decoration:none;
+    color:#bb7a2a;
+}
+a:active {
+    text-decoration:none;
+    color:#4c6b87;
+}
+a[name] {
+    color:#353833;
+}
+a[name]:hover {
+    text-decoration:none;
+    color:#353833;
 }
 pre {
-    font-size:1.0em;
+    font-size:1.3em;
 }
 h1 {
-    font-size:1.4em;
+    font-size:1.8em;
 }
 h2 {
-    font-size:1.35em;
+    font-size:1.5em;
 }
 h3 {
-    font-size:1.3em;
+    font-size:1.4em;
 }
 h4 {
-    font-size:1.25em;
+    font-size:1.3em;
+}
+h5 {
+    font-size:1.2em;
+}
+h6 {
+    font-size:1.1em;
 }
 ul {
-    margin:10px 0 10px 20px;
     list-style-type:disc;
 }
-caption {
-    background: #CCCCFF;
-    color:#000000;
-    text-align:left;
-    font-size:150%;
-    font-weight:bold;
-    border-left:2px ridge;
-    border-right:2px ridge;
-    border-top:2px ridge;
-    padding-left:5px;
-    width:auto;
+code, tt {
+    font-size:1.2em;
+}
+dt code {
+    font-size:1.2em;
+}
+table tr td dt code {
+    font-size:1.2em;
+    vertical-align:top;
+}
+sup {
+    font-size:.6em;
 }
 /*
 Document title and Copyright styles
 */
+.clear {
+    clear:both;
+    height:0px;
+    overflow:hidden;
+}
 .aboutLanguage {
     float:right;
-    font-size:0.9em;
-    color:#000000;
+    padding:0px 21px;
+    font-size:.8em;
+    z-index:200;
+    margin-top:-7px;
 }
 .legalCopy {
-    margin:7px 0;
+    margin-left:.5em;
+}
+.bar a, .bar a:link, .bar a:visited, .bar a:active {
+    color:#FFFFFF;
+    text-decoration:none;
+}
+.bar a:hover, .bar a:focus {
+    color:#bb7a2a;
 }
-.bar {
-    font-size:1em;
-    margin:10px 0 0 2px;
-}
-.bar a {
-    font-weight:normal;
+.tab {
+    background-color:#0066FF;
+    background-image:url(resources/titlebar.gif);
+    background-position:left top;
+    background-repeat:no-repeat;
+    color:#ffffff;
+    padding:8px;
+    width:5em;
+    font-weight:bold;
 }
 /*
 Navigation bar styles
 */
+.bar {
+    background-image:url(resources/background.gif);
+    background-repeat:repeat-x;
+    color:#FFFFFF;
+    padding:.8em .5em .4em .8em;
+    height:auto;/*height:1.8em;*/
+    font-size:1em;
+    margin:0;
+}
 .topNav {
-    border-top:2px solid #C0C0C0;
-    padding:7px 0;
+    background-image:url(resources/background.gif);
+    background-repeat:repeat-x;
+    color:#FFFFFF;
+    float:left;
+    padding:0;
+    width:100%;
+    clear:right;
     height:2.8em;
-    width:100%;
-    min-width:600px;
+    padding-top:10px;
+    overflow:hidden;
 }
 .bottomNav {
-    border-top:2px solid #C0C0C0;
-    padding:7px 0;
+    margin-top:10px;
+    background-image:url(resources/background.gif);
+    background-repeat:repeat-x;
+    color:#FFFFFF;
+    float:left;
+    padding:0;
+    width:100%;
+    clear:right;
     height:2.8em;
-    width:100%;
+    padding-top:10px;
+    overflow:hidden;
 }
 .subNav {
-    border-bottom:2px solid #C0C0C0;
+    background-color:#dee3e9;
+    border-bottom:1px solid #9eadc0;
     float:left;
     width:100%;
-    min-width:600px;
+    overflow:hidden;
 }
 .subNav div {
     clear:left;
     float:left;
-    padding:0 0 5px 2px;
-    width:100%;
+    padding:0 0 5px 6px;
 }
-.topNav a:link,.topNav a:active, .topNav a:visited, .topNav a:hover,
-.bottomNav a:link,.bottomNav a:active, .bottomNav a:visited, .bottomNav a:hover {
-    color:#000000;
-    font-weight:bold;
-    text-decoration:underline;
-    font-size:1em;
-}
-/* Navigation bar list styles */
-.topNav ul.navList, .bottomNav ul.navList {
-    background-color:#EEEEFF;
-    padding:4px 4px;
-    margin:0;
+ul.navList, ul.subNavList {
     float:left;
-    width:80%;
+    margin:0 25px 0 0;
+    padding:0;
 }
 ul.navList li{
     list-style:none;
     float:left;
-    padding:0 4px;
-    color:#000000;
-    font-size:0.98em;
-}
-ul.navList li.navBarCell1Rev {
-    background-color:#00008B;
-    color:#FFFFFF;
-    font-weight:bold;
-    font-size:0.97em;
-}
-/* Sub-navigation bar list styles */
-.subNav ul.navList {
-    float:left;
-    margin:0;
-    padding:0;
-    font-size:0.8em;
-    width:350px;
-}
-ul.subNavList {
-    float:left;
-    font-size:0.8em;
-    width:350px;
-    margin:0;
-    padding:0;
+    padding:3px 6px;
 }
 ul.subNavList li{
     list-style:none;
     float:left;
-    font-size:98%;
+    font-size:90%;
+}
+.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited {
+    color:#FFFFFF;
+    text-decoration:none;
+}
+.topNav a:hover, .bottomNav a:hover {
+    text-decoration:none;
+    color:#bb7a2a;
+}
+.navBarCell1Rev {
+    background-image:url(resources/tab.gif);
+    background-color:#a88834;
+    color:#FFFFFF;
+    margin: auto 5px;
+    border:1px solid #c9aa44;
 }
 /*
 Page header and footer styles
 */
 .header, .footer {
     clear:both;
-    padding:10px 0;
+    margin:0 20px;
+    padding:5px 0 0 0;
 }
 .indexHeader {
-    font-size:0.9em;
-    margin:10px 0 0 2px;
+    margin:10px;
+    position:relative;
+}
+.indexHeader h1 {
+    font-size:1.3em;
+}
+.title {
+    color:#2c4557;
+    margin:10px 0;
+}
+.subTitle {
+    margin:5px 0 0 0;
 }
 .header ul {
-    padding-left:20px;
+    margin:0 0 25px 0;
+    padding:0;
 }
-/* Header and footer title styles */
-.header h1.title {
-    font-size:1.4em;
-    text-align:center;
-    margin:0;
+.footer ul {
+    margin:20px 0 5px 0;
 }
-.header h2.title {
-    font-size:1.35em;
-    margin:0;
-}
-.subTitle {
-    padding-top:10px;
+.header ul li, .footer ul li {
+    list-style:none;
+    font-size:1.2em;
 }
 /*
-Content styles
+Heading styles
 */
-.deprecatedContent {
-    margin:0;
-    padding:10px 0;
+div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 {
+    background-color:#dee3e9;
+    border-top:1px solid #9eadc0;
+    border-bottom:1px solid #9eadc0;
+    margin:0 0 6px -8px;
+    padding:2px 5px;
 }
-.docSummary {
-    padding-top:10px;
+ul.blockList ul.blockList ul.blockList li.blockList h3 {
+    background-color:#dee3e9;
+    border-top:1px solid #9eadc0;
+    border-bottom:1px solid #9eadc0;
+    margin:0 0 6px -8px;
+    padding:2px 5px;
+}
+ul.blockList ul.blockList li.blockList h3 {
+    padding:0;
+    margin:15px 0;
+}
+ul.blockList li.blockList h2 {
+    padding:0px 0 20px 0;
 }
 /*
 Page layout container styles
 */
-.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer,
-.constantValuesContainer {
+.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer {
     clear:both;
+    padding:10px 20px;
     position:relative;
-    padding-bottom:20px;
 }
 .indexContainer {
-    padding:0 0 0 2px;
+    margin:10px;
+    position:relative;
+    font-size:1.0em;
+}
+.indexContainer h2 {
+    font-size:1.1em;
+    padding:0 0 3px 0;
+}
+.indexContainer ul {
+    margin:0;
+    padding:0;
+}
+.indexContainer ul li {
+    list-style:none;
+}
+.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt {
+    font-size:1.1em;
+    font-weight:bold;
+    margin:10px 0 0 0;
+    color:#4E4E4E;
+}
+.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd {
+    margin:10px 0 10px 20px;
+}
+.serializedFormContainer dl.nameValue dt {
+    margin-left:1px;
+    font-size:1.1em;
+    display:inline;
+    font-weight:bold;
+}
+.serializedFormContainer dl.nameValue dd {
+    margin:0 0 0 1px;
+    font-size:1.1em;
+    display:inline;
+}
+/*
+List styles
+*/
+ul.horizontal li {
+    display:inline;
     font-size:0.9em;
 }
-/*
-Class inheritance information styles
-*/
 ul.inheritance {
     margin:0;
     padding:0;
@@ -194,236 +297,178 @@
 }
 ul.inheritance li ul.inheritance {
     margin-left:15px;
-    background-image:url(resources/inherit.gif);
-    background-repeat:no-repeat;
     padding-left:15px;
     padding-top:1px;
 }
-/*
-Heading styles
-*/
-.indexContainer h2 {
-    font-weight:normal;
-    font-size:1.0em;
-    padding:5px 0 0 0;
-    margin:10px 0 0 0;
-}
-.contentContainer h2 {
-    margin:10px 0;
-}
-.constantValuesContainer h2 {
-    background:#CCCCFF;
-    border:2px ridge;
-    padding:3px;
-    margin:0 0 10px 0;
-}
-.serializedFormContainer ul.blockList li.blockList h2 {
-    background:#EEEEFF;
-    border:2px ridge;
-    padding:3px;
-    margin:0 0 15px 0;
-    text-align:center;
-}
-.classUseContainer ul li ul li h3 {
-    margin-bottom:30px;
-    padding:3px;
-}
-.serializedFormContainer ul.blockList li.blockList ul.blockList li.blockList h3 {
-    background:#EEEEFF;
-    margin:0 0 15px 0;
-    padding:3px;
-}
-.serializedFormContainer ul.blockList li.blockList ul.blockList li.blockList ul.blockList li.blockList h3 {
-    background:#CCCCFF;
-    margin:0 0 15px 0;
-    padding:3px;
-    border:2px ridge;
-}
-ul.blockList ul.blockList li.blockList h3, ul.blockList ul.blockList li.blockList h3 {
-    background:#CCCCFF;
-    border:2px ridge;
-    padding-left:5px;
-}
-div.summary ul.blockList ul.blockList li.blockList h3 {
-    background:#CCCCFF;
-    border:0;
-    border:2px ridge;
-    margin:0;
-}
-div.summary ul.blockList ul.blockList ul.blockList li.blockList h3 {
-    background:#EEEEFF;
-    border:0;
-    border-bottom:2px ridge;
-}
-div.details ul.blockList ul.blockList ul.blockList li.blockList h4,
-div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 {
-    font-size:1.15em;
-    font-weight:bold;
-    padding:0 0 5px 0;
-    margin:0;
-}
-/*
-Table styles
-*/
-.contentContainer table {
-    border-collapse:collapse ;
-    width:100%;
-}
-.contentContainer table td, .contentContainer table th {
-    border:2px ridge;
-}
-/* Constant values page table styles */
-.constantValuesContainer table {
-    border-collapse:collapse;
-}
-.constantValuesContainer table caption{
-    font-size:0.95em;
-    padding:3px;
-    background:#EEEEFF;
-}
-.constantValuesContainer table td, .constantValuesContainer table th {
-    border:2px ridge;
-    padding:3px;
-}
-/* Class-use/Package-use page table styles */
-.classUseContainer table {
-    border-collapse:collapse ;
-    width:100%;
-    margin:0 0 10px 0;
-}
-.classUseContainer ul li ul li table caption{
-    font-size:0.95em;
-    padding:3px;
-    background:#EEEEFF;
-}
-.classUseContainer table td, .classUseContainer table th {
-    border:2px ridge;
-    padding:3px;
-}
-/* Summary table styles */
-ul.blockList li.blockList table.overviewSummary {
-    margin:0;
-    margin-bottom:15px;
-}
-ul.blockList li.blockList table caption {
-    padding:3px;
-}
-ul.blockList li.blockList table.overviewSummary td.colFirst{
-    text-align:right;
-}
-table.packageSummary td.colFirst, table.overviewSummary th.colFirst {
-    width:15%;
-}
-div.summary ul.blockList ul.blockList li.blockList caption {
-    display:none;
-}
-div.summary ul.blockList li.blockList ul.blockList li.blockList table.overviewSummary th {
-    border-top:0;
-}
-/* Table column block styles */
-ul.blockList li.blockList table.overviewSummary td.colLast div.block{
+ul.blockList, ul.blockListLast {
+    margin:10px 0 10px 0;
     padding:0;
-    padding-left:40px;
-}
-ul.blockList li.blockList table.overviewSummary td.colOne div.block{
-    padding:0;
-    padding-left:40px;
-}
-.contentContainer ul.blockList li.blockList table .colOne div.block{
-    padding-left:40px;
-}
-.classUseContainer ul li ul li table .colLast div.block,
-.classUseContainer ul li ul li table .colOne div.block{
-    padding-left:40px;
-}
-/*
-List styles
-*/
-ul.horizontal li {
-    display:inline;
-    font-size:0.9em;   
-}
-/* Container specific list styles */
-.indexContainer ul {
-    margin:0;
-    padding:0;
-}
-.indexContainer ul li {
-    list-style:none;
-}
-.serializedFormContainer ul.blockList li.blockList ul.blockList li.blockList ul.blockList li.blockList {
-    border:0;
-}
-.serializedFormContainer ul.blockList li.blockList ul.blockList li.blockList ul.blockList li.blockList ul.blockList li.blockList {
-    list-style:none;
-    border:0;
-    border-bottom:2px ridge;
-    height:1%;
-}
-.serializedFormContainer ul.blockList li.blockList ul.blockList li.blockList ul.blockList li.blockList ul.blockList li.blockListLast {
-    list-style:none;
-}
-/* General list styles */
-ul.blockList, ul.blockListLast {
-    margin-left:0;
-    padding-left:0;
 }
 ul.blockList li.blockList, ul.blockListLast li.blockList {
     list-style:none;
     margin-bottom:25px;
 }
-ul.blockList ul.blockList ul.blockList li.blockList {
-    border:2px ridge;
+ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList {
+    padding:0px 20px 5px 10px;
+    border:1px solid #9eadc0;
+    background-color:#f9f9f9;
+}
+ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList {
+    padding:0 0 5px 8px;
+    background-color:#ffffff;
+    border:1px solid #9eadc0;
+    border-top:none;
 }
-div.details ul.blockList ul.blockList ul.blockList li.blockList {
-    border:0;
-    border-bottom:2px ridge;
-    height:1%;
+ul.blockList ul.blockList ul.blockList ul.blockList li.blockList {
+    margin-left:0;
+    padding-left:0;
+    padding-bottom:15px;
+    border:none;
+    border-bottom:1px solid #9eadc0;
+}
+ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast {
+    list-style:none;
+    border-bottom:none;
+    padding-bottom:0;
+}
+table tr td dl, table tr td dl dt, table tr td dl dd {
+    margin-top:0;
+    margin-bottom:1px;
 }
-/* Definition list styles */
-ul.blockList li.blockList dl{
-    margin-bottom:15px;
+/*
+Table styles
+*/
+.contentContainer table, .classUseContainer table, .constantValuesContainer table {
+    border-bottom:1px solid #9eadc0;
+    width:100%;
 }
-ul.blockList li.blockList dl dd{
-    margin:0 0 0 30px;
+.contentContainer ul li table, .classUseContainer ul li table, .constantValuesContainer ul li table {
+    width:100%;
+}
+.contentContainer .description table, .contentContainer .details table {
+    border-bottom:none;
+}
+.contentContainer ul li table th.colOne, .contentContainer ul li table th.colFirst, .contentContainer ul li table th.colLast, .classUseContainer ul li table th, .constantValuesContainer ul li table th, .contentContainer ul li table td.colOne, .contentContainer ul li table td.colFirst, .contentContainer ul li table td.colLast, .classUseContainer ul li table td, .constantValuesContainer ul li table td{
+    vertical-align:top;
+    padding-right:20px;
 }
-ul.blockList li.blockList ul.blockList li.blockList ul.blockList li.blockList dl,
-ul.blockList li.blockList ul.blockList li.blockList ul.blockListLast li.blockList dl{
-    padding:0 0 10px 35px;
+.contentContainer ul li table th.colLast, .classUseContainer ul li table th.colLast,.constantValuesContainer ul li table th.colLast,
+.contentContainer ul li table td.colLast, .classUseContainer ul li table td.colLast,.constantValuesContainer ul li table td.colLast,
+.contentContainer ul li table th.colOne, .classUseContainer ul li table th.colOne,
+.contentContainer ul li table td.colOne, .classUseContainer ul li table td.colOne {
+    padding-right:3px;
 }
-dl.nameValue dt, dl.nameValue dd{
-    display:inline;
+.overviewSummary caption, .packageSummary caption, .contentContainer ul.blockList li.blockList caption, .summary caption, .classUseContainer caption, .constantValuesContainer caption {
+    position:relative;
+    text-align:left;
+    background-repeat:no-repeat;
+    color:#FFFFFF;
+    font-weight:bold;
+    clear:none;
+    overflow:hidden;
+    padding:0px;
+    margin:0px;
+}
+caption a:link, caption a:hover, caption a:active, caption a:visited {
+    color:#FFFFFF;
 }
-ul.blockList li.blockList pre{
-    margin:0 0 15px 0;
+.overviewSummary caption span, .packageSummary caption span, .contentContainer ul.blockList li.blockList caption span, .summary caption span, .classUseContainer caption span, .constantValuesContainer caption span {
+    white-space:nowrap;
+    padding-top:8px;
+    padding-left:8px;
+    display:block;
+    float:left;
+    background-image:url(resources/titlebar.gif);
+    height:18px;
+}
+.overviewSummary .tabEnd, .packageSummary .tabEnd, .contentContainer ul.blockList li.blockList .tabEnd, .summary .tabEnd, .classUseContainer .tabEnd, .constantValuesContainer .tabEnd {
+    width:10px;
+    background-image:url(resources/titlebar_end.gif);
+    background-repeat:no-repeat;
+    background-position:top right;
+    position:relative;
+    float:left;
 }
-.description dl dt {
-    font-size:0.95em;
-    font-weight:bold;
-    margin:5px 0 0 0;
+ul.blockList ul.blockList li.blockList table {
+    margin:0 0 12px 0px;
+    width:100%;
+}
+.tableSubHeadingColor {
+    background-color: #EEEEFF;
 }
-.description dl dd {
-    margin:10px 0 10px 20px;
+.altColor {
+    background-color:#eeeeef;
+}
+.rowColor {
+    background-color:#ffffff;
+}
+.overviewSummary td, .packageSummary td, .contentContainer ul.blockList li.blockList td, .summary td, .classUseContainer td, .constantValuesContainer td {
+    text-align:left;
+    padding:3px 3px 3px 7px;
 }
-/* List content styles */
-ul.blockList li.blockList ul.blockList li.blockList pre{
-    margin:10px 0 10px 0;
+th.colFirst, th.colLast, th.colOne, .constantValuesContainer th {
+    background:#dee3e9;
+    border-top:1px solid #9eadc0;
+    border-bottom:1px solid #9eadc0;
+    text-align:left;
+    padding:3px 3px 3px 7px;
+}
+td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover {
+    font-weight:bold;
+}
+td.colFirst, th.colFirst {
+    border-left:1px solid #9eadc0;
+    white-space:nowrap;
+}
+td.colLast, th.colLast {
+    border-right:1px solid #9eadc0;
+}
+td.colOne, th.colOne {
+    border-right:1px solid #9eadc0;
+    border-left:1px solid #9eadc0;
 }
-ul.blockList li.blockList ul.blockList li.blockList ul.blockList li.blockList pre,
-ul.blockList li.blockList ul.blockList li.blockList ul.blockListLast li.blockList pre{
-    padding:0 0 10px 0;
+table.overviewSummary  {
+    padding:0px;
+    margin-left:0px;
+}
+table.overviewSummary td.colFirst, table.overviewSummary th.colFirst,
+table.overviewSummary td.colOne, table.overviewSummary th.colOne {
+    width:25%;
+    vertical-align:middle;
+}
+table.packageSummary td.colFirst, table.overviewSummary th.colFirst {
+    width:25%;
+    vertical-align:middle;
 }
-ul.blockList li.blockList ul.blockList li.blockList ul.blockList li.blockList div.block,
-ul.blockList li.blockList ul.blockList li.blockList ul.blockListLast li.blockList div.block{
-    padding:0 0 10px 35px;
+/*
+Content styles
+*/
+.description pre {
+    margin-top:0;
+}
+.deprecatedContent {
+    margin:0;
+    padding:10px 0;
+}
+.docSummary {
+    padding:0;
 }
 /*
 Formatting effect styles
 */
-.strong {
-    font-weight:bold;
-}
 .sourceLineNo {
     color:green;
     padding:0 30px 0 0;
 }
+h1.hidden {
+    visibility:hidden;
+    overflow:hidden;
+    font-size:.9em;
+}
+.block {
+    display:block;
+    margin:3px 0 0 0;
+}
+.strong {
+    font-weight:bold;
+}
Binary file langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/tab.gif has changed
Binary file langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/titlebar.gif has changed
Binary file langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/titlebar_end.gif has changed
--- a/langtools/test/com/sun/javadoc/AccessH1/AccessH1.java	Wed Jun 08 10:24:10 2011 -0700
+++ b/langtools/test/com/sun/javadoc/AccessH1/AccessH1.java	Mon Jun 20 17:38:27 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 4636667
+ * @bug 4636667 7052425
  * @summary  Use <H1, <H2>, and <H3> in proper sequence for accessibility
  * @author dkramer
  * @run main AccessH1
@@ -42,7 +42,7 @@
  */
 public class AccessH1 {
 
-    private static final String BUGID = "4636667";
+    private static final String BUGID = "4636667-7052425";
     private static final String BUGNAME = "AccessH1";
     private static final String FS = System.getProperty("file.separator");
     private static final String PS = System.getProperty("path.separator");
@@ -85,8 +85,7 @@
     private static final String[][] testArray = {
         // Test the style sheet
         {
-            ".header h1.title {" + LS + "    font-size:1.4em;" + LS +
-            "    text-align:center;" + LS + "    margin:0;" + LS +
+            "h1 {" + LS + "    font-size:1.8em;" + LS +
             "}",
             TMPDEST_DIR1 + "stylesheet.css"
         },
--- a/langtools/test/com/sun/javadoc/testStylesheet/TestStylesheet.java	Wed Jun 08 10:24:10 2011 -0700
+++ b/langtools/test/com/sun/javadoc/testStylesheet/TestStylesheet.java	Mon Jun 20 17:38:27 2011 -0700
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug      4494033 7028815
+ * @bug      4494033 7028815 7052425
  * @summary  Run tests on doclet stylesheet.
  * @author   jamieh
  * @library  ../lib/
@@ -34,7 +34,7 @@
 public class TestStylesheet extends JavadocTester {
 
     //Test information.
-    private static final String BUG_ID = "4494033-7028815";
+    private static final String BUG_ID = "4494033-7028815-7052425";
 
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
@@ -52,11 +52,12 @@
         {BUG_ID + FS + "stylesheet.css",
                 "/*" + NL + "Navigation bar styles" + NL + "*/"},
         {BUG_ID + FS + "stylesheet.css",
-                "body {" + NL + "    font-family:Helvetica, Arial, sans-serif;" + NL +
-                "    color:#000000;" + NL + "}"},
+                "body {" + NL + "    background-color:#ffffff;" + NL +
+                "    color:#353833;" + NL +
+                "    font-family:Arial, Helvetica, sans-serif;" + NL +
+                "    font-size:76%;" + NL + "    margin:0;" + NL + "}"},
         {BUG_ID + FS + "stylesheet.css",
-                "ul {" + NL + "    margin:10px 0 10px 20px;" + NL +
-                "    list-style-type:disc;" + NL + "}"},
+                "ul {" + NL + "    list-style-type:disc;" + NL + "}"},
         // Test whether a link to the stylesheet file is inserted properly
         // in the class documentation.
         {BUG_ID + FS + "pkg" + FS + "A.html",
--- a/langtools/test/tools/javac/meth/InvokeMH.java	Wed Jun 08 10:24:10 2011 -0700
+++ b/langtools/test/tools/javac/meth/InvokeMH.java	Mon Jun 20 17:38:27 2011 -0700
@@ -77,23 +77,23 @@
         Object o; String s; int i;  // for return type testing
 
         // next five must have sig = (*,*)*
-        o = mh_SiO.invokeGeneric((Object)"world", (Object)123);
-        mh_SiO.invokeGeneric((Object)"mundus", (Object)456);
+        o = mh_SiO.invoke((Object)"world", (Object)123);
+        mh_SiO.invoke((Object)"mundus", (Object)456);
         Object k = "kosmos";
-        o = mh_SiO.invokeGeneric(k, 789);
-        o = mh_SiO.invokeGeneric(null, 000);
-        o = mh_SiO.invokeGeneric("arda", -123);
+        o = mh_SiO.invoke(k, 789);
+        o = mh_SiO.invoke(null, 000);
+        o = mh_SiO.invoke("arda", -123);
 
         // sig = ()String
-        o = mh_vS.invokeGeneric();
+        o = mh_vS.invoke();
 
         // sig = ()int
-        i = (int) mh_vi.invokeGeneric();
-        o = (int) mh_vi.invokeGeneric();
-        mh_vi.invokeGeneric();
+        i = (int) mh_vi.invoke();
+        o = (int) mh_vi.invoke();
+        mh_vi.invoke();
 
         // sig = ()void
-        mh_vv.invokeGeneric();
-        o = mh_vv.invokeGeneric();
+        mh_vv.invoke();
+        o = mh_vv.invoke();
     }
 }
--- a/langtools/test/tools/javac/meth/XlintWarn.java	Wed Jun 08 10:24:10 2011 -0700
+++ b/langtools/test/tools/javac/meth/XlintWarn.java	Mon Jun 20 17:38:27 2011 -0700
@@ -35,19 +35,19 @@
 class XlintWarn {
     void test(MethodHandle mh) throws Throwable {
         int i1 = (int)mh.invokeExact();
-        int i2 = (int)mh.invokeGeneric();
+        int i2 = (int)mh.invoke();
         int i3 = (int)mh.invokeWithArguments();
     }
 
     void test2(MethodHandle mh) throws Throwable {
         int i1 = (int)(mh.invokeExact());
-        int i2 = (int)(mh.invokeGeneric());
+        int i2 = (int)(mh.invoke());
         int i3 = (int)(mh.invokeWithArguments());
     }
 
     void test3(MethodHandle mh) throws Throwable {
         int i1 = (int)((mh.invokeExact()));
-        int i2 = (int)((mh.invokeGeneric()));
+        int i2 = (int)((mh.invoke()));
         int i3 = (int)((mh.invokeWithArguments()));
     }
 }