changeset 5472:c24b39419c35

Merge
author asaha
date Fri, 26 Oct 2012 10:55:23 -0700
parents cb7176d0e597 84083b5de11e
children 4113d4a2c289
files make/common/Release.gmk test/com/sun/jndi/ldap/LdapsReadTimeoutTest.java test/com/sun/jndi/ldap/ReadTimeoutTest.java
diffstat 105 files changed, 2829 insertions(+), 962 deletions(-) [+]
line wrap: on
line diff
--- a/make/common/Release.gmk	Thu Oct 18 23:19:48 2012 -0700
+++ b/make/common/Release.gmk	Fri Oct 26 10:55:23 2012 -0700
@@ -158,7 +158,6 @@
         jstack.1           \
         jstat.1            \
         jstatd.1           \
-        jvisualvm.1        \
 	native2ascii.1     \
 	rmic.1             \
         schemagen.1        \
@@ -167,6 +166,10 @@
         wsimport.1         \
         xjc.1
 
+ifndef OPENJDK
+  JDK_MAN_PAGES += jvisualvm.1
+endif
+
 ifeq ($(PLATFORM), solaris)
   MANBASEDIRS=$(JDK_TOPDIR)/src/solaris/doc $(IMPORTDOCDIR)
   MAN1SUBDIR=sun/man/man1
--- a/make/docs/Makefile	Thu Oct 18 23:19:48 2012 -0700
+++ b/make/docs/Makefile	Fri Oct 26 10:55:23 2012 -0700
@@ -47,11 +47,11 @@
 
 # Url to devdocs page
 #   Was: http://java.sun.com/javase/6/webnotes/devdocs-vs-specs.html
-DEV_DOCS_URL-5 = http://java.sun.com/j2se/1.5.0/docs/index.html
-DEV_DOCS_URL-6 = http://download.oracle.com/javase/6/docs/index.html
-DEV_DOCS_URL-7 = http://download.oracle.com/javase/7/docs/index.html
+DEV_DOCS_URL-5 = http://docs.oracle.com/javase/1.5.0/docs/index.html
+DEV_DOCS_URL-6 = http://docs.oracle.com/javase/6/docs/index.html
+DEV_DOCS_URL-7 = http://docs.oracle.com/javase/7/docs/index.html
 DEV_DOCS_URL = $(DEV_DOCS_URL-$(JDK_MINOR_VERSION))
-DOCS_BASE_URL = http://download.oracle.com/javase/7/docs
+DOCS_BASE_URL = http://docs.oracle.com/javase/7/docs
 
 # Url to Java Language Spec
 #JLS3_URL = http://java.sun.com/docs/books/jls/
--- a/make/java/nio/Makefile	Thu Oct 18 23:19:48 2012 -0700
+++ b/make/java/nio/Makefile	Fri Oct 26 10:55:23 2012 -0700
@@ -54,6 +54,9 @@
 	sun/nio/ch/DevPollArrayWrapper.java \
 	sun/nio/ch/DevPollSelectorImpl.java \
         sun/nio/ch/DevPollSelectorProvider.java \
+	sun/nio/ch/EventPortSelectorImpl.java \
+	sun/nio/ch/EventPortSelectorProvider.java \
+	sun/nio/ch/EventPortWrapper.java \
 	sun/nio/ch/InheritedChannel.java \
         sun/nio/ch/PollSelectorProvider.java \
         sun/nio/ch/PollSelectorImpl.java \
@@ -278,6 +281,9 @@
 	sun/nio/fs/BsdFileSystem.java \
 	sun/nio/fs/BsdFileSystemProvider.java \
 	sun/nio/fs/BsdNativeDispatcher.java \
+	sun/nio/fs/MacOSXFileSystemProvider.java \
+	sun/nio/fs/MacOSXFileSystem.java \
+	sun/nio/fs/MacOSXNativeDispatcher.java \
 	sun/nio/fs/PollingWatchService.java \
 	sun/nio/fs/UnixChannelFactory.java \
 	sun/nio/fs/UnixCopyFile.java \
@@ -306,6 +312,7 @@
 	UnixAsynchronousSocketChannelImpl.c \
 	\
 	BsdNativeDispatcher.c \
+	MacOSXNativeDispatcher.c \
 	UnixCopyFile.c \
 	UnixNativeDispatcher.c \
 	\
@@ -379,7 +386,7 @@
 OTHER_LDLIBS += -L$(LIBDIR)/$(LIBARCH) -ljava -lnet -lpthread $(LIBDL)
 endif
 ifeq ($(PLATFORM), macosx)
-OTHER_LDLIBS += -L$(LIBDIR) -ljava -lnet -pthread
+OTHER_LDLIBS += -L$(LIBDIR) -ljava -lnet -pthread -framework CoreFoundation
 endif
 ifeq ($(PLATFORM), solaris)
 OTHER_LDLIBS += $(JVMLIB) $(LIBSOCKET) -lposix4 $(LIBDL) -lsendfile \
--- a/make/java/nio/mapfile-linux	Thu Oct 18 23:19:48 2012 -0700
+++ b/make/java/nio/mapfile-linux	Fri Oct 26 10:55:23 2012 -0700
@@ -39,7 +39,6 @@
                 Java_sun_nio_ch_EPollArrayWrapper_epollCreate;
                 Java_sun_nio_ch_EPollArrayWrapper_epollCtl;
                 Java_sun_nio_ch_EPollArrayWrapper_epollWait;
-		Java_sun_nio_ch_EPollArrayWrapper_fdLimit;
 		Java_sun_nio_ch_EPollArrayWrapper_init;
 		Java_sun_nio_ch_EPollArrayWrapper_interrupt;
 		Java_sun_nio_ch_EPollArrayWrapper_offsetofData;
@@ -87,6 +86,7 @@
                 Java_sun_nio_ch_IOUtil_configureBlocking;
                 Java_sun_nio_ch_IOUtil_drain;
                 Java_sun_nio_ch_IOUtil_fdVal;
+		Java_sun_nio_ch_IOUtil_fdLimit;
                 Java_sun_nio_ch_IOUtil_initIDs;
 		Java_sun_nio_ch_IOUtil_iovMax;
                 Java_sun_nio_ch_IOUtil_makePipe;
--- a/make/java/nio/mapfile-solaris	Thu Oct 18 23:19:48 2012 -0700
+++ b/make/java/nio/mapfile-solaris	Fri Oct 26 10:55:23 2012 -0700
@@ -36,7 +36,6 @@
                 Java_sun_nio_ch_DatagramDispatcher_readv0;
                 Java_sun_nio_ch_DatagramDispatcher_write0;
                 Java_sun_nio_ch_DatagramDispatcher_writev0;
-                Java_sun_nio_ch_DevPollArrayWrapper_fdLimit;
                 Java_sun_nio_ch_DevPollArrayWrapper_init;
                 Java_sun_nio_ch_DevPollArrayWrapper_interrupt;
                 Java_sun_nio_ch_DevPollArrayWrapper_poll0;
@@ -74,6 +73,7 @@
 		Java_sun_nio_ch_InheritedChannel_soType0;
                 Java_sun_nio_ch_IOUtil_configureBlocking;
                 Java_sun_nio_ch_IOUtil_drain;
+		Java_sun_nio_ch_IOUtil_fdLimit;
                 Java_sun_nio_ch_IOUtil_fdVal;
                 Java_sun_nio_ch_IOUtil_initIDs;
 		Java_sun_nio_ch_IOUtil_iovMax;
@@ -113,13 +113,13 @@
 		Java_sun_nio_ch_UnixAsynchronousServerSocketChannelImpl_accept0;
 		Java_sun_nio_ch_UnixAsynchronousServerSocketChannelImpl_initIDs;
 		Java_sun_nio_ch_UnixAsynchronousSocketChannelImpl_checkConnect;
-		Java_sun_nio_ch_SolarisEventPort_init;
-		Java_sun_nio_ch_SolarisEventPort_portCreate;
-		Java_sun_nio_ch_SolarisEventPort_portClose;
-		Java_sun_nio_ch_SolarisEventPort_portAssociate;
-		Java_sun_nio_ch_SolarisEventPort_portGet;
-		Java_sun_nio_ch_SolarisEventPort_portGetn;
-		Java_sun_nio_ch_SolarisEventPort_portSend;
+		Java_sun_nio_ch_SolarisEventPort_port_1create;
+		Java_sun_nio_ch_SolarisEventPort_port_1close;
+		Java_sun_nio_ch_SolarisEventPort_port_1associate;
+		Java_sun_nio_ch_SolarisEventPort_port_1dissociate;
+		Java_sun_nio_ch_SolarisEventPort_port_1get;
+		Java_sun_nio_ch_SolarisEventPort_port_1getn;
+		Java_sun_nio_ch_SolarisEventPort_port_1send;
 		Java_sun_nio_fs_GnomeFileTypeDetector_initializeGio;
 		Java_sun_nio_fs_GnomeFileTypeDetector_probeUsingGio;
 		Java_sun_nio_fs_GnomeFileTypeDetector_initializeGnomeVfs;
--- a/src/macosx/classes/java/util/prefs/MacOSXPreferences.java	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/macosx/classes/java/util/prefs/MacOSXPreferences.java	Fri Oct 26 10:55:23 2012 -0700
@@ -98,7 +98,7 @@
         else
             this.isUser = isUserNode();
         path = isRoot ? absolutePath() : absolutePath() + "/";
-        file = cfFileForNode(isUser);
+        file = cfFileForNode(this.isUser);
         if (isNew)
             newNode = isNew;
         else
--- a/src/macosx/classes/sun/lwawt/macosx/CPlatformResponder.java	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/macosx/classes/sun/lwawt/macosx/CPlatformResponder.java	Fri Oct 26 10:55:23 2012 -0700
@@ -134,7 +134,7 @@
         boolean postsTyped = false;
 
         char testChar = KeyEvent.CHAR_UNDEFINED;
-        char testDeadChar = 0;
+        boolean isDeadChar = (chars!= null && chars.length() == 0);
 
         if (isFlagsChangedEvent) {
             int[] in = new int[] {modifierFlags, keyCode};
@@ -150,14 +150,21 @@
                 testChar = chars.charAt(0);
             }
 
-            int[] in = new int[] {testChar, testDeadChar, modifierFlags, keyCode};
-            int[] out = new int[2]; // [jkeyCode, jkeyLocation]
+            int[] in = new int[] {testChar, isDeadChar ? 1 : 0, modifierFlags, keyCode};
+            int[] out = new int[3]; // [jkeyCode, jkeyLocation, deadChar]
 
             postsTyped = NSEvent.nsToJavaKeyInfo(in, out);
             if (!postsTyped) {
                 testChar = KeyEvent.CHAR_UNDEFINED;
             }
 
+            if(isDeadChar){
+                testChar = (char) out[2];
+                if(testChar == 0){
+                    return;
+                }
+            }
+
             jkeyCode = out[0];
             jkeyLocation = out[1];
             jeventType = isNpapiCallback ? NSEvent.npToJavaEventType(eventType) :
--- a/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Fri Oct 26 10:55:23 2012 -0700
@@ -64,7 +64,7 @@
     private static native void nativeSynthesizeMouseEnteredExitedEvents(long nsWindowPtr);
     private static native void nativeDispose(long nsWindowPtr);
 
-    private static native int nativeGetNSWindowDisplayID_AppKitThread(long nsWindowPtr);
+    private static native int nativeGetNSWindowDisplayID(long nsWindowPtr);
 
     // Loger to report issues happened during execution but that do not affect functionality
     private static final PlatformLogger logger = PlatformLogger.getLogger("sun.lwawt.macosx.CPlatformWindow");
@@ -443,7 +443,7 @@
     public GraphicsDevice getGraphicsDevice() {
         GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
         CGraphicsEnvironment cge = (CGraphicsEnvironment)ge;
-        int displayID = nativeGetNSWindowDisplayID_AppKitThread(getNSWindowPtr());
+        int displayID = nativeGetNSWindowDisplayID(getNSWindowPtr());
         GraphicsDevice gd = cge.getScreenDevice(displayID);
         if (gd == null) {
             // this could possibly happen during device removal
--- a/src/macosx/native/sun/awt/AWTEvent.m	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/macosx/native/sun/awt/AWTEvent.m	Fri Oct 26 10:55:23 2012 -0700
@@ -26,6 +26,7 @@
 #import <JavaNativeFoundation/JavaNativeFoundation.h>
 #import <JavaRuntimeSupport/JavaRuntimeSupport.h>
 #import <sys/time.h>
+#include <Carbon/Carbon.h>
 
 #import "LWCToolkit.h"
 #import "ThreadUtilities.h"
@@ -378,26 +379,68 @@
     return nsChar;
 }
 
+static unichar NsGetDeadKeyChar(unsigned short keyCode)
+{
+    TISInputSourceRef currentKeyboard = TISCopyCurrentKeyboardInputSource();
+    CFDataRef uchr = (CFDataRef)TISGetInputSourceProperty(currentKeyboard, kTISPropertyUnicodeKeyLayoutData);
+    if (uchr == nil) { return; }
+    const UCKeyboardLayout *keyboardLayout = (const UCKeyboardLayout*)CFDataGetBytePtr(uchr);
+    // Carbon modifiers should be used instead of NSEvent modifiers
+    UInt32 modifierKeyState = (GetCurrentEventKeyModifiers() >> 8) & 0xFF;
+
+    if (keyboardLayout) {
+        UInt32 deadKeyState = 0;
+        UniCharCount maxStringLength = 255;
+        UniCharCount actualStringLength = 0;
+        UniChar unicodeString[maxStringLength];
+
+        // get the deadKeyState
+        OSStatus status = UCKeyTranslate(keyboardLayout,
+                                         keyCode, kUCKeyActionDown, modifierKeyState,
+                                         LMGetKbdType(), kUCKeyTranslateNoDeadKeysBit,
+                                         &deadKeyState,
+                                         maxStringLength,
+                                         &actualStringLength, unicodeString);
+
+        if (status == noErr && deadKeyState != 0) {
+            // Press SPACE to get the dead key char
+            status = UCKeyTranslate(keyboardLayout,
+                                    kVK_Space, kUCKeyActionDown, 0,
+                                    LMGetKbdType(), 0,
+                                    &deadKeyState,
+                                    maxStringLength,
+                                    &actualStringLength, unicodeString);
+
+            if (status == noErr && actualStringLength > 0) {
+                return unicodeString[0];
+            }
+        }
+    }
+    return 0;
+}
+
 /*
  * This is the function that uses the table above to take incoming
  * NSEvent keyCodes and translate to the Java virtual key code.
  */
 static void
-NsCharToJavaVirtualKeyCode(unichar ch, unichar deadChar,
+NsCharToJavaVirtualKeyCode(unichar ch, BOOL isDeadChar,
                            NSUInteger flags, unsigned short key,
-                           jint *keyCode, jint *keyLocation, BOOL *postsTyped)
+                           jint *keyCode, jint *keyLocation, BOOL *postsTyped, unichar *deadChar)
 {
     static size_t size = sizeof(keyTable) / sizeof(struct _key);
     NSInteger offset;
 
-    if (deadChar) {
+    if (isDeadChar) {
+        unichar testDeadChar = NsGetDeadKeyChar(key);
         const struct CharToVKEntry *map;
         for (map = charToDeadVKTable; map->c != 0; ++map) {
-            if (deadChar == map->c) {
+            if (testDeadChar == map->c) {
                 *keyCode = map->javaKey;
                 *postsTyped = NO;
                 // TODO: use UNKNOWN here?
                 *keyLocation = java_awt_event_KeyEvent_KEY_LOCATION_UNKNOWN;
+                *deadChar = testDeadChar;
                 return;
             }
         }
@@ -521,18 +564,18 @@
     const struct _nsKeyToJavaModifier* cur;
 
     for (cur = nsKeyToJavaModifierTable; cur->nsMask != 0; ++cur) {
-        jint mask = isExtMods? cur->javaExtMask : cur->javaMask; 
+        jint mask = isExtMods? cur->javaExtMask : cur->javaMask;
         if ((mask & javaModifiers) != 0) {
             nsFlags |= cur->nsMask;
         }
     }
 
     // special case
-    jint mask = isExtMods? java_awt_event_InputEvent_ALT_GRAPH_DOWN_MASK : 
+    jint mask = isExtMods? java_awt_event_InputEvent_ALT_GRAPH_DOWN_MASK :
                            java_awt_event_InputEvent_ALT_GRAPH_MASK;
 
     if ((mask & javaModifiers) != 0) {
-        nsFlags |= NSAlternateKeyMask;      
+        nsFlags |= NSAlternateKeyMask;
     }
 
     return nsFlags;
@@ -691,14 +734,10 @@
         }
 
         javaModifiers = NsKeyModifiersToJavaModifiers([event modifierFlags], TRUE);
-        if (javaModifiers == 0) {
-      // TODO: dead key chars
-//            testDeadChar = GetDeadKeyCharacter(event);
-        }
 
-        NsCharToJavaVirtualKeyCode(testChar, testDeadChar,
+        NsCharToJavaVirtualKeyCode(testChar, NO,
                                    [event modifierFlags], [event keyCode],
-                                   &javaKeyCode, &javaKeyLocation, &postsTyped);
+                                   &javaKeyCode, &javaKeyLocation, &postsTyped, &testDeadChar);
         if( !postsTyped ) {
             testChar = java_awt_event_KeyEvent_CHAR_UNDEFINED;
         }
@@ -823,18 +862,14 @@
     unichar testChar, testDeadChar = 0;
     jint javaModifiers = NsKeyModifiersToJavaModifiers([nsEvent modifierFlags], TRUE);
 
-    if (javaModifiers == 0) {
-        testDeadChar = [nsEvent deadKeyCharacter];
-    }
-
     NSString *theChars = [nsEvent characters];
     unsigned i, stringLength = [theChars length];
 
     for (i = 0; i < stringLength; i++) {
         testChar = [theChars characterAtIndex:i];
-        NsCharToJavaVirtualKeyCode(testChar, testDeadChar,
+        NsCharToJavaVirtualKeyCode(testChar, NO,
                                    [nsEvent modifierFlags], [nsEvent keyCode],
-                                   &javaKeyCode, &javaKeyLocation, &postsTyped);
+                                   &javaKeyCode, &javaKeyLocation, &postsTyped, &testDeadChar);
 
         if (postsTyped) {
             // Some keys may generate a KEY_TYPED, but we can't determine
@@ -1042,23 +1077,25 @@
 
     // in  = [testChar, testDeadChar, modifierFlags, keyCode]
     jchar testChar = (jchar)data[0];
-    jchar testDeadChar = (jchar)data[1];
+    BOOL isDeadChar = (data[1] != 0);
     jint modifierFlags = data[2];
     jshort keyCode = (jshort)data[3];
 
     jint jkeyCode = java_awt_event_KeyEvent_VK_UNDEFINED;
     jint jkeyLocation = java_awt_event_KeyEvent_KEY_LOCATION_UNKNOWN;
+    jchar testDeadChar = 0;
 
-    NsCharToJavaVirtualKeyCode((unichar)testChar, (unichar)testDeadChar,
+    NsCharToJavaVirtualKeyCode((unichar)testChar, isDeadChar,
                                (NSUInteger)modifierFlags, (unsigned short)keyCode,
-                               &jkeyCode, &jkeyLocation, &postsTyped);
+                               &jkeyCode, &jkeyLocation, &postsTyped, &testDeadChar);
 
-    // out = [jkeyCode, jkeyLocation];
+    // out = [jkeyCode, jkeyLocation, deadKeyChar];
     (*env)->SetIntArrayRegion(env, outData, 0, 1, &jkeyCode);
     (*env)->SetIntArrayRegion(env, outData, 1, 1, &jkeyLocation);
-    
+    (*env)->SetIntArrayRegion(env, outData, 2, 1, (jint *)&testDeadChar);
+
     (*env)->ReleaseIntArrayElements(env, inData, data, 0);
-    
+
 JNF_COCOA_EXIT(env);
 
     return postsTyped;
@@ -1098,7 +1135,7 @@
     (*env)->SetIntArrayRegion(env, outData, 2, 1, &jkeyType);
 
     (*env)->ReleaseIntArrayElements(env, inData, data, 0);
-    
+
 JNF_COCOA_EXIT(env);
 }
 
@@ -1112,12 +1149,12 @@
 (JNIEnv *env, jclass cls, char nsChar, jint modifierFlags)
 {
     jchar javaChar = 0;
-    
+
 JNF_COCOA_ENTER(env);
-    
+
     javaChar = NsCharToJavaChar(nsChar, modifierFlags);
 
 JNF_COCOA_EXIT(env);
-    
+
     return javaChar;
 }
--- a/src/macosx/native/sun/awt/AWTView.m	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/macosx/native/sun/awt/AWTView.m	Fri Oct 26 10:55:23 2012 -0700
@@ -278,7 +278,10 @@
         return;
     }
 
-    if (![self hasMarkedText] && fKeyEventsNeeded) {
+    NSString *eventCharacters = [event characters];
+    BOOL isDeadKey = (eventCharacters != nil && [eventCharacters length] == 0);
+
+    if ((![self hasMarkedText] && fKeyEventsNeeded) || isDeadKey) {
         [self deliverJavaKeyEventHelper: event];
     }
 
--- a/src/macosx/native/sun/awt/AWTWindow.m	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/macosx/native/sun/awt/AWTWindow.m	Fri Oct 26 10:55:23 2012 -0700
@@ -358,6 +358,13 @@
     [[self.nsWindow contentView] deliverJavaMouseEvent: mouseEvent];
 }
 
++ (NSNumber *) getNSWindowDisplayID_AppKitThread:(NSWindow *)window {
+    AWT_ASSERT_APPKIT_THREAD;
+    NSScreen *screen = [window screen];
+    NSDictionary *deviceDescription = [screen deviceDescription];
+    return [deviceDescription objectForKey:@"NSScreenNumber"];
+}
+
 - (void) dealloc {
 AWT_ASSERT_APPKIT_THREAD;
 
@@ -1142,19 +1149,22 @@
  * Signature: (J)I
  */
 JNIEXPORT jint JNICALL
-Java_sun_lwawt_macosx_CPlatformWindow_nativeGetNSWindowDisplayID_1AppKitThread
+Java_sun_lwawt_macosx_CPlatformWindow_nativeGetNSWindowDisplayID
 (JNIEnv *env, jclass clazz, jlong windowPtr)
 {
-    jint ret; // CGDirectDisplayID
+    __block jint ret; // CGDirectDisplayID
 
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_APPKIT_THREAD;
 
     NSWindow *window = OBJC(windowPtr);
-    NSScreen *screen = [window screen];
-    NSDictionary *deviceDescription = [screen deviceDescription];
-    NSNumber *displayID = [deviceDescription objectForKey:@"NSScreenNumber"];
-    ret = (jint)[displayID intValue];
+
+    if ([NSThread isMainThread]) {
+        ret = (jint)[[AWTWindow getNSWindowDisplayID_AppKitThread: window] intValue];
+    } else {
+        [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+            ret = (jint)[[AWTWindow getNSWindowDisplayID_AppKitThread: window] intValue];
+        }];
+    }
 
 JNF_COCOA_EXIT(env);
 
--- a/src/share/classes/com/sun/java/swing/plaf/motif/MotifFileChooserUI.java	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/MotifFileChooserUI.java	Fri Oct 26 10:55:23 2012 -0700
@@ -529,21 +529,25 @@
         Locale l = fc.getLocale();
 
         enterFolderNameLabelText = UIManager.getString("FileChooser.enterFolderNameLabelText",l);
-        enterFolderNameLabelMnemonic = UIManager.getInt("FileChooser.enterFolderNameLabelMnemonic");
+        enterFolderNameLabelMnemonic = getMnemonic("FileChooser.enterFolderNameLabelMnemonic", l);
         enterFileNameLabelText = UIManager.getString("FileChooser.enterFileNameLabelText",l);
-        enterFileNameLabelMnemonic = UIManager.getInt("FileChooser.enterFileNameLabelMnemonic");
+        enterFileNameLabelMnemonic = getMnemonic("FileChooser.enterFileNameLabelMnemonic", l);
 
         filesLabelText = UIManager.getString("FileChooser.filesLabelText",l);
-        filesLabelMnemonic = UIManager.getInt("FileChooser.filesLabelMnemonic");
+        filesLabelMnemonic = getMnemonic("FileChooser.filesLabelMnemonic", l);
 
         foldersLabelText = UIManager.getString("FileChooser.foldersLabelText",l);
-        foldersLabelMnemonic = UIManager.getInt("FileChooser.foldersLabelMnemonic");
+        foldersLabelMnemonic = getMnemonic("FileChooser.foldersLabelMnemonic", l);
 
         pathLabelText = UIManager.getString("FileChooser.pathLabelText",l);
-        pathLabelMnemonic = UIManager.getInt("FileChooser.pathLabelMnemonic");
+        pathLabelMnemonic = getMnemonic("FileChooser.pathLabelMnemonic", l);
 
         filterLabelText = UIManager.getString("FileChooser.filterLabelText",l);
-        filterLabelMnemonic = UIManager.getInt("FileChooser.filterLabelMnemonic");
+        filterLabelMnemonic = getMnemonic("FileChooser.filterLabelMnemonic", l);
+    }
+
+    private Integer getMnemonic(String key, Locale l) {
+        return SwingUtilities2.getUIDefaultsInt(key, l);
     }
 
     protected void installIcons(JFileChooser fc) {
--- a/src/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java	Fri Oct 26 10:55:23 2012 -0700
@@ -1215,11 +1215,6 @@
             "EditorPane.focusInputMap", multilineInputMap,
 
 
-            "FileChooser.pathLabelMnemonic", new Integer(KeyEvent.VK_P), // 'p'
-            "FileChooser.filterLabelMnemonic", new Integer (KeyEvent.VK_R), // 'r'
-            "FileChooser.foldersLabelMnemonic", new Integer (KeyEvent.VK_L), // 'l'
-            "FileChooser.filesLabelMnemonic", new Integer (KeyEvent.VK_I), // 'i'
-            "FileChooser.enterFileNameLabelMnemonic", new Integer (KeyEvent.VK_N), // 'n'
             "FileChooser.ancestorInputMap",
                new UIDefaults.LazyInputMap(new Object[] {
                      "ESCAPE", "cancelSelection"
--- a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif.properties	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif.properties	Fri Oct 26 10:55:23 2012 -0700
@@ -26,11 +26,11 @@
 FileChooser.openDialogTitle.textAndMnemonic=Open
 FileChooser.updateButton.textAndMnemonic=Update
 FileChooser.helpButton.textAndMnemonic=Help
-FileChooser.pathLabel.textAndMnemonic=Enter path or folder name:
-FileChooser.filterLabel.textAndMnemonic=Filter
-FileChooser.foldersLabel.textAndMnemonic=Folders
-FileChooser.filesLabel.textAndMnemonic=Files
-FileChooser.enterFileNameLabel.textAndMnemonic=Enter file name:
+FileChooser.pathLabel.textAndMnemonic=Enter &path or folder name:
+FileChooser.filterLabel.textAndMnemonic=Filte&r
+FileChooser.foldersLabel.textAndMnemonic=Fo&lders
+FileChooser.filesLabel.textAndMnemonic=F&iles
+FileChooser.enterFileNameLabel.textAndMnemonic=E&nter file name:
 FileChooser.enterFolderNameLabel.textAndMnemonic=Enter folder name:
 
 FileChooser.cancelButtonToolTip.textAndMnemonic=Abort file chooser dialog.
--- a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_de.properties	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_de.properties	Fri Oct 26 10:55:23 2012 -0700
@@ -26,11 +26,11 @@
 FileChooser.openDialogTitle.textAndMnemonic=\u00D6ffnen
 FileChooser.updateButton.textAndMnemonic=Aktualisieren
 FileChooser.helpButton.textAndMnemonic=Hilfe
-FileChooser.pathLabel.textAndMnemonic=Pfad- oder Ordnernamen eingeben:
-FileChooser.filterLabel.textAndMnemonic=Filter
-FileChooser.foldersLabel.textAndMnemonic=Ordner
-FileChooser.filesLabel.textAndMnemonic=Dateien
-FileChooser.enterFileNameLabel.textAndMnemonic=Dateinamen eingeben:
+FileChooser.pathLabel.textAndMnemonic=&Pfad- oder Ordnernamen eingeben:
+FileChooser.filterLabel.textAndMnemonic=Filte&r
+FileChooser.foldersLabel.textAndMnemonic=Ordner(&L)
+FileChooser.filesLabel.textAndMnemonic=Date&ien
+FileChooser.enterFileNameLabel.textAndMnemonic=Datei&namen eingeben:
 FileChooser.enterFolderNameLabel.textAndMnemonic=Ordnernamen eingeben:
 
 FileChooser.cancelButtonToolTip.textAndMnemonic=Dialogfeld f\u00FCr Dateiauswahl schlie\u00DFen.
--- a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_es.properties	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_es.properties	Fri Oct 26 10:55:23 2012 -0700
@@ -26,11 +26,11 @@
 FileChooser.openDialogTitle.textAndMnemonic=Abrir
 FileChooser.updateButton.textAndMnemonic=Actualizar
 FileChooser.helpButton.textAndMnemonic=Ayuda
-FileChooser.pathLabel.textAndMnemonic=Introducir nombre de la ruta de acceso o carpeta:
-FileChooser.filterLabel.textAndMnemonic=Filtro
-FileChooser.foldersLabel.textAndMnemonic=Carpetas
-FileChooser.filesLabel.textAndMnemonic=Archivos
-FileChooser.enterFileNameLabel.textAndMnemonic=Introducir nombre de archivo:
+FileChooser.pathLabel.textAndMnemonic=Introducir nombre de la ruta de acceso o car&peta:
+FileChooser.filterLabel.textAndMnemonic=Filt&ro
+FileChooser.foldersLabel.textAndMnemonic=Carpetas(&L)
+FileChooser.filesLabel.textAndMnemonic=Arch&ivos
+FileChooser.enterFileNameLabel.textAndMnemonic=I&ntroducir nombre de archivo:
 FileChooser.enterFolderNameLabel.textAndMnemonic=Introducir nombre de carpeta:
 
 FileChooser.cancelButtonToolTip.textAndMnemonic=Abortar cuadro de di\u00E1logo del selector de archivos.
--- a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_fr.properties	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_fr.properties	Fri Oct 26 10:55:23 2012 -0700
@@ -26,11 +26,11 @@
 FileChooser.openDialogTitle.textAndMnemonic=Ouvrir
 FileChooser.updateButton.textAndMnemonic=Mettre \u00E0 jour
 FileChooser.helpButton.textAndMnemonic=Aide
-FileChooser.pathLabel.textAndMnemonic=Entrez le chemin ou le nom du dossier :
-FileChooser.filterLabel.textAndMnemonic=Filtre
-FileChooser.foldersLabel.textAndMnemonic=Dossiers
-FileChooser.filesLabel.textAndMnemonic=Fichiers
-FileChooser.enterFileNameLabel.textAndMnemonic=Entrez le nom du fichier :
+FileChooser.pathLabel.textAndMnemonic=Entrez le chemin ou le nom du dossier (&P):
+FileChooser.filterLabel.textAndMnemonic=Filt&re
+FileChooser.foldersLabel.textAndMnemonic=Dossiers(&L)
+FileChooser.filesLabel.textAndMnemonic=Fich&iers
+FileChooser.enterFileNameLabel.textAndMnemonic=E&ntrez le nom du fichier :
 FileChooser.enterFolderNameLabel.textAndMnemonic=Entrez le nom du dossier :
 
 FileChooser.cancelButtonToolTip.textAndMnemonic=Ferme la bo\u00EEte de dialogue du s\u00E9lecteur de fichiers.
--- a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_it.properties	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_it.properties	Fri Oct 26 10:55:23 2012 -0700
@@ -26,11 +26,11 @@
 FileChooser.openDialogTitle.textAndMnemonic=Apri
 FileChooser.updateButton.textAndMnemonic=Aggiorna
 FileChooser.helpButton.textAndMnemonic=?
-FileChooser.pathLabel.textAndMnemonic=Percorso o nome cartella:
-FileChooser.filterLabel.textAndMnemonic=Filtro
-FileChooser.foldersLabel.textAndMnemonic=Cartelle
-FileChooser.filesLabel.textAndMnemonic=File
-FileChooser.enterFileNameLabel.textAndMnemonic=Nome file:
+FileChooser.pathLabel.textAndMnemonic=&Percorso o nome cartella:
+FileChooser.filterLabel.textAndMnemonic=Filt&ro
+FileChooser.foldersLabel.textAndMnemonic=Carte&lle
+FileChooser.filesLabel.textAndMnemonic=F&ile
+FileChooser.enterFileNameLabel.textAndMnemonic=&Nome file:
 FileChooser.enterFolderNameLabel.textAndMnemonic=Nome cartella:
 
 FileChooser.cancelButtonToolTip.textAndMnemonic=Chiude la finestra di dialogo di selezione file.
--- a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_ja.properties	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_ja.properties	Fri Oct 26 10:55:23 2012 -0700
@@ -26,11 +26,11 @@
 FileChooser.openDialogTitle.textAndMnemonic=\u958B\u304F
 FileChooser.updateButton.textAndMnemonic=\u66F4\u65B0
 FileChooser.helpButton.textAndMnemonic=\u30D8\u30EB\u30D7
-FileChooser.pathLabel.textAndMnemonic=\u30D1\u30B9\u307E\u305F\u306F\u30D5\u30A9\u30EB\u30C0\u540D\u3092\u5165\u529B:
-FileChooser.filterLabel.textAndMnemonic=\u30D5\u30A3\u30EB\u30BF
-FileChooser.foldersLabel.textAndMnemonic=\u30D5\u30A9\u30EB\u30C0
-FileChooser.filesLabel.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB
-FileChooser.enterFileNameLabel.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u540D\u3092\u5165\u529B:
+FileChooser.pathLabel.textAndMnemonic=\u30D1\u30B9\u307E\u305F\u306F\u30D5\u30A9\u30EB\u30C0\u540D\u3092\u5165\u529B(&P):
+FileChooser.filterLabel.textAndMnemonic=\u30D5\u30A3\u30EB\u30BF(&R)
+FileChooser.foldersLabel.textAndMnemonic=\u30D5\u30A9\u30EB\u30C0(&L)
+FileChooser.filesLabel.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB(&I)
+FileChooser.enterFileNameLabel.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u540D\u3092\u5165\u529B(&N):
 FileChooser.enterFolderNameLabel.textAndMnemonic=\u30D5\u30A9\u30EB\u30C0\u540D\u3092\u5165\u529B:
 
 FileChooser.cancelButtonToolTip.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u30FB\u30C1\u30E5\u30FC\u30B6\u30FB\u30C0\u30A4\u30A2\u30ED\u30B0\u3092\u7D42\u4E86\u3057\u307E\u3059\u3002
--- a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_ko.properties	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_ko.properties	Fri Oct 26 10:55:23 2012 -0700
@@ -26,11 +26,11 @@
 FileChooser.openDialogTitle.textAndMnemonic=\uC5F4\uAE30
 FileChooser.updateButton.textAndMnemonic=\uAC31\uC2E0
 FileChooser.helpButton.textAndMnemonic=\uB3C4\uC6C0\uB9D0
-FileChooser.pathLabel.textAndMnemonic=\uACBD\uB85C \uB610\uB294 \uD3F4\uB354 \uC774\uB984 \uC785\uB825:
-FileChooser.filterLabel.textAndMnemonic=\uD544\uD130
-FileChooser.foldersLabel.textAndMnemonic=\uD3F4\uB354
-FileChooser.filesLabel.textAndMnemonic=\uD30C\uC77C
-FileChooser.enterFileNameLabel.textAndMnemonic=\uD30C\uC77C \uC774\uB984 \uC785\uB825:
+FileChooser.pathLabel.textAndMnemonic=\uACBD\uB85C \uB610\uB294 \uD3F4\uB354 \uC774\uB984 \uC785\uB825(&P):
+FileChooser.filterLabel.textAndMnemonic=\uD544\uD130(&R)
+FileChooser.foldersLabel.textAndMnemonic=\uD3F4\uB354(&L)
+FileChooser.filesLabel.textAndMnemonic=\uD30C\uC77C(&I)
+FileChooser.enterFileNameLabel.textAndMnemonic=\uD30C\uC77C \uC774\uB984 \uC785\uB825(&N):
 FileChooser.enterFolderNameLabel.textAndMnemonic=\uD3F4\uB354 \uC774\uB984 \uC785\uB825:
 
 FileChooser.cancelButtonToolTip.textAndMnemonic=\uD30C\uC77C \uC120\uD0DD\uAE30 \uB300\uD654\uC0C1\uC790\uB97C \uC911\uB2E8\uD569\uB2C8\uB2E4.
--- a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_pt_BR.properties	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_pt_BR.properties	Fri Oct 26 10:55:23 2012 -0700
@@ -26,11 +26,11 @@
 FileChooser.openDialogTitle.textAndMnemonic=Abrir
 FileChooser.updateButton.textAndMnemonic=Atualizar
 FileChooser.helpButton.textAndMnemonic=Ajuda
-FileChooser.pathLabel.textAndMnemonic=Informar caminho ou nome da pasta:
-FileChooser.filterLabel.textAndMnemonic=Filtro
-FileChooser.foldersLabel.textAndMnemonic=Pastas
-FileChooser.filesLabel.textAndMnemonic=Arquivos
-FileChooser.enterFileNameLabel.textAndMnemonic=Informar nome do arquivo:
+FileChooser.pathLabel.textAndMnemonic=Informar caminho ou nome da &pasta:
+FileChooser.filterLabel.textAndMnemonic=Filt&ro
+FileChooser.foldersLabel.textAndMnemonic=Pastas(&L)
+FileChooser.filesLabel.textAndMnemonic=Arqu&ivos
+FileChooser.enterFileNameLabel.textAndMnemonic=I&nformar nome do arquivo:
 FileChooser.enterFolderNameLabel.textAndMnemonic=Informar nome da pasta:
 
 FileChooser.cancelButtonToolTip.textAndMnemonic=Abortar caixa de di\u00E1logo do seletor de arquivos.
--- a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_sv.properties	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_sv.properties	Fri Oct 26 10:55:23 2012 -0700
@@ -26,11 +26,11 @@
 FileChooser.openDialogTitle.textAndMnemonic=\u00D6ppna
 FileChooser.updateButton.textAndMnemonic=Uppdatera
 FileChooser.helpButton.textAndMnemonic=Hj\u00E4lp
-FileChooser.pathLabel.textAndMnemonic=Ange s\u00F6kv\u00E4g eller mappnamn:
-FileChooser.filterLabel.textAndMnemonic=Filter
-FileChooser.foldersLabel.textAndMnemonic=Mappar
-FileChooser.filesLabel.textAndMnemonic=Filer
-FileChooser.enterFileNameLabel.textAndMnemonic=Ange filnamn:
+FileChooser.pathLabel.textAndMnemonic=Ange s\u00F6kv\u00E4g eller mappnamn(&P):
+FileChooser.filterLabel.textAndMnemonic=Filte&r
+FileChooser.foldersLabel.textAndMnemonic=Mappar(&L)
+FileChooser.filesLabel.textAndMnemonic=F&iler
+FileChooser.enterFileNameLabel.textAndMnemonic=A&nge filnamn:
 FileChooser.enterFolderNameLabel.textAndMnemonic=Ange ett mappnamn:
 
 FileChooser.cancelButtonToolTip.textAndMnemonic=Avbryt dialogrutan Filv\u00E4ljare.
--- a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_zh_CN.properties	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_zh_CN.properties	Fri Oct 26 10:55:23 2012 -0700
@@ -26,11 +26,11 @@
 FileChooser.openDialogTitle.textAndMnemonic=\u6253\u5F00
 FileChooser.updateButton.textAndMnemonic=\u66F4\u65B0
 FileChooser.helpButton.textAndMnemonic=\u5E2E\u52A9
-FileChooser.pathLabel.textAndMnemonic=\u952E\u5165\u8DEF\u5F84\u6216\u6587\u4EF6\u5939\u540D: 
-FileChooser.filterLabel.textAndMnemonic=\u7B5B\u9009\u5668
-FileChooser.foldersLabel.textAndMnemonic=\u6587\u4EF6\u5939
-FileChooser.filesLabel.textAndMnemonic=\u6587\u4EF6
-FileChooser.enterFileNameLabel.textAndMnemonic=\u952E\u5165\u6587\u4EF6\u540D: 
+FileChooser.pathLabel.textAndMnemonic=\u952E\u5165\u8DEF\u5F84\u6216\u6587\u4EF6\u5939\u540D: (&P)
+FileChooser.filterLabel.textAndMnemonic=\u7B5B\u9009\u5668(&R)
+FileChooser.foldersLabel.textAndMnemonic=\u6587\u4EF6\u5939(&L)
+FileChooser.filesLabel.textAndMnemonic=\u6587\u4EF6(&I)
+FileChooser.enterFileNameLabel.textAndMnemonic=\u952E\u5165\u6587\u4EF6\u540D: (&N)
 FileChooser.enterFolderNameLabel.textAndMnemonic=\u8F93\u5165\u6587\u4EF6\u5939\u540D:
 
 FileChooser.cancelButtonToolTip.textAndMnemonic=\u4E2D\u6B62\u6587\u4EF6\u9009\u62E9\u5668\u5BF9\u8BDD\u6846\u3002
--- a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_zh_TW.properties	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_zh_TW.properties	Fri Oct 26 10:55:23 2012 -0700
@@ -26,11 +26,11 @@
 FileChooser.openDialogTitle.textAndMnemonic=\u958B\u555F
 FileChooser.updateButton.textAndMnemonic=\u66F4\u65B0
 FileChooser.helpButton.textAndMnemonic=\u8AAA\u660E
-FileChooser.pathLabel.textAndMnemonic=\u8F38\u5165\u8DEF\u5F91\u6216\u8CC7\u6599\u593E\u540D\u7A31:
-FileChooser.filterLabel.textAndMnemonic=\u7BE9\u9078
-FileChooser.foldersLabel.textAndMnemonic=\u8CC7\u6599\u593E
-FileChooser.filesLabel.textAndMnemonic=\u6A94\u6848
-FileChooser.enterFileNameLabel.textAndMnemonic=\u8F38\u5165\u6A94\u6848\u540D\u7A31:
+FileChooser.pathLabel.textAndMnemonic=\u8F38\u5165\u8DEF\u5F91\u6216\u8CC7\u6599\u593E\u540D\u7A31(&P):
+FileChooser.filterLabel.textAndMnemonic=\u7BE9\u9078(&R)
+FileChooser.foldersLabel.textAndMnemonic=\u8CC7\u6599\u593E(&L)
+FileChooser.filesLabel.textAndMnemonic=\u6A94\u6848(&I)
+FileChooser.enterFileNameLabel.textAndMnemonic=\u8F38\u5165\u6A94\u6848\u540D\u7A31(&N):
 FileChooser.enterFolderNameLabel.textAndMnemonic=\u8F38\u5165\u8CC7\u6599\u593E\u540D\u7A31:
 
 FileChooser.cancelButtonToolTip.textAndMnemonic=\u4E2D\u6B62\u6A94\u6848\u9078\u64C7\u5668\u5C0D\u8A71\u65B9\u584A\u3002
--- a/src/share/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java	Fri Oct 26 10:55:23 2012 -0700
@@ -528,16 +528,16 @@
 
         Locale l = fc.getLocale();
 
-        lookInLabelMnemonic = UIManager.getInt("FileChooser.lookInLabelMnemonic");
+        lookInLabelMnemonic = getMnemonic("FileChooser.lookInLabelMnemonic", l);
         lookInLabelText = UIManager.getString("FileChooser.lookInLabelText",l);
         saveInLabelText = UIManager.getString("FileChooser.saveInLabelText",l);
 
-        fileNameLabelMnemonic = UIManager.getInt("FileChooser.fileNameLabelMnemonic");
+        fileNameLabelMnemonic = getMnemonic("FileChooser.fileNameLabelMnemonic", l);
         fileNameLabelText = UIManager.getString("FileChooser.fileNameLabelText",l);
-        folderNameLabelMnemonic = UIManager.getInt("FileChooser.folderNameLabelMnemonic");
+        folderNameLabelMnemonic = getMnemonic("FileChooser.folderNameLabelMnemonic", l);
         folderNameLabelText = UIManager.getString("FileChooser.folderNameLabelText",l);
 
-        filesOfTypeLabelMnemonic = UIManager.getInt("FileChooser.filesOfTypeLabelMnemonic");
+        filesOfTypeLabelMnemonic = getMnemonic("FileChooser.filesOfTypeLabelMnemonic", l);
         filesOfTypeLabelText = UIManager.getString("FileChooser.filesOfTypeLabelText",l);
 
         upFolderToolTipText =  UIManager.getString("FileChooser.upFolderToolTipText",l);
@@ -550,6 +550,10 @@
         viewMenuButtonAccessibleName = UIManager.getString("FileChooser.viewMenuButtonAccessibleName",l);
     }
 
+    private Integer getMnemonic(String key, Locale l) {
+        return SwingUtilities2.getUIDefaultsInt(key, l);
+    }
+
     protected void installListeners(JFileChooser fc) {
         super.installListeners(fc);
         ActionMap actionMap = getActionMap();
--- a/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java	Fri Oct 26 10:55:23 2012 -0700
@@ -773,9 +773,6 @@
                                                                "icons/NewFolder.gif"),
             "FileChooser.useSystemExtensionHiding", Boolean.TRUE,
 
-            "FileChooser.lookInLabelMnemonic", Integer.valueOf(KeyEvent.VK_I),
-            "FileChooser.fileNameLabelMnemonic", Integer.valueOf(KeyEvent.VK_N),
-            "FileChooser.filesOfTypeLabelMnemonic", Integer.valueOf(KeyEvent.VK_T),
             "FileChooser.usesSingleFilePane", Boolean.TRUE,
             "FileChooser.noPlacesBar", new DesktopProperty("win.comdlg.noPlacesBar",
                                                            Boolean.FALSE),
--- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows.properties	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows.properties	Fri Oct 26 10:55:23 2012 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=Look in:
+FileChooser.lookInLabel.textAndMnemonic=Look &in:
 FileChooser.saveInLabel.textAndMnemonic=Save in:
-FileChooser.fileNameLabel.textAndMnemonic=File name:
-FileChooser.folderNameLabel.textAndMnemonic=Folder name:
-FileChooser.filesOfTypeLabel.textAndMnemonic=Files of type:
+FileChooser.fileNameLabel.textAndMnemonic=File &name:
+FileChooser.folderNameLabel.textAndMnemonic=Folder &name:
+FileChooser.filesOfTypeLabel.textAndMnemonic=Files of &type:
 FileChooser.upFolderToolTip.textAndMnemonic=Up One Level
 FileChooser.upFolderAccessibleName=Up
 FileChooser.homeFolderToolTip.textAndMnemonic=Home
--- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_de.properties	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_de.properties	Fri Oct 26 10:55:23 2012 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=Suchen in:
+FileChooser.lookInLabel.textAndMnemonic=Suchen &in:
 FileChooser.saveInLabel.textAndMnemonic=Speichern in:
-FileChooser.fileNameLabel.textAndMnemonic=Dateiname:
-FileChooser.folderNameLabel.textAndMnemonic=Ordnername:
-FileChooser.filesOfTypeLabel.textAndMnemonic=Dateityp:
+FileChooser.fileNameLabel.textAndMnemonic=Datei&name:
+FileChooser.folderNameLabel.textAndMnemonic=Ord&nername:
+FileChooser.filesOfTypeLabel.textAndMnemonic=Da&teityp:
 FileChooser.upFolderToolTip.textAndMnemonic=Eine Ebene h\u00F6her
 FileChooser.upFolderAccessibleName=Nach oben
 FileChooser.homeFolderToolTip.textAndMnemonic=Home
--- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_es.properties	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_es.properties	Fri Oct 26 10:55:23 2012 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=Buscar en:
+FileChooser.lookInLabel.textAndMnemonic=Buscar en(&I):
 FileChooser.saveInLabel.textAndMnemonic=Guardar en:
-FileChooser.fileNameLabel.textAndMnemonic=Nombre de Archivo:
-FileChooser.folderNameLabel.textAndMnemonic=Nombre de la Carpeta:
-FileChooser.filesOfTypeLabel.textAndMnemonic=Archivos de Tipo:
+FileChooser.fileNameLabel.textAndMnemonic=&Nombre de Archivo:
+FileChooser.folderNameLabel.textAndMnemonic=&Nombre de la Carpeta:
+FileChooser.filesOfTypeLabel.textAndMnemonic=Archivos de &Tipo:
 FileChooser.upFolderToolTip.textAndMnemonic=Subir un Nivel
 FileChooser.upFolderAccessibleName=Arriba
 FileChooser.homeFolderToolTip.textAndMnemonic=Inicio
--- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_fr.properties	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_fr.properties	Fri Oct 26 10:55:23 2012 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=Rechercher dans :
+FileChooser.lookInLabel.textAndMnemonic=Rechercher dans (&I):
 FileChooser.saveInLabel.textAndMnemonic=Enregistrer dans :
-FileChooser.fileNameLabel.textAndMnemonic=Nom du fichier :
-FileChooser.folderNameLabel.textAndMnemonic=Nom du dossier :
-FileChooser.filesOfTypeLabel.textAndMnemonic=Fichiers de type :
+FileChooser.fileNameLabel.textAndMnemonic=&Nom du fichier :
+FileChooser.folderNameLabel.textAndMnemonic=&Nom du dossier :
+FileChooser.filesOfTypeLabel.textAndMnemonic=Fichiers de &type :
 FileChooser.upFolderToolTip.textAndMnemonic=Remonte d'un niveau.
 FileChooser.upFolderAccessibleName=Monter
 FileChooser.homeFolderToolTip.textAndMnemonic=R\u00E9pertoire d'origine
--- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_it.properties	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_it.properties	Fri Oct 26 10:55:23 2012 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=Cerca in:
+FileChooser.lookInLabel.textAndMnemonic=Cerca &in:
 FileChooser.saveInLabel.textAndMnemonic=Salva in:
-FileChooser.fileNameLabel.textAndMnemonic=Nome file:
-FileChooser.folderNameLabel.textAndMnemonic=Nome della cartella:
-FileChooser.filesOfTypeLabel.textAndMnemonic=Tipo file:
+FileChooser.fileNameLabel.textAndMnemonic=&Nome file:
+FileChooser.folderNameLabel.textAndMnemonic=&Nome della cartella:
+FileChooser.filesOfTypeLabel.textAndMnemonic=&Tipo file:
 FileChooser.upFolderToolTip.textAndMnemonic=Cartella superiore
 FileChooser.upFolderAccessibleName=Superiore
 FileChooser.homeFolderToolTip.textAndMnemonic=Home
--- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_ja.properties	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_ja.properties	Fri Oct 26 10:55:23 2012 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=\u53C2\u7167:
+FileChooser.lookInLabel.textAndMnemonic=\u53C2\u7167(&I):
 FileChooser.saveInLabel.textAndMnemonic=\u4FDD\u5B58:
-FileChooser.fileNameLabel.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u540D:
-FileChooser.folderNameLabel.textAndMnemonic=\u30D5\u30A9\u30EB\u30C0\u540D:
-FileChooser.filesOfTypeLabel.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u306E\u30BF\u30A4\u30D7:
+FileChooser.fileNameLabel.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u540D(&N):
+FileChooser.folderNameLabel.textAndMnemonic=\u30D5\u30A9\u30EB\u30C0\u540D(&N):
+FileChooser.filesOfTypeLabel.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u306E\u30BF\u30A4\u30D7(&T):
 FileChooser.upFolderToolTip.textAndMnemonic=1\u30EC\u30D9\u30EB\u4E0A\u3078
 FileChooser.upFolderAccessibleName=\u4E0A\u3078
 FileChooser.homeFolderToolTip.textAndMnemonic=\u30DB\u30FC\u30E0
--- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_ko.properties	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_ko.properties	Fri Oct 26 10:55:23 2012 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=\uAC80\uC0C9 \uC704\uCE58:
+FileChooser.lookInLabel.textAndMnemonic=\uAC80\uC0C9 \uC704\uCE58(&I):
 FileChooser.saveInLabel.textAndMnemonic=\uC800\uC7A5 \uC704\uCE58:
-FileChooser.fileNameLabel.textAndMnemonic=\uD30C\uC77C \uC774\uB984:
-FileChooser.folderNameLabel.textAndMnemonic=\uD3F4\uB354 \uC774\uB984:
-FileChooser.filesOfTypeLabel.textAndMnemonic=\uD30C\uC77C \uC720\uD615:
+FileChooser.fileNameLabel.textAndMnemonic=\uD30C\uC77C \uC774\uB984(&N):
+FileChooser.folderNameLabel.textAndMnemonic=\uD3F4\uB354 \uC774\uB984(&N):
+FileChooser.filesOfTypeLabel.textAndMnemonic=\uD30C\uC77C \uC720\uD615(&T):
 FileChooser.upFolderToolTip.textAndMnemonic=\uD55C \uB808\uBCA8 \uC704\uB85C
 FileChooser.upFolderAccessibleName=\uC704\uB85C
 FileChooser.homeFolderToolTip.textAndMnemonic=\uD648
--- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_pt_BR.properties	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_pt_BR.properties	Fri Oct 26 10:55:23 2012 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=Consultar em:
+FileChooser.lookInLabel.textAndMnemonic=Consultar em(&I):
 FileChooser.saveInLabel.textAndMnemonic=Salvar em:
-FileChooser.fileNameLabel.textAndMnemonic=Nome do arquivo:
-FileChooser.folderNameLabel.textAndMnemonic=Nome da pasta:
-FileChooser.filesOfTypeLabel.textAndMnemonic=Arquivos do tipo:
+FileChooser.fileNameLabel.textAndMnemonic=&Nome do arquivo:
+FileChooser.folderNameLabel.textAndMnemonic=&Nome da pasta:
+FileChooser.filesOfTypeLabel.textAndMnemonic=Arquivos do &tipo:
 FileChooser.upFolderToolTip.textAndMnemonic=Um N\u00EDvel Acima
 FileChooser.upFolderAccessibleName=Acima
 FileChooser.homeFolderToolTip.textAndMnemonic=In\u00EDcio
--- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_sv.properties	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_sv.properties	Fri Oct 26 10:55:23 2012 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=Leta i:
+FileChooser.lookInLabel.textAndMnemonic=Leta &i:
 FileChooser.saveInLabel.textAndMnemonic=Spara i:
-FileChooser.fileNameLabel.textAndMnemonic=Filnamn:
-FileChooser.folderNameLabel.textAndMnemonic=Mapp:
-FileChooser.filesOfTypeLabel.textAndMnemonic=Filformat:
+FileChooser.fileNameLabel.textAndMnemonic=Fil&namn:
+FileChooser.folderNameLabel.textAndMnemonic=Mapp(&N):
+FileChooser.filesOfTypeLabel.textAndMnemonic=Filforma&t:
 FileChooser.upFolderToolTip.textAndMnemonic=Upp en niv\u00E5
 FileChooser.upFolderAccessibleName=Upp
 FileChooser.homeFolderToolTip.textAndMnemonic=Hem
--- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_zh_CN.properties	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_zh_CN.properties	Fri Oct 26 10:55:23 2012 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=\u67E5\u770B: 
+FileChooser.lookInLabel.textAndMnemonic=\u67E5\u770B: (&I)
 FileChooser.saveInLabel.textAndMnemonic=\u4FDD\u5B58: 
-FileChooser.fileNameLabel.textAndMnemonic=\u6587\u4EF6\u540D: 
-FileChooser.folderNameLabel.textAndMnemonic=\u6587\u4EF6\u5939\u540D: 
-FileChooser.filesOfTypeLabel.textAndMnemonic=\u6587\u4EF6\u7C7B\u578B: 
+FileChooser.fileNameLabel.textAndMnemonic=\u6587\u4EF6\u540D: (&N)
+FileChooser.folderNameLabel.textAndMnemonic=\u6587\u4EF6\u5939\u540D: (&N)
+FileChooser.filesOfTypeLabel.textAndMnemonic=\u6587\u4EF6\u7C7B\u578B: (&T)
 FileChooser.upFolderToolTip.textAndMnemonic=\u5411\u4E0A\u4E00\u7EA7
 FileChooser.upFolderAccessibleName=\u5411\u4E0A
 FileChooser.homeFolderToolTip.textAndMnemonic=\u4E3B\u76EE\u5F55
--- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_zh_TW.properties	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_zh_TW.properties	Fri Oct 26 10:55:23 2012 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=\u67E5\u8A62:
+FileChooser.lookInLabel.textAndMnemonic=\u67E5\u8A62(&I):
 FileChooser.saveInLabel.textAndMnemonic=\u5132\u5B58\u65BC: 
-FileChooser.fileNameLabel.textAndMnemonic=\u6A94\u6848\u540D\u7A31:
-FileChooser.folderNameLabel.textAndMnemonic=\u8CC7\u6599\u593E\u540D\u7A31:
-FileChooser.filesOfTypeLabel.textAndMnemonic=\u6A94\u6848\u985E\u578B:
+FileChooser.fileNameLabel.textAndMnemonic=\u6A94\u6848\u540D\u7A31(&N):
+FileChooser.folderNameLabel.textAndMnemonic=\u8CC7\u6599\u593E\u540D\u7A31(&N):
+FileChooser.filesOfTypeLabel.textAndMnemonic=\u6A94\u6848\u985E\u578B(&T):
 FileChooser.upFolderToolTip.textAndMnemonic=\u5F80\u4E0A\u4E00\u5C64
 FileChooser.upFolderAccessibleName=\u5F80\u4E0A
 FileChooser.homeFolderToolTip.textAndMnemonic=\u4E3B\u76EE\u9304
--- a/src/share/classes/com/sun/jndi/ldap/Connection.java	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/com/sun/jndi/ldap/Connection.java	Fri Oct 26 10:55:23 2012 -0700
@@ -157,7 +157,8 @@
     volatile IOException closureReason = null;
     volatile boolean useable = true;  // is Connection still useable
 
-    private int readTimeout;
+    int readTimeout;
+    int connectTimeout;
 
     // true means v3; false means v2
     // Called in LdapClient.authenticate() (which is synchronized)
@@ -187,6 +188,7 @@
         this.port = port;
         this.parent = parent;
         this.readTimeout = readTimeout;
+        this.connectTimeout = connectTimeout;
 
         if (trace != null) {
             traceFile = trace;
--- a/src/share/classes/com/sun/jndi/ldap/LdapClient.java	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/com/sun/jndi/ldap/LdapClient.java	Fri Oct 26 10:55:23 2012 -0700
@@ -149,149 +149,155 @@
         String authMechanism, Control[] ctls,  Hashtable env)
         throws NamingException {
 
-        authenticateCalled = true;
+        int readTimeout = conn.readTimeout;
+        conn.readTimeout = conn.connectTimeout;
+        LdapResult res = null;
 
         try {
-            ensureOpen();
-        } catch (IOException e) {
-            NamingException ne = new CommunicationException();
-            ne.setRootCause(e);
-            throw ne;
-        }
+            authenticateCalled = true;
 
-        switch (version) {
-        case LDAP_VERSION3_VERSION2:
-        case LDAP_VERSION3:
-            isLdapv3 = true;
-            break;
-        case LDAP_VERSION2:
-            isLdapv3 = false;
-            break;
-        default:
-            throw new CommunicationException("Protocol version " + version +
-                " not supported");
-        }
+            try {
+                ensureOpen();
+            } catch (IOException e) {
+                NamingException ne = new CommunicationException();
+                ne.setRootCause(e);
+                throw ne;
+            }
 
-        LdapResult res = null;
+            switch (version) {
+            case LDAP_VERSION3_VERSION2:
+            case LDAP_VERSION3:
+                isLdapv3 = true;
+                break;
+            case LDAP_VERSION2:
+                isLdapv3 = false;
+                break;
+            default:
+                throw new CommunicationException("Protocol version " + version +
+                    " not supported");
+            }
 
-        if (authMechanism.equalsIgnoreCase("none") ||
-            authMechanism.equalsIgnoreCase("anonymous")) {
+            if (authMechanism.equalsIgnoreCase("none") ||
+                authMechanism.equalsIgnoreCase("anonymous")) {
 
-            // Perform LDAP bind if we are reauthenticating, using LDAPv2,
-            // supporting failover to LDAPv2, or controls have been supplied.
-            if (!initial ||
-                (version == LDAP_VERSION2) ||
-                (version == LDAP_VERSION3_VERSION2) ||
-                ((ctls != null) && (ctls.length > 0))) {
+                // Perform LDAP bind if we are reauthenticating, using LDAPv2,
+                // supporting failover to LDAPv2, or controls have been supplied.
+                if (!initial ||
+                    (version == LDAP_VERSION2) ||
+                    (version == LDAP_VERSION3_VERSION2) ||
+                    ((ctls != null) && (ctls.length > 0))) {
+                    try {
+                        // anonymous bind; update name/pw for LDAPv2 retry
+                        res = ldapBind(name=null, (byte[])(pw=null), ctls, null,
+                            false);
+                        if (res.status == LdapClient.LDAP_SUCCESS) {
+                            conn.setBound();
+                        }
+                    } catch (IOException e) {
+                        NamingException ne =
+                            new CommunicationException("anonymous bind failed: " +
+                            conn.host + ":" + conn.port);
+                        ne.setRootCause(e);
+                        throw ne;
+                    }
+                } else {
+                    // Skip LDAP bind for LDAPv3 anonymous bind
+                    res = new LdapResult();
+                    res.status = LdapClient.LDAP_SUCCESS;
+                }
+            } else if (authMechanism.equalsIgnoreCase("simple")) {
+                // simple authentication
+                byte[] encodedPw = null;
                 try {
-                    // anonymous bind; update name/pw for LDAPv2 retry
-                    res = ldapBind(name=null, (byte[])(pw=null), ctls, null,
-                        false);
+                    encodedPw = encodePassword(pw, isLdapv3);
+                    res = ldapBind(name, encodedPw, ctls, null, false);
                     if (res.status == LdapClient.LDAP_SUCCESS) {
                         conn.setBound();
                     }
                 } catch (IOException e) {
                     NamingException ne =
-                        new CommunicationException("anonymous bind failed: " +
+                        new CommunicationException("simple bind failed: " +
+                            conn.host + ":" + conn.port);
+                    ne.setRootCause(e);
+                    throw ne;
+                } finally {
+                    // If pw was copied to a new array, clear that array as
+                    // a security precaution.
+                    if (encodedPw != pw && encodedPw != null) {
+                        for (int i = 0; i < encodedPw.length; i++) {
+                            encodedPw[i] = 0;
+                        }
+                    }
+                }
+            } else if (isLdapv3) {
+                // SASL authentication
+                try {
+                    res = LdapSasl.saslBind(this, conn, conn.host, name, pw,
+                        authMechanism, env, ctls);
+                    if (res.status == LdapClient.LDAP_SUCCESS) {
+                        conn.setBound();
+                    }
+                } catch (IOException e) {
+                    NamingException ne =
+                        new CommunicationException("SASL bind failed: " +
                         conn.host + ":" + conn.port);
                     ne.setRootCause(e);
                     throw ne;
                 }
             } else {
-                // Skip LDAP bind for LDAPv3 anonymous bind
-                res = new LdapResult();
-                res.status = LdapClient.LDAP_SUCCESS;
+                throw new AuthenticationNotSupportedException(authMechanism);
             }
-        } else if (authMechanism.equalsIgnoreCase("simple")) {
-            // simple authentication
-            byte[] encodedPw = null;
-            try {
-                encodedPw = encodePassword(pw, isLdapv3);
-                res = ldapBind(name, encodedPw, ctls, null, false);
-                if (res.status == LdapClient.LDAP_SUCCESS) {
-                    conn.setBound();
-                }
-            } catch (IOException e) {
-                NamingException ne =
-                    new CommunicationException("simple bind failed: " +
-                        conn.host + ":" + conn.port);
-                ne.setRootCause(e);
-                throw ne;
-            } finally {
-                // If pw was copied to a new array, clear that array as
-                // a security precaution.
-                if (encodedPw != pw && encodedPw != null) {
-                    for (int i = 0; i < encodedPw.length; i++) {
-                        encodedPw[i] = 0;
+
+            //
+            // re-try login using v2 if failing over
+            //
+            if (initial &&
+                (res.status == LdapClient.LDAP_PROTOCOL_ERROR) &&
+                (version == LdapClient.LDAP_VERSION3_VERSION2) &&
+                (authMechanism.equalsIgnoreCase("none") ||
+                    authMechanism.equalsIgnoreCase("anonymous") ||
+                    authMechanism.equalsIgnoreCase("simple"))) {
+
+                byte[] encodedPw = null;
+                try {
+                    isLdapv3 = false;
+                    encodedPw = encodePassword(pw, false);
+                    res = ldapBind(name, encodedPw, ctls, null, false);
+                    if (res.status == LdapClient.LDAP_SUCCESS) {
+                        conn.setBound();
+                    }
+                } catch (IOException e) {
+                    NamingException ne =
+                        new CommunicationException(authMechanism + ":" +
+                            conn.host +     ":" + conn.port);
+                    ne.setRootCause(e);
+                    throw ne;
+                } finally {
+                    // If pw was copied to a new array, clear that array as
+                    // a security precaution.
+                    if (encodedPw != pw && encodedPw != null) {
+                        for (int i = 0; i < encodedPw.length; i++) {
+                            encodedPw[i] = 0;
+                        }
                     }
                 }
             }
-        } else if (isLdapv3) {
-            // SASL authentication
-            try {
-                res = LdapSasl.saslBind(this, conn, conn.host, name, pw,
-                    authMechanism, env, ctls);
-                if (res.status == LdapClient.LDAP_SUCCESS) {
-                    conn.setBound();
-                }
-            } catch (IOException e) {
-                NamingException ne =
-                    new CommunicationException("SASL bind failed: " +
-                    conn.host + ":" + conn.port);
-                ne.setRootCause(e);
-                throw ne;
+
+            // principal name not found
+            // (map NameNotFoundException to AuthenticationException)
+            // %%% This is a workaround for Netscape servers returning
+            // %%% no such object when the principal name is not found
+            // %%% Note that when this workaround is applied, it does not allow
+            // %%% response controls to be recorded by the calling context
+            if (res.status == LdapClient.LDAP_NO_SUCH_OBJECT) {
+                throw new AuthenticationException(
+                    getErrorMessage(res.status, res.errorMessage));
             }
-        } else {
-            throw new AuthenticationNotSupportedException(authMechanism);
+            conn.setV3(isLdapv3);
+            return res;
+        } finally {
+            conn.readTimeout = readTimeout;
         }
-
-        //
-        // re-try login using v2 if failing over
-        //
-        if (initial &&
-            (res.status == LdapClient.LDAP_PROTOCOL_ERROR) &&
-            (version == LdapClient.LDAP_VERSION3_VERSION2) &&
-            (authMechanism.equalsIgnoreCase("none") ||
-                authMechanism.equalsIgnoreCase("anonymous") ||
-                authMechanism.equalsIgnoreCase("simple"))) {
-
-            byte[] encodedPw = null;
-            try {
-                isLdapv3 = false;
-                encodedPw = encodePassword(pw, false);
-                res = ldapBind(name, encodedPw, ctls, null, false);
-                if (res.status == LdapClient.LDAP_SUCCESS) {
-                    conn.setBound();
-                }
-            } catch (IOException e) {
-                NamingException ne =
-                    new CommunicationException(authMechanism + ":" +
-                        conn.host +     ":" + conn.port);
-                ne.setRootCause(e);
-                throw ne;
-            } finally {
-                // If pw was copied to a new array, clear that array as
-                // a security precaution.
-                if (encodedPw != pw && encodedPw != null) {
-                    for (int i = 0; i < encodedPw.length; i++) {
-                        encodedPw[i] = 0;
-                    }
-                }
-            }
-        }
-
-        // principal name not found
-        // (map NameNotFoundException to AuthenticationException)
-        // %%% This is a workaround for Netscape servers returning
-        // %%% no such object when the principal name is not found
-        // %%% Note that when this workaround is applied, it does not allow
-        // %%% response controls to be recorded by the calling context
-        if (res.status == LdapClient.LDAP_NO_SUCH_OBJECT) {
-            throw new AuthenticationException(
-                getErrorMessage(res.status, res.errorMessage));
-        }
-        conn.setV3(isLdapv3);
-        return res;
     }
 
     /**
--- a/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java	Fri Oct 26 10:55:23 2012 -0700
@@ -1060,12 +1060,17 @@
 
             if (storeKey) {
                 if (encKeys == null) {
-                    if (!privCredSet.contains(ktab)) {
-                        privCredSet.add(ktab);
-                        // Compatibility; also add keys to privCredSet
-                        for (KerberosKey key: ktab.getKeys(kerbClientPrinc)) {
-                            privCredSet.add(new Krb5Util.KeysFromKeyTab(key));
+                    if (ktab != null) {
+                        if (!privCredSet.contains(ktab)) {
+                            privCredSet.add(ktab);
+                            // Compatibility; also add keys to privCredSet
+                            for (KerberosKey key: ktab.getKeys(kerbClientPrinc)) {
+                                privCredSet.add(new Krb5Util.KeysFromKeyTab(key));
+                            }
                         }
+                    } else {
+                        succeeded = false;
+                        throw new LoginException("No key to store");
                     }
                 } else {
                     for (int i = 0; i < kerbKeys.length; i ++) {
--- a/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal.properties	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal.properties	Fri Oct 26 10:55:23 2012 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=Look In:
+FileChooser.lookInLabel.textAndMnemonic=Look &In:
 FileChooser.saveInLabel.textAndMnemonic=Save In:
-FileChooser.fileNameLabel.textAndMnemonic=File Name:
-FileChooser.folderNameLabel.textAndMnemonic=Folder name:
-FileChooser.filesOfTypeLabel.textAndMnemonic=Files of Type:
+FileChooser.fileNameLabel.textAndMnemonic=File &Name:
+FileChooser.folderNameLabel.textAndMnemonic=Folder &name:
+FileChooser.filesOfTypeLabel.textAndMnemonic=Files of &Type:
 FileChooser.upFolderToolTip.textAndMnemonic=Up One Level
 FileChooser.upFolderAccessibleName=Up
 FileChooser.homeFolderToolTip.textAndMnemonic=Home
--- a/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_de.properties	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_de.properties	Fri Oct 26 10:55:23 2012 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=Suchen in:
+FileChooser.lookInLabel.textAndMnemonic=Suchen &in:
 FileChooser.saveInLabel.textAndMnemonic=Speichern in:
-FileChooser.fileNameLabel.textAndMnemonic=Dateiname:
-FileChooser.folderNameLabel.textAndMnemonic=Ordnername:
-FileChooser.filesOfTypeLabel.textAndMnemonic=Dateityp:
+FileChooser.fileNameLabel.textAndMnemonic=Datei&name:
+FileChooser.folderNameLabel.textAndMnemonic=Ord&nername:
+FileChooser.filesOfTypeLabel.textAndMnemonic=Da&teityp:
 FileChooser.upFolderToolTip.textAndMnemonic=Eine Ebene h\u00F6her
 FileChooser.upFolderAccessibleName=Nach oben
 FileChooser.homeFolderToolTip.textAndMnemonic=Home
--- a/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_es.properties	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_es.properties	Fri Oct 26 10:55:23 2012 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=Buscar en:
+FileChooser.lookInLabel.textAndMnemonic=Buscar en(&I):
 FileChooser.saveInLabel.textAndMnemonic=Guardar en:
-FileChooser.fileNameLabel.textAndMnemonic=Nombre de Archivo:
-FileChooser.folderNameLabel.textAndMnemonic=Nombre de la Carpeta:
-FileChooser.filesOfTypeLabel.textAndMnemonic=Archivos de Tipo:
+FileChooser.fileNameLabel.textAndMnemonic=&Nombre de Archivo:
+FileChooser.folderNameLabel.textAndMnemonic=&Nombre de la Carpeta:
+FileChooser.filesOfTypeLabel.textAndMnemonic=Archivos de &Tipo:
 FileChooser.upFolderToolTip.textAndMnemonic=Subir un Nivel
 FileChooser.upFolderAccessibleName=Arriba
 FileChooser.homeFolderToolTip.textAndMnemonic=Inicio
--- a/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_fr.properties	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_fr.properties	Fri Oct 26 10:55:23 2012 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=Rechercher dans :
+FileChooser.lookInLabel.textAndMnemonic=Rechercher dans (&I):
 FileChooser.saveInLabel.textAndMnemonic=Enregistrer dans :
-FileChooser.fileNameLabel.textAndMnemonic=Nom du fichier :
-FileChooser.folderNameLabel.textAndMnemonic=Nom du dossier :
-FileChooser.filesOfTypeLabel.textAndMnemonic=Fichiers de type :
+FileChooser.fileNameLabel.textAndMnemonic=&Nom du fichier :
+FileChooser.folderNameLabel.textAndMnemonic=&Nom du dossier :
+FileChooser.filesOfTypeLabel.textAndMnemonic=Fichiers de &type :
 FileChooser.upFolderToolTip.textAndMnemonic=Remonte d'un niveau.
 FileChooser.upFolderAccessibleName=Monter
 FileChooser.homeFolderToolTip.textAndMnemonic=R\u00E9pertoire d'origine
--- a/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_it.properties	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_it.properties	Fri Oct 26 10:55:23 2012 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=Cerca in:
+FileChooser.lookInLabel.textAndMnemonic=Cerca &in:
 FileChooser.saveInLabel.textAndMnemonic=Salva in:
-FileChooser.fileNameLabel.textAndMnemonic=Nome file:
-FileChooser.folderNameLabel.textAndMnemonic=Nome della cartella:
-FileChooser.filesOfTypeLabel.textAndMnemonic=Tipo file:
+FileChooser.fileNameLabel.textAndMnemonic=&Nome file:
+FileChooser.folderNameLabel.textAndMnemonic=&Nome della cartella:
+FileChooser.filesOfTypeLabel.textAndMnemonic=&Tipo file:
 FileChooser.upFolderToolTip.textAndMnemonic=Cartella superiore
 FileChooser.upFolderAccessibleName=Superiore
 FileChooser.homeFolderToolTip.textAndMnemonic=Home
--- a/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_ja.properties	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_ja.properties	Fri Oct 26 10:55:23 2012 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=\u53C2\u7167:
+FileChooser.lookInLabel.textAndMnemonic=\u53C2\u7167(&I):
 FileChooser.saveInLabel.textAndMnemonic=\u4FDD\u5B58:
-FileChooser.fileNameLabel.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u540D:
-FileChooser.folderNameLabel.textAndMnemonic=\u30D5\u30A9\u30EB\u30C0\u540D:
-FileChooser.filesOfTypeLabel.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u306E\u30BF\u30A4\u30D7:
+FileChooser.fileNameLabel.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u540D(&N):
+FileChooser.folderNameLabel.textAndMnemonic=\u30D5\u30A9\u30EB\u30C0\u540D(&N):
+FileChooser.filesOfTypeLabel.textAndMnemonic=\u30D5\u30A1\u30A4\u30EB\u306E\u30BF\u30A4\u30D7(&T):
 FileChooser.upFolderToolTip.textAndMnemonic=1\u30EC\u30D9\u30EB\u4E0A\u3078
 FileChooser.upFolderAccessibleName=\u4E0A\u3078
 FileChooser.homeFolderToolTip.textAndMnemonic=\u30DB\u30FC\u30E0
--- a/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_ko.properties	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_ko.properties	Fri Oct 26 10:55:23 2012 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=\uAC80\uC0C9 \uC704\uCE58:
+FileChooser.lookInLabel.textAndMnemonic=\uAC80\uC0C9 \uC704\uCE58(&I):
 FileChooser.saveInLabel.textAndMnemonic=\uC800\uC7A5 \uC704\uCE58:
-FileChooser.fileNameLabel.textAndMnemonic=\uD30C\uC77C \uC774\uB984:
-FileChooser.folderNameLabel.textAndMnemonic=\uD3F4\uB354 \uC774\uB984:
-FileChooser.filesOfTypeLabel.textAndMnemonic=\uD30C\uC77C \uC720\uD615:
+FileChooser.fileNameLabel.textAndMnemonic=\uD30C\uC77C \uC774\uB984(&N):
+FileChooser.folderNameLabel.textAndMnemonic=\uD3F4\uB354 \uC774\uB984(&N):
+FileChooser.filesOfTypeLabel.textAndMnemonic=\uD30C\uC77C \uC720\uD615(&T):
 FileChooser.upFolderToolTip.textAndMnemonic=\uD55C \uB808\uBCA8 \uC704\uB85C
 FileChooser.upFolderAccessibleName=\uC704\uB85C
 FileChooser.homeFolderToolTip.textAndMnemonic=\uD648
--- a/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_pt_BR.properties	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_pt_BR.properties	Fri Oct 26 10:55:23 2012 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=Consultar Em:
+FileChooser.lookInLabel.textAndMnemonic=Consultar Em(&I):
 FileChooser.saveInLabel.textAndMnemonic=Salvar Em:
-FileChooser.fileNameLabel.textAndMnemonic=Nome do Arquivo:
-FileChooser.folderNameLabel.textAndMnemonic=Nome da pasta:
-FileChooser.filesOfTypeLabel.textAndMnemonic=Arquivos do Tipo:
+FileChooser.fileNameLabel.textAndMnemonic=&Nome do Arquivo:
+FileChooser.folderNameLabel.textAndMnemonic=&Nome da pasta:
+FileChooser.filesOfTypeLabel.textAndMnemonic=Arquivos do &Tipo:
 FileChooser.upFolderToolTip.textAndMnemonic=Um N\u00EDvel Acima
 FileChooser.upFolderAccessibleName=Acima
 FileChooser.homeFolderToolTip.textAndMnemonic=In\u00EDcio
--- a/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_sv.properties	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_sv.properties	Fri Oct 26 10:55:23 2012 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=Leta i:
+FileChooser.lookInLabel.textAndMnemonic=Leta &i:
 FileChooser.saveInLabel.textAndMnemonic=Spara i:
-FileChooser.fileNameLabel.textAndMnemonic=Filnamn:
-FileChooser.folderNameLabel.textAndMnemonic=Mapp:
-FileChooser.filesOfTypeLabel.textAndMnemonic=Filformat:
+FileChooser.fileNameLabel.textAndMnemonic=Fil&namn:
+FileChooser.folderNameLabel.textAndMnemonic=Mapp(&N):
+FileChooser.filesOfTypeLabel.textAndMnemonic=Filforma&t:
 FileChooser.upFolderToolTip.textAndMnemonic=Upp en niv\u00E5
 FileChooser.upFolderAccessibleName=Upp
 FileChooser.homeFolderToolTip.textAndMnemonic=Hem
--- a/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_zh_CN.properties	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_zh_CN.properties	Fri Oct 26 10:55:23 2012 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=\u67E5\u770B: 
+FileChooser.lookInLabel.textAndMnemonic=\u67E5\u770B(&I): 
 FileChooser.saveInLabel.textAndMnemonic=\u4FDD\u5B58: 
-FileChooser.fileNameLabel.textAndMnemonic=\u6587\u4EF6\u540D: 
-FileChooser.folderNameLabel.textAndMnemonic=\u6587\u4EF6\u5939\u540D: 
-FileChooser.filesOfTypeLabel.textAndMnemonic=\u6587\u4EF6\u7C7B\u578B: 
+FileChooser.fileNameLabel.textAndMnemonic=\u6587\u4EF6\u540D(&N): 
+FileChooser.folderNameLabel.textAndMnemonic=\u6587\u4EF6\u5939\u540D(&N): 
+FileChooser.filesOfTypeLabel.textAndMnemonic=\u6587\u4EF6\u7C7B\u578B(&T): 
 FileChooser.upFolderToolTip.textAndMnemonic=\u5411\u4E0A\u4E00\u7EA7
 FileChooser.upFolderAccessibleName=\u5411\u4E0A
 FileChooser.homeFolderToolTip.textAndMnemonic=\u4E3B\u76EE\u5F55
--- a/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_zh_TW.properties	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_zh_TW.properties	Fri Oct 26 10:55:23 2012 -0700
@@ -18,11 +18,11 @@
 
 ############ FILE CHOOSER STRINGS #############
 
-FileChooser.lookInLabel.textAndMnemonic=\u67E5\u8A62:
+FileChooser.lookInLabel.textAndMnemonic=\u67E5\u8A62(&I):
 FileChooser.saveInLabel.textAndMnemonic=\u5132\u5B58\u65BC: 
-FileChooser.fileNameLabel.textAndMnemonic=\u6A94\u6848\u540D\u7A31:
-FileChooser.folderNameLabel.textAndMnemonic=\u8CC7\u6599\u593E\u540D\u7A31:
-FileChooser.filesOfTypeLabel.textAndMnemonic=\u6A94\u6848\u985E\u578B:
+FileChooser.fileNameLabel.textAndMnemonic=\u6A94\u6848\u540D\u7A31(&N):
+FileChooser.folderNameLabel.textAndMnemonic=\u8CC7\u6599\u593E\u540D\u7A31(&N):
+FileChooser.filesOfTypeLabel.textAndMnemonic=\u6A94\u6848\u985E\u578B(&T):
 FileChooser.upFolderToolTip.textAndMnemonic=\u5F80\u4E0A\u4E00\u5C64
 FileChooser.upFolderAccessibleName=\u5F80\u4E0A
 FileChooser.homeFolderToolTip.textAndMnemonic=\u4E3B\u76EE\u9304
--- a/src/share/classes/java/util/Hashtable.java	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/java/util/Hashtable.java	Fri Oct 26 10:55:23 2012 -0700
@@ -1114,7 +1114,7 @@
         }
 
         public int hashCode() {
-            return hash ^ value.hashCode();
+            return (Objects.hashCode(key) ^ Objects.hashCode(value));
         }
 
         public String toString() {
--- a/src/share/classes/java/util/WeakHashMap.java	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/java/util/WeakHashMap.java	Fri Oct 26 10:55:23 2012 -0700
@@ -90,7 +90,8 @@
  * from being discarded.  Note that a value object may refer indirectly to its
  * key via the <tt>WeakHashMap</tt> itself; that is, a value object may
  * strongly refer to some other key object whose associated value object, in
- * turn, strongly refers to the key of the first value object.  One way
+ * turn, strongly refers to the key of the first value object.  If the values
+ * in the map do not rely on the map holding strong references to them, one way
  * to deal with this is to wrap values themselves within
  * <tt>WeakReferences</tt> before
  * inserting, as in: <tt>m.put(key, new WeakReference(value))</tt>,
--- a/src/share/classes/javax/swing/AncestorNotifier.java	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/javax/swing/AncestorNotifier.java	Fri Oct 26 10:55:23 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -44,7 +44,7 @@
 
 class AncestorNotifier implements ComponentListener, PropertyChangeListener, Serializable
 {
-    Component firstInvisibleAncestor;
+    transient Component firstInvisibleAncestor;
     EventListenerList listenerList = new EventListenerList();
     JComponent root;
 
--- a/src/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java	Fri Oct 26 10:55:23 2012 -0700
@@ -461,16 +461,16 @@
 
         Locale l = fc.getLocale();
 
-        lookInLabelMnemonic = UIManager.getInt("FileChooser.lookInLabelMnemonic");
+        lookInLabelMnemonic = getMnemonic("FileChooser.lookInLabelMnemonic", l);
         lookInLabelText = UIManager.getString("FileChooser.lookInLabelText",l);
         saveInLabelText = UIManager.getString("FileChooser.saveInLabelText",l);
 
-        fileNameLabelMnemonic = UIManager.getInt("FileChooser.fileNameLabelMnemonic");
+        fileNameLabelMnemonic = getMnemonic("FileChooser.fileNameLabelMnemonic", l);
         fileNameLabelText = UIManager.getString("FileChooser.fileNameLabelText",l);
-        folderNameLabelMnemonic = UIManager.getInt("FileChooser.folderNameLabelMnemonic");
+        folderNameLabelMnemonic = getMnemonic("FileChooser.folderNameLabelMnemonic", l);
         folderNameLabelText = UIManager.getString("FileChooser.folderNameLabelText",l);
 
-        filesOfTypeLabelMnemonic = UIManager.getInt("FileChooser.filesOfTypeLabelMnemonic");
+        filesOfTypeLabelMnemonic = getMnemonic("FileChooser.filesOfTypeLabelMnemonic", l);
         filesOfTypeLabelText = UIManager.getString("FileChooser.filesOfTypeLabelText",l);
 
         upFolderToolTipText =  UIManager.getString("FileChooser.upFolderToolTipText",l);
@@ -489,6 +489,10 @@
         detailsViewButtonAccessibleName = UIManager.getString("FileChooser.detailsViewButtonAccessibleName",l);
     }
 
+    private Integer getMnemonic(String key, Locale l) {
+        return SwingUtilities2.getUIDefaultsInt(key, l);
+    }
+
     protected void installListeners(JFileChooser fc) {
         super.installListeners(fc);
         ActionMap actionMap = getActionMap();
--- a/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java	Fri Oct 26 10:55:23 2012 -0700
@@ -844,9 +844,6 @@
             "FileChooser.newFolderIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getFileChooserNewFolderIcon"),
             "FileChooser.upFolderIcon", new SwingLazyValue("javax.swing.plaf.metal.MetalIconFactory", "getFileChooserUpFolderIcon"),
 
-            "FileChooser.lookInLabelMnemonic", new Integer(KeyEvent.VK_I),
-            "FileChooser.fileNameLabelMnemonic", new Integer(KeyEvent.VK_N),
-            "FileChooser.filesOfTypeLabelMnemonic", new Integer(KeyEvent.VK_T),
             "FileChooser.usesSingleFilePane", Boolean.TRUE,
             "FileChooser.ancestorInputMap",
                new UIDefaults.LazyInputMap(new Object[] {
--- a/src/share/classes/sun/nio/ch/IOUtil.java	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/sun/nio/ch/IOUtil.java	Fri Oct 26 10:55:23 2012 -0700
@@ -344,6 +344,8 @@
 
     static native int iovMax();
 
+    static native int fdLimit();
+
     static native void initIDs();
 
     static {
--- a/src/share/classes/sun/security/krb5/internal/ccache/FileCredentialsCache.java	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/classes/sun/security/krb5/internal/ccache/FileCredentialsCache.java	Fri Oct 26 10:55:23 2012 -0700
@@ -356,7 +356,7 @@
      * Returns path name of the credentials cache file.
      * The path name is searched in the following order:
      *
-     * 1. KRB5CCNAME
+     * 1. KRB5CCNAME (bare file name without FILE:)
      * 2. /tmp/krb5cc_<uid> on unix systems
      * 3. <user.home>/krb5cc_<user.name>
      * 4. <user.home>/krb5cc (if can't get <user.name>)
@@ -367,11 +367,19 @@
         String stdCacheNameComponent = "krb5cc";
         String name;
 
+        // The env var can start with TYPE:, we only support FILE: here.
+        // http://docs.oracle.com/cd/E19082-01/819-2252/6n4i8rtr3/index.html
         name = java.security.AccessController.doPrivileged(
                 new java.security.PrivilegedAction<String>() {
             @Override
             public String run() {
-                return System.getenv("KRB5CCNAME");
+                String cache = System.getenv("KRB5CCNAME");
+                if (cache != null &&
+                        (cache.length() >= 5) &&
+                        cache.regionMatches(true, 0, "FILE:", 0, 5)) {
+                    cache = cache.substring(5);
+                }
+                return cache;
             }
         });
         if (name != null) {
--- a/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystemProvider.java	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystemProvider.java	Fri Oct 26 10:55:23 2012 -0700
@@ -78,7 +78,7 @@
         }
         try {
             // only support legacy JAR URL syntax  jar:{uri}!/{entry} for now
-            String spec = uri.getSchemeSpecificPart();
+            String spec = uri.getRawSchemeSpecificPart();
             int sep = spec.indexOf("!/");
             if (sep != -1)
                 spec = spec.substring(0, sep);
--- a/src/share/native/java/io/io_util.h	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/share/native/java/io/io_util.h	Fri Oct 26 10:55:23 2012 -0700
@@ -25,9 +25,6 @@
 
 #include "jni.h"
 #include "jni_util.h"
-#ifdef MACOSX
-char* convertToNFDIfNeeded(const char *origPath, char *buf, size_t bufsize);
-#endif
 
 extern jfieldID IO_fd_fdID;
 extern jfieldID IO_handle_fdID;
@@ -59,7 +56,6 @@
 void throwFileNotFoundException(JNIEnv *env, jstring path);
 
 
-
 /*
  * Macros for managing platform strings.  The typical usage pattern is:
  *
@@ -88,35 +84,6 @@
  * declares a unique variable.
  */
 
-#ifdef MACOSX
-
-#define WITH_PLATFORM_STRING(env, strexp, var)                                \
-    if (1) {                                                                  \
-        const char *var;                                                      \
-        jstring _##var##str = (strexp);                                       \
-        if (_##var##str == NULL) {                                            \
-            JNU_ThrowNullPointerException((env), NULL);                       \
-            goto _##var##end;                                                 \
-        }                                                                     \
-        const char *temp_var = JNU_GetStringPlatformChars((env), _##var##str, NULL);      \
-        if (temp_var == NULL) goto _##var##end;                               \
-        char buf[MAXPATHLEN];                                                 \
-        var = convertToNFDIfNeeded(temp_var, buf, sizeof(buf));
-
-#define WITH_FIELD_PLATFORM_STRING(env, object, id, var)                      \
-    WITH_PLATFORM_STRING(env,                                                 \
-                         ((object == NULL)                                    \
-                          ? NULL                                              \
-                          : (*(env))->GetObjectField((env), (object), (id))), \
-                        var)
-
-#define END_PLATFORM_STRING(env, var)                                         \
-        JNU_ReleaseStringPlatformChars(env, _##var##str, temp_var);           \
-    _##var##end: ;                                                            \
-    } else ((void)NULL)
-
-#else
-
 #define WITH_PLATFORM_STRING(env, strexp, var)                                \
     if (1) {                                                                  \
         const char *var;                                                      \
@@ -140,8 +107,6 @@
     _##var##end: ;                                                            \
     } else ((void)NULL)
 
-#endif
-
 
 /* Macros for transforming Java Strings into native Unicode strings.
  * Works analogously to WITH_PLATFORM_STRING.
--- a/src/solaris/classes/sun/nio/ch/DevPollArrayWrapper.java	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/solaris/classes/sun/nio/ch/DevPollArrayWrapper.java	Fri Oct 26 10:55:23 2012 -0700
@@ -71,7 +71,7 @@
     static final byte  IGNORE        = (byte)-1;
 
     // Maximum number of open file descriptors
-    static final int   OPEN_MAX      = fdLimit();
+    static final int   OPEN_MAX      = IOUtil.fdLimit();
 
     // Number of pollfd structures to create.
     // dpwrite/ioctl(DP_POLL) allows up to OPEN_MAX-1
@@ -316,5 +316,4 @@
     private native int poll0(long pollAddress, int numfds, long timeout,
                              int wfd);
     private static native void interrupt(int fd);
-    private static native int fdLimit();
 }
--- a/src/solaris/classes/sun/nio/ch/EPollArrayWrapper.java	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/solaris/classes/sun/nio/ch/EPollArrayWrapper.java	Fri Oct 26 10:55:23 2012 -0700
@@ -74,7 +74,7 @@
     static final int EVENT_OFFSET     = 0;
     static final int DATA_OFFSET      = offsetofData();
     static final int FD_OFFSET        = DATA_OFFSET;
-    static final int NUM_EPOLLEVENTS  = Math.min(fdLimit(), 8192);
+    static final int NUM_EPOLLEVENTS  = Math.min(IOUtil.fdLimit(), 8192);
 
     // Base address of the native pollArray
     private final long pollArrayAddress;
@@ -296,7 +296,6 @@
                                  int epfd) throws IOException;
     private static native int sizeofEPollEvent();
     private static native int offsetofData();
-    private static native int fdLimit();
     private static native void interrupt(int fd);
     private static native void init();
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/solaris/classes/sun/nio/ch/EventPortSelectorImpl.java	Fri Oct 26 10:55:23 2012 -0700
@@ -0,0 +1,170 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.nio.ch;
+
+import java.io.IOException;
+import java.nio.channels.*;
+import java.nio.channels.spi.*;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Iterator;
+
+/**
+ * Selector implementation based on the Solaris event port mechanism.
+ */
+
+class EventPortSelectorImpl
+    extends SelectorImpl
+{
+    private final EventPortWrapper pollWrapper;
+
+    // Maps from file descriptors to keys
+    private Map<Integer,SelectionKeyImpl> fdToKey;
+
+    // True if this Selector has been closed
+    private boolean closed = false;
+
+    // Lock for interrupt triggering and clearing
+    private final Object interruptLock = new Object();
+    private boolean interruptTriggered = false;
+
+    /**
+     * Package private constructor called by factory method in
+     * the abstract superclass Selector.
+     */
+    EventPortSelectorImpl(SelectorProvider sp) throws IOException {
+        super(sp);
+        pollWrapper = new EventPortWrapper();
+        fdToKey = new HashMap<>();
+    }
+
+    protected int doSelect(long timeout) throws IOException {
+        if (closed)
+            throw new ClosedSelectorException();
+        processDeregisterQueue();
+        int entries;
+        try {
+            begin();
+            entries = pollWrapper.poll(timeout);
+        } finally {
+            end();
+        }
+        processDeregisterQueue();
+        int numKeysUpdated = updateSelectedKeys(entries);
+        if (pollWrapper.interrupted()) {
+            synchronized (interruptLock) {
+                interruptTriggered = false;
+            }
+        }
+        return numKeysUpdated;
+    }
+
+    private int updateSelectedKeys(int entries) {
+        int numKeysUpdated = 0;
+        for (int i=0; i<entries; i++) {
+            int nextFD = pollWrapper.getDescriptor(i);
+            SelectionKeyImpl ski = fdToKey.get(Integer.valueOf(nextFD));
+            if (ski != null) {
+                int rOps = pollWrapper.getEventOps(i);
+                if (selectedKeys.contains(ski)) {
+                    if (ski.channel.translateAndSetReadyOps(rOps, ski)) {
+                        numKeysUpdated++;
+                    }
+                } else {
+                    ski.channel.translateAndSetReadyOps(rOps, ski);
+                    if ((ski.nioReadyOps() & ski.nioInterestOps()) != 0) {
+                        selectedKeys.add(ski);
+                        numKeysUpdated++;
+                    }
+                }
+            }
+        }
+        return numKeysUpdated;
+    }
+
+    protected void implClose() throws IOException {
+        if (closed)
+            return;
+        closed = true;
+
+        // prevent further wakeup
+        synchronized (interruptLock) {
+            interruptTriggered = true;
+        }
+
+        pollWrapper.close();
+        selectedKeys = null;
+
+        // Deregister channels
+        Iterator<SelectionKey> i = keys.iterator();
+        while (i.hasNext()) {
+            SelectionKeyImpl ski = (SelectionKeyImpl)i.next();
+            deregister(ski);
+            SelectableChannel selch = ski.channel();
+            if (!selch.isOpen() && !selch.isRegistered())
+                ((SelChImpl)selch).kill();
+            i.remove();
+        }
+    }
+
+    protected void implRegister(SelectionKeyImpl ski) {
+        int fd = IOUtil.fdVal(ski.channel.getFD());
+        fdToKey.put(Integer.valueOf(fd), ski);
+        keys.add(ski);
+    }
+
+    protected void implDereg(SelectionKeyImpl ski) throws IOException {
+        int i = ski.getIndex();
+        assert (i >= 0);
+        int fd = ski.channel.getFDVal();
+        fdToKey.remove(Integer.valueOf(fd));
+        pollWrapper.release(fd);
+        ski.setIndex(-1);
+        keys.remove(ski);
+        selectedKeys.remove(ski);
+        deregister((AbstractSelectionKey)ski);
+        SelectableChannel selch = ski.channel();
+        if (!selch.isOpen() && !selch.isRegistered())
+            ((SelChImpl)selch).kill();
+    }
+
+    public void putEventOps(SelectionKeyImpl sk, int ops) {
+        if (closed)
+            throw new ClosedSelectorException();
+        int fd = sk.channel.getFDVal();
+        pollWrapper.setInterest(fd, ops);
+    }
+
+    public Selector wakeup() {
+        synchronized (interruptLock) {
+            if (!interruptTriggered) {
+                pollWrapper.interrupt();
+                interruptTriggered = true;
+            }
+        }
+        return this;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/solaris/classes/sun/nio/ch/EventPortSelectorProvider.java	Fri Oct 26 10:55:23 2012 -0700
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.nio.ch;
+
+import java.io.IOException;
+import java.nio.channels.*;
+import java.nio.channels.spi.*;
+
+public class EventPortSelectorProvider
+    extends SelectorProviderImpl
+{
+    public AbstractSelector openSelector() throws IOException {
+        return new EventPortSelectorImpl(this);
+    }
+
+    public Channel inheritedChannel() throws IOException {
+        return InheritedChannel.getChannel();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/solaris/classes/sun/nio/ch/EventPortWrapper.java	Fri Oct 26 10:55:23 2012 -0700
@@ -0,0 +1,262 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.nio.ch;
+
+import sun.misc.Unsafe;
+import java.io.IOException;
+import java.util.*;
+import static sun.nio.ch.SolarisEventPort.*;
+
+/**
+ * Manages a Solaris event port and manipulates a native array of pollfd structs
+ * on Solaris.
+ */
+
+class EventPortWrapper {
+    private static final Unsafe unsafe = Unsafe.getUnsafe();
+    private static final int addressSize = unsafe.addressSize();
+
+    // Maximum number of open file descriptors
+    static final int   OPEN_MAX     = IOUtil.fdLimit();
+
+    // Maximum number of events to retrive in one call to port_getn
+    static final int   POLL_MAX     =  Math.min(OPEN_MAX-1, 1024);
+
+    // initial size of the array to hold pending updates
+    private final int INITIAL_PENDING_UPDATE_SIZE = 256;
+
+    // maximum size of updateArray
+    private final int MAX_UPDATE_ARRAY_SIZE = Math.min(OPEN_MAX, 64*1024);
+
+    // special update status to indicate that it should be ignored
+    private static final byte IGNORE = -1;
+
+    // port file descriptor
+    private final int pfd;
+
+    // the poll array (populated by port_getn)
+    private final long pollArrayAddress;
+    private final AllocatedNativeObject pollArray;
+
+    // required when accessing the update* fields
+    private final Object updateLock = new Object();
+
+    // the number of pending updates
+    private int updateCount;
+
+    // queue of file descriptors with updates pending
+    private int[] updateDescriptors = new int[INITIAL_PENDING_UPDATE_SIZE];
+
+    // events for file descriptors with registration changes pending, indexed
+    // by file descriptor and stored as bytes for efficiency reasons. For
+    // file descriptors higher than MAX_UPDATE_ARRAY_SIZE (unlimited case at
+    // least then the update is stored in a map.
+    private final byte[] eventsLow = new byte[MAX_UPDATE_ARRAY_SIZE];
+    private Map<Integer,Byte> eventsHigh;
+    // Used by release and updateRegistrations to track whether a file
+    // descriptor is registered with /dev/poll.
+    private final BitSet registered = new BitSet();
+
+    // bit set to indicate if a file descriptor has been visited when
+    // processing updates (used to avoid duplicates calls to port_associate)
+    private BitSet visited = new BitSet();
+
+    EventPortWrapper() throws IOException {
+        int allocationSize = POLL_MAX * SIZEOF_PORT_EVENT;
+        pollArray = new AllocatedNativeObject(allocationSize, true);
+        pollArrayAddress = pollArray.address();
+        this.pfd = port_create();
+        if (OPEN_MAX > MAX_UPDATE_ARRAY_SIZE)
+            eventsHigh = new HashMap<>();
+    }
+
+    void close() throws IOException {
+        port_close(pfd);
+        pollArray.free();
+    }
+
+    private short getSource(int i) {
+        int offset = SIZEOF_PORT_EVENT * i + OFFSETOF_SOURCE;
+        return pollArray.getShort(offset);
+    }
+
+    int getEventOps(int i) {
+        int offset = SIZEOF_PORT_EVENT * i + OFFSETOF_EVENTS;
+        return pollArray.getInt(offset);
+    }
+
+    int getDescriptor(int i) {
+        int offset = SIZEOF_PORT_EVENT * i + OFFSETOF_OBJECT;
+        if (addressSize == 4) {
+            return pollArray.getInt(offset);
+        } else {
+            return (int) pollArray.getLong(offset);
+        }
+    }
+
+    private void setDescriptor(int i, int fd) {
+        int offset = SIZEOF_PORT_EVENT * i + OFFSETOF_OBJECT;
+        if (addressSize == 4) {
+            pollArray.putInt(offset, fd);
+        } else {
+            pollArray.putLong(offset, fd);
+        }
+    }
+
+    private void setUpdate(int fd, byte events) {
+        if (fd < MAX_UPDATE_ARRAY_SIZE) {
+            eventsLow[fd] = events;
+        } else {
+            eventsHigh.put(Integer.valueOf(fd), Byte.valueOf(events));
+        }
+    }
+
+    private byte getUpdate(int fd) {
+        if (fd < MAX_UPDATE_ARRAY_SIZE) {
+            return eventsLow[fd];
+        } else {
+            Byte result = eventsHigh.get(Integer.valueOf(fd));
+            // result should never be null
+            return result.byteValue();
+        }
+    }
+
+    int poll(long timeout) throws IOException {
+        // update registrations prior to poll
+        synchronized (updateLock) {
+
+            // process newest updates first
+            int i = updateCount - 1;
+            while (i >= 0) {
+                int fd = updateDescriptors[i];
+                if (!visited.get(fd)) {
+                    short ev = getUpdate(fd);
+                    if (ev != IGNORE) {
+                        if (ev == 0) {
+                            if (registered.get(fd)) {
+                                port_dissociate(pfd, PORT_SOURCE_FD, (long)fd);
+                                registered.clear(fd);
+                            }
+                        } else {
+                            if (port_associate(pfd, PORT_SOURCE_FD, (long)fd, ev)) {
+                                registered.set(fd);
+                            }
+                        }
+
+                    }
+                    visited.set(fd);
+                }
+                i--;
+            }
+            updateCount = 0;
+        }
+
+        // poll for events
+        int updated = port_getn(pfd, pollArrayAddress, POLL_MAX, timeout);
+
+        // after polling we need to queue all polled file descriptors as they
+        // are candidates to register for the next poll.
+        synchronized (updateLock) {
+            for (int i=0; i<updated; i++) {
+                if (getSource(i) == PORT_SOURCE_USER) {
+                    interrupted = true;
+                    setDescriptor(i, -1);
+                } else {
+                    // the default is to re-associate for the next poll
+                    int fd = getDescriptor(i);
+                    registered.clear(fd);
+                    setInterest(fd);
+                }
+            }
+        }
+
+        return updated;
+    }
+
+    private void setInterest(int fd) {
+        assert Thread.holdsLock(updateLock);
+
+        // record the file descriptor and events, expanding the
+        // respective arrays first if necessary.
+        int oldCapacity = updateDescriptors.length;
+        if (updateCount >= oldCapacity) {
+            int newCapacity = oldCapacity + INITIAL_PENDING_UPDATE_SIZE;
+            int[] newDescriptors = new int[newCapacity];
+            System.arraycopy(updateDescriptors, 0, newDescriptors, 0, oldCapacity);
+            updateDescriptors = newDescriptors;
+        }
+        updateDescriptors[updateCount++] = fd;
+        visited.clear(fd);
+    }
+
+    void setInterest(int fd, int mask) {
+        synchronized (updateLock) {
+            setInterest(fd);
+            setUpdate(fd, (byte)mask);
+            assert getUpdate(fd) == mask;
+        }
+    }
+
+    void release(int fd) {
+        synchronized (updateLock) {
+            if (registered.get(fd)) {
+                try {
+                    port_dissociate(pfd, PORT_SOURCE_FD, (long)fd);
+                } catch (IOException ioe) {
+                    InternalError x =
+                        new InternalError(ioe.getMessage());
+                    x.initCause(ioe);
+                    throw x;
+                }
+                registered.clear(fd);
+            }
+            setUpdate(fd, IGNORE);
+        }
+    }
+
+    // -- wakeup support --
+
+    private boolean interrupted;
+
+    public void interrupt() {
+        try {
+            port_send(pfd, 0);
+        } catch (IOException ioe) {
+            InternalError x =
+                new InternalError(ioe.getMessage());
+            x.initCause(ioe);
+            throw x;
+        }
+    }
+
+    boolean interrupted() {
+        return interrupted;
+    }
+
+    void clearInterrupted() {
+        interrupted = false;
+    }
+}
--- a/src/solaris/classes/sun/nio/ch/SolarisEventPort.java	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/solaris/classes/sun/nio/ch/SolarisEventPort.java	Fri Oct 26 10:55:23 2012 -0700
@@ -31,8 +31,8 @@
 import sun.misc.Unsafe;
 
 /**
- * AsynchronousChannelGroup implementation based on the Solaris 10 event port
- * framework.
+ * Provides an AsynchronousChannelGroup implementation based on the Solaris 10
+ * event port framework and also provides direct access to that framework.
  */
 
 class SolarisEventPort
@@ -54,14 +54,14 @@
      *     void            *portev_user;
      * } port_event_t;
      */
-    private static final int SIZEOF_PORT_EVENT  = dependsArch(16, 24);
-    private static final int OFFSETOF_EVENTS    = 0;
-    private static final int OFFSETOF_SOURCE    = 4;
-    private static final int OFFSETOF_OBJECT    = 8;
+    static final int SIZEOF_PORT_EVENT  = dependsArch(16, 24);
+    static final int OFFSETOF_EVENTS    = 0;
+    static final int OFFSETOF_SOURCE    = 4;
+    static final int OFFSETOF_OBJECT    = 8;
 
     // port sources
-    private static final short PORT_SOURCE_USER     = 3;
-    private static final short PORT_SOURCE_FD       = 4;
+    static final short PORT_SOURCE_USER     = 3;
+    static final short PORT_SOURCE_FD       = 4;
 
     // file descriptor to event port.
     private final int port;
@@ -75,7 +75,7 @@
         super(provider, pool);
 
         // create event port
-        this.port = portCreate();
+        this.port = port_create();
     }
 
     SolarisEventPort start() {
@@ -90,12 +90,12 @@
                 return;
             closed = true;
         }
-        portClose(port);
+        port_close(port);
     }
 
     private void wakeup() {
         try {
-            portSend(port, 0);
+            port_send(port, 0);
         } catch (IOException x) {
             throw new AssertionError(x);
         }
@@ -124,7 +124,7 @@
             // send user event to wakeup each thread
             while (nThreads-- > 0) {
                 try {
-                    portSend(port, 0);
+                    port_send(port, 0);
                 } catch (IOException x) {
                     throw new AssertionError(x);
                 }
@@ -137,7 +137,7 @@
         // (re-)associate file descriptor
         // no need to translate events
         try {
-            portAssociate(port, PORT_SOURCE_FD, fd, events);
+            port_associate(port, PORT_SOURCE_FD, fd, events);
         } catch (IOException x) {
             throw new AssertionError();     // should not happen
         }
@@ -164,7 +164,7 @@
                     // A error here is fatal (thread will not be replaced)
                     replaceMe = false;
                     try {
-                        portGet(port, address);
+                        port_get(port, address);
                     } catch (IOException x) {
                         x.printStackTrace();
                         return;
@@ -220,26 +220,46 @@
         }
     }
 
-    // -- Native methods --
+    /**
+     * Creates an event port
+     */
+    static native int port_create() throws IOException;
 
-    private static native void init();
-
-    private static native int portCreate() throws IOException;
-
-    private static native void portAssociate(int port, int source, long object,
-        int events) throws IOException;
-
-    private static native void portGet(int port, long pe) throws IOException;
-
-    private static native int portGetn(int port, long address, int max)
+    /**
+     * Associates specific events of a given object with a port
+     */
+    static native boolean port_associate(int port, int source, long object, int events)
         throws IOException;
 
-    private static native void portSend(int port, int events) throws IOException;
+    /**
+     * Removes the association of an object with a port.
+     */
+    static native boolean port_dissociate(int port, int source, long object)
+        throws IOException;
 
-    private static native void portClose(int port);
+    /**
+     * Retrieves a single event from a port
+     */
+    static native void port_get(int port, long pe) throws IOException;
+
+    /**
+     * Retrieves at most {@code max} events from a port.
+     */
+    static native int port_getn(int port, long address, int max, long timeout)
+        throws IOException;
+
+    /**
+     * Sends a user-defined eventto a specified  port.
+     */
+    static native void port_send(int port, int events) throws IOException;
+
+    /**
+     * Closes a port.
+     */
+    static native void port_close(int port);
+
 
     static {
         Util.load();
-        init();
     }
 }
--- a/src/solaris/classes/sun/nio/fs/BsdNativeDispatcher.java	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/solaris/classes/sun/nio/fs/BsdNativeDispatcher.java	Fri Oct 26 10:55:23 2012 -0700
@@ -33,7 +33,7 @@
  */
 
 class BsdNativeDispatcher extends UnixNativeDispatcher {
-    private BsdNativeDispatcher() { }
+    protected BsdNativeDispatcher() { }
 
    /**
     * struct fsstat_iter *getfsstat();
@@ -55,11 +55,6 @@
     private static native void initIDs();
 
     static {
-        AccessController.doPrivileged(new PrivilegedAction<Void>() {
-            public Void run() {
-                System.loadLibrary("nio");
-                return null;
-        }});
-        initIDs();
+         initIDs();
     }
 }
--- a/src/solaris/classes/sun/nio/fs/DefaultFileSystemProvider.java	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/solaris/classes/sun/nio/fs/DefaultFileSystemProvider.java	Fri Oct 26 10:55:23 2012 -0700
@@ -69,7 +69,7 @@
         if (osname.equals("Linux"))
             return createProvider("sun.nio.fs.LinuxFileSystemProvider");
         if (osname.equals("Darwin") || osname.contains("OS X"))
-            return createProvider("sun.nio.fs.BsdFileSystemProvider");
+            return createProvider("sun.nio.fs.MacOSXFileSystemProvider");
         throw new AssertionError("Platform not recognized");
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/solaris/classes/sun/nio/fs/MacOSXFileSystem.java	Fri Oct 26 10:55:23 2012 -0700
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2008, 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.
+ */
+
+package sun.nio.fs;
+
+import java.nio.file.*;
+import java.io.IOException;
+import java.util.*;
+import java.util.regex.Pattern;
+import java.security.AccessController;
+import sun.security.action.GetPropertyAction;
+
+import static sun.nio.fs.MacOSXNativeDispatcher.*;
+
+/**
+ * MacOS implementation of FileSystem
+ */
+
+class MacOSXFileSystem extends BsdFileSystem {
+
+    MacOSXFileSystem(UnixFileSystemProvider provider, String dir) {
+        super(provider, dir);
+    }
+
+    // match in unicode canon_eq
+    Pattern compilePathMatchPattern(String expr) {
+        return Pattern.compile(expr, Pattern.CANON_EQ) ;
+    }
+
+    char[] normalizeNativePath(char[] path) {
+        for (char c : path) {
+            if (c > 0x80)
+                return normalizepath(path, kCFStringNormalizationFormD);
+        }
+        return path;
+    }
+
+    String normalizeJavaPath(String path) {
+        for (int i = 0; i < path.length(); i++) {
+            if (path.charAt(i) > 0x80)
+                return new String(normalizepath(path.toCharArray(),
+                                  kCFStringNormalizationFormC));
+        }
+        return path;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/solaris/classes/sun/nio/fs/MacOSXFileSystemProvider.java	Fri Oct 26 10:55:23 2012 -0700
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2008, 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.
+ */
+
+package sun.nio.fs;
+
+import java.nio.file.*;
+import java.nio.file.attribute.*;
+import java.io.IOException;
+
+/**
+ * MacOSX implementation of FileSystemProvider
+ */
+
+public class MacOSXFileSystemProvider extends BsdFileSystemProvider {
+    public MacOSXFileSystemProvider() {
+        super();
+    }
+
+    @Override
+    MacOSXFileSystem newFileSystem(String dir) {
+        return new MacOSXFileSystem(this, dir);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/solaris/classes/sun/nio/fs/MacOSXNativeDispatcher.java	Fri Oct 26 10:55:23 2012 -0700
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.nio.fs;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+/**
+ * MacOSX specific system calls.
+ */
+
+class MacOSXNativeDispatcher extends BsdNativeDispatcher {
+    private MacOSXNativeDispatcher() { }
+
+    static final int kCFStringNormalizationFormC = 2;
+    static final int kCFStringNormalizationFormD = 0;
+    static native char[] normalizepath(char[] path, int form);
+}
--- a/src/solaris/classes/sun/nio/fs/UnixFileSystem.java	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/solaris/classes/sun/nio/fs/UnixFileSystem.java	Fri Oct 26 10:55:23 2012 -0700
@@ -302,7 +302,8 @@
         }
 
         // return matcher
-        final Pattern pattern = Pattern.compile(expr);
+        final Pattern pattern = compilePathMatchPattern(expr);
+
         return new PathMatcher() {
             @Override
             public boolean matches(Path path) {
@@ -310,11 +311,10 @@
             }
         };
     }
+
     private static final String GLOB_SYNTAX = "glob";
     private static final String REGEX_SYNTAX = "regex";
 
-
-
     @Override
     public final UserPrincipalLookupService getUserPrincipalLookupService() {
         return LookupService.instance;
@@ -339,4 +339,23 @@
             };
     }
 
+    // Override if the platform has different path match requrement, such as
+    // case insensitive or Unicode canonical equal on MacOSX
+    Pattern compilePathMatchPattern(String expr) {
+        return Pattern.compile(expr);
+    }
+
+    // Override if the platform uses different Unicode normalization form
+    // for native file path. For example on MacOSX, the native path is stored
+    // in Unicode NFD form.
+    char[] normalizeNativePath(char[] path) {
+        return path;
+    }
+
+    // Override if the native file path use non-NFC form. For example on MacOSX,
+    // the native path is stored in Unicode NFD form, the path need to be
+    // normalized back to NFC before passed back to Java level.
+    String normalizeJavaPath(String path) {
+        return path;
+    }
 }
--- a/src/solaris/classes/sun/nio/fs/UnixPath.java	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/solaris/classes/sun/nio/fs/UnixPath.java	Fri Oct 26 10:55:23 2012 -0700
@@ -68,7 +68,7 @@
 
     UnixPath(UnixFileSystem fs, String input) {
         // removes redundant slashes and checks for invalid characters
-        this(fs, encode(normalizeAndCheck(input)));
+        this(fs, encode(fs, normalizeAndCheck(input)));
     }
 
     // package-private
@@ -116,7 +116,7 @@
     }
 
     // encodes the given path-string into a sequence of bytes
-    private static byte[] encode(String input) {
+    private static byte[] encode(UnixFileSystem fs, String input) {
         SoftReference<CharsetEncoder> ref = encoder.get();
         CharsetEncoder ce = (ref != null) ? ref.get() : null;
         if (ce == null) {
@@ -126,7 +126,7 @@
             encoder.set(new SoftReference<CharsetEncoder>(ce));
         }
 
-        char[] ca = input.toCharArray();
+        char[] ca = fs.normalizeNativePath(input.toCharArray());
 
         // size output buffer for worse-case size
         byte[] ba = new byte[(int)(ca.length * (double)ce.maxBytesPerChar())];
@@ -728,7 +728,7 @@
             if (c1 != c2) {
                 return c1 - c2;
             }
-            k++;
+           k++;
         }
         return len1 - len2;
     }
@@ -757,8 +757,9 @@
     @Override
     public String toString() {
         // OK if two or more threads create a String
-        if (stringValue == null)
-            stringValue = new String(path);     // platform encoding
+        if (stringValue == null) {
+            stringValue = fs.normalizeJavaPath(new String(path));     // platform encoding
+        }
         return stringValue;
     }
 
--- a/src/solaris/native/java/io/UnixFileSystem_md.c	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/solaris/native/java/io/UnixFileSystem_md.c	Fri Oct 26 10:55:23 2012 -0700
@@ -38,6 +38,7 @@
 #include "jlong.h"
 #include "jvm.h"
 #include "io_util.h"
+#include "io_util_md.h"
 #include "java_io_FileSystem.h"
 #include "java_io_UnixFileSystem.h"
 
@@ -80,7 +81,11 @@
                          canonicalPath, JVM_MAXPATHLEN) < 0) {
             JNU_ThrowIOExceptionWithLastError(env, "Bad pathname");
         } else {
+#ifdef MACOSX
+            rv = newStringPlatform(env, canonicalPath);
+#else
             rv = JNU_NewStringPlatform(env, canonicalPath);
+#endif
         }
     } END_PLATFORM_STRING(env, path);
     return rv;
@@ -311,7 +316,11 @@
             if (JNU_CopyObjectArray(env, rv, old, len) < 0) goto error;
             (*env)->DeleteLocalRef(env, old);
         }
+#ifdef MACOSX
+        name = newStringPlatform(env, ptr->d_name);
+#else
         name = JNU_NewStringPlatform(env, ptr->d_name);
+#endif
         if (name == NULL) goto error;
         (*env)->SetObjectArrayElement(env, rv, len++, name);
         (*env)->DeleteLocalRef(env, name);
--- a/src/solaris/native/java/io/io_util_md.c	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/solaris/native/java/io/io_util_md.c	Fri Oct 26 10:55:23 2012 -0700
@@ -34,37 +34,32 @@
 
 #include <CoreFoundation/CoreFoundation.h>
 
-static inline char *convertToNFD(const char *path, char *buf, size_t bufsize)
+__private_extern__
+jstring newStringPlatform(JNIEnv *env, const char* str)
 {
-    CFMutableStringRef mutable = CFStringCreateMutable(NULL, 0);
-    CFStringAppendCString(mutable, path, kCFStringEncodingUTF8);
-    CFStringNormalize(mutable, kCFStringNormalizationFormD);
-
-    CFStringGetCString(mutable, buf, bufsize, kCFStringEncodingUTF8);
-
-    CFRelease(mutable);
-    return buf;
-}
-
-/* Converts the path to NFD form if it was in NFC form. Returns a pointer to
- * the converting string which could be buf (if the converstion took place) or
- * origPath if no conversion was needed
- */
-__private_extern__
-char* convertToNFDIfNeeded(const char *origPath, char *buf, size_t bufsize)
-{
-    const char *current = origPath;
-    int c;
-    for (c = *current; c != 0; current++, c = *current) {
-        if (c < 0) {
-            // Need to convert
-            return convertToNFD(origPath, buf, bufsize);
+    jstring rv = NULL;
+    CFMutableStringRef csref = CFStringCreateMutable(NULL, 0);
+    if (csref == NULL) {
+        JNU_ThrowOutOfMemoryError(env, "native heap");
+    } else {
+        CFStringAppendCString(csref, str, kCFStringEncodingUTF8);
+        CFStringNormalize(csref, kCFStringNormalizationFormC);
+        int clen = CFStringGetLength(csref);
+        int ulen = (clen + 1) * 2;        // utf16 + zero padding
+        char* chars = malloc(ulen);
+        if (chars == NULL) {
+            CFRelease(csref);
+            JNU_ThrowOutOfMemoryError(env, "native heap");
+        } else {
+            if (CFStringGetCString(csref, chars, ulen, kCFStringEncodingUTF16)) {
+                rv = (*env)->NewString(env, (jchar*)chars, clen);
+            }
+            free(chars);
+            CFRelease(csref);
         }
     }
-
-    return (char *)origPath;
+    return rv;
 }
-
 #endif
 
 void
--- a/src/solaris/native/java/io/io_util_md.h	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/solaris/native/java/io/io_util_md.h	Fri Oct 26 10:55:23 2012 -0700
@@ -72,3 +72,7 @@
  * IO helper function(s)
  */
 void fileClose(JNIEnv *env, jobject this, jfieldID fid);
+
+#ifdef MACOSX
+jstring newStringPlatform(JNIEnv *env, const char* str);
+#endif
--- a/src/solaris/native/sun/nio/ch/DevPollArrayWrapper.c	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/solaris/native/sun/nio/ch/DevPollArrayWrapper.c	Fri Oct 26 10:55:23 2012 -0700
@@ -28,9 +28,7 @@
 #include "jvm.h"
 #include "jlong.h"
 #include "sun_nio_ch_DevPollArrayWrapper.h"
-#include "java_lang_Integer.h"
 #include <sys/poll.h>
-#include <sys/resource.h>
 #include <unistd.h>
 #include <sys/time.h>
 
@@ -178,21 +176,6 @@
     return result;
 }
 
-JNIEXPORT jint JNICALL
-Java_sun_nio_ch_DevPollArrayWrapper_fdLimit(JNIEnv *env, jclass this)
-{
-    struct rlimit rlp;
-    if (getrlimit(RLIMIT_NOFILE, &rlp) < 0) {
-        JNU_ThrowIOExceptionWithLastError(env,
-                                          "getrlimit failed");
-    }
-    if (rlp.rlim_max < 0 || rlp.rlim_max > java_lang_Integer_MAX_VALUE) {
-        return java_lang_Integer_MAX_VALUE;
-    } else {
-        return (jint)rlp.rlim_max;
-    }
-}
-
 JNIEXPORT void JNICALL
 Java_sun_nio_ch_DevPollArrayWrapper_interrupt(JNIEnv *env, jclass this, jint fd)
 {
--- a/src/solaris/native/sun/nio/ch/EPollArrayWrapper.c	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/solaris/native/sun/nio/ch/EPollArrayWrapper.c	Fri Oct 26 10:55:23 2012 -0700
@@ -32,7 +32,6 @@
 
 #include <dlfcn.h>
 #include <unistd.h>
-#include <sys/resource.h>
 #include <sys/time.h>
 
 #ifdef  __cplusplus
@@ -142,16 +141,6 @@
 }
 
 JNIEXPORT jint JNICALL
-Java_sun_nio_ch_EPollArrayWrapper_fdLimit(JNIEnv *env, jclass this)
-{
-    struct rlimit rlp;
-    if (getrlimit(RLIMIT_NOFILE, &rlp) < 0) {
-        JNU_ThrowIOExceptionWithLastError(env, "getrlimit failed");
-    }
-    return (jint)rlp.rlim_max;
-}
-
-JNIEXPORT jint JNICALL
 Java_sun_nio_ch_EPollArrayWrapper_sizeofEPollEvent(JNIEnv* env, jclass this)
 {
     return sizeof(struct epoll_event);
--- a/src/solaris/native/sun/nio/ch/IOUtil.c	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/solaris/native/sun/nio/ch/IOUtil.c	Fri Oct 26 10:55:23 2012 -0700
@@ -25,11 +25,14 @@
 
 #include <sys/types.h>
 #include <string.h>
+#include <sys/resource.h>
+
 #include "jni.h"
 #include "jni_util.h"
 #include "jvm.h"
 #include "jlong.h"
 #include "sun_nio_ch_IOUtil.h"
+#include "java_lang_Integer.h"
 #include "nio.h"
 #include "nio_util.h"
 
@@ -118,6 +121,20 @@
     }
 }
 
+JNIEXPORT jint JNICALL
+Java_sun_nio_ch_IOUtil_fdLimit(JNIEnv *env, jclass this)
+{
+    struct rlimit rlp;
+    if (getrlimit(RLIMIT_NOFILE, &rlp) < 0) {
+        JNU_ThrowIOExceptionWithLastError(env, "getrlimit failed");
+        return -1;
+    }
+    if (rlp.rlim_max < 0 || rlp.rlim_max > java_lang_Integer_MAX_VALUE) {
+        return java_lang_Integer_MAX_VALUE;
+    } else {
+        return (jint)rlp.rlim_max;
+    }
+}
 
 /* Declared in nio_util.h for use elsewhere in NIO */
 
--- a/src/solaris/native/sun/nio/ch/SolarisEventPort.c	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/solaris/native/sun/nio/ch/SolarisEventPort.c	Fri Oct 26 10:55:23 2012 -0700
@@ -32,17 +32,12 @@
 #include <stdlib.h>
 #include <dlfcn.h>
 #include <sys/types.h>
-#include <port.h>       // Solaris 10
+#include <port.h>
 
 #include "sun_nio_ch_SolarisEventPort.h"
 
-JNIEXPORT void JNICALL
-Java_sun_nio_ch_SolarisEventPort_init(JNIEnv *env, jclass clazz)
-{
-}
-
 JNIEXPORT jint JNICALL
-Java_sun_nio_ch_SolarisEventPort_portCreate
+Java_sun_nio_ch_SolarisEventPort_port_1create
     (JNIEnv* env, jclass clazz)
 {
     int port = port_create();
@@ -53,37 +48,44 @@
 }
 
 JNIEXPORT void JNICALL
-Java_sun_nio_ch_SolarisEventPort_portClose
+Java_sun_nio_ch_SolarisEventPort_port_1close
     (JNIEnv* env, jclass clazz, jint port)
 {
     int res;
     RESTARTABLE(close(port), res);
 }
 
-JNIEXPORT void JNICALL
-Java_sun_nio_ch_SolarisEventPort_portAssociate
+JNIEXPORT jboolean JNICALL
+Java_sun_nio_ch_SolarisEventPort_port_1associate
     (JNIEnv* env, jclass clazz, jint port, jint source, jlong objectAddress, jint events)
 {
     uintptr_t object = (uintptr_t)jlong_to_ptr(objectAddress);
+    if (port_associate((int)port, (int)source, object, (int)events, NULL) == 0) {
+        return JNI_TRUE;
+    } else {
+        if (errno != EBADFD)
+            JNU_ThrowIOExceptionWithLastError(env, "port_associate");
+        return JNI_FALSE;
+    }
+}
 
-    if (port_associate((int)port, (int)source, object, (int)events, NULL) == -1) {
-        JNU_ThrowIOExceptionWithLastError(env, "port_associate");
+JNIEXPORT jboolean JNICALL
+Java_sun_nio_ch_SolarisEventPort_port_1dissociate
+    (JNIEnv* env, jclass clazz, jint port, jint source, jlong objectAddress)
+{
+    uintptr_t object = (uintptr_t)jlong_to_ptr(objectAddress);
+
+    if (port_dissociate((int)port, (int)source, object) == 0) {
+        return JNI_TRUE;
+    } else {
+        if (errno != ENOENT)
+            JNU_ThrowIOExceptionWithLastError(env, "port_dissociate");
+        return JNI_FALSE;
     }
 }
 
 JNIEXPORT void JNICALL
-Java_sun_nio_ch_SolarisEventPort_portDissociate
-    (JNIEnv* env, jclass clazz, jint port, jint source, jlong objectAddress)
-{
-    uintptr_t object = (uintptr_t)jlong_to_ptr(objectAddress);
-
-    if (port_dissociate((int)port, (int)source, object) == -1) {
-        JNU_ThrowIOExceptionWithLastError(env, "port_dissociate");
-    }
-}
-
-JNIEXPORT void JNICALL
-Java_sun_nio_ch_SolarisEventPort_portSend(JNIEnv* env, jclass clazz,
+Java_sun_nio_ch_SolarisEventPort_port_1send(JNIEnv* env, jclass clazz,
     jint port, jint events)
 {
     if (port_send((int)port, (int)events, NULL) == -1) {
@@ -92,7 +94,7 @@
 }
 
 JNIEXPORT void JNICALL
-Java_sun_nio_ch_SolarisEventPort_portGet(JNIEnv* env, jclass clazz,
+Java_sun_nio_ch_SolarisEventPort_port_1get(JNIEnv* env, jclass clazz,
     jint port, jlong eventAddress)
 {
     int res;
@@ -105,16 +107,28 @@
 }
 
 JNIEXPORT jint JNICALL
-Java_sun_nio_ch_SolarisEventPort_portGetn(JNIEnv* env, jclass clazz,
-    jint port, jlong arrayAddress, jint max)
+Java_sun_nio_ch_SolarisEventPort_port_1getn(JNIEnv* env, jclass clazz,
+    jint port, jlong arrayAddress, jint max, jlong timeout)
 {
     int res;
     uint_t n = 1;
     port_event_t* list = (port_event_t*)jlong_to_ptr(arrayAddress);
+    timespec_t ts;
+    timespec_t* tsp;
 
-    RESTARTABLE(port_getn((int)port, list, (uint_t)max, &n, NULL), res);
+    if (timeout >= 0L) {
+        ts.tv_sec = timeout / 1000;
+        ts.tv_nsec = 1000000 * (timeout % 1000);
+        tsp = &ts;
+    } else {
+        tsp = NULL;
+    }
+
+    res = port_getn((int)port, list, (uint_t)max, &n, tsp);
     if (res == -1) {
-        JNU_ThrowIOExceptionWithLastError(env, "port_getn");
+        if (errno != ETIME && errno != EINTR)
+            JNU_ThrowIOExceptionWithLastError(env, "port_getn");
     }
+
     return (jint)n;
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/solaris/native/sun/nio/fs/MacOSXNativeDispatcher.c	Fri Oct 26 10:55:23 2012 -0700
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#include "jni.h"
+#include "jni_util.h"
+#include "jvm.h"
+#include "jlong.h"
+
+#include <stdlib.h>
+#include <string.h>
+
+#include <CoreFoundation/CoreFoundation.h>
+
+JNIEXPORT jcharArray JNICALL
+Java_sun_nio_fs_MacOSXNativeDispatcher_normalizepath(JNIEnv* env, jclass this,
+                                                     jcharArray path,
+                                                     jint form)
+{
+    jcharArray result = NULL;
+    char chars_buf[(PATH_MAX + 1) * 2];     // utf16 + zero padding
+    CFMutableStringRef csref = CFStringCreateMutable(NULL, 0);
+    if (csref == NULL) {
+        JNU_ThrowOutOfMemoryError(env, "native heap");
+    } else {
+        char *chars = (char*)(*env)->GetPrimitiveArrayCritical(env, path, 0);
+        jsize len = (*env)->GetArrayLength(env, path);
+        CFStringAppendCharacters(csref, (const UniChar*)chars, len);
+        (*env)->ReleasePrimitiveArrayCritical(env, path, chars, 0);
+        CFStringNormalize(csref, form);
+        len = CFStringGetLength(csref);
+        if (len < PATH_MAX) {
+            if (CFStringGetCString(csref, chars_buf, sizeof(chars_buf), kCFStringEncodingUTF16)) {
+                result = (*env)->NewCharArray(env, len);
+                (*env)->SetCharArrayRegion(env, result, 0, len, (jchar*)&chars_buf);
+            }
+        } else {
+            int ulen = (len + 1) * 2;
+            chars = malloc(ulen);
+            if (chars == NULL) {
+                CFRelease(csref);
+                JNU_ThrowOutOfMemoryError(env, "native heap");
+                return result;
+            } else {
+                if (CFStringGetCString(csref, chars, ulen, kCFStringEncodingUTF16)) {
+                    result = (*env)->NewCharArray(env, len);
+                    (*env)->SetCharArrayRegion(env, result, 0, len, (jchar*)chars);
+                }
+                free(chars);
+            }
+        }
+        CFRelease(csref);
+    }
+    return result;
+}
--- a/src/windows/classes/sun/awt/shell/Win32ShellFolder2.java	Thu Oct 18 23:19:48 2012 -0700
+++ b/src/windows/classes/sun/awt/shell/Win32ShellFolder2.java	Fri Oct 26 10:55:23 2012 -0700
@@ -1099,7 +1099,7 @@
                                     ? SwingConstants.CENTER
                                     : SwingConstants.LEADING);
 
-                            column.setComparator(new ColumnComparator(getIShellFolder(), i));
+                            column.setComparator(new ColumnComparator(Win32ShellFolder2.this, i));
 
                             notNullColumns.add(column);
                         }
@@ -1135,7 +1135,7 @@
         // synchronize the whole code of the sort method once
         invoke(new Callable<Void>() {
             public Void call() {
-                Collections.sort(files, new ColumnComparator(getIShellFolder(), 0));
+                Collections.sort(files, new ColumnComparator(Win32ShellFolder2.this, 0));
 
                 return null;
             }
@@ -1143,12 +1143,12 @@
     }
 
     private static class ColumnComparator implements Comparator<File> {
-        private final long parentIShellFolder;
+        private final Win32ShellFolder2 shellFolder;
 
         private final int columnIdx;
 
-        public ColumnComparator(long parentIShellFolder, int columnIdx) {
-            this.parentIShellFolder = parentIShellFolder;
+        public ColumnComparator(Win32ShellFolder2 shellFolder, int columnIdx) {
+            this.shellFolder = shellFolder;
             this.columnIdx = columnIdx;
         }
 
@@ -1159,7 +1159,7 @@
                     if (o instanceof Win32ShellFolder2
                         && o1 instanceof Win32ShellFolder2) {
                         // delegates comparison to native method
-                        return compareIDsByColumn(parentIShellFolder,
+                        return compareIDsByColumn(shellFolder.getIShellFolder(),
                             ((Win32ShellFolder2) o).getRelativePIDL(),
                             ((Win32ShellFolder2) o1).getRelativePIDL(),
                             columnIdx);
--- a/test/ProblemList.txt	Thu Oct 18 23:19:48 2012 -0700
+++ b/test/ProblemList.txt	Fri Oct 26 10:55:23 2012 -0700
@@ -114,83 +114,10 @@
 
 # jdk_awt
 
-# None of the awt tests are using samevm, might not be worth the effort due
-#  to the vm overhead not being enough to make a difference.
-# In general, the awt tests are problematic with or without samevm, and there
-#  are issues with using a Xvfb display.
-
-# Fails on solaris sparc, timedout? in othervm mode
-java/awt/event/MouseEvent/AcceptExtraButton/AcceptExtraButton.java generic-all
-
-# Causes hang in samevm mode??? Solaris 11 i586
-java/awt/FullScreen/SetFSWindow/FSFrame.java                    generic-all
-
-# Fails on solaris 11 i586, -client, in othervm mode not sure why
-java/awt/Component/PrintAllXcheckJNI/PrintAllXcheckJNI.java     generic-all
-java/awt/Focus/CloseDialogActivateOwnerTest/CloseDialogActivateOwnerTest.java generic-all
-java/awt/FontClass/FontAccess.java                              generic-all
-java/awt/Mixing/HWDisappear.java                                generic-all
-java/awt/Mixing/MixingInHwPanel.java                            generic-all
-java/awt/Mouse/MaximizedFrameTest/MaximizedFrameTest.html       generic-all
-java/awt/Robot/AcceptExtraMouseButtons/AcceptExtraMouseButtons.java generic-all
-java/awt/Toolkit/SecurityTest/SecurityTest2.java                generic-all
-java/awt/image/mlib/MlibOpsTest.java                            generic-all
-
-# Fails on windows, othervm mode, various errors
-java/awt/Focus/NonFocusableWindowTest/NonfocusableOwnerTest.java        generic-all
-java/awt/Focus/OwnedWindowFocusIMECrashTest/OwnedWindowFocusIMECrashTest.java   generic-all
-java/awt/FullScreen/NoResizeEventOnDMChangeTest/NoResizeEventOnDMChangeTest.java        generic-all
-java/awt/Mouse/MouseModifiersUnitTest/MouseModifiersUnitTest_Standard.java      generic-all
-java/awt/event/KeyEvent/KeyTyped/CtrlASCII.html                 generic-all
-java/awt/font/Threads/FontThread.java                           generic-all
-java/awt/print/PrinterJob/PrtException.java                     generic-all
-
-# Fails with windows X64, othervm, -server
-com/sun/awt/Translucency/WindowOpacity.java                     generic-all
-java/awt/EventDispatchThread/HandleExceptionOnEDT/HandleExceptionOnEDT.java             generic-all
-java/awt/EventDispatchThread/LoopRobustness/LoopRobustness.html generic-all
-java/awt/Focus/AppletInitialFocusTest/AppletInitialFocusTest1.html generic-all
-java/awt/Focus/FocusEmbeddedFrameTest/FocusEmbeddedFrameTest.java generic-all
-java/awt/Frame/LayoutOnMaximizeTest/LayoutOnMaximizeTest.java   generic-all
-java/awt/FullScreen/TranslucentWindow/TranslucentWindow.java    generic-all
-java/awt/Mixing/MixingOnShrinkingHWButton.java                  generic-all
-java/awt/Mouse/MouseModifiersUnitTest/ExtraButtonDrag.java      generic-all
-
 ############################################################################
 
 # jdk_beans
 
-# A large set of the beans tests set the security manager, which would seem
-#  to indicate that a large number of them should be "othervm", yet are all
-#  very small tests and could greatly benefit from a samevm test run.
-#  So a large batch of beans tests are currently run with othervm mode.
-
-# Filed 6986807
-java/beans/Introspector/TestTypeResolver.java                   generic-all
-
-# Filed 6986813
-java/beans/Introspector/memory/Test4508780.java                 generic-all
-
-# Linux, some kind of problems with X11 display
-java/beans/PropertyChangeSupport/Test4682386.java               generic-all
-java/beans/PropertyChangeSupport/TestSynchronization.java       generic-all
-java/beans/Statement/Test4653179.java                           generic-all
-
-# Runs REALLY slow on Solaris sparc for some reason, both -client and -server
-java/beans/XMLEncoder/Test4625418.java                          solaris-sparc
-
-# Problems with samevm and setting security manager (speculation partially)
-java/beans/Introspector/4168475/Test4168475.java                generic-all
-java/beans/Introspector/4520754/Test4520754.java                generic-all
-java/beans/Introspector/6380849/TestBeanInfo.java               generic-all
-java/beans/Introspector/Test4144543.java                        generic-all
-
-# Failed to call method solaris-sparc???
-java/beans/EventHandler/Test6788531.java                        generic-all
-
-# Jar or class not found???
-java/beans/XMLEncoder/6329581/Test6329581.java                  generic-all
-
 ############################################################################
 
 # jdk_lang
@@ -304,94 +231,29 @@
 # 6988950
 demo/jvmti/compiledMethodLoad/CompiledMethodLoadTest.java       generic-all
 
-# 7162111
-demo/jvmti/mtrace/TraceJFrame.java				macosx-all
-
-# Need to be marked othervm, or changed to be samevm safe
+# 7056489
 com/sun/jndi/ldap/ReadTimeoutTest.java                          generic-all
 
-# Need to be marked othervm, or changed to be samevm safe
-com/sun/org/apache/xml/internal/security/transforms/ClassLoaderTest.java generic-all
-
-# Solaris sparc and others, exception in initializer
-javax/imageio/CachePremissionsTest/CachePermissionsTest.java    generic-all
-
-# Leaves file rgba_* open, fails with windows samevm
-javax/imageio/plugins/png/PngOutputTypeTest.java                generic-all
-
-# Suspect test.png file is left open, windows samevm problems
-javax/imageio/plugins/png/ITXtTest.java                         generic-all
-
-# Solaris sparc and others, failed to compile testcase
-javax/imageio/metadata/DOML3Node.java                           generic-all
-
-# One of these tests is leaving file IMGP1001.JPG open, windows samevm
-javax/imageio/plugins/jpeg/ConcurrentReadingTest.java           generic-all
-javax/imageio/plugins/jpeg/ReadingInterruptionTest.java         generic-all
-
-# One of these files is missing a close on writer_* files, windows samevm
-javax/imageio/plugins/jpeg/ConcurrentWritingTest.java           generic-all
-javax/imageio/plugins/jpeg/WritingInterruptionTest.java         generic-all
-
-# Leaving file test.jpg open, windows samevm
-javax/imageio/plugins/jpeg/ReadAsGrayTest.java                  generic-all
-
-# Missing close on file wbmp*, windows samevm
-javax/imageio/plugins/wbmp/CanDecodeTest.java                   generic-all
-
-# Failures on OpenSolaris, cannot read input files? samevm issues?
-javax/imageio/metadata/BooleanAttributes.java                   generic-all
-javax/imageio/plugins/bmp/BMPSubsamplingTest.java               generic-all
-javax/imageio/plugins/bmp/TopDownTest.java                      generic-all
-javax/imageio/plugins/gif/EncodeSubImageTest.java               generic-all
-javax/imageio/plugins/gif/GifTransparencyTest.java              generic-all
-javax/imageio/plugins/png/GrayPngTest.java                      generic-all
-javax/imageio/plugins/png/ItxtUtf8Test.java                     generic-all
-javax/imageio/plugins/png/MergeStdCommentTest.java              generic-all
-javax/imageio/plugins/png/ShortHistogramTest.java               generic-all
-javax/imageio/plugins/shared/BitDepth.java                      generic-all
-
-# Exclude all javax/print tests, even if they passed, they may need samevm work
-
-# Times out on solaris-sparc, sparcv9, x64 -server, some on i586 -client
-javax/print/attribute/autosense/PrintAutoSenseData.java         generic-all
-javax/print/attribute/Chroma.java                               generic-all
-javax/print/attribute/CollateAttr.java                          generic-all
-javax/print/attribute/PSCopiesFlavorTest.java                   generic-all
-javax/print/LookupServices.java                                 generic-all
-javax/print/TestRaceCond.java                                   generic-all
-
-# These tests really require a printer (might all be windows only tests?)
-javax/print/CheckDupFlavor.java                                 generic-all
-javax/print/PrintSE/PrintSE.sh                                  generic-all
-javax/print/attribute/ChromaticityValues.java                   generic-all
-javax/print/attribute/GetCopiesSupported.java                   generic-all
-javax/print/attribute/SidesPageRangesTest.java                  generic-all
-javax/print/attribute/SupportedPrintableAreas.java              generic-all
-javax/print/attribute/AttributeTest.java                        generic-all
-
-# Only print test left, excluding just because all print tests have been
-javax/print/attribute/MediaMappingsTest.java                    generic-all
-
 # 7162111
-javax/script/CauseExceptionTest.java				macosx-all
-javax/script/GetInterfaceTest.java				macosx-all
-javax/script/JavaScriptScopeTest.java				macosx-all
-javax/script/NullUndefinedVarTest.java				macosx-all
-javax/script/PluggableContextTest.java				macosx-all
-javax/script/ProviderTest.sh					macosx-all
-javax/script/RhinoExceptionTest.java				macosx-all
-javax/script/StringWriterPrintTest.java				macosx-all
-javax/script/Test1.java						macosx-all
-javax/script/Test2.java						macosx-all
-javax/script/Test3.java						macosx-all
-javax/script/Test4.java						macosx-all
-javax/script/Test5.java						macosx-all
-javax/script/Test6.java						macosx-all
-javax/script/Test7.java						macosx-all
-javax/script/Test8.java						macosx-all
-javax/script/UnescapedBracketRegExTest.java			macosx-all
-javax/script/VersionTest.java					macosx-all
+demo/jvmti/mtrace/TraceJFrame.java                              macosx-all
+javax/script/CauseExceptionTest.java                            macosx-all
+javax/script/GetInterfaceTest.java                              macosx-all
+javax/script/JavaScriptScopeTest.java                           macosx-all
+javax/script/NullUndefinedVarTest.java                          macosx-all
+javax/script/PluggableContextTest.java                          macosx-all
+javax/script/ProviderTest.sh                                    macosx-all
+javax/script/RhinoExceptionTest.java                            macosx-all
+javax/script/StringWriterPrintTest.java                         macosx-all
+javax/script/Test1.java                                         macosx-all
+javax/script/Test2.java                                         macosx-all
+javax/script/Test3.java                                         macosx-all
+javax/script/Test4.java                                         macosx-all
+javax/script/Test5.java                                         macosx-all
+javax/script/Test6.java                                         macosx-all
+javax/script/Test7.java                                         macosx-all
+javax/script/Test8.java                                         macosx-all
+javax/script/UnescapedBracketRegExTest.java                     macosx-all
+javax/script/VersionTest.java                                   macosx-all
 
 ############################################################################
 
@@ -583,15 +445,12 @@
 # Timeout on solaris-sparc and i586 and x64, -client and -server
 sun/security/ssl/com/sun/net/ssl/internal/ssl/InputRecord/InterruptedIO.java solaris-all
 
+# 7147060
+com/sun/org/apache/xml/internal/security/transforms/ClassLoaderTest.java        generic-all
+
 ############################################################################
 
-# jdk_swing (not using samevm)
-
-# Fails on solaris 11 i586, with othervm
-javax/swing/JFileChooser/6570445/bug6570445.java                generic-all
-javax/swing/JFileChooser/6738668/bug6738668.java                generic-all
-javax/swing/JPopupMenu/6675802/bug6675802.java                  generic-all
-javax/swing/system/6799345/TestShutdown.java                    generic-all
+# jdk_swing
 
 ############################################################################
 
@@ -604,6 +463,9 @@
 
 # jdk_tools
 
+# 6461635
+com/sun/tools/attach/BasicTests.sh                              generic-all
+
 # Filed 6952105
 com/sun/jdi/SuspendThreadTest.java                              generic-all
 
@@ -627,6 +489,13 @@
 sun/tools/jrunscript/jrunscript-fTest.sh			macosx-all
 sun/tools/jrunscript/jrunscriptTest.sh				macosx-all
 
+# 8001118
+sun/tools/jcmd/jcmd-f.sh					generic-all
+sun/tools/jcmd/jcmd-help-help.sh				generic-all
+
+# 7175775
+sun/tools/jinfo/Basic.sh					macosx-all
+
 ############################################################################
 
 # jdk_util
@@ -660,6 +529,10 @@
 
 # 7162111
 java/util/ResourceBundle/Control/Bug6530694.java		macosx-all
+java/util/logging/LoggingDeadlock4.java				macosx-all
+
+# 7041639, Solaris DSA keypair generation bug
+java/util/TimeZone/TimeZoneDatePermissionCheck.sh               solaris-all
 
 ############################################################################
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/jndi/ldap/LdapTimeoutTest.java	Fri Oct 26 10:55:23 2012 -0700
@@ -0,0 +1,177 @@
+/*
+ * 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 7094377 8000487 6176036 7056489
+ * @summary Timeout tests for ldap
+ */
+
+import java.net.Socket;
+import java.net.ServerSocket;
+import java.net.SocketTimeoutException;
+import java.io.*;
+import javax.naming.*;
+import javax.naming.directory.*;
+import java.util.Hashtable;
+import java.util.concurrent.Callable;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledFuture;
+import java.util.concurrent.TimeUnit;
+
+public class LdapTimeoutTest {
+    private static final ScheduledExecutorService pool =
+        Executors.newScheduledThreadPool(1);
+    static volatile int passed = 0, failed = 0;
+    static void pass() {passed++;}
+    static void fail() {failed++; Thread.dumpStack();}
+
+    public static void main(String[] args) throws Exception {
+        ServerSocket serverSock = new ServerSocket(0);
+        Server s = new Server(serverSock);
+        s.start();
+        Thread.sleep(200);
+
+        Hashtable env = new Hashtable(11);
+        env.put(Context.INITIAL_CONTEXT_FACTORY,
+            "com.sun.jndi.ldap.LdapCtxFactory");
+        env.put(Context.PROVIDER_URL, "ldap://localhost:" +
+            serverSock.getLocalPort());
+
+        env.put(Context.SECURITY_AUTHENTICATION,"simple");
+
+        env.put(Context.SECURITY_PRINCIPAL, "user");
+        env.put(Context.SECURITY_CREDENTIALS, "password");
+
+        env.put("com.sun.jndi.ldap.connect.timeout", "10");
+        env.put("com.sun.jndi.ldap.read.timeout", "3000");
+
+        InitialContext ctx = null;
+        try {
+            new LdapTimeoutTest().ldapReadTimeoutTest(env, false);
+            new LdapTimeoutTest().ldapReadTimeoutTest(env, true);
+            new LdapTimeoutTest().simpleAuthConnectTest(env);
+        } finally {
+            s.interrupt();
+            LdapTimeoutTest.pool.shutdown();
+        }
+
+        System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed);
+        if (failed > 0) throw new AssertionError("Some tests failed");
+    }
+
+    void ldapReadTimeoutTest(Hashtable env, boolean ssl) {
+        InitialContext ctx = null;
+        if (ssl) env.put(Context.SECURITY_PROTOCOL, "ssl");
+        ScheduledFuture killer = killSwitch();
+        long start = System.nanoTime();
+        try {
+            ctx = new InitialDirContext(env);
+            SearchControls scl = new SearchControls();
+            scl.setSearchScope(SearchControls.SUBTREE_SCOPE);
+            NamingEnumeration<SearchResult> answer = ((InitialDirContext)ctx)
+                .search("ou=People,o=JNDITutorial", "(objectClass=*)", scl);
+            // shouldn't reach here
+            fail();
+        } catch (NamingException e) {
+            if (ssl) {
+                if (e.getCause() instanceof SocketTimeoutException) {
+                    pass();
+                } else if (e.getCause() instanceof InterruptedIOException) {
+                    Thread.interrupted();
+                    fail();
+                }
+            } else {
+                pass();
+            }
+        } finally {
+            if (!shutItDown(killer, ctx)) fail();
+        }
+    }
+
+    void simpleAuthConnectTest(Hashtable env) {
+        InitialContext ctx = null;
+        ScheduledFuture killer = killSwitch();
+        long start = System.nanoTime();
+        try {
+            ctx = new InitialDirContext(env);
+            // shouldn't reach here
+            System.err.println("Fail: InitialDirContext succeeded");
+            fail();
+        } catch (NamingException e) {
+            long end = System.nanoTime();
+            if (e.getCause() instanceof SocketTimeoutException) {
+                if (TimeUnit.NANOSECONDS.toMillis(end - start) < 2900) {
+                    pass();
+                } else {
+                    System.err.println("Fail: Waited too long");
+                    fail();
+                }
+            } else if (e.getCause() instanceof InterruptedIOException) {
+                Thread.interrupted();
+                fail();
+            } else {
+                fail();
+            }
+        } finally {
+            if (!shutItDown(killer, ctx)) fail();
+        }
+    }
+
+    boolean shutItDown(ScheduledFuture killer, InitialContext ctx) {
+        killer.cancel(true);
+        try {
+            if (ctx != null) ctx.close();
+            return true;
+        } catch (NamingException ex) {
+            return false;
+        }
+    }
+
+    ScheduledFuture killSwitch() {
+        final Thread current = Thread.currentThread();
+        return LdapTimeoutTest.pool.schedule(new Callable<Void>() {
+            public Void call() throws Exception {
+                System.err.println("Fail: killSwitch()");
+                current.interrupt();
+                return null;
+            }
+        }, 5000, TimeUnit.MILLISECONDS);
+    }
+
+    static class Server extends Thread {
+        final ServerSocket serverSock;
+
+        Server(ServerSocket serverSock) {
+            this.serverSock = serverSock;
+        }
+
+        public void run() {
+            try {
+                Socket socket = serverSock.accept();
+            } catch (IOException e) {}
+        }
+    }
+}
+
--- a/test/com/sun/jndi/ldap/LdapsReadTimeoutTest.java	Thu Oct 18 23:19:48 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,118 +0,0 @@
-/*
- * 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 7094377
- * @summary Com.sun.jndi.ldap.read.timeout doesn't work with ldaps.
- */
-
-import java.net.Socket;
-import java.net.ServerSocket;
-import java.io.*;
-import javax.naming.*;
-import javax.naming.directory.*;
-import java.util.Hashtable;
-
-public class LdapsReadTimeoutTest {
-
-    public static void main(String[] args) throws Exception {
-        boolean passed = false;
-
-        // create the server
-        try (Server server = Server.create()) {
-            // Set up the environment for creating the initial context
-            Hashtable<String,Object> env = new Hashtable<>(11);
-            env.put(Context.INITIAL_CONTEXT_FACTORY,
-                "com.sun.jndi.ldap.LdapCtxFactory");
-            env.put("com.sun.jndi.ldap.connect.timeout", "1000");
-            env.put("com.sun.jndi.ldap.read.timeout", "1000");
-            env.put(Context.PROVIDER_URL, "ldaps://localhost:" + server.port());
-
-
-            // Create initial context
-            DirContext ctx = new InitialDirContext(env);
-            try {
-                System.out.println("LDAP Client: Connected to the Server");
-
-                SearchControls scl = new SearchControls();
-                scl.setSearchScope(SearchControls.SUBTREE_SCOPE);
-                System.out.println("Performing Search");
-                NamingEnumeration<SearchResult> answer =
-                    ctx.search("ou=People,o=JNDITutorial", "(objectClass=*)", scl);
-            } finally {
-                // Close the context when we're done
-                ctx.close();
-            }
-        } catch (NamingException e) {
-            passed = true;
-            e.printStackTrace();
-        }
-
-        if (!passed) {
-            throw new Exception("Read timeout test failed," +
-                         " read timeout exception not thrown");
-        }
-        System.out.println("The test PASSED");
-    }
-
-    static class Server implements Runnable, Closeable {
-        private final ServerSocket ss;
-        private Socket sref;
-
-        private Server(ServerSocket ss) {
-            this.ss = ss;
-        }
-
-        static Server create() throws IOException {
-            Server server = new Server(new ServerSocket(0));
-            new Thread(server).start();
-            return server;
-        }
-
-        int port() {
-            return ss.getLocalPort();
-        }
-
-        public void run() {
-            try (Socket s = ss.accept()) {
-                sref = s;
-                System.out.println("Server: Connection accepted");
-                BufferedInputStream bis =
-                    new BufferedInputStream(s.getInputStream());
-                byte[] buf = new byte[100];
-                int n;
-                do {
-                    n = bis.read(buf);
-                } while (n > 0);
-            } catch (IOException e) {
-                // ignore
-            }
-        }
-
-        public void close() throws IOException {
-            ss.close();
-            sref.close();
-        }
-    }
-}
--- a/test/com/sun/jndi/ldap/ReadTimeoutTest.java	Thu Oct 18 23:19:48 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,104 +0,0 @@
-/*
- * 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 6176036
- * @summary Read-timeout specification for LDAP operations
- */
-
-import java.net.Socket;
-import java.net.ServerSocket;
-import java.io.*;
-import javax.naming.*;
-import javax.naming.directory.*;
-import java.util.Hashtable;
-
-public class ReadTimeoutTest {
-
-    public static void main(String[] args) throws Exception {
-
-        boolean passed = false;
-
-        // Set up the environment for creating the initial context
-        Hashtable env = new Hashtable(11);
-        env.put(Context.INITIAL_CONTEXT_FACTORY,
-            "com.sun.jndi.ldap.LdapCtxFactory");
-        env.put("com.sun.jndi.ldap.read.timeout", "1000");
-        env.put(Context.PROVIDER_URL, "ldap://localhost:2001");
-
-        Server s = new Server();
-
-        try {
-
-            // start the server
-            s.start();
-
-            // Create initial context
-            DirContext ctx = new InitialDirContext(env);
-            System.out.println("LDAP Client: Connected to the Server");
-
-            SearchControls scl = new SearchControls();
-            scl.setSearchScope(SearchControls.SUBTREE_SCOPE);
-            System.out.println("Performing Search");
-            NamingEnumeration answer =
-                ctx.search("ou=People,o=JNDITutorial", "(objectClass=*)", scl);
-
-            // Close the context when we're done
-            ctx.close();
-        } catch (NamingException e) {
-            passed = true;
-            e.printStackTrace();
-        }
-        s.interrupt();
-        if (!passed) {
-            throw new Exception("Read timeout test failed," +
-                         " read timeout exception not thrown");
-        }
-        System.out.println("The test PASSED");
-    }
-
-    static class Server extends Thread {
-
-        static int serverPort = 2001;
-
-        Server() {
-        }
-
-        public void run() {
-            try {
-                ServerSocket serverSock = new ServerSocket(serverPort);
-                Socket socket = serverSock.accept();
-                System.out.println("Server: Connection accepted");
-
-                BufferedInputStream bin = new BufferedInputStream(socket.
-                                getInputStream());
-                while (true) {
-                    bin.read();
-                }
-            } catch (IOException e) {
-                // ignore
-            }
-    }
-}
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/demo/zipfs/ZFSTests.java	Fri Oct 26 10:55:23 2012 -0700
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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 7156873
+   @summary ZipFileSystem regression tests
+ */
+
+
+import java.net.URI;
+import java.nio.file.*;
+import java.util.Map;
+import java.util.HashMap;
+
+public class ZFSTests {
+
+    public static void main(String[] args) throws Throwable {
+        test7156873();
+    }
+
+    static void test7156873() throws Throwable {
+        String DIRWITHSPACE = "testdir with spaces";
+        Path dir = Paths.get(DIRWITHSPACE);
+        Path path = Paths.get(DIRWITHSPACE, "file.zip");
+        try {
+            Files.createDirectory(dir);
+            URI uri = URI.create("jar:" + path.toUri());
+            Map<String, Object> env = new HashMap<String, Object>();
+            env.put("create", "true");
+            try (FileSystem fs = FileSystems.newFileSystem(uri, env)) {}
+        } finally {
+            Files.deleteIfExists(path);
+            Files.deleteIfExists(dir);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/event/KeyEvent/DeadKey/DeadKeyMacOSX.java	Fri Oct 26 10:55:23 2012 -0700
@@ -0,0 +1,138 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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 7196547
+ * @summary Dead Key implementation for KeyEvent on Mac OS X
+ * @author alexandr.scherbatiy area=awt.event
+ * @run main DeadKeyMacOSX
+ */
+
+import java.awt.*;
+import java.awt.event.*;
+import java.awt.event.KeyEvent;
+import sun.awt.OSInfo;
+import sun.awt.SunToolkit;
+
+public class DeadKeyMacOSX {
+
+    private static SunToolkit toolkit;
+    private static volatile int state = 0;
+
+    public static void main(String[] args) throws Exception {
+
+        if (OSInfo.getOSType() != OSInfo.OSType.MACOSX) {
+            return;
+        }
+
+        toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+        Robot robot = new Robot();
+        robot.setAutoDelay(50);
+
+        createAndShowGUI();
+
+        // Pressed keys: Alt + E + A
+        // Results:  ALT + VK_DEAD_ACUTE + a with accute accent
+        robot.keyPress(KeyEvent.VK_ALT);
+        robot.keyPress(KeyEvent.VK_E);
+        robot.keyRelease(KeyEvent.VK_E);
+        robot.keyRelease(KeyEvent.VK_ALT);
+
+        robot.keyPress(KeyEvent.VK_A);
+        robot.keyRelease(KeyEvent.VK_A);
+
+        if (state != 3) {
+            throw new RuntimeException("Wrong number of key events.");
+        }
+    }
+
+    static void createAndShowGUI() {
+        Frame frame = new Frame();
+        frame.setSize(300, 300);
+        Panel panel = new Panel();
+        panel.addKeyListener(new DeadKeyListener());
+        frame.add(panel);
+        frame.setVisible(true);
+        toolkit.realSync();
+
+        panel.requestFocusInWindow();
+        toolkit.realSync();
+    }
+
+    static class DeadKeyListener extends KeyAdapter {
+
+        @Override
+        public void keyPressed(KeyEvent e) {
+            int keyCode = e.getKeyCode();
+            char keyChar = e.getKeyChar();
+
+            switch (state) {
+                case 0:
+                    if (keyCode != KeyEvent.VK_ALT) {
+                        throw new RuntimeException("Alt is not pressed.");
+                    }
+                    state++;
+                    break;
+                case 1:
+                    if (keyCode != KeyEvent.VK_DEAD_ACUTE) {
+                        throw new RuntimeException("Dead ACUTE is not pressed.");
+                    }
+                    if (keyChar != 0xB4) {
+                        throw new RuntimeException("Pressed char is not dead acute.");
+                    }
+
+                    state++;
+                    break;
+                case 2:
+                    if (keyCode != KeyEvent.VK_A) {
+                        throw new RuntimeException("A is not pressed.");
+                    }
+                    if (keyChar != 0xE1) {
+                        throw new RuntimeException("A char does not have ACCUTE accent");
+                    }
+                    state++;
+                    break;
+                default:
+                    throw new RuntimeException("Excessive keyPressed event.");
+            }
+        }
+
+        @Override
+        public void keyTyped(KeyEvent e) {
+            int keyCode = e.getKeyCode();
+            char keyChar = e.getKeyChar();
+
+            if (state == 3) {
+                if (keyCode != 0) {
+                    throw new RuntimeException("Key code should be undefined.");
+                }
+                if (keyChar != 0xE1) {
+                    throw new RuntimeException("A char does not have ACCUTE accent");
+                }
+            } else {
+                throw new RuntimeException("Wron number of keyTyped events.");
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/event/KeyEvent/DeadKey/DeadKeyMacOSXInputText.java	Fri Oct 26 10:55:23 2012 -0700
@@ -0,0 +1,131 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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 7199180
+ * @summary [macosx] Dead keys handling for input methods
+ * @author alexandr.scherbatiy area=awt.event
+ * @run main DeadKeyMacOSXInputText
+ */
+import java.awt.*;
+import java.awt.event.*;
+import java.awt.event.KeyEvent;
+import javax.swing.JTextField;
+import sun.awt.OSInfo;
+import sun.awt.SunToolkit;
+
+public class DeadKeyMacOSXInputText {
+
+    private static SunToolkit toolkit;
+    private static volatile int state = 0;
+
+    public static void main(String[] args) throws Exception {
+
+        if (OSInfo.getOSType() != OSInfo.OSType.MACOSX) {
+            return;
+        }
+
+        toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+        Robot robot = new Robot();
+        robot.setAutoDelay(50);
+
+        createAndShowGUI();
+
+        // Pressed keys: Alt + E + A
+        // Results:  ALT + VK_DEAD_ACUTE + a with accute accent
+        robot.keyPress(KeyEvent.VK_ALT);
+        robot.keyPress(KeyEvent.VK_E);
+        robot.keyRelease(KeyEvent.VK_E);
+        robot.keyRelease(KeyEvent.VK_ALT);
+
+        robot.keyPress(KeyEvent.VK_A);
+        robot.keyRelease(KeyEvent.VK_A);
+        toolkit.realSync();
+
+        if (state != 3) {
+            throw new RuntimeException("Wrong number of key events.");
+        }
+    }
+
+    static void createAndShowGUI() {
+        Frame frame = new Frame();
+        frame.setSize(300, 300);
+        Panel panel = new Panel(new BorderLayout());
+        JTextField textField = new JTextField();
+        textField.addKeyListener(new DeadKeyListener());
+        panel.add(textField, BorderLayout.CENTER);
+        frame.add(panel);
+        frame.setVisible(true);
+        toolkit.realSync();
+
+        textField.requestFocusInWindow();
+        toolkit.realSync();
+
+    }
+
+    static class DeadKeyListener extends KeyAdapter {
+
+        @Override
+        public void keyPressed(KeyEvent e) {
+            int keyCode = e.getKeyCode();
+            char keyChar = e.getKeyChar();
+
+            switch (state) {
+                case 0:
+                    if (keyCode != KeyEvent.VK_ALT) {
+                        throw new RuntimeException("Alt is not pressed.");
+                    }
+                    state++;
+                    break;
+                case 1:
+                    if (keyCode != KeyEvent.VK_DEAD_ACUTE) {
+                        throw new RuntimeException("Dead ACUTE is not pressed.");
+                    }
+                    if (keyChar != 0xB4) {
+                        throw new RuntimeException("Pressed char is not dead acute.");
+                    }
+                    state++;
+                    break;
+            }
+        }
+
+        @Override
+        public void keyTyped(KeyEvent e) {
+            int keyCode = e.getKeyCode();
+            char keyChar = e.getKeyChar();
+
+            if (state == 2) {
+                if (keyCode != 0) {
+                    throw new RuntimeException("Key code should be undefined.");
+                }
+                if (keyChar != 0xE1) {
+                    throw new RuntimeException("A char does not have ACCUTE accent");
+                }
+                state++;
+            } else {
+                throw new RuntimeException("Wron number of keyTyped events.");
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/io/File/MacPathTest.java	Fri Oct 26 10:55:23 2012 -0700
@@ -0,0 +1,166 @@
+/*
+ * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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 7130915
+ * @summary Tests file path with nfc/nfd forms on MacOSX
+ * @build MacPathTest
+ * @run shell MacPathTest.sh
+ */
+
+import java.io.*;
+import java.text.*;
+import java.util.*;
+
+public class MacPathTest {
+
+    public static void main(String args[]) throws Throwable {
+        String osname = System.getProperty("os.name");
+        if (!osname.contains("OS X") && !osname.contains("Darwin"))
+            return;
+
+        // English
+        test("TestDir_apple",                                    // test dir
+             "dir_macosx",                                       // dir
+             "file_macosx");                                     // file
+
+        // Japanese composite character
+        test("TestDir_\u30c8\u30a4\u30e4\u30cb\u30ca\u30eb/",
+             "dir_\u30a4\u30c1\u30b4\u306e\u30b1\u30fc\u30ad",
+             "file_\u30a4\u30c1\u30b4\u306e\u30b1\u30fc\u30ad");
+
+        // latin-1 supplementory
+        test("TestDir_K\u00f6rperlich\u00e4\u00df/",
+             "dir_Entt\u00e4uschung",
+             "file_Entt\u00e4uschung");
+
+        test("TestDir_K\u00f6rperlich\u00e4\u00df/",
+             "dir_Entt\u00c4uschung",
+             "file_Entt\u00c4uschung");
+
+        // Korean syblla
+        test("TestDir_\uac00\uac01\uac02",
+             "dir_\uac20\uac21\uac22",
+             "file_\uacc0\uacc1\uacc2");
+    }
+
+    private static void removeAll(File file) throws Throwable {
+        if (file.isDirectory()) {
+            for (File f : file.listFiles()) {
+                removeAll(f);
+            }
+        }
+        file.delete();
+    }
+
+    private static boolean equal(Object x, Object y) {
+        return x == null ? y == null : x.equals(y);
+    }
+
+    private static boolean match(File target, File src) {
+        if (target.equals(src)) {
+            String fname = target.toString();
+            System.out.printf("    ->matched   : [%s], length=%d%n", fname, fname.length());
+            return true;
+        }
+        return false;
+    }
+
+    private static void open_read(String what, File file) throws Throwable {
+        try (FileInputStream fis = new FileInputStream(file)) {
+           byte[] bytes = new byte[10];
+           fis.read(bytes);
+           System.out.printf("    %s:%s%n", what, new String(bytes));
+        }
+    }
+
+    private static void test(String testdir, String dname, String fname_nfc)
+        throws Throwable
+    {
+        String fname = null;
+        String dname_nfd = Normalizer.normalize(dname, Normalizer.Form.NFD);
+        String fname_nfd = Normalizer.normalize(fname_nfc, Normalizer.Form.NFD);
+
+        System.out.printf("%n%n--------Testing...----------%n");
+        File base = new File(testdir);
+        File dir  = new File(base, dname);
+        File dir_nfd =  new File(base, dname_nfd);
+        File file_nfc = new File(base, fname_nfc);
+        File file_nfd = new File(base, fname_nfd);
+
+        System.out.printf("base           :[%s][len=%d]%n", testdir, testdir.length());
+        System.out.printf("dir            :[%s][len=%d]%n", dname, dname.length());
+        System.out.printf("fname_nfc      :[%s][len=%d]%n", fname_nfc, fname_nfc.length());
+        System.out.printf("fname_nfd      :[%s][len=%d]%n", fname_nfd, fname_nfd.length());
+
+        fname = file_nfc.toString();
+        System.out.printf("file_nfc ->[%s][len=%d]%n", fname, fname.length());
+        fname = file_nfd.toString();
+        System.out.printf("file_nfd ->[%s][len=%d]%n%n", fname, fname.length());
+
+        removeAll(base);
+        dir.mkdirs();
+
+        fname = dir.toString();
+        System.out.printf(":Directory [%s][len=%d] created%n", fname, fname.length());
+
+        //////////////////////////////////////////////////////////////
+        if (!dir.isDirectory() || !dir_nfd.isDirectory()) {
+            throw new RuntimeException("File.isDirectory() failed");
+        }
+
+        //////////////////////////////////////////////////////////////
+        // write to via nfd
+        try (FileOutputStream fos = new FileOutputStream(file_nfd)) {
+           fos.write('n'); fos.write('f'); fos.write('d');
+        }
+        open_read("read in with nfc (from nfd)", file_nfc);
+        file_nfd.delete();
+
+        //////////////////////////////////////////////////////////////
+        // write to with nfc
+        try (FileOutputStream fos = new FileOutputStream(file_nfc)) {
+           fos.write('n'); fos.write('f'); fos.write('c');
+        }
+        open_read("read in with nfd      (from nfc)", file_nfd);
+        //file_nfc.delete();
+
+        //////////////////////////////////////////////////////////////
+        boolean found_dir = false;
+        boolean found_file_nfc = false;
+        boolean found_file_nfd = false;
+
+        for (File f : base.listFiles()) {
+            fname = f.toString();
+            System.out.printf("Found   : [%s], length=%d%n", fname, fname.length());
+            found_dir      |= match(dir, f);
+            found_file_nfc |= match(file_nfc, f);
+            found_file_nfd |= match(file_nfd, f);
+        }
+
+        if (!found_dir || !found_file_nfc || !found_file_nfc) {
+            throw new RuntimeException("File.equal() failed");
+        }
+        removeAll(base);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/io/File/MacPathTest.sh	Fri Oct 26 10:55:23 2012 -0700
@@ -0,0 +1,39 @@
+#! /bin/sh
+
+#
+# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.
+#
+# 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.
+#
+#
+OS=`uname -s`
+case "$OS" in
+  Darwin ) ;;
+  * )
+    exit 0
+    ;;
+esac
+
+if [ "x$TESTJAVA" = x ]; then
+  TESTJAVA=$1; shift
+  TESTCLASSES=.
+fi
+
+export LC_ALL=en_US.UTF-8 ;${TESTJAVA}/bin/java -cp ${TESTCLASSES} MacPathTest
--- a/test/java/lang/ProcessBuilder/Basic.java	Thu Oct 18 23:19:48 2012 -0700
+++ b/test/java/lang/ProcessBuilder/Basic.java	Fri Oct 26 10:55:23 2012 -0700
@@ -36,9 +36,11 @@
 import static java.lang.ProcessBuilder.Redirect.*;
 
 import java.io.*;
+import java.lang.reflect.Field;
 import java.util.*;
 import java.util.concurrent.CountDownLatch;
 import java.security.*;
+import sun.misc.Unsafe;
 import java.util.regex.Pattern;
 import java.util.regex.Matcher;
 import static java.lang.System.getenv;
@@ -1908,17 +1910,21 @@
                 final byte[] bytes = new byte[10];
                 final Process p = new ProcessBuilder(childArgs).start();
                 final CountDownLatch latch = new CountDownLatch(1);
+                final InputStream s;
+                switch (action & 0x1) {
+                    case 0: s = p.getInputStream(); break;
+                    case 1: s = p.getErrorStream(); break;
+                    default: throw new Error();
+                }
                 final Thread thread = new Thread() {
                     public void run() {
                         try {
+                            int r;
                             latch.countDown();
-                            int r;
-                            switch (action) {
-                            case 0: r = p.getInputStream().read(); break;
-                            case 1: r = p.getErrorStream().read(); break;
-                            case 2: r = p.getInputStream().read(bytes); break;
-                            case 3: r = p.getErrorStream().read(bytes); break;
-                            default: throw new Error();
+                            switch (action & 0x2) {
+                                case 0: r = s.read(); break;
+                                case 2: r = s.read(bytes); break;
+                                default: throw new Error();
                             }
                             equal(-1, r);
                         } catch (Throwable t) { unexpected(t); }}};
@@ -1926,6 +1932,40 @@
                 thread.start();
                 latch.await();
                 Thread.sleep(10);
+
+                String os = System.getProperty("os.name");
+                if (os.equalsIgnoreCase("Solaris") ||
+                    os.equalsIgnoreCase("SunOS"))
+                {
+                    final Object deferred;
+                    Class<?> c = s.getClass();
+                    if (c.getName().equals(
+                        "java.lang.UNIXProcess$DeferredCloseInputStream"))
+                    {
+                        deferred = s;
+                    } else {
+                        Field deferredField = p.getClass().
+                            getDeclaredField("stdout_inner_stream");
+                        deferredField.setAccessible(true);
+                        deferred = deferredField.get(p);
+                    }
+                    Field useCountField = deferred.getClass().
+                        getDeclaredField("useCount");
+                    useCountField.setAccessible(true);
+
+                    while (useCountField.getInt(deferred) <= 0) {
+                        Thread.yield();
+                    }
+                } else if (s instanceof BufferedInputStream) {
+                    Field f = Unsafe.class.getDeclaredField("theUnsafe");
+                    f.setAccessible(true);
+                    Unsafe unsafe = (Unsafe)f.get(null);
+
+                    while (unsafe.tryMonitorEnter(s)) {
+                        unsafe.monitorExit(s);
+                        Thread.sleep(1);
+                    }
+                }
                 p.destroy();
                 thread.join();
             }
--- a/test/java/nio/channels/Selector/lots_of_updates.sh	Thu Oct 18 23:19:48 2012 -0700
+++ b/test/java/nio/channels/Selector/lots_of_updates.sh	Fri Oct 26 10:55:23 2012 -0700
@@ -46,4 +46,4 @@
     ulimit -n 2048
 fi
 
-${TESTJAVA}/bin/java LotsOfUpdates
+${TESTJAVA}/bin/java ${TESTVMOPTS} LotsOfUpdates
--- a/test/java/nio/channels/SocketChannel/Open.sh	Thu Oct 18 23:19:48 2012 -0700
+++ b/test/java/nio/channels/SocketChannel/Open.sh	Fri Oct 26 10:55:23 2012 -0700
@@ -29,7 +29,7 @@
     case "$OS" in
         SunOS )
             ulimit -n 100
-            $TESTJAVA/bin/java -classpath $TESTCLASSES Open ;;
+            $TESTJAVA/bin/java ${TESTVMOPTS} -classpath $TESTCLASSES Open ;;
         * )
             echo "unrecognized system: $OS" ;;
     esac
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/nio/file/Path/MacPathTest.java	Fri Oct 26 10:55:23 2012 -0700
@@ -0,0 +1,177 @@
+/*
+ * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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 7130915
+ * @summary Tests file path with nfc/nfd forms on MacOSX
+ * @library ../
+ * @build MacPathTest
+ * @run shell MacPathTest.sh
+ */
+
+import java.nio.file.*;
+import java.nio.file.attribute.*;
+import java.text.*;
+import java.util.*;
+import java.util.regex.*;
+
+public class MacPathTest {
+
+    public static void main(String args[]) throws Throwable {
+        String osname = System.getProperty("os.name");
+        if (!osname.contains("OS X") && !osname.contains("Darwin"))
+            return;
+        System.out.printf("sun.jnu.encoding=%s, file.encoding=%s%n",
+                          System.getProperty("file.encoding"),
+                          System.getProperty("sun.jnu.encoding"));
+        // English
+        test("TestDir_apple",                                    // test dir
+             "dir_macosx",                                       // dir
+             "file_macosx");                                     // file
+
+        // Japanese composite character
+        test("TestDir_\u30c8\u30a4\u30e4\u30cb\u30ca\u30eb/",
+             "dir_\u30a4\u30c1\u30b4\u306e\u30b1\u30fc\u30ad",
+             "file_\u30a4\u30c1\u30b4\u306e\u30b1\u30fc\u30ad");
+
+        // latin-1 supplementory
+        test("TestDir_K\u00f6rperlich\u00e4\u00df/",
+             "dir_Entt\u00e4uschung",
+             "file_Entt\u00e4uschung");
+
+        test("TestDir_K\u00f6rperlich\u00e4\u00df/",
+             "dir_Entt\u00c4uschung",
+             "file_Entt\u00c4uschung");
+
+        // Korean syblla
+        test("TestDir_\uac00\uac01\uac02",
+             "dir_\uac20\uac21\uac22",
+             "file_\uacc0\uacc1\uacc2");
+    }
+
+    private static boolean equal(Object x, Object y) {
+        return x == null ? y == null : x.equals(y);
+    }
+
+    private static boolean match(Path target, Path src) {
+        String fname = target.toString();
+        System.out.printf("    --> Trying  [%s], length=%d...", fname, fname.length());
+        if (target.equals(src)) {
+            System.out.println(" MATCHED!");
+            return true;
+        } else {
+            System.out.println(" NOT MATCHED!");
+        }
+        return false;
+    }
+
+    private static void test(String testdir, String dname, String fname_nfc)
+        throws Throwable
+    {
+        String fname = null;
+        String dname_nfd = Normalizer.normalize(dname, Normalizer.Form.NFD);
+        String fname_nfd = Normalizer.normalize(fname_nfc, Normalizer.Form.NFD);
+
+        System.out.printf("%n%n--------Testing...----------%n");
+        Path bpath = Paths.get(testdir);
+        Path dpath = Paths.get(testdir, dname);
+        Path dpath_nfd = Paths.get(testdir, dname_nfd);
+        Path fpath_nfc = Paths.get(testdir, fname_nfc);
+        Path fpath_nfd = Paths.get(testdir, fname_nfd);
+
+        if (Files.exists(bpath))
+            TestUtil.removeAll(bpath);
+        Files.createDirectories(dpath);
+
+        fname = dpath.toString();
+        System.out.printf(":Directory [%s][len=%d] created%n", fname, fname.length());
+
+        //////////////////////////////////////////////////////////////
+        if (!Files.isDirectory(dpath) || !Files.isDirectory(dpath_nfd)) {
+            throw new RuntimeException("Files.isDirectory(...) failed");
+        }
+
+        //////////////////////////////////////////////////////////////
+        // write out with nfd, read in with nfc + case
+        Files.write(fpath_nfd, new byte[] { 'n', 'f', 'd'});
+        System.out.println("    read in with nfc      (from nfd):" + new String(Files.readAllBytes(fpath_nfc)));
+
+        // check attrs with nfc + case
+        Set<PosixFilePermission> pfp = Files.getPosixFilePermissions(fpath_nfd);
+        if (!equal(pfp, Files.getPosixFilePermissions(fpath_nfc)) ) {
+            throw new RuntimeException("Files.getPosixfilePermission(...) failed");
+        }
+        Files.delete(fpath_nfd);
+
+        // write out with nfc, read in with nfd + case
+        Files.write(fpath_nfc, new byte[] { 'n', 'f', 'c'});
+        System.out.println("    read in with nfd      (from nfc):" + new String(Files.readAllBytes(fpath_nfd)));
+
+        // check attrs with nfc + case
+        pfp = Files.getPosixFilePermissions(fpath_nfc);
+        if (!equal(pfp, Files.getPosixFilePermissions(fpath_nfd))) {
+            throw new RuntimeException("Files.getPosixfilePermission(...) failed");
+        }
+        //////////////////////////////////////////////////////////////
+        boolean found_dir = false;
+        boolean found_file_nfc = false;
+        boolean found_file_nfd = false;
+        try (DirectoryStream<Path> stream = Files.newDirectoryStream(bpath)) {
+            for (Path path: stream) {
+                fname = path.toString();
+                System.out.printf("Found   : [%s], length=%d%n", fname, fname.length());
+                found_dir      |= match(dpath, path);
+                found_file_nfc |= match(fpath_nfc, path);
+                found_file_nfd |= match(fpath_nfd, path);
+            }
+        }
+        if (!found_dir || !found_file_nfc || !found_file_nfd) {
+            throw new RuntimeException("File.equal() failed");
+        }
+        // glob
+        String glob = "*" + fname_nfd.substring(2);  // remove leading "FI" from "FILE..."
+        System.out.println("glob=" + glob);
+        boolean globmatched = false;
+        try (DirectoryStream<Path> stream = Files.newDirectoryStream(bpath, glob)) {
+            for (Path path: stream) {
+                fname = path.toString();
+                System.out.printf("PathMatch : [%s], length=%d%n", fname, fname.length());
+                globmatched |= match(fpath_nfc, path);
+            }
+        }
+        if (!globmatched) {
+            //throw new RuntimeException("path matcher failed");
+            // it appears we have a regex.anon_eq bug in hangul syllable handling
+            System.out.printf("pathmatcher failed, glob=[%s]%n", glob);
+            System.out.printf("    -> fname_nfd.matches(fname_nfc)=%b%n",
+                              Pattern.compile(fname_nfd, Pattern.CANON_EQ)
+                                     .matcher(fname_nfc)
+                                     .matches());
+            System.out.printf("    -> fname_nfc.matches(fname_nfd)=%b%n",
+                              Pattern.compile(fname_nfc, Pattern.CANON_EQ)
+                                     .matcher(fname_nfd)
+                                     .matches());
+        }
+        TestUtil.removeAll(bpath);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/nio/file/Path/MacPathTest.sh	Fri Oct 26 10:55:23 2012 -0700
@@ -0,0 +1,39 @@
+#! /bin/sh
+
+#
+# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.
+#
+# 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.
+#
+#
+OS=`uname -s`
+case "$OS" in
+  Darwin )  ;;
+  * )
+    exit 0
+    ;;
+esac
+
+if [ "x$TESTJAVA" = x ]; then
+  TESTJAVA=$1; shift
+  TESTCLASSES=.
+fi
+
+export LC_ALL=en_US.UTF-8; ${TESTJAVA}/bin/java -cp ${TESTCLASSES} MacPathTest
--- a/test/java/util/Map/Collisions.java	Thu Oct 18 23:19:48 2012 -0700
+++ b/test/java/util/Map/Collisions.java	Fri Oct 26 10:55:23 2012 -0700
@@ -24,6 +24,8 @@
 /*
  * @test
  * @bug 7126277
+ * @run main Collisions -shortrun
+ * @run main/othervm -Djdk.map.althashing.threshold=0 Collisions -shortrun
  * @summary Ensure Maps behave well with lots of hashCode() collisions.
  * @author Mike Duigou
  */
@@ -33,6 +35,11 @@
 
 public class Collisions {
 
+    /**
+     * Number of elements per map.
+     */
+    private static final int TEST_SIZE = 5000;
+
     final static class HashableInteger implements Comparable<HashableInteger> {
 
         final int value;
@@ -64,20 +71,19 @@
             return value - o.value;
         }
 
+        @Override
         public String toString() {
             return Integer.toString(value);
         }
     }
-    private static final int ITEMS = 5000;
-    private static final Object KEYS[][];
 
-    static {
-        HashableInteger UNIQUE_OBJECTS[] = new HashableInteger[ITEMS];
-        HashableInteger COLLIDING_OBJECTS[] = new HashableInteger[ITEMS];
-        String UNIQUE_STRINGS[] = new String[ITEMS];
-        String COLLIDING_STRINGS[] = new String[ITEMS];
+    private static Object[][] makeTestData(int size) {
+        HashableInteger UNIQUE_OBJECTS[] = new HashableInteger[size];
+        HashableInteger COLLIDING_OBJECTS[] = new HashableInteger[size];
+        String UNIQUE_STRINGS[] = new String[size];
+        String COLLIDING_STRINGS[] = new String[size];
 
-        for (int i = 0; i < ITEMS; i++) {
+        for (int i = 0; i < size; i++) {
             UNIQUE_OBJECTS[i] = new HashableInteger(i, Integer.MAX_VALUE);
             COLLIDING_OBJECTS[i] = new HashableInteger(i, 10);
             UNIQUE_STRINGS[i] = unhash(i);
@@ -86,7 +92,7 @@
                     : "\u0000\u0000\u0000\u0000\u0000" + COLLIDING_STRINGS[i - 1];
         }
 
-     KEYS = new Object[][] {
+     return new Object[][] {
             new Object[]{"Unique Objects", UNIQUE_OBJECTS},
             new Object[]{"Colliding Objects", COLLIDING_OBJECTS},
             new Object[]{"Unique Strings", UNIQUE_STRINGS},
@@ -132,23 +138,29 @@
     }
 
     private static void realMain(String[] args) throws Throwable {
-        for (Object[] keys_desc : KEYS) {
-            Map<Object, Object>[] MAPS = (Map<Object, Object>[]) new Map[]{
+        boolean shortRun = args.length > 0 && args[0].equals("-shortrun");
+
+        Object[][] mapKeys = makeTestData(shortRun ? (TEST_SIZE / 2) : TEST_SIZE);
+
+        // loop through data sets
+        for (Object[] keys_desc : mapKeys) {
+            Map<Object, Object>[] maps = (Map<Object, Object>[]) new Map[]{
+                        new HashMap<>(),
                         new Hashtable<>(),
-                        new HashMap<>(),
                         new IdentityHashMap<>(),
                         new LinkedHashMap<>(),
+                        new TreeMap<>(),
+                        new WeakHashMap<>(),
                         new ConcurrentHashMap<>(),
-                        new WeakHashMap<>(),
-                        new TreeMap<>(),
                         new ConcurrentSkipListMap<>()
                     };
 
-            for (Map<Object, Object> map : MAPS) {
+            // for each map type.
+            for (Map<Object, Object> map : maps) {
                 String desc = (String) keys_desc[0];
                 Object[] keys = (Object[]) keys_desc[1];
                 try {
-                testMap(map, desc, keys);
+                    testMap(map, desc, keys);
                 } catch(Exception all) {
                     unexpected("Failed for " + map.getClass().getName() + " with " + desc, all);
                 }
@@ -397,7 +409,7 @@
     }
 
     public static void main(String[] args) throws Throwable {
-        Thread.currentThread().setName("Collisions");
+        Thread.currentThread().setName(Collisions.class.getName());
 //        Thread.currentThread().setPriority(Thread.MAX_PRIORITY);
         try {
             realMain(args);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/util/Map/EntryHashCode.java	Fri Oct 26 10:55:23 2012 -0700
@@ -0,0 +1,110 @@
+/*
+ * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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.
+ */
+
+/*
+ * Portions Copyright (c) 2012 IBM Corporation
+ */
+
+/*
+ * @test
+ * @bug 8000955
+ * @summary Map.Entry implementations need to comply with Map.Entry.hashCode() defined behaviour.
+ * @author ngmr
+ * @run main/othervm -Djdk.map.althashing.threshold=1 EntryHashCode
+ */
+import java.util.*;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentSkipListMap;
+
+public class EntryHashCode {
+    private static final int TEST_SIZE = 100;
+
+    static final Object[][] entryData = {
+        new Object[TEST_SIZE],
+        new Object[TEST_SIZE]
+    };
+
+    @SuppressWarnings("unchecked")
+    static final Map<Object,Object>[] maps = (Map<Object,Object>[])new Map[] {
+        new HashMap<>(),
+        new Hashtable<>(),
+        new IdentityHashMap<>(),
+        new LinkedHashMap<>(),
+        new TreeMap<>(),
+        new WeakHashMap<>(),
+        new ConcurrentHashMap<>(),
+        new ConcurrentSkipListMap<>()
+    };
+
+    static {
+        for (int i = 0; i < entryData[0].length; i++) {
+            // key objects need to be Comparable for use in TreeMap
+            entryData[0][i] = new Comparable<Object>() {
+                public int compareTo(Object o) {
+                    return (hashCode() - o.hashCode());
+                }
+            };
+            entryData[1][i] = new Object();
+        }
+    }
+
+    private static void addTestData(Map<Object,Object> map) {
+        for (int i = 0; i < entryData[0].length; i++) {
+            map.put(entryData[0][i], entryData[1][i]);
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        Exception failure = null;
+        for (Map<Object,Object> map: maps) {
+            addTestData(map);
+
+            try {
+                for (Map.Entry<Object,Object> e: map.entrySet()) {
+                    Object key = e.getKey();
+                    Object value = e.getValue();
+                    int expectedEntryHashCode =
+                        (Objects.hashCode(key) ^ Objects.hashCode(value));
+
+                    if (e.hashCode() != expectedEntryHashCode) {
+                        throw new Exception("FAILURE: " +
+                                e.getClass().getName() +
+                                ".hashCode() does not conform to defined" +
+                                " behaviour of java.util.Map.Entry.hashCode()");
+                    }
+                }
+            } catch (Exception e) {
+                if (failure == null) {
+                    failure = e;
+                } else {
+                    failure.addSuppressed(e);
+                }
+            } finally {
+                map.clear();
+            }
+        }
+        if (failure != null) {
+            throw failure;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/util/prefs/CheckUserPrefFirst.java	Fri Oct 26 10:55:23 2012 -0700
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.util.prefs.Preferences;
+
+/**
+ *
+ * @author khazra
+ * First class called by CheckUserPrefsStorage.sh to create and
+ * store a user preference
+ */
+
+public class CheckUserPrefFirst {
+
+    public static void main(String[] args) throws Exception {
+        Preferences prefs = Preferences.userNodeForPackage(CheckUserPrefFirst.class);
+        prefs.put("Check", "Success");
+        prefs.flush();
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/util/prefs/CheckUserPrefLater.java	Fri Oct 26 10:55:23 2012 -0700
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.util.prefs.Preferences;
+
+/**
+ * CheckUserPrefsStorage.sh uses this to check that preferences stored
+ * by CheckUserPrefFirst.java can be retrieved
+ * @author khazra
+ */
+
+public class CheckUserPrefLater {
+
+    public static void main(String[] args) throws Exception {
+        Preferences prefs = Preferences.userNodeForPackage(CheckUserPrefFirst.class);
+        String result = prefs.get("Check", null);
+        if ((result == null) || !(result.equals("Success")))
+            throw new RuntimeException("User pref not stored!");
+        prefs.remove("Check");
+        prefs.flush();
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/util/prefs/CheckUserPrefsStorage.sh	Fri Oct 26 10:55:23 2012 -0700
@@ -0,0 +1,68 @@
+#
+# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.
+#
+# 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 7198073
+# @build CheckUserPrefFirst CheckUserPrefLater
+# @run shell CheckUserPrefsStorage.sh
+# @summary Tests that user preferences are stored in the 
+#          permanent storage
+#
+
+OS=`uname -s`
+case "$OS" in
+  SunOS | Linux | Darwin )
+    PS=":"
+    FS="/"
+    ;;
+  CYGWIN* )
+    PS=";"
+    FS="/"
+    ;;
+  Windows* )
+    PS=";"
+    FS="\\"
+    ;;
+  * )
+    echo "Unrecognized system!"
+    exit 1;
+    ;;
+esac
+
+# run CheckUserPrefFirst - creates and stores a user pref
+${TESTJAVA}${FS}bin${FS}java -cp ${TESTCLASSES} CheckUserPrefFirst
+result=$?
+if [ "$result" -ne "0" ]; then
+    exit 1
+fi
+
+# run CheckUserPrefLater - Looks for the stored pref
+${TESTJAVA}${FS}bin${FS}java -cp ${TESTCLASSES} CheckUserPrefLater
+result=$?
+if [ "$result" -ne "0" ]; then
+    exit 1
+fi
+
+# no failures, exit.
+exit 0
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/AncestorNotifier/7193219/bug7193219.java	Fri Oct 26 10:55:23 2012 -0700
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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 7193219
+   @summary JComboBox serialization fails in JDK 1.7
+   @author Anton Litvinov
+*/
+
+import java.io.*;
+
+import javax.swing.*;
+
+public class bug7193219 {
+    private static byte[] serializeGUI() {
+        // Create and set up the window.
+        JFrame frame = new JFrame("Serialization");
+        JPanel mainPanel = new JPanel();
+
+        /**
+         * If JComboBox is replaced with other component like JLabel
+         * The issue does not happen.
+         */
+        JComboBox status = new JComboBox();
+        status.addItem("123");
+        mainPanel.add(status);
+        frame.getContentPane().add(mainPanel);
+        frame.pack();
+
+        try {
+            ByteArrayOutputStream baos = new ByteArrayOutputStream();
+            ObjectOutputStream oos = new ObjectOutputStream(baos);
+            oos.writeObject(mainPanel);
+            oos.flush();
+            frame.dispose();
+            return baos.toByteArray();
+        } catch (IOException ioe) {
+            throw new RuntimeException(ioe);
+        }
+    }
+
+    private static void deserializeGUI(byte[] serializedData) {
+        try {
+            ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(serializedData));
+            JPanel mainPanel = (JPanel)ois.readObject();
+            JFrame frame = new JFrame("Deserialization");
+            frame.getContentPane().add(mainPanel);
+            frame.pack();
+            frame.dispose();
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                deserializeGUI(serializeGUI());
+            }
+        });
+    }
+}
--- a/test/sun/nio/ch/SelProvider.java	Thu Oct 18 23:19:48 2012 -0700
+++ b/test/sun/nio/ch/SelProvider.java	Fri Oct 26 10:55:23 2012 -0700
@@ -31,19 +31,23 @@
 
 public class SelProvider {
     public static void main(String[] args) throws Exception {
-        String osname = System.getProperty("os.name");
-        String osver = System.getProperty("os.version");
-        String spName = SelectorProvider.provider().getClass().getName();
-        String expected = null;
-        if ("SunOS".equals(osname)) {
-            expected = "sun.nio.ch.DevPollSelectorProvider";
-        } else if ("Linux".equals(osname)) {
-            expected = "sun.nio.ch.EPollSelectorProvider";
-        } else if (osname.contains("OS X")) {
-            expected = "sun.nio.ch.KQueueSelectorProvider";
-        } else
-            return;
-        if (!spName.equals(expected))
+        String expected = System.getProperty("java.nio.channels.spi.SelectorProvider");
+        if (expected == null) {
+            String osname = System.getProperty("os.name");
+            String osver = System.getProperty("os.version");
+            if ("SunOS".equals(osname)) {
+                expected = "sun.nio.ch.DevPollSelectorProvider";
+            } else if ("Linux".equals(osname)) {
+                expected = "sun.nio.ch.EPollSelectorProvider";
+            } else if (osname.contains("OS X")) {
+                expected = "sun.nio.ch.KQueueSelectorProvider";
+            } else {
+                return;
+            }
+        }
+        String cn = SelectorProvider.provider().getClass().getName();
+        System.out.println(cn);
+        if (!cn.equals(expected))
             throw new Exception("failed");
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/security/krb5/auto/UseCacheAndStoreKey.java	Fri Oct 26 10:55:23 2012 -0700
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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 7201053
+ * @summary Krb5LoginModule shows NPE when both useTicketCache and storeKey
+ *          are set to true
+ * @compile -XDignore.symbol.file UseCacheAndStoreKey.java
+ * @run main/othervm UseCacheAndStoreKey
+ */
+
+import java.io.FileOutputStream;
+import javax.security.auth.login.LoginException;
+
+// The basic krb5 test skeleton you can copy from
+public class UseCacheAndStoreKey {
+
+    public static void main(String[] args) throws Exception {
+
+        new OneKDC(null).writeJAASConf();
+
+        // KDC would save ccache for client
+        System.setProperty("test.kdc.save.ccache", "cache.here");
+        try (FileOutputStream fos = new FileOutputStream(OneKDC.JAAS_CONF)) {
+            fos.write((
+                "me {\n" +
+                "    com.sun.security.auth.module.Krb5LoginModule required\n" +
+                "    principal=\"" + OneKDC.USER + "\"\n" +
+                "    useTicketCache=true\n" +
+                "    ticketCache=cache.here\n" +
+                "    isInitiator=true\n" +
+                "    storeKey=true;\n};\n"
+                ).getBytes());
+        }
+
+        // The first login will use default callback and succeed
+        Context.fromJAAS("me");
+
+        // The second login uses ccache and won't be able to store the keys
+        try {
+            Context.fromJAAS("me");
+            throw new Exception("Should fail");
+        } catch (LoginException le) {
+            if (le.getMessage().indexOf("NullPointerException") >= 0
+                    || le.getCause() instanceof NullPointerException) {
+                throw new Exception("NPE");
+            }
+        }
+    }
+}
--- a/test/sun/security/krb5/ccache/EmptyCC.java	Thu Oct 18 23:19:48 2012 -0700
+++ b/test/sun/security/krb5/ccache/EmptyCC.java	Fri Oct 26 10:55:23 2012 -0700
@@ -24,9 +24,11 @@
 /*
  * @test
  * @bug 7158329
+ * @bug 8001208
  * @summary NPE in sun.security.krb5.Credentials.acquireDefaultCreds()
  * @compile -XDignore.symbol.file EmptyCC.java
- * @run main EmptyCC
+ * @run main EmptyCC tmpcc
+ * @run main EmptyCC FILE:tmpcc
  */
 import java.io.File;
 import java.io.InputStream;
@@ -40,9 +42,9 @@
 public class EmptyCC {
     public static void main(String[] args) throws Exception {
         final PrincipalName pn = new PrincipalName("dummy@FOO.COM");
-        final String ccache = "tmpcc";
+        final String ccache = args[0];
 
-        if (args.length == 0) {
+        if (args.length == 1) {
             // Main process, write the ccache and launch sub process
             CredentialsCache cache = CredentialsCache.create(pn, ccache);
             cache.save();
@@ -54,6 +56,7 @@
                     "-cp",
                     System.getProperty("test.classes"),
                     "EmptyCC",
+                    ccache,
                     "readcc"
                     );
 
@@ -77,6 +80,14 @@
             if (!cc.equals(ccache)) {
                 throw new Exception("env not set correctly");
             }
+            // 8001208: Fix for KRB5CCNAME not complete
+            // Make sure the ccache is created with bare file name
+            if (CredentialsCache.getInstance() == null) {
+                throw new Exception("Cache not instantiated");
+            }
+            if (!new File("tmpcc").exists()) {
+                throw new Exception("File not found");
+            }
             Credentials.acquireTGTFromCache(pn, null);
         }
     }