changeset 6479:3979e4d22028

Merge
author coffeys
date Wed, 17 Jul 2013 23:49:37 +0100
parents d76eee9b4820 3730baa74076
children 84101d9f6c3a
files
diffstat 67 files changed, 1188 insertions(+), 447 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Thu Jul 11 09:21:09 2013 +0200
+++ b/.hgtags	Wed Jul 17 23:49:37 2013 +0100
@@ -325,3 +325,5 @@
 60d52db33828bf0355a94be2a82df90c901592f3 jdk7u40-b30
 c2522d149ff6663ed1d3602c88c286cff25a43a7 jdk7u40-b31
 b9f86896cd0aa9b83e472a90b20ae7c253fba633 jdk7u40-b32
+419939ecee8311c8a38ff624ae67e473f8c60e51 jdk7u40-b33
+7c1d6fc3b6da19c7b7c0aad0716a2d810dbb974b jdk7u40-b34
--- a/make/sun/security/pkcs11/mapfile-vers	Thu Jul 11 09:21:09 2013 +0200
+++ b/make/sun/security/pkcs11/mapfile-vers	Wed Jul 17 23:49:37 2013 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -102,7 +102,7 @@
 		Java_sun_security_pkcs11_Secmod_nssGetLibraryHandle;
 		Java_sun_security_pkcs11_Secmod_nssLoadLibrary;
 		Java_sun_security_pkcs11_Secmod_nssVersionCheck;
-		Java_sun_security_pkcs11_Secmod_nssInit;
+		Java_sun_security_pkcs11_Secmod_nssInitialize;
 		Java_sun_security_pkcs11_Secmod_nssGetModuleList;
 
 	local:
--- a/src/macosx/classes/com/apple/eawt/FullScreenHandler.java	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/macosx/classes/com/apple/eawt/FullScreenHandler.java	Wed Jul 17 23:49:37 2013 +0100
@@ -32,6 +32,7 @@
 import javax.swing.RootPaneContainer;
 
 import com.apple.eawt.AppEvent.FullScreenEvent;
+import sun.awt.SunToolkit;
 
 final class FullScreenHandler {
     private static final String CLIENT_PROPERTY = "com.apple.eawt.event.internalFullScreenHandler";
@@ -73,7 +74,7 @@
     static void handleFullScreenEventFromNative(final Window window, final int type) {
         if (!(window instanceof RootPaneContainer)) return; // handles null
 
-        EventQueue.invokeLater(new Runnable() {
+        SunToolkit.executeOnEventHandlerThread(window, new Runnable() {
             public void run() {
                 final FullScreenHandler handler = getHandlerFor((RootPaneContainer)window);
                 if (handler != null) handler.notifyListener(new FullScreenEvent(window), type);
--- a/src/macosx/classes/com/apple/eawt/_AppEventHandler.java	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/macosx/classes/com/apple/eawt/_AppEventHandler.java	Wed Jul 17 23:49:37 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,8 @@
 import java.net.*;
 import java.util.*;
 import java.util.List;
+import sun.awt.AppContext;
+import sun.awt.SunToolkit;
 
 import com.apple.eawt.AppEvent.*;
 
@@ -269,11 +271,9 @@
     }
 
     class _AppReOpenedDispatcher extends _AppEventMultiplexor<AppReOpenedListener> {
-        void performOnListeners(final List<AppReOpenedListener> listeners, final _NativeEvent event) {
+        void performOnListener(AppReOpenedListener listener, final _NativeEvent event) {
             final AppReOpenedEvent e = new AppReOpenedEvent();
-            for (final AppReOpenedListener listener : listeners) {
-                listener.appReOpened(e);
-            }
+            listener.appReOpened(e);
         }
     }
 
@@ -415,50 +415,67 @@
     }
 
     abstract class _AppEventMultiplexor<L> {
-        final List<L> _listeners = new ArrayList<L>(0);
+        private final Map<L, AppContext> listenerToAppContext =
+                new IdentityHashMap<L, AppContext>();
         boolean nativeListenerRegistered;
 
         // called from AppKit Thread-0
         void dispatch(final _NativeEvent event, final Object... args) {
-            // grab a local ref to the listeners
-            final List<L> localListeners;
+            // grab a local ref to the listeners and its contexts as an array of the map's entries
+            final ArrayList<Map.Entry<L, AppContext>> localEntries;
             synchronized (this) {
-                if (_listeners.size() == 0) return;
-                localListeners = new ArrayList<L>(_listeners);
+                if (listenerToAppContext.size() == 0) {
+                    return;
+                }
+                localEntries = new ArrayList<Map.Entry<L, AppContext>>(listenerToAppContext.size());
+                localEntries.addAll(listenerToAppContext.entrySet());
             }
 
-            EventQueue.invokeLater(new Runnable() {
-                public void run() {
-                    performOnListeners(localListeners, event);
-                }
-            });
+            for (final Map.Entry<L, AppContext> e : localEntries) {
+                final L listener = e.getKey();
+                final AppContext listenerContext = e.getValue();
+                SunToolkit.invokeLaterOnAppContext(listenerContext, new Runnable() {
+                    public void run() {
+                        performOnListener(listener, event);
+                    }
+                });
+            }
         }
 
         synchronized void addListener(final L listener) {
+            setListenerContext(listener, AppContext.getAppContext());
+
             if (!nativeListenerRegistered) {
                 registerNativeListener();
                 nativeListenerRegistered = true;
             }
-            _listeners.add(listener);
         }
 
         synchronized void removeListener(final L listener) {
-            _listeners.remove(listener);
+            listenerToAppContext.remove(listener);
         }
 
-        abstract void performOnListeners(final List<L> listeners, final _NativeEvent event);
+        abstract void performOnListener(L listener, final _NativeEvent event);
         void registerNativeListener() { }
+
+        private void setListenerContext(L listener, AppContext listenerContext) {
+            if (listenerContext == null) {
+                throw new RuntimeException(
+                        "Attempting to add a listener from a thread group without AppContext");
+            }
+            listenerToAppContext.put(listener, AppContext.getAppContext());
+        }
     }
 
     abstract class _BooleanAppEventMultiplexor<L, E> extends _AppEventMultiplexor<L> {
         @Override
-        void performOnListeners(final List<L> listeners, final _NativeEvent event) {
+        void performOnListener(L listener, final _NativeEvent event) {
             final boolean isTrue = Boolean.TRUE.equals(event.get(0));
             final E e = createEvent(isTrue);
             if (isTrue) {
-                for (final L listener : listeners) performTrueEventOn(listener, e);
+                performTrueEventOn(listener, e);
             } else {
-                for (final L listener : listeners) performFalseEventOn(listener, e);
+                performFalseEventOn(listener, e);
             }
         }
 
@@ -479,30 +496,34 @@
      */
     abstract class _AppEventDispatcher<H> {
         H _handler;
+        AppContext handlerContext;
 
         // called from AppKit Thread-0
         void dispatch(final _NativeEvent event) {
-            EventQueue.invokeLater(new Runnable() {
-                public void run() {
-                    // grab a local ref to the handler
-                    final H localHandler;
-                    synchronized (_AppEventDispatcher.this) {
-                        localHandler = _handler;
-                    }
+            // grab a local ref to the handler
+            final H localHandler;
+            final AppContext localHandlerContext;
+            synchronized (_AppEventDispatcher.this) {
+                localHandler = _handler;
+                localHandlerContext = handlerContext;
+            }
 
-                    // invoke the handler outside of the synchronized block
-                    if (localHandler == null) {
-                        performDefaultAction(event);
-                    } else {
+            if (localHandler == null) {
+                performDefaultAction(event);
+            } else {
+                SunToolkit.invokeLaterOnAppContext(localHandlerContext, new Runnable() {
+                    public void run() {
                         performUsing(localHandler, event);
                     }
-                }
-            });
+                });
+            }
         }
 
         synchronized void setHandler(final H handler) {
             this._handler = handler;
 
+            setHandlerContext(AppContext.getAppContext());
+
             // if a new handler is installed, block addition of legacy ApplicationListeners
             if (handler == legacyHandler) return;
             legacyHandler.blockLegacyAPI();
@@ -510,6 +531,15 @@
 
         void performDefaultAction(final _NativeEvent event) { } // by default, do nothing
         abstract void performUsing(final H handler, final _NativeEvent event);
+
+        protected void setHandlerContext(AppContext ctx) {
+            if (ctx == null) {
+                throw new RuntimeException(
+                        "Attempting to set a handler from a thread group without AppContext");
+            }
+
+            handlerContext = ctx;
+        }
     }
 
     abstract class _QueuingAppEventDispatcher<H> extends _AppEventDispatcher<H> {
@@ -531,6 +561,8 @@
         synchronized void setHandler(final H handler) {
             this._handler = handler;
 
+            setHandlerContext(AppContext.getAppContext());
+
             // dispatch any events in the queue
             if (queuedEvents != null) {
                 // grab a local ref to the queue, so the real one can be nulled out
--- a/src/macosx/classes/com/apple/eawt/event/GestureHandler.java	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/macosx/classes/com/apple/eawt/event/GestureHandler.java	Wed Jul 17 23:49:37 2013 +0100
@@ -25,6 +25,8 @@
 
 package com.apple.eawt.event;
 
+import sun.awt.SunToolkit;
+
 import java.awt.*;
 import java.util.*;
 import java.util.List;
@@ -68,7 +70,7 @@
     static void handleGestureFromNative(final Window window, final int type, final double x, final double y, final double a, final double b) {
         if (window == null) return; // should never happen...
 
-        EventQueue.invokeLater(new Runnable() {
+        SunToolkit.executeOnEventHandlerThread(window, new Runnable() {
             public void run() {
                 final Component component = SwingUtilities.getDeepestComponentAt(window, (int)x, (int)y);
 
--- a/src/macosx/classes/com/apple/laf/ScreenMenu.java	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/macosx/classes/com/apple/laf/ScreenMenu.java	Wed Jul 17 23:49:37 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,6 +33,7 @@
 
 import javax.swing.*;
 
+import sun.awt.SunToolkit;
 import sun.lwawt.LWToolkit;
 import sun.lwawt.macosx.*;
 
@@ -139,7 +140,7 @@
                     updateItems();
                     fItemBounds = new Rectangle[invoker.getMenuComponentCount()];
                 }
-            }, null);
+            }, invoker);
         } catch (final Exception e) {
             System.err.println(e);
             e.printStackTrace();
@@ -167,7 +168,7 @@
 
             fItemBounds = null;
     }
-            }, null);
+            }, invoker);
         } catch (final Exception e) {
             e.printStackTrace();
         }
@@ -195,7 +196,7 @@
         if (kind == 0) return;
         if (fItemBounds == null) return;
 
-        SwingUtilities.invokeLater(new Runnable() {
+        SunToolkit.executeOnEventHandlerThread(fInvoker, new Runnable() {
             @Override
             public void run() {
                 Component target = null;
--- a/src/macosx/classes/sun/lwawt/LWComponentPeer.java	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/macosx/classes/sun/lwawt/LWComponentPeer.java	Wed Jul 17 23:49:37 2013 +0100
@@ -328,7 +328,7 @@
         return peerTreeLock;
     }
 
-    final T getTarget() {
+    public final T getTarget() {
         return target;
     }
 
--- a/src/macosx/classes/sun/lwawt/LWWindowPeer.java	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/macosx/classes/sun/lwawt/LWWindowPeer.java	Wed Jul 17 23:49:37 2013 +0100
@@ -787,7 +787,8 @@
                     Point lp = lastMouseEventPeer.windowToLocal(x, y,
                                                                 lastWindowPeer);
                     Component target = lastMouseEventPeer.getTarget();
-                    postMouseEnteredExitedEvent(target, id, when, modifiers, lp,
+                    postMouseEnteredExitedEvent(target, MouseEvent.MOUSE_EXITED,
+                            when, modifiers, lp,
                             screenX, screenY, clickCount, popupTrigger, button);
                 }
                 lastMouseEventPeer = null;
@@ -805,12 +806,14 @@
                         oldp.x += r.x - lr.x;
                         oldp.y += r.y - lr.y;
                         Component target = lastMouseEventPeer.getTarget();
-                        postMouseEnteredExitedEvent(target, id, when, modifiers, oldp,
+                        postMouseEnteredExitedEvent(target, MouseEvent.MOUSE_EXITED,
+                                when, modifiers, oldp,
                                 screenX, screenY, clickCount, popupTrigger, button);
                     } else {
                         Point oldp = lastMouseEventPeer.windowToLocal(x, y, this);
                         Component target = lastMouseEventPeer.getTarget();
-                        postMouseEnteredExitedEvent(target, id, when, modifiers, oldp,
+                        postMouseEnteredExitedEvent(target, MouseEvent.MOUSE_EXITED,
+                                when, modifiers, oldp,
                                 screenX, screenY, clickCount, popupTrigger, button);
                     }
                 }
@@ -818,7 +821,8 @@
                 if (targetPeer != null && targetPeer.isEnabled() && id != MouseEvent.MOUSE_ENTERED) {
                     Point newp = targetPeer.windowToLocal(x, y, curWindowPeer);
                     Component target = targetPeer.getTarget();
-                    postMouseEnteredExitedEvent(target, id, when, modifiers, newp,
+                    postMouseEnteredExitedEvent(target, MouseEvent.MOUSE_ENTERED,
+                            when, modifiers, newp,
                             screenX, screenY, clickCount, popupTrigger, button);
                 }
             }
--- a/src/macosx/classes/sun/lwawt/macosx/CCheckboxMenuItem.java	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/macosx/classes/sun/lwawt/macosx/CCheckboxMenuItem.java	Wed Jul 17 23:49:37 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -53,7 +53,7 @@
 
     public void handleAction(final boolean state) {
         final CheckboxMenuItem target = (CheckboxMenuItem)getTarget();
-        EventQueue.invokeLater(new Runnable() {
+        SunToolkit.executeOnEventHandlerThread(target, new Runnable() {
             public void run() {
                 target.setState(state);
             }
--- a/src/macosx/classes/sun/lwawt/macosx/CCursorManager.java	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/macosx/classes/sun/lwawt/macosx/CCursorManager.java	Wed Jul 17 23:49:37 2013 +0100
@@ -51,15 +51,6 @@
 
     @Override
     protected Point getCursorPosition() {
-        synchronized(this) {
-            if (isDragging) {
-                // during the drag operation, the appkit thread is blocked,
-                // so nativeGetCursorPosition invocation may cause a deadlock.
-                // In order to avoid this, we returns last know cursor position.
-                return new Point(dragPos);
-            }
-        }
-
         final Point2D nativePosition = nativeGetCursorPosition();
         return new Point((int)nativePosition.getX(), (int)nativePosition.getY());
     }
@@ -101,31 +92,4 @@
         // do something special
         throw new RuntimeException("Unimplemented");
     }
-
-    // package private methods to handle cursor change during drag-and-drop
-    private boolean isDragging = false;
-    private Point dragPos = null;
-
-    synchronized void startDrag(int x, int y) {
-        if (isDragging) {
-            throw new RuntimeException("Invalid Drag state in CCursorManager!");
-        }
-        isDragging = true;
-        dragPos = new Point(x, y);
-    }
-
-    synchronized void updateDragPosition(int x, int y) {
-        if (!isDragging) {
-            throw new RuntimeException("Invalid Drag state in CCursorManager!");
-        }
-        dragPos.move(x, y);
-    }
-
-    synchronized void stopDrag() {
-        if (!isDragging) {
-            throw new RuntimeException("Invalid Drag state in CCursorManager!");
-        }
-        isDragging = false;
-        dragPos = null;
-    }
 }
--- a/src/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java	Wed Jul 17 23:49:37 2013 +0100
@@ -38,8 +38,12 @@
 import javax.accessibility.*;
 
 import java.util.Map;
+import java.util.concurrent.Callable;
+
 import sun.awt.dnd.*;
 import sun.lwawt.LWComponentPeer;
+import sun.lwawt.LWWindowPeer;
+import sun.lwawt.PlatformWindow;
 
 
 public final class CDragSourceContextPeer extends SunDragSourceContextPeer {
@@ -104,13 +108,8 @@
         }
 
         //It sure will be LWComponentPeer instance as rootComponent is a Window
-        LWComponentPeer peer = (LWComponentPeer)rootComponent.getPeer();
-        //Get a pointer to a native window
-        CPlatformWindow platformWindow = (CPlatformWindow) peer.getPlatformWindow();
-        long nativeWindowPtr = platformWindow.getNSWindowPtr();
-
-        // Get drag cursor:
-        Cursor cursor = this.getCursor();
+        PlatformWindow platformWindow = ((LWComponentPeer)rootComponent.getPeer()).getPlatformWindow();
+        long nativeViewPtr = CPlatformWindow.getNativeViewPtr(platformWindow);
 
         // If there isn't any drag image make one of default appearance:
         if (fDragImage == null)
@@ -139,19 +138,15 @@
 
         try {
             // Create native dragging source:
-            final long nativeDragSource = createNativeDragSource(component, peer, nativeWindowPtr, transferable, triggerEvent,
+            final long nativeDragSource = createNativeDragSource(component, nativeViewPtr, transferable, triggerEvent,
                 (int) (dragOrigin.getX()), (int) (dragOrigin.getY()), extModifiers,
-                clickCount, timestamp, cursor, fDragCImage, dragImageOffset.x, dragImageOffset.y,
+                clickCount, timestamp, fDragCImage, dragImageOffset.x, dragImageOffset.y,
                 getDragSourceContext().getSourceActions(), formats, formatMap);
 
             if (nativeDragSource == 0)
                 throw new InvalidDnDOperationException("");
 
             setNativeContext(nativeDragSource);
-
-            CCursorManager.getInstance().startDrag(
-                    (int) (dragOrigin.getX()),
-                    (int) (dragOrigin.getY()));
         }
 
         catch (Exception e) {
@@ -160,6 +155,8 @@
 
         SunDropTargetContextPeer.setCurrentJVMLocalSourceTransferable(transferable);
 
+        CCursorManager.getInstance().setCursor(getCursor());
+
         // Create a new thread to run the dragging operation since it's synchronous, only coming back
         // after dragging is finished. This leaves the AWT event thread free to handle AWT events which
         // are posted during dragging by native event handlers.
@@ -173,8 +170,6 @@
                     } catch (Exception e) {
                         e.printStackTrace();
                     } finally {
-                        CCursorManager.getInstance().stopDrag();
-
                         releaseNativeDragSource(nativeDragSource);
                         fDragImage = null;
                         if (fDragCImage != null) {
@@ -189,8 +184,6 @@
         }
 
         catch (Exception e) {
-            CCursorManager.getInstance().stopDrag();
-
             final long nativeDragSource = getNativeContext();
             setNativeContext(0);
             releaseNativeDragSource(nativeDragSource);
@@ -416,13 +409,24 @@
                                 final int modifiers,
                                 final int x, final int y) {
 
-        CCursorManager.getInstance().updateDragPosition(x, y);
+        try {
+            Component componentAt = LWCToolkit.invokeAndWait(
+                    new Callable<Component>() {
+                        @Override
+                        public Component call() {
+                            LWWindowPeer mouseEventComponent = LWWindowPeer.getWindowUnderCursor();
+                            if (mouseEventComponent == null) {
+                                return null;
+                            }
+                            Component root = SwingUtilities.getRoot(mouseEventComponent.getTarget());
+                            if (root == null) {
+                                return null;
+                            }
+                            Point rootLocation = root.getLocationOnScreen();
+                            return getDropTargetAt(root, x - rootLocation.x, y - rootLocation.y);
+                        }
+                    }, getComponent());
 
-        Component rootComponent = SwingUtilities.getRoot(getComponent());
-        if(rootComponent != null) {
-            Point componentPoint = new Point(x, y);
-            SwingUtilities.convertPointFromScreen(componentPoint, rootComponent);
-            Component componentAt = SwingUtilities.getDeepestComponentAt(rootComponent, componentPoint.x, componentPoint.y);
             if(componentAt != hoveringComponent) {
                 if(hoveringComponent != null) {
                     dragExit(x, y);
@@ -432,20 +436,36 @@
                 }
                 hoveringComponent = componentAt;
             }
+
+            postDragSourceDragEvent(targetActions, modifiers, x, y,
+                    DISPATCH_MOUSE_MOVED);
+        } catch (Exception e) {
+            throw new InvalidDnDOperationException("Failed to handle DragMouseMoved event");
         }
-        postDragSourceDragEvent(targetActions, modifiers, x, y,
-                                DISPATCH_MOUSE_MOVED);
     }
 
-    /**
-     * upcall from native code
-     */
-    private void dragEnter(final int targetActions,
-                           final int modifiers,
-                           final int x, final int y) {
-        CCursorManager.getInstance().updateDragPosition(x, y);
+    //Returns the first lightweight or heavyweight Component which has a dropTarget ready to accept the drag
+    //Should be called from the EventDispatchThread
+    private static Component getDropTargetAt(Component root, int x, int y) {
+        if (!root.contains(x, y) || !root.isEnabled() || !root.isVisible()) {
+            return null;
+        }
 
-        postDragSourceDragEvent(targetActions, modifiers, x, y, DISPATCH_ENTER);
+        if (root.getDropTarget() != null && root.getDropTarget().isActive()) {
+            return root;
+        }
+
+        if (root instanceof Container) {
+            for (Component comp : ((Container) root).getComponents()) {
+                Point loc = comp.getLocation();
+                Component dropTarget = getDropTargetAt(comp, x - loc.x, y - loc.y);
+                if (dropTarget != null) {
+                    return dropTarget;
+                }
+            }
+        }
+
+        return null;
     }
 
     /**
@@ -455,19 +475,15 @@
         hoveringComponent = null;
     }
 
-    public void setCursor(Cursor c) throws InvalidDnDOperationException {
-        // TODO : BG
-        //AWTLockAccess.awtLock();
-        super.setCursor(c);
-        //AWTLockAccess.awtUnlock();
+    @Override
+    protected void setNativeCursor(long nativeCtxt, Cursor c, int cType) {
+        CCursorManager.getInstance().setCursor(c);
     }
 
-    protected native void setNativeCursor(long nativeCtxt, Cursor c, int cType);
-
     // Native support:
-    private native long createNativeDragSource(Component component, ComponentPeer peer, long nativePeer, Transferable transferable,
+    private native long createNativeDragSource(Component component, long nativePeer, Transferable transferable,
         InputEvent triggerEvent, int dragPosX, int dragPosY, int extModifiers, int clickCount, long timestamp,
-        Cursor cursor, CImage nsDragImage, int dragImageOffsetX, int dragImageOffsetY,
+        CImage nsDragImage, int dragImageOffsetX, int dragImageOffsetY,
         int sourceActions, long[] formats, Map formatMap);
 
     private native void doDragging(long nativeDragSource);
--- a/src/macosx/classes/sun/lwawt/macosx/CDropTarget.java	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/macosx/classes/sun/lwawt/macosx/CDropTarget.java	Wed Jul 17 23:49:37 2013 +0100
@@ -30,6 +30,7 @@
 import java.awt.dnd.DropTarget;
 
 import sun.lwawt.LWComponentPeer;
+import sun.lwawt.PlatformWindow;
 
 
 public final class CDropTarget {
@@ -50,21 +51,11 @@
         fComponent = component;
         fPeer = peer;
 
-        // Make sure the drop target is a ComponentModel:
-        if (!(peer instanceof LWComponentPeer))
-            throw new IllegalArgumentException("CDropTarget's peer must be a LWComponentPeer.");
-
-        // Get model pointer (CButton.m and such) and its native peer:
-        LWComponentPeer model = (LWComponentPeer) peer;
-        if (model.getPlatformWindow() instanceof CPlatformWindow) {
-            CPlatformWindow platformWindow = (CPlatformWindow) model.getPlatformWindow();
-            long nativePeer = platformWindow.getNSWindowPtr();
-
-            // Create native dragging destination:
-            fNativeDropTarget = this.createNativeDropTarget(dropTarget, component, peer, nativePeer);
-            if (fNativeDropTarget == 0) {
-                throw new IllegalStateException("CDropTarget.createNativeDropTarget() failed.");
-            }
+        long nativePeer = CPlatformWindow.getNativeViewPtr(((LWComponentPeer) peer).getPlatformWindow());
+        // Create native dragging destination:
+        fNativeDropTarget = this.createNativeDropTarget(dropTarget, component, peer, nativePeer);
+        if (fNativeDropTarget == 0) {
+            throw new IllegalStateException("CDropTarget.createNativeDropTarget() failed.");
         }
     }
 
--- a/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Wed Jul 17 23:49:37 2013 +0100
@@ -923,6 +923,21 @@
         }
     }
 
+    /**
+     * Helper method to get a pointer to the native view from the PlatformWindow.
+     */
+    static long getNativeViewPtr(PlatformWindow platformWindow) {
+        long nativePeer = 0L;
+        if (platformWindow instanceof CPlatformWindow) {
+            nativePeer = ((CPlatformWindow) platformWindow).getContentView().getAWTView();
+        } else if (platformWindow instanceof CViewPlatformEmbeddedFrame){
+            nativePeer = ((CViewPlatformEmbeddedFrame) platformWindow).getNSViewPtr();
+        } else {
+            throw new IllegalArgumentException("Unsupported platformWindow implementation");
+        }
+        return nativePeer;
+    }
+
     /*************************************************************
      * Callbacks from the AWTWindow and AWTView objc classes.
      *************************************************************/
@@ -949,25 +964,19 @@
 
         final Rectangle oldB = nativeBounds;
         nativeBounds = new Rectangle(x, y, width, height);
-        final GraphicsConfiguration oldGC = contentView.getGraphicsConfiguration();
-
-        if (peer!= null) {
+        if (peer != null) {
             peer.notifyReshape(x, y, width, height);
-        }
-
-        final GraphicsConfiguration newGC = contentView.getGraphicsConfiguration();
-        // System-dependent appearance optimization.
-        if ((byUser && !oldB.getSize().equals(nativeBounds.getSize()))
-            || isFullScreenAnimationOn || !Objects.equals(newGC, oldGC)) {
-            flushBuffers();
+            // System-dependent appearance optimization.
+            if ((byUser && !oldB.getSize().equals(nativeBounds.getSize()))
+                    || isFullScreenAnimationOn) {
+                flushBuffers();
+            }
         }
     }
 
     private void deliverWindowClosingEvent() {
-        if (peer != null) {
-            if (peer.getBlocker() == null)  {
-                peer.postEvent(new WindowEvent(target, WindowEvent.WINDOW_CLOSING));
-            }
+        if (peer != null && peer.getBlocker() == null) {
+            peer.postEvent(new WindowEvent(target, WindowEvent.WINDOW_CLOSING));
         }
     }
 
--- a/src/macosx/classes/sun/lwawt/macosx/CViewEmbeddedFrame.java	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/macosx/classes/sun/lwawt/macosx/CViewEmbeddedFrame.java	Wed Jul 17 23:49:37 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -96,7 +96,7 @@
                     validate();
                     setVisible(true);
                 }
-            }, null);
+            }, this);
         } catch (InterruptedException | InvocationTargetException ex) {}
     }
 }
--- a/src/macosx/native/sun/awt/CDragSource.h	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/macosx/native/sun/awt/CDragSource.h	Wed Jul 17 23:49:37 2013 +0100
@@ -33,7 +33,6 @@
 @private
     NSView*        fView;
     jobject            fComponent;
-    jobject            fComponentPeer;
     jobject            fDragSourceContextPeer;
 
     jobject            fTransferable;
@@ -43,8 +42,6 @@
     jint                fClickCount;
     jint                fModifiers;
 
-    jobject            fCursor;
-
     NSImage*        fDragImage;
     NSPoint            fDragImageOffset;
 
@@ -59,12 +56,22 @@
 + (CDragSource *) currentDragSource;
 
 // Common methods:
-- (id)init:(jobject)jdragsourcecontextpeer component:(jobject)jcomponent peer:(jobject)jpeer control:(id)control
-    transferable:(jobject)jtransferable triggerEvent:(jobject)jtrigger
-    dragPosX:(jint)dragPosX dragPosY:(jint)dragPosY modifiers:(jint)extModifiers clickCount:(jint)clickCount timeStamp:(jlong)timeStamp
-    cursor:(jobject)jcursor
-    dragImage:(jobject)jnsdragimage dragImageOffsetX:(jint)jdragimageoffsetx dragImageOffsetY:(jint)jdragimageoffsety
-    sourceActions:(jint)jsourceactions formats:(jlongArray)jformats formatMap:(jobject)jformatmap;
+- (id)        init:(jobject)jDragSourceContextPeer
+         component:(jobject)jComponent
+           control:(id)control
+      transferable:(jobject)jTransferable
+      triggerEvent:(jobject)jTrigger
+          dragPosX:(jint)dragPosX
+          dragPosY:(jint)dragPosY
+         modifiers:(jint)extModifiers
+        clickCount:(jint)clickCount
+         timeStamp:(jlong)timeStamp
+         dragImage:(jobject)jDragImage
+  dragImageOffsetX:(jint)jDragImageOffsetX
+  dragImageOffsetY:(jint)jDragImageOffsetY
+     sourceActions:(jint)jSourceActions
+           formats:(jlongArray)jFormats
+         formatMap:(jobject)jFormatMap;
 
 - (void)removeFromView:(JNIEnv *)env;
 
--- a/src/macosx/native/sun/awt/CDragSource.m	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/macosx/native/sun/awt/CDragSource.m	Wed Jul 17 23:49:37 2013 +0100
@@ -84,12 +84,22 @@
     return sCurrentDragSource;
 }
 
-- (id)init:(jobject)jdragsourcecontextpeer component:(jobject)jcomponent peer:(jobject)jpeer control:(id)control
-    transferable:(jobject)jtransferable triggerEvent:(jobject)jtrigger
-    dragPosX:(jint)dragPosX dragPosY:(jint)dragPosY modifiers:(jint)extModifiers clickCount:(jint)clickCount
-    timeStamp:(jlong)timeStamp cursor:(jobject)jcursor
-    dragImage:(jobject)jnsdragimage dragImageOffsetX:(jint)jdragimageoffsetx dragImageOffsetY:(jint)jdragimageoffsety
-    sourceActions:(jint)jsourceactions formats:(jlongArray)jformats formatMap:(jobject)jformatmap
+- (id)        init:(jobject)jDragSourceContextPeer
+         component:(jobject)jComponent
+           control:(id)control
+      transferable:(jobject)jTransferable
+      triggerEvent:(jobject)jTrigger
+          dragPosX:(jint)dragPosX
+          dragPosY:(jint)dragPosY
+         modifiers:(jint)extModifiers
+        clickCount:(jint)clickCount
+         timeStamp:(jlong)timeStamp
+         dragImage:(jobject)jDragImage
+  dragImageOffsetX:(jint)jDragImageOffsetX
+  dragImageOffsetY:(jint)jDragImageOffsetY
+     sourceActions:(jint)jSourceActions
+           formats:(jlongArray)jFormats
+         formatMap:(jobject)jFormatMap
 {
     self = [super init];
     DLog2(@"[CDragSource init]: %@\n", self);
@@ -100,27 +110,25 @@
     // Construct the object if we have a valid model for it:
     if (control != nil) {
         JNIEnv *env = [ThreadUtilities getJNIEnv];
-        fComponent = JNFNewGlobalRef(env, jcomponent);
-        fComponentPeer = JNFNewGlobalRef(env, jpeer);
-        fDragSourceContextPeer = JNFNewGlobalRef(env, jdragsourcecontextpeer);
+        fComponent = JNFNewGlobalRef(env, jComponent);
+        fDragSourceContextPeer = JNFNewGlobalRef(env, jDragSourceContextPeer);
 
-        fTransferable = JNFNewGlobalRef(env, jtransferable);
-        fTriggerEvent = JNFNewGlobalRef(env, jtrigger);
-        fCursor = JNFNewGlobalRef(env, jcursor);
+        fTransferable = JNFNewGlobalRef(env, jTransferable);
+        fTriggerEvent = JNFNewGlobalRef(env, jTrigger);
 
-        if (jnsdragimage) {
+        if (jDragImage) {
             JNF_MEMBER_CACHE(nsImagePtr, CImageClass, "ptr", "J");
-            jlong imgPtr = JNFGetLongField(env, jnsdragimage, nsImagePtr);
+            jlong imgPtr = JNFGetLongField(env, jDragImage, nsImagePtr);
             fDragImage = (NSImage*) jlong_to_ptr(imgPtr); // Double-casting prevents compiler 'd$|//
 
             [fDragImage retain];
         }
 
-        fDragImageOffset = NSMakePoint(jdragimageoffsetx, jdragimageoffsety);
+        fDragImageOffset = NSMakePoint(jDragImageOffsetX, jDragImageOffsetY);
 
-        fSourceActions = jsourceactions;
-        fFormats = JNFNewGlobalRef(env, jformats);
-        fFormatMap = JNFNewGlobalRef(env, jformatmap);
+        fSourceActions = jSourceActions;
+        fFormats = JNFNewGlobalRef(env, jFormats);
+        fFormatMap = JNFNewGlobalRef(env, jFormatMap);
 
         fTriggerEventTimeStamp = timeStamp;
         fDragPos = NSMakePoint(dragPosX, dragPosY);
@@ -129,9 +137,8 @@
 
         // Set this object as a dragging source:
 
-        AWTView *awtView = [((NSWindow *) control) contentView];
-        fView = [awtView retain];
-        [awtView setDragSource:self];
+        fView = [(AWTView *) control retain];
+        [fView setDragSource:self];
 
         // Let AWTEvent know Java drag is getting underway:
         [NSEvent javaDraggingBegin];
@@ -158,11 +165,6 @@
         fComponent = NULL;
     }
 
-    if (fComponentPeer != NULL) {
-        JNFDeleteGlobalRef(env, fComponentPeer);
-        fComponentPeer = NULL;
-    }
-
     if (fDragSourceContextPeer != NULL) {
         JNFDeleteGlobalRef(env, fDragSourceContextPeer);
         fDragSourceContextPeer = NULL;
@@ -178,11 +180,6 @@
         fTriggerEvent = NULL;
     }
 
-    if (fCursor != NULL) {
-        JNFDeleteGlobalRef(env, fCursor);
-        fCursor = NULL;
-    }
-
     if (fFormats != NULL) {
         JNFDeleteGlobalRef(env, fFormats);
         fFormats = NULL;
@@ -586,11 +583,6 @@
 {
     AWT_ASSERT_NOT_APPKIT_THREAD;
 
-    // Set the drag cursor (or not 3839999)
-    //JNIEnv *env = [ThreadUtilities getJNIEnv];
-    //jobject gCursor = JNFNewGlobalRef(env, fCursor);
-    //[EventFactory setJavaCursor:gCursor withEnv:env];
-
     [self performSelectorOnMainThread:@selector(doDrag) withObject:nil waitUntilDone:YES]; // AWT_THREADING Safe (called from unique asynchronous thread)
 }
 
--- a/src/macosx/native/sun/awt/CDragSourceContextPeer.m	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/macosx/native/sun/awt/CDragSourceContextPeer.m	Wed Jul 17 23:49:37 2013 +0100
@@ -34,12 +34,13 @@
 /*
  * Class:     sun_lwawt_macosx_CDragSourceContextPeer
  * Method:    createNativeDragSource
- * Signature: (Ljava/awt/Component;Ljava/awt/peer/ComponentPeer;JLjava/awt/datatransfer/Transferable;Ljava/awt/event/InputEvent;IIIIJLjava/awt/Cursor;IJIII[JLjava/util/Map;)J
+ * Signature: (Ljava/awt/Component;JLjava/awt/datatransfer/Transferable;
+               Ljava/awt/event/InputEvent;IIIIJIJIII[JLjava/util/Map;)J
  */
 JNIEXPORT jlong JNICALL Java_sun_lwawt_macosx_CDragSourceContextPeer_createNativeDragSource
-  (JNIEnv *env, jobject jthis, jobject jcomponent, jobject jpeer, jlong jnativepeer, jobject jtransferable,
+  (JNIEnv *env, jobject jthis, jobject jcomponent, jlong jnativepeer, jobject jtransferable,
    jobject jtrigger, jint jdragposx, jint jdragposy, jint jextmodifiers, jint jclickcount, jlong jtimestamp,
-   jobject jcursor, jobject jnsdragimage, jint jdragimageoffsetx, jint jdragimageoffsety,
+   jobject jnsdragimage, jint jdragimageoffsetx, jint jdragimageoffsety,
    jint jsourceactions, jlongArray jformats, jobject jformatmap)
 {
     id controlObj = (id) jlong_to_ptr(jnativepeer);
@@ -47,12 +48,22 @@
 
 JNF_COCOA_ENTER(env);
     [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
-        dragSource = [[CDragSource alloc] init:jthis component:jcomponent peer:jpeer control:controlObj
-            transferable:jtransferable triggerEvent:jtrigger dragPosX:jdragposx
-            dragPosY:jdragposy modifiers:jextmodifiers clickCount:jclickcount timeStamp:jtimestamp
-            cursor:jcursor dragImage:jnsdragimage dragImageOffsetX:jdragimageoffsetx
-            dragImageOffsetY:jdragimageoffsety sourceActions:jsourceactions
-            formats:jformats formatMap:jformatmap];
+        dragSource = [[CDragSource alloc] init:jthis
+                                     component:jcomponent
+                                       control:controlObj
+                                  transferable:jtransferable
+                                  triggerEvent:jtrigger
+                                      dragPosX:jdragposx
+                                      dragPosY:jdragposy
+                                     modifiers:jextmodifiers
+                                    clickCount:jclickcount
+                                     timeStamp:jtimestamp
+                                     dragImage:jnsdragimage
+                              dragImageOffsetX:jdragimageoffsetx
+                              dragImageOffsetY:jdragimageoffsety
+                                 sourceActions:jsourceactions
+                                       formats:jformats
+                                     formatMap:jformatmap];
     }];
 JNF_COCOA_EXIT(env);
 
@@ -94,19 +105,3 @@
     [dragSource removeFromView:env];
 JNF_COCOA_EXIT(env);
 }
-
-/*
- * Class:     sun_lwawt_macosx_CDragSourceContextPeer
- * Method:    setNativeCursor
- * Signature: (JLjava/awt/Cursor;I)V
- */
-JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CDragSourceContextPeer_setNativeCursor
-  (JNIEnv *env, jobject jthis, jlong nativeDragSourceVal, jobject jcursor, jint jcursortype)
-{
-   //AWT_ASSERT_NOT_APPKIT_THREAD;
-
-//JNF_COCOA_ENTER(env);
-//    jobject gCursor = JNFNewGlobalRef(env, jcursor);
-//    [EventFactory setJavaCursor:gCursor withEnv:env];
-//JNF_COCOA_EXIT(env);
-}
--- a/src/macosx/native/sun/awt/CDropTarget.m	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/macosx/native/sun/awt/CDropTarget.m	Wed Jul 17 23:49:37 2013 +0100
@@ -81,9 +81,8 @@
         fComponent = JNFNewGlobalRef(env, jcomponent);
         fDropTarget = JNFNewGlobalRef(env, jdropTarget);
 
-        AWTView *awtView = [((NSWindow *) control) contentView];
-        fView = [awtView retain];
-        [awtView setDropTarget:self];
+        fView = [((AWTView *) control) retain];
+        [fView setDropTarget:self];
 
 
     } else {
@@ -177,6 +176,10 @@
 {
     DLog2(@"[CDropTarget dealloc]: %@\n", self);
 
+    if(sCurrentDropTarget == self) {
+        sCurrentDropTarget = nil;
+    }
+
     [fView release];
     fView = nil;
 
@@ -490,7 +493,10 @@
         JNF_MEMBER_CACHE(handleEnterMessageMethod, jc_CDropTargetContextPeer, "handleEnterMessage", "(Ljava/awt/Component;IIII[JJ)I");
         if (sDraggingError == FALSE) {
             // Double-casting self gets rid of 'different size' compiler warning:
-            actions = JNFCallIntMethod(env, fDropTargetContextPeer, handleEnterMessageMethod, fComponent, (jint) javaLocation.x, (jint) javaLocation.y, dropAction, actions, formats, ptr_to_jlong(self)); // AWT_THREADING Safe (CToolkitThreadBlockedHandler)
+            // AWT_THREADING Safe (CToolkitThreadBlockedHandler)
+            actions = JNFCallIntMethod(env, fDropTargetContextPeer, handleEnterMessageMethod,
+                                       fComponent, (jint) javaLocation.x, (jint) javaLocation.y,
+                                       dropAction, actions, formats, ptr_to_jlong(self));
         }
 
         if (sDraggingError == FALSE) {
@@ -510,11 +516,6 @@
             // Remember the dragOp for no-op'd update messages:
             sUpdateOperation = dragOp;
         }
-
-        // If we are in the same process as the sender, make the sender post the appropriate message
-        if (sender) {
-            [[CDragSource currentDragSource] postDragEnter];
-        }
     }
 
     // 9-11-02 Note: the native event thread would not handle an exception gracefully:
@@ -608,11 +609,9 @@
         JNF_MEMBER_CACHE(handleExitMessageMethod, jc_CDropTargetContextPeer, "handleExitMessage", "(Ljava/awt/Component;J)V");
         if (sDraggingError == FALSE) {
             DLog3(@"  - dragExit: loc native %f, %f\n", sDraggingLocation.x, sDraggingLocation.y);
-            JNFCallVoidMethod(env, fDropTargetContextPeer, handleExitMessageMethod, fComponent, ptr_to_jlong(self)); // AWT_THREADING Safe (CToolkitThreadBlockedHandler)
-            // If we are in the same process as the sender, make the sender post the appropriate message
-            if (sender) {
-                [[CDragSource currentDragSource] postDragExit];
-            }
+             // AWT_THREADING Safe (CToolkitThreadBlockedHandler) 
+            JNFCallVoidMethod(env, fDropTargetContextPeer,
+                              handleExitMessageMethod, fComponent, ptr_to_jlong(self));
         }
 
         // 5-27-03 Note: [Radar 3270455]
--- a/src/macosx/native/sun/awt/CMenuItem.m	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/macosx/native/sun/awt/CMenuItem.m	Wed Jul 17 23:49:37 2013 +0100
@@ -82,8 +82,13 @@
         // keys, so we need to do the same translation here that we do
         // for the regular key down events
         if ([eventKey length] == 1) {
-            unichar ch =  NsCharToJavaChar([eventKey characterAtIndex:0], 0);
-            eventKey = [NSString stringWithCharacters: &ch length: 1];
+            unichar origChar = [eventKey characterAtIndex:0];
+            unichar newChar =  NsCharToJavaChar(origChar, 0);
+            if (newChar == java_awt_event_KeyEvent_CHAR_UNDEFINED) {
+                newChar = origChar;
+            }
+
+            eventKey = [NSString stringWithCharacters: &newChar length: 1];
         }
 
         if ([menuKey isEqualToString:eventKey]) {
--- a/src/share/classes/com/sun/accessibility/internal/resources/accessibility.properties	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/share/classes/com/sun/accessibility/internal/resources/accessibility.properties	Wed Jul 17 23:49:37 2013 +0100
@@ -102,7 +102,7 @@
 #
 # accessible actions
 #
-toggle expand=toggle expand
+toggleexpand=toggle expand
 
 # new relations, roles and states for J2SE 1.5.0
 
--- a/src/share/classes/com/sun/accessibility/internal/resources/accessibility_de.properties	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/share/classes/com/sun/accessibility/internal/resources/accessibility_de.properties	Wed Jul 17 23:49:37 2013 +0100
@@ -102,7 +102,7 @@
 #
 # accessible actions
 #
-toggle expand=ein-/ausblenden
+toggleexpand=ein-/ausblenden
 
 # new relations, roles and states for J2SE 1.5.0
 
--- a/src/share/classes/com/sun/accessibility/internal/resources/accessibility_es.properties	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/share/classes/com/sun/accessibility/internal/resources/accessibility_es.properties	Wed Jul 17 23:49:37 2013 +0100
@@ -102,7 +102,7 @@
 #
 # accessible actions
 #
-toggle expand=activar/desactivar ampliaci\u00F3n
+toggleexpand=activar/desactivar ampliaci\u00F3n
 
 # new relations, roles and states for J2SE 1.5.0
 
--- a/src/share/classes/com/sun/accessibility/internal/resources/accessibility_fr.properties	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/share/classes/com/sun/accessibility/internal/resources/accessibility_fr.properties	Wed Jul 17 23:49:37 2013 +0100
@@ -102,7 +102,7 @@
 #
 # accessible actions
 #
-toggle expand=basculer le d\u00E9veloppement
+toggleexpand=basculer le d\u00E9veloppement
 
 # new relations, roles and states for J2SE 1.5.0
 
--- a/src/share/classes/com/sun/accessibility/internal/resources/accessibility_it.properties	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/share/classes/com/sun/accessibility/internal/resources/accessibility_it.properties	Wed Jul 17 23:49:37 2013 +0100
@@ -102,7 +102,7 @@
 #
 # accessible actions
 #
-toggle expand=abilita/disabilita espansione
+toggleexpand=abilita/disabilita espansione
 
 # new relations, roles and states for J2SE 1.5.0
 
--- a/src/share/classes/com/sun/accessibility/internal/resources/accessibility_ja.properties	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/share/classes/com/sun/accessibility/internal/resources/accessibility_ja.properties	Wed Jul 17 23:49:37 2013 +0100
@@ -102,7 +102,7 @@
 #
 # accessible actions
 #
-toggle expand=\u5C55\u958B\u306E\u30C8\u30B0\u30EB
+toggleexpand=\u5C55\u958B\u306E\u30C8\u30B0\u30EB
 
 # new relations, roles and states for J2SE 1.5.0
 
--- a/src/share/classes/com/sun/accessibility/internal/resources/accessibility_ko.properties	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/share/classes/com/sun/accessibility/internal/resources/accessibility_ko.properties	Wed Jul 17 23:49:37 2013 +0100
@@ -102,7 +102,7 @@
 #
 # accessible actions
 #
-toggle expand=\uD1A0\uAE00 \uD655\uC7A5
+toggleexpand=\uD1A0\uAE00 \uD655\uC7A5
 
 # new relations, roles and states for J2SE 1.5.0
 
--- a/src/share/classes/com/sun/accessibility/internal/resources/accessibility_pt_BR.properties	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/share/classes/com/sun/accessibility/internal/resources/accessibility_pt_BR.properties	Wed Jul 17 23:49:37 2013 +0100
@@ -102,7 +102,7 @@
 #
 # accessible actions
 #
-toggle expand=alternar expans\u00E3o
+toggleexpand=alternar expans\u00E3o
 
 # new relations, roles and states for J2SE 1.5.0
 
--- a/src/share/classes/com/sun/accessibility/internal/resources/accessibility_sv.properties	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/share/classes/com/sun/accessibility/internal/resources/accessibility_sv.properties	Wed Jul 17 23:49:37 2013 +0100
@@ -102,7 +102,7 @@
 #
 # accessible actions
 #
-toggle expand=v\u00E4xla ut\u00F6ka
+toggleexpand=v\u00E4xla ut\u00F6ka
 
 # new relations, roles and states for J2SE 1.5.0
 
--- a/src/share/classes/com/sun/accessibility/internal/resources/accessibility_zh_CN.properties	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/share/classes/com/sun/accessibility/internal/resources/accessibility_zh_CN.properties	Wed Jul 17 23:49:37 2013 +0100
@@ -102,7 +102,7 @@
 #
 # accessible actions
 #
-toggle expand=\u5207\u6362\u5C55\u5F00
+toggleexpand=\u5207\u6362\u5C55\u5F00
 
 # new relations, roles and states for J2SE 1.5.0
 
--- a/src/share/classes/com/sun/accessibility/internal/resources/accessibility_zh_TW.properties	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/share/classes/com/sun/accessibility/internal/resources/accessibility_zh_TW.properties	Wed Jul 17 23:49:37 2013 +0100
@@ -102,7 +102,7 @@
 #
 # accessible actions
 #
-toggle expand=\u5207\u63DB\u64F4\u5C55
+toggleexpand=\u5207\u63DB\u64F4\u5C55
 
 # new relations, roles and states for J2SE 1.5.0
 
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/algorithms/JCEMapper.java	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/algorithms/JCEMapper.java	Wed Jul 17 23:49:37 2013 +0100
@@ -160,7 +160,7 @@
         );
         algorithmsMap.put(
             XMLCipher.RSA_OAEP,
-            new Algorithm("RSA", "RSA/ECB/OAEPPadding", "KeyTransport")
+            new Algorithm("RSA", "RSA/ECB/OAEPWithSHA1AndMGF1Padding", "KeyTransport")
         );
         algorithmsMap.put(
             XMLCipher.DIFFIE_HELLMAN,
--- a/src/share/classes/java/awt/GraphicsDevice.java	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/share/classes/java/awt/GraphicsDevice.java	Wed Jul 17 23:49:37 2013 +0100
@@ -296,6 +296,12 @@
                                     bgColor.getBlue(), 255);
                 w.setBackground(bgColor);
             }
+            // Check if this window is in fullscreen mode on another device.
+            final GraphicsConfiguration gc = w.getGraphicsConfiguration();
+            if (gc != null && gc.getDevice() != this
+                    && gc.getDevice().getFullScreenWindow() == w) {
+                gc.getDevice().setFullScreenWindow(null);
+            }
         }
         if (fullScreenWindow != null && windowedModeBounds != null) {
             // if the window went into fs mode before it was realized it may
--- a/src/share/classes/javax/accessibility/AccessibleAction.java	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/share/classes/javax/accessibility/AccessibleAction.java	Wed Jul 17 23:49:37 2013 +0100
@@ -54,7 +54,7 @@
      * @since 1.5
      */
     public static final String TOGGLE_EXPAND =
-        new String ("toggle expand");
+        new String ("toggleexpand");
 
     /**
      * An action which increments a value.
--- a/src/share/classes/sun/awt/dnd/SunDragSourceContextPeer.java	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/share/classes/sun/awt/dnd/SunDragSourceContextPeer.java	Wed Jul 17 23:49:37 2013 +0100
@@ -274,7 +274,7 @@
      * upcall from native code
      */
 
-    private void dragEnter(final int targetActions,
+    protected void dragEnter(final int targetActions,
                            final int modifiers,
                            final int x, final int y) {
         postDragSourceDragEvent(targetActions, modifiers, x, y, DISPATCH_ENTER);
@@ -352,10 +352,6 @@
 
     public static void setDragDropInProgress(boolean b)
       throws InvalidDnDOperationException {
-        if (dragDropInProgress == b) {
-            throw new InvalidDnDOperationException(getExceptionMessage(b));
-        }
-
         synchronized (SunDragSourceContextPeer.class) {
             if (dragDropInProgress == b) {
                 throw new InvalidDnDOperationException(getExceptionMessage(b));
--- a/src/share/classes/sun/java2d/SunGraphics2D.java	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/share/classes/sun/java2d/SunGraphics2D.java	Wed Jul 17 23:49:37 2013 +0100
@@ -1770,20 +1770,10 @@
     }
 
     public Rectangle getClipBounds() {
-        Rectangle r;
         if (clipState == CLIP_DEVICE) {
-            r = null;
-        } else if (transformState <= TRANSFORM_INT_TRANSLATE) {
-            if (usrClip instanceof Rectangle) {
-                r = new Rectangle((Rectangle) usrClip);
-            } else {
-                r = usrClip.getBounds();
-            }
-            r.translate(-transX, -transY);
-        } else {
-            r = getClip().getBounds();
+            return null;
         }
-        return r;
+        return getClipBounds(new Rectangle());
     }
 
     public Rectangle getClipBounds(Rectangle r) {
@@ -1792,11 +1782,11 @@
                 if (usrClip instanceof Rectangle) {
                     r.setBounds((Rectangle) usrClip);
                 } else {
-                    r.setBounds(usrClip.getBounds());
+                    r.setFrame(usrClip.getBounds2D());
                 }
                 r.translate(-transX, -transY);
             } else {
-                r.setBounds(getClip().getBounds());
+                r.setFrame(getClip().getBounds2D());
             }
         } else if (r == null) {
             throw new NullPointerException("null rectangle parameter");
@@ -1971,10 +1961,10 @@
             matrix[2] = matrix[0] + rect.getWidth();
             matrix[3] = matrix[1] + rect.getHeight();
             tx.transform(matrix, 0, matrix, 0, 2);
-            rect = new Rectangle2D.Float();
-            rect.setFrameFromDiagonal(matrix[0], matrix[1],
-                                      matrix[2], matrix[3]);
-            return rect;
+            fixRectangleOrientation(matrix, rect);
+            return new Rectangle2D.Double(matrix[0], matrix[1],
+                                          matrix[2] - matrix[0],
+                                          matrix[3] - matrix[1]);
         }
 
         if (tx.isIdentity()) {
@@ -1984,6 +1974,22 @@
         return tx.createTransformedShape(clip);
     }
 
+    /**
+     * Sets orientation of the rectangle according to the clip.
+     */
+    private static void fixRectangleOrientation(double[] m, Rectangle2D clip) {
+        if (clip.getWidth() > 0 != (m[2] - m[0] > 0)) {
+            double t = m[0];
+            m[0] = m[2];
+            m[2] = t;
+        }
+        if (clip.getHeight() > 0 != (m[3] - m[1] > 0)) {
+            double t = m[1];
+            m[1] = m[3];
+            m[3] = t;
+        }
+    }
+
     public void clipRect(int x, int y, int w, int h) {
         clip(new Rectangle(x, y, w, h));
     }
--- a/src/share/classes/sun/security/pkcs11/Config.java	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/share/classes/sun/security/pkcs11/Config.java	Wed Jul 17 23:49:37 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -197,6 +197,10 @@
     // (false).
     private boolean useEcX963Encoding = false;
 
+    // Flag to indicate whether NSS should favour performance (false) or
+    // memory footprint (true).
+    private boolean nssOptimizeSpace = false;
+
     private Config(String filename, InputStream in) throws IOException {
         if (in == null) {
             if (filename.startsWith("--")) {
@@ -329,6 +333,10 @@
         return useEcX963Encoding;
     }
 
+    boolean getNssOptimizeSpace() {
+        return nssOptimizeSpace;
+    }
+
     private static String expand(final String s) throws IOException {
         try {
             return PropertyExpander.expand(s);
@@ -451,6 +459,8 @@
                 nssUseSecmodTrust = parseBooleanEntry(word);
             } else if (word.equals("useEcX963Encoding")) {
                 useEcX963Encoding = parseBooleanEntry(word);
+            } else if (word.equals("nssOptimizeSpace")) {
+                nssOptimizeSpace = parseBooleanEntry(word);
             } else {
                 throw new ConfigurationException
                         ("Unknown keyword '" + word + "', line " + st.lineno());
--- a/src/share/classes/sun/security/pkcs11/Secmod.java	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/share/classes/sun/security/pkcs11/Secmod.java	Wed Jul 17 23:49:37 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -157,11 +157,17 @@
      */
     public void initialize(String configDir, String nssLibDir)
             throws IOException {
-        initialize(DbMode.READ_WRITE, configDir, nssLibDir);
+        initialize(DbMode.READ_WRITE, configDir, nssLibDir, false);
     }
 
-    public synchronized void initialize(DbMode dbMode, String configDir, String nssLibDir)
+    public void initialize(DbMode dbMode, String configDir, String nssLibDir)
             throws IOException {
+        initialize(dbMode, configDir, nssLibDir, false);
+    }
+
+    public synchronized void initialize(DbMode dbMode, String configDir,
+        String nssLibDir, boolean nssOptimizeSpace) throws IOException {
+
         if (isInitialized()) {
             throw new IOException("NSS is already initialized");
         }
@@ -210,7 +216,8 @@
         }
 
         if (DEBUG) System.out.println("dir: " + configDir);
-        boolean initok = nssInit(dbMode.functionName, nssHandle, configDir);
+        boolean initok = nssInitialize(dbMode.functionName, nssHandle,
+            configDir, nssOptimizeSpace);
         if (DEBUG) System.out.println("init: " + initok);
         if (initok == false) {
             throw new IOException("NSS initialization failed");
@@ -753,7 +760,7 @@
 
     private static native boolean nssVersionCheck(long handle, String minVersion);
 
-    private static native boolean nssInit(String functionName, long handle, String configDir);
+    private static native boolean nssInitialize(String functionName, long handle, String configDir, boolean nssOptimizeSpace);
 
     private static native Object nssGetModuleList(long handle, String libDir);
 
--- a/src/share/classes/sun/security/pkcs11/SunPKCS11.java	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/share/classes/sun/security/pkcs11/SunPKCS11.java	Wed Jul 17 23:49:37 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -167,6 +167,7 @@
             try {
                 String nssLibraryDirectory = config.getNssLibraryDirectory();
                 String nssSecmodDirectory = config.getNssSecmodDirectory();
+                boolean nssOptimizeSpace = config.getNssOptimizeSpace();
 
                 if (secmod.isInitialized()) {
                     if (nssSecmodDirectory != null) {
@@ -204,7 +205,7 @@
                         }
                     }
                     secmod.initialize(nssDbMode, nssSecmodDirectory,
-                        nssLibraryDirectory);
+                        nssLibraryDirectory, nssOptimizeSpace);
                 }
             } catch (IOException e) {
                 // XXX which exception to throw
--- a/src/share/classes/sun/security/x509/X509CertImpl.java	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/share/classes/sun/security/x509/X509CertImpl.java	Wed Jul 17 23:49:37 2013 +0100
@@ -174,12 +174,6 @@
      */
     private boolean verificationResult;
 
-    // Cached SKID
-    private byte[] subjectKeyId = null;
-
-    // Cached AKID
-    private byte[] issuerKeyId = null;
-
     /**
      * Default constructor.
      */
@@ -1068,25 +1062,25 @@
      */
     public byte[] getIssuerKeyIdentifier()
     {
-        if (issuerKeyId == null) {
-            AuthorityKeyIdentifierExtension aki =
-                getAuthorityKeyIdentifierExtension();
-            if (aki != null) {
+        byte[] issuerKeyId = null;
+        AuthorityKeyIdentifierExtension aki =
+            getAuthorityKeyIdentifierExtension();
 
-                try {
-                    issuerKeyId = ((KeyIdentifier)
-                        aki.get(AuthorityKeyIdentifierExtension.KEY_ID))
-                            .getIdentifier();
-                } catch (IOException e) {
-                    // should never happen (because KEY_ID attr is supported)
+        if (aki != null) {
+
+            try {
+                KeyIdentifier ki =
+                    ((KeyIdentifier) aki.get(
+                        AuthorityKeyIdentifierExtension.KEY_ID));
+                if (ki != null) {
+                    issuerKeyId = ki.getIdentifier();
                 }
-
-            } else {
-                issuerKeyId = new byte[0]; // no AKID present
+            } catch (IOException e) {
+                // should never happen (because KEY_ID attr is supported)
             }
         }
 
-        return issuerKeyId.length != 0 ? issuerKeyId : null;
+        return issuerKeyId;
     }
 
     /**
@@ -1193,25 +1187,24 @@
      */
     public byte[] getSubjectKeyIdentifier()
     {
-        if (subjectKeyId == null) {
-            SubjectKeyIdentifierExtension ski =
-                getSubjectKeyIdentifierExtension();
-            if (ski != null) {
+        byte[] subjectKeyId = null;
+        SubjectKeyIdentifierExtension ski = getSubjectKeyIdentifierExtension();
 
-                try {
-                    subjectKeyId = ((KeyIdentifier)
-                        ski.get(SubjectKeyIdentifierExtension.KEY_ID))
-                            .getIdentifier();
-                } catch (IOException e) {
-                    // should never happen (because KEY_ID attr is supported)
+        if (ski != null) {
+
+            try {
+                KeyIdentifier ki =
+                    ((KeyIdentifier) ski.get(
+                        SubjectKeyIdentifierExtension.KEY_ID));
+                if (ki != null) {
+                    subjectKeyId = ki.getIdentifier();
                 }
-
-            } else {
-                subjectKeyId = new byte[0]; // no SKID present
+            } catch (IOException e) {
+                // should never happen (because KEY_ID attr is supported)
             }
         }
 
-        return subjectKeyId.length != 0 ? subjectKeyId : null;
+        return subjectKeyId;
     }
 
     /**
--- a/src/share/classes/sun/util/logging/resources/logging_de.properties	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/share/classes/sun/util/logging/resources/logging_de.properties	Wed Jul 17 23:49:37 2013 +0100
@@ -27,20 +27,20 @@
 # these are the same as the non-localized level name.
 
 # The following ALL CAPS words should be translated.
-ALL=ALL
+ALL=Alle
 # The following ALL CAPS words should be translated.
-SEVERE=SEVERE
+SEVERE=Schwerwiegend
 # The following ALL CAPS words should be translated.
-WARNING=WARNING
+WARNING=Warnung
 # The following ALL CAPS words should be translated.
-INFO=INFO
+INFO=Information
 # The following ALL CAPS words should be translated.
-CONFIG= CONFIG
+CONFIG= Konfiguration
 # The following ALL CAPS words should be translated.
-FINE=FINE
+FINE=Fein
 # The following ALL CAPS words should be translated.
-FINER=FINER
+FINER=Feiner
 # The following ALL CAPS words should be translated.
-FINEST=FINEST
+FINEST=Am feinsten
 # The following ALL CAPS words should be translated.
-OFF=OFF
+OFF=Deaktiviert
--- a/src/share/classes/sun/util/logging/resources/logging_es.properties	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/share/classes/sun/util/logging/resources/logging_es.properties	Wed Jul 17 23:49:37 2013 +0100
@@ -27,20 +27,20 @@
 # these are the same as the non-localized level name.
 
 # The following ALL CAPS words should be translated.
-ALL=ALL
+ALL=Todo
 # The following ALL CAPS words should be translated.
-SEVERE=SEVERE
+SEVERE=Grave
 # The following ALL CAPS words should be translated.
-WARNING=WARNING
+WARNING=Advertencia
 # The following ALL CAPS words should be translated.
-INFO=INFO
+INFO=Informaci\u00F3n
 # The following ALL CAPS words should be translated.
-CONFIG= CONFIG
+CONFIG= Configurar
 # The following ALL CAPS words should be translated.
-FINE=FINE
+FINE=Detallado
 # The following ALL CAPS words should be translated.
-FINER=FINER
+FINER=Muy Detallado
 # The following ALL CAPS words should be translated.
-FINEST=FINEST
+FINEST=M\u00E1s Detallado
 # The following ALL CAPS words should be translated.
-OFF=OFF
+OFF=Desactivado
--- a/src/share/classes/sun/util/logging/resources/logging_fr.properties	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/share/classes/sun/util/logging/resources/logging_fr.properties	Wed Jul 17 23:49:37 2013 +0100
@@ -27,20 +27,20 @@
 # these are the same as the non-localized level name.
 
 # The following ALL CAPS words should be translated.
-ALL=ALL
+ALL=Tout
 # The following ALL CAPS words should be translated.
-SEVERE=SEVERE
+SEVERE=Grave
 # The following ALL CAPS words should be translated.
-WARNING=WARNING
+WARNING=Avertissement
 # The following ALL CAPS words should be translated.
-INFO=INFO
+INFO=Infos
 # The following ALL CAPS words should be translated.
-CONFIG= CONFIG
+CONFIG= Config
 # The following ALL CAPS words should be translated.
-FINE=FINE
+FINE=Pr\u00E9cis
 # The following ALL CAPS words should be translated.
-FINER=FINER
+FINER=Plus pr\u00E9cis
 # The following ALL CAPS words should be translated.
-FINEST=FINEST
+FINEST=Le plus pr\u00E9cis
 # The following ALL CAPS words should be translated.
-OFF=OFF
+OFF=D\u00E9sactiv\u00E9
--- a/src/share/classes/sun/util/logging/resources/logging_it.properties	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/share/classes/sun/util/logging/resources/logging_it.properties	Wed Jul 17 23:49:37 2013 +0100
@@ -27,20 +27,20 @@
 # these are the same as the non-localized level name.
 
 # The following ALL CAPS words should be translated.
-ALL=ALL
+ALL=Tutto
 # The following ALL CAPS words should be translated.
-SEVERE=SEVERE
+SEVERE=Grave
 # The following ALL CAPS words should be translated.
-WARNING=WARNING
+WARNING=Avvertenza
 # The following ALL CAPS words should be translated.
-INFO=INFO
+INFO=Informazioni
 # The following ALL CAPS words should be translated.
-CONFIG= CONFIG
+CONFIG= Configurazione
 # The following ALL CAPS words should be translated.
-FINE=FINE
+FINE=Buono
 # The following ALL CAPS words should be translated.
-FINER=FINER
+FINER=Migliore
 # The following ALL CAPS words should be translated.
-FINEST=FINEST
+FINEST=Ottimale
 # The following ALL CAPS words should be translated.
-OFF=OFF
+OFF=Non attivo
--- a/src/share/classes/sun/util/logging/resources/logging_ja.properties	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/share/classes/sun/util/logging/resources/logging_ja.properties	Wed Jul 17 23:49:37 2013 +0100
@@ -29,18 +29,18 @@
 # The following ALL CAPS words should be translated.
 ALL=\u3059\u3079\u3066
 # The following ALL CAPS words should be translated.
-SEVERE=SEVERE
+SEVERE=\u91CD\u5927
 # The following ALL CAPS words should be translated.
-WARNING=WARNING
+WARNING=\u8B66\u544A
 # The following ALL CAPS words should be translated.
 INFO=\u60C5\u5831
 # The following ALL CAPS words should be translated.
-CONFIG= CONFIG
+CONFIG= \u69CB\u6210
 # The following ALL CAPS words should be translated.
-FINE=\u8A73\u7D30\u30EC\u30D9\u30EB(\u4F4E)
+FINE=\u666E\u901A
 # The following ALL CAPS words should be translated.
-FINER=FINER
+FINER=\u8A73\u7D30
 # The following ALL CAPS words should be translated.
-FINEST=FINEST
+FINEST=\u6700\u3082\u8A73\u7D30
 # The following ALL CAPS words should be translated.
 OFF=\u30AA\u30D5
--- a/src/share/classes/sun/util/logging/resources/logging_ko.properties	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/share/classes/sun/util/logging/resources/logging_ko.properties	Wed Jul 17 23:49:37 2013 +0100
@@ -27,20 +27,20 @@
 # these are the same as the non-localized level name.
 
 # The following ALL CAPS words should be translated.
-ALL=ALL
+ALL=\uBAA8\uB450
 # The following ALL CAPS words should be translated.
-SEVERE=SEVERE
+SEVERE=\uC2EC\uAC01
 # The following ALL CAPS words should be translated.
-WARNING=WARNING
+WARNING=\uACBD\uACE0
 # The following ALL CAPS words should be translated.
-INFO=INFO
+INFO=\uC815\uBCF4
 # The following ALL CAPS words should be translated.
-CONFIG= CONFIG
+CONFIG= \uAD6C\uC131
 # The following ALL CAPS words should be translated.
-FINE=FINE
+FINE=\uBBF8\uC138
 # The following ALL CAPS words should be translated.
-FINER=FINER
+FINER=\uBCF4\uB2E4 \uBBF8\uC138
 # The following ALL CAPS words should be translated.
-FINEST=FINEST
+FINEST=\uAC00\uC7A5 \uBBF8\uC138
 # The following ALL CAPS words should be translated.
-OFF=OFF
+OFF=\uD574\uC81C
--- a/src/share/classes/sun/util/logging/resources/logging_pt_BR.properties	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/share/classes/sun/util/logging/resources/logging_pt_BR.properties	Wed Jul 17 23:49:37 2013 +0100
@@ -27,20 +27,20 @@
 # these are the same as the non-localized level name.
 
 # The following ALL CAPS words should be translated.
-ALL=ALL
+ALL=Tudo
 # The following ALL CAPS words should be translated.
-SEVERE=SEVERE
+SEVERE=Grave
 # The following ALL CAPS words should be translated.
-WARNING=WARNING
+WARNING=Advert\u00EAncia
 # The following ALL CAPS words should be translated.
-INFO=INFO
+INFO=Informa\u00E7\u00F5es
 # The following ALL CAPS words should be translated.
-CONFIG= CONFIG
+CONFIG= Configura\u00E7\u00E3o
 # The following ALL CAPS words should be translated.
-FINE=FINE
+FINE=Detalhado
 # The following ALL CAPS words should be translated.
-FINER=FINER
+FINER=Mais Detalhado
 # The following ALL CAPS words should be translated.
-FINEST=FINEST
+FINEST=O Mais Detalhado
 # The following ALL CAPS words should be translated.
-OFF=OFF
+OFF=Desativado
--- a/src/share/classes/sun/util/logging/resources/logging_sv.properties	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/share/classes/sun/util/logging/resources/logging_sv.properties	Wed Jul 17 23:49:37 2013 +0100
@@ -27,20 +27,20 @@
 # these are the same as the non-localized level name.
 
 # The following ALL CAPS words should be translated.
-ALL=ALLA
+ALL=Alla
 # The following ALL CAPS words should be translated.
-SEVERE=SEVERE
+SEVERE=Allvarlig
 # The following ALL CAPS words should be translated.
-WARNING=WARNING
+WARNING=Varning
 # The following ALL CAPS words should be translated.
-INFO=INFO
+INFO=Info
 # The following ALL CAPS words should be translated.
-CONFIG= CONFIG
+CONFIG= Konfig
 # The following ALL CAPS words should be translated.
-FINE=FINE
+FINE=Fin
 # The following ALL CAPS words should be translated.
-FINER=FINER
+FINER=Finare
 # The following ALL CAPS words should be translated.
-FINEST=FINEST
+FINEST=Finaste
 # The following ALL CAPS words should be translated.
-OFF=OFF
+OFF=Av
--- a/src/share/classes/sun/util/logging/resources/logging_zh_CN.properties	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/share/classes/sun/util/logging/resources/logging_zh_CN.properties	Wed Jul 17 23:49:37 2013 +0100
@@ -27,20 +27,20 @@
 # these are the same as the non-localized level name.
 
 # The following ALL CAPS words should be translated.
-ALL=ALL
+ALL=\u5168\u90E8
 # The following ALL CAPS words should be translated.
-SEVERE=SEVERE
+SEVERE=\u4E25\u91CD
 # The following ALL CAPS words should be translated.
-WARNING=WARNING
+WARNING=\u8B66\u544A
 # The following ALL CAPS words should be translated.
-INFO=INFO
+INFO=\u4FE1\u606F
 # The following ALL CAPS words should be translated.
-CONFIG= CONFIG
+CONFIG= \u914D\u7F6E
 # The following ALL CAPS words should be translated.
-FINE=FINE
+FINE=\u8BE6\u7EC6
 # The following ALL CAPS words should be translated.
-FINER=FINER
+FINER=\u8F83\u8BE6\u7EC6
 # The following ALL CAPS words should be translated.
-FINEST=FINEST
+FINEST=\u975E\u5E38\u8BE6\u7EC6
 # The following ALL CAPS words should be translated.
-OFF=OFF
+OFF=\u7981\u7528
--- a/src/share/classes/sun/util/logging/resources/logging_zh_TW.properties	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/share/classes/sun/util/logging/resources/logging_zh_TW.properties	Wed Jul 17 23:49:37 2013 +0100
@@ -27,20 +27,20 @@
 # these are the same as the non-localized level name.
 
 # The following ALL CAPS words should be translated.
-ALL=\u6240\u6709
+ALL=\u5168\u90E8
 # The following ALL CAPS words should be translated.
-SEVERE=SEVERE
+SEVERE=\u56B4\u91CD
 # The following ALL CAPS words should be translated.
-WARNING=WARNING
+WARNING=\u8B66\u544A
 # The following ALL CAPS words should be translated.
 INFO=\u8CC7\u8A0A
 # The following ALL CAPS words should be translated.
-CONFIG= CONFIG
+CONFIG= \u7D44\u614B
 # The following ALL CAPS words should be translated.
 FINE=\u8A73\u7D30
 # The following ALL CAPS words should be translated.
-FINER=FINER
+FINER=\u8F03\u8A73\u7D30
 # The following ALL CAPS words should be translated.
-FINEST=FINEST
+FINEST=\u6700\u8A73\u7D30
 # The following ALL CAPS words should be translated.
 OFF=\u95DC\u9589
--- a/src/share/lib/security/java.security-linux	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/share/lib/security/java.security-linux	Wed Jul 17 23:49:37 2013 +0100
@@ -124,7 +124,6 @@
 # corresponding RuntimePermission ("accessClassInPackage."+package) has
 # been granted.
 package.access=sun.,\
-               com.sun.corba.se.impl.,\
                com.sun.xml.internal.,\
                com.sun.imageio.,\
                com.sun.istack.internal.,\
@@ -162,7 +161,6 @@
 # checkPackageDefinition.
 #
 package.definition=sun.,\
-                   com.sun.corba.se.impl.,\
                    com.sun.xml.internal.,\
                    com.sun.imageio.,\
                    com.sun.istack.internal.,\
--- a/src/share/lib/security/java.security-macosx	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/share/lib/security/java.security-macosx	Wed Jul 17 23:49:37 2013 +0100
@@ -125,7 +125,6 @@
 # corresponding RuntimePermission ("accessClassInPackage."+package) has
 # been granted.
 package.access=sun.,\
-               com.sun.corba.se.impl.,\
                com.sun.xml.internal.,\
                com.sun.imageio.,\
                com.sun.istack.internal.,\
@@ -165,7 +164,6 @@
 # checkPackageDefinition.
 #
 package.definition=sun.,\
-                   com.sun.corba.se.impl.,\
                    com.sun.xml.internal.,\
                    com.sun.imageio.,\
                    com.sun.istack.internal.,\
--- a/src/share/lib/security/java.security-solaris	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/share/lib/security/java.security-solaris	Wed Jul 17 23:49:37 2013 +0100
@@ -126,7 +126,6 @@
 # corresponding RuntimePermission ("accessClassInPackage."+package) has
 # been granted.
 package.access=sun.,\
-               com.sun.corba.se.impl.,\
                com.sun.xml.internal.,\
                com.sun.imageio.,\
                com.sun.istack.internal.,\
@@ -165,7 +164,6 @@
 # checkPackageDefinition.
 #
 package.definition=sun.,\
-                   com.sun.corba.se.impl.,\
                    com.sun.xml.internal.,\
                    com.sun.imageio.,\
                    com.sun.istack.internal.,\
--- a/src/share/lib/security/java.security-windows	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/share/lib/security/java.security-windows	Wed Jul 17 23:49:37 2013 +0100
@@ -125,7 +125,6 @@
 # corresponding RuntimePermission ("accessClassInPackage."+package) has
 # been granted.
 package.access=sun.,\
-               com.sun.corba.se.impl.,\
                com.sun.xml.internal.,\
                com.sun.imageio.,\
                com.sun.istack.internal.,\
@@ -165,7 +164,6 @@
 # checkPackageDefinition.
 #
 package.definition=sun.,\
-                   com.sun.corba.se.impl.,\
                    com.sun.xml.internal.,\
                    com.sun.imageio.,\
                    com.sun.istack.internal.,\
--- a/src/share/native/sun/security/pkcs11/j2secmod.c	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/share/native/sun/security/pkcs11/j2secmod.c	Wed Jul 17 23:49:37 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -51,20 +51,63 @@
     return (res == 0) ? JNI_FALSE : JNI_TRUE;
 }
 
-JNIEXPORT jboolean JNICALL Java_sun_security_pkcs11_Secmod_nssInit
-  (JNIEnv *env, jclass thisClass, jstring jFunctionName, jlong jHandle, jstring jConfigDir)
+/*
+ * Initializes NSS.
+ * The NSS_INIT_OPTIMIZESPACE flag is supplied by the caller.
+ * The NSS_Init* functions are mapped to the NSS_Initialize function.
+ */
+JNIEXPORT jboolean JNICALL Java_sun_security_pkcs11_Secmod_nssInitialize
+  (JNIEnv *env, jclass thisClass, jstring jFunctionName, jlong jHandle, jstring jConfigDir, jboolean jNssOptimizeSpace)
 {
-    const char *functionName = (*env)->GetStringUTFChars(env, jFunctionName, NULL);
-    const char *configDir = (jConfigDir == NULL) ? NULL : (*env)->GetStringUTFChars(env, jConfigDir, NULL);
-    FPTR_Init init = (FPTR_Init)findFunction(env, jHandle, functionName);
-    int res;
+    const char *functionName =
+        (*env)->GetStringUTFChars(env, jFunctionName, NULL);
+    const char *configDir = (jConfigDir == NULL)
+        ? NULL : (*env)->GetStringUTFChars(env, jConfigDir, NULL);
+    FPTR_Initialize initialize =
+        (FPTR_Initialize)findFunction(env, jHandle, "NSS_Initialize");
+    int res = 0;
+    unsigned int flags = 0x00;
 
-    (*env)->ReleaseStringUTFChars(env, jFunctionName, functionName);
-    if (init == NULL) {
-        return JNI_FALSE;
+    if (jNssOptimizeSpace == JNI_TRUE) {
+        flags = 0x20; // NSS_INIT_OPTIMIZESPACE flag
     }
 
-    res = init(configDir);
+    if (initialize != NULL) {
+        /*
+         * If the NSS_Init function is requested then call NSS_Initialize to
+         * open the Cert, Key and Security Module databases, read only.
+         */
+        if (strcmp("NSS_Init", functionName) == 0) {
+            flags = flags | 0x01; // NSS_INIT_READONLY flag
+            res = initialize(configDir, "", "", "secmod.db", flags);
+
+        /*
+         * If the NSS_InitReadWrite function is requested then call
+         * NSS_Initialize to open the Cert, Key and Security Module databases,
+         * read/write.
+         */
+        } else if (strcmp("NSS_InitReadWrite", functionName) == 0) {
+            res = initialize(configDir, "", "", "secmod.db", flags);
+
+        /*
+         * If the NSS_NoDB_Init function is requested then call
+         * NSS_Initialize without creating Cert, Key or Security Module
+         * databases.
+         */
+        } else if (strcmp("NSS_NoDB_Init", functionName) == 0) {
+            flags = flags | 0x02  // NSS_INIT_NOCERTDB flag
+                          | 0x04  // NSS_INIT_NOMODDB flag
+                          | 0x08  // NSS_INIT_FORCEOPEN flag
+                          | 0x10; // NSS_INIT_NOROOTINIT flag
+            res = initialize("", "", "", "", flags);
+
+        } else {
+            res = 2;
+        }
+    } else {
+        res = 1;
+    }
+    (*env)->ReleaseStringUTFChars(env, jFunctionName, functionName);
     if (configDir != NULL) {
         (*env)->ReleaseStringUTFChars(env, jConfigDir, configDir);
     }
--- a/src/solaris/classes/sun/print/IPPPrintService.java	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/solaris/classes/sun/print/IPPPrintService.java	Wed Jul 17 23:49:37 2013 +0100
@@ -1029,7 +1029,16 @@
             // now supports collation and that most OS has a way
             // of setting it, it is a safe assumption to just always
             // include SheetCollate as supported attribute.
-            catList.add(SheetCollate.class);
+
+            /*
+               In Linux, we use Postscript for rendering but Linux still
+               has issues in propagating Postscript-embedded setpagedevice
+               setting like collation.  Therefore, we temporarily exclude
+               Linux.
+            */
+            if (!UnixPrintServiceLookup.isLinux()) {
+                catList.add(SheetCollate.class);
+            }
         }
 
         // With the assumption that  Chromaticity is equivalent to
--- a/src/solaris/classes/sun/print/UnixPrintServiceLookup.java	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/solaris/classes/sun/print/UnixPrintServiceLookup.java	Wed Jul 17 23:49:37 2013 +0100
@@ -123,6 +123,10 @@
         return osname.equals("SunOS");
     }
 
+    static boolean isLinux() {
+        return (osname.equals("Linux"));
+    }
+
     static boolean isBSD() {
         return (osname.equals("Linux") ||
                 osname.contains("OS X"));
--- a/src/solaris/native/sun/security/pkcs11/j2secmod_md.h	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/solaris/native/sun/security/pkcs11/j2secmod_md.h	Wed Jul 17 23:49:37 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,9 +25,14 @@
 
 // in nss.h:
 // extern PRBool NSS_VersionCheck(const char *importedVersion);
-// extern SECStatus NSS_Init(const char *configdir);
+// extern SECStatus NSS_Initialize(const char *configdir,
+//     const char *certPrefix, const char *keyPrefix,
+//     const char *secmodName, PRUint32 flags);
+
 typedef int (*FPTR_VersionCheck)(const char *importedVersion);
-typedef int (*FPTR_Init)(const char *configdir);
+typedef int (*FPTR_Initialize)(const char *configdir,
+        const char *certPrefix, const char *keyPrefix,
+        const char *secmodName, unsigned int flags);
 
 // in secmod.h
 //extern SECMODModule *SECMOD_LoadModule(char *moduleSpec,SECMODModule *parent,
--- a/src/windows/native/sun/security/pkcs11/j2secmod_md.h	Thu Jul 11 09:21:09 2013 +0200
+++ b/src/windows/native/sun/security/pkcs11/j2secmod_md.h	Wed Jul 17 23:49:37 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,9 +27,14 @@
 
 // in nss.h:
 // extern PRBool NSS_VersionCheck(const char *importedVersion);
-// extern SECStatus NSS_Init(const char *configdir);
+// extern SECStatus NSS_Initialize(const char *configdir,
+//      const char *certPrefix, const char *keyPrefix,
+//      const char *secmodName, PRUint32 flags);
+
 typedef int __declspec(dllimport) (*FPTR_VersionCheck)(const char *importedVersion);
-typedef int __declspec(dllimport) (*FPTR_Init)(const char *configdir);
+typedef int __declspec(dllimport) (*FPTR_Initialize)(const char *configdir,
+        const char *certPrefix, const char *keyPrefix,
+        const char *secmodName, unsigned int flags);
 
 // in secmod.h
 //extern SECMODModule *SECMOD_LoadModule(char *moduleSpec,SECMODModule *parent,
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/org/apache/xml/internal/security/encryption/XMLCipher/GetInstance.java	Wed Jul 17 23:49:37 2013 +0100
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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 8017173
+ * @summary Check that an XMLCipher with RSA_OAEP Key Transport algorithm can
+ *    be instantiated
+ * @compile -XDignore.symbol.file GetInstance.java
+ * @run main GetInstance
+ */
+import com.sun.org.apache.xml.internal.security.Init;
+import com.sun.org.apache.xml.internal.security.encryption.XMLCipher;
+
+public class GetInstance {
+
+    private static final String RSA_OAEP =
+        "http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p";
+
+    public static void main(String[] args) throws Exception {
+        Init.init();
+        XMLCipher.getInstance(RSA_OAEP);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Graphics2D/Test8004859/Test8004859.java	Wed Jul 17 23:49:37 2013 +0100
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Graphics2D;
+import java.awt.Rectangle;
+import java.awt.Shape;
+import java.awt.geom.NoninvertibleTransformException;
+import java.awt.image.BufferedImage;
+
+import sun.java2d.SunGraphics2D;
+
+/**
+ * @test
+ * @bug 8004859
+ * @summary getClipBounds/getClip should return equivalent bounds.
+ * @author Sergey Bylokhov
+ */
+public final class Test8004859 {
+
+    private static Shape[] clips = {new Rectangle(0, 0, -1, -1), new Rectangle(
+            100, 100, -100, -100)};
+
+    private static boolean status = true;
+
+    public static void main(final String[] args)
+            throws NoninvertibleTransformException {
+        final BufferedImage bi = new BufferedImage(300, 300,
+                                                   BufferedImage.TYPE_INT_RGB);
+        final Graphics2D g = (Graphics2D) bi.getGraphics();
+        test(g);
+        g.translate(2.0, 2.0);
+        test(g);
+        g.translate(-4.0, -4.0);
+        test(g);
+        g.scale(2.0, 2.0);
+        test(g);
+        g.scale(-4.0, -4.0);
+        test(g);
+        g.rotate(Math.toRadians(90));
+        test(g);
+        g.rotate(Math.toRadians(90));
+        test(g);
+        g.rotate(Math.toRadians(90));
+        test(g);
+        g.rotate(Math.toRadians(90));
+        test(g);
+        g.dispose();
+        if (!status) {
+            throw new RuntimeException("Test failed");
+        }
+    }
+
+    private static void test(final Graphics2D g) {
+        for (final Shape clip : clips) {
+            g.setClip(clip);
+            if (!g.getClip().equals(clip)) {
+                System.err.println("Expected clip: " + clip);
+                System.err.println("Actual clip: " + g.getClip());
+                System.err.println("bounds="+g.getClip().getBounds2D());
+                System.err.println("bounds="+g.getClip().getBounds());
+                status = false;
+            }
+            final Rectangle bounds = g.getClipBounds();
+            if (!clip.equals(bounds)) {
+                System.err.println("Expected getClipBounds(): " + clip);
+                System.err.println("Actual getClipBounds(): " + bounds);
+                status = false;
+            }
+            g.getClipBounds(bounds);
+            if (!clip.equals(bounds)) {
+                System.err.println("Expected getClipBounds(r): " + clip);
+                System.err.println("Actual getClipBounds(r): " + bounds);
+                status = false;
+            }
+            if (!clip.getBounds2D().isEmpty() && ((SunGraphics2D) g).clipRegion
+                    .isEmpty()) {
+                System.err.println("clipRegion should not be empty");
+                status = false;
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/GraphicsDevice/IncorrectDisplayModeExitFullscreen.java	Wed Jul 17 23:49:37 2013 +0100
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+import java.awt.Color;
+import java.awt.DisplayMode;
+import java.awt.Frame;
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsEnvironment;
+import java.awt.Toolkit;
+
+import sun.awt.SunToolkit;
+
+/**
+ * @test
+ * @bug 8019587
+ * @author Sergey Bylokhov
+ */
+public class IncorrectDisplayModeExitFullscreen {
+
+    public static void main(final String[] args) {
+
+        final GraphicsDevice[] devices =
+                GraphicsEnvironment.getLocalGraphicsEnvironment()
+                                   .getScreenDevices();
+        if (devices.length < 2 || devices[0].getDisplayModes().length < 2
+                || !devices[0].isFullScreenSupported()
+                || !devices[1].isFullScreenSupported()) {
+            System.err.println("Testcase is not applicable");
+            return;
+        }
+        final DisplayMode defaultDM = devices[0].getDisplayMode();
+        final DisplayMode[] dms = devices[0].getDisplayModes();
+        DisplayMode nonDefaultDM = null;
+
+        for (final DisplayMode dm : dms) {
+            if (!dm.equals(defaultDM)) {
+                nonDefaultDM = dm;
+                break;
+            }
+        }
+        if (nonDefaultDM == null) {
+            System.err.println("Testcase is not applicable");
+            return;
+        }
+
+        final Frame frame = new Frame();
+        frame.setBackground(Color.GREEN);
+        frame.setUndecorated(true);
+        try {
+            devices[0].setFullScreenWindow(frame);
+            sleep();
+            devices[0].setDisplayMode(nonDefaultDM);
+            sleep();
+            devices[1].setFullScreenWindow(frame);
+            sleep();
+            if (!defaultDM.equals(devices[0].getDisplayMode())) {
+                throw new RuntimeException("DisplayMode is not restored");
+            }
+        } finally {
+            // cleaning up
+            devices[0].setFullScreenWindow(null);
+            devices[1].setFullScreenWindow(null);
+            frame.dispose();
+        }
+    }
+    private static void sleep() {
+        ((SunToolkit) Toolkit.getDefaultToolkit()).realSync();
+        try {
+            Thread.sleep(1500);
+        } catch (InterruptedException ignored) {
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/dnd/DisposeFrameOnDragCrash/DisposeFrameOnDragTest.java	Wed Jul 17 23:49:37 2013 +0100
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test @summary JVM crash if the frame is disposed in DropTargetListener
+ * @author Petr Pchelko
+ * @library ../../regtesthelpers
+ * @build Util
+ * @compile DisposeFrameOnDragTest.java
+ * @run main/othervm DisposeFrameOnDragTest
+ */
+import java.awt.AWTException;
+import java.awt.Point;
+import java.awt.Robot;
+import java.awt.dnd.DropTargetAdapter;
+import java.awt.dnd.DropTargetDragEvent;
+import java.awt.dnd.DropTargetDropEvent;
+import java.awt.event.InputEvent;
+import java.lang.reflect.InvocationTargetException;
+import java.util.TooManyListenersException;
+import javax.swing.JFrame;
+import javax.swing.JTextArea;
+import javax.swing.SwingUtilities;
+import test.java.awt.regtesthelpers.Util;
+
+public class DisposeFrameOnDragTest {
+
+    private static JTextArea textArea;
+
+    public static void main(String[] args) throws Throwable {
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                constructTestUI();
+            }
+        });
+
+        Util.waitForIdle(null);
+        try {
+            Point loc = textArea.getLocationOnScreen();
+            Util.drag(new Robot(),
+                    new Point((int) loc.x + 3, (int) loc.y + 3),
+                    new Point((int) loc.x + 40, (int) loc.y + 40),
+                    InputEvent.BUTTON1_MASK);
+        } catch (AWTException ex) {
+            throw new RuntimeException("Could not initiate a drag operation");
+        }
+        Util.waitForIdle(null);
+    }
+
+    private static void constructTestUI() {
+        final JFrame frame = new JFrame("Test frame");
+        textArea = new JTextArea("Drag Me!");
+        try {
+            textArea.getDropTarget().addDropTargetListener(new DropTargetAdapter() {
+                @Override
+                public void drop(DropTargetDropEvent dtde) {
+                    //IGNORE
+                }
+
+                @Override
+                public void dragOver(DropTargetDragEvent dtde) {
+                    frame.dispose();
+                }
+            });
+        } catch (TooManyListenersException ex) {
+            throw new RuntimeException(ex);
+        }
+        textArea.setSize(100, 100);
+        textArea.setDragEnabled(true);
+        textArea.select(0, textArea.getText().length());
+        frame.add(textArea);
+        frame.setBounds(100, 100, 100, 100);
+        frame.setVisible(true);
+    }
+}
--- a/test/java/lang/SecurityManager/CheckPackageAccess.java	Thu Jul 11 09:21:09 2013 +0200
+++ b/test/java/lang/SecurityManager/CheckPackageAccess.java	Wed Jul 17 23:49:37 2013 +0100
@@ -22,31 +22,127 @@
  */
 
 /*
- * @test
- * @bug 7146431 8000450
- * @summary Test that internal packages cannot be accessed
+ *  @test
+ *  @bug 6741606 7146431 8000450
+ *  @summary Make sure all restricted packages listed in the package.access
+ *           property in the java.security file are blocked
+ *  @run main/othervm CheckPackageAccess
  */
 
+import java.security.Security;
+import java.util.Collections;
+import java.util.Arrays;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.StringTokenizer;
+
+/*
+ * The main benefit of this test is to catch merge errors or other types
+ * of issues where one or more of the packages are accidentally
+ * removed. This is why the packages that are known to be restricted have to
+ * be explicitly listed below.
+ */
 public class CheckPackageAccess {
 
+    /*
+     * This array should be updated whenever new packages are added to the
+     * package.access property in the java.security file
+     */
+    private static final String[] packages = {
+        "sun.",
+        "com.sun.xml.internal.",
+        "com.sun.imageio.",
+        "com.sun.istack.internal.",
+        "com.sun.jmx.",
+        "com.sun.proxy.",
+        "com.sun.org.apache.bcel.internal.",
+        "com.sun.org.apache.regexp.internal.",
+        "com.sun.org.apache.xerces.internal.",
+        "com.sun.org.apache.xpath.internal.",
+        "com.sun.org.apache.xalan.internal.extensions.",
+        "com.sun.org.apache.xalan.internal.lib.",
+        "com.sun.org.apache.xalan.internal.res.",
+        "com.sun.org.apache.xalan.internal.templates.",
+        "com.sun.org.apache.xalan.internal.utils.",
+        "com.sun.org.apache.xalan.internal.xslt.",
+        "com.sun.org.apache.xalan.internal.xsltc.cmdline.",
+        "com.sun.org.apache.xalan.internal.xsltc.compiler.",
+        "com.sun.org.apache.xalan.internal.xsltc.trax.",
+        "com.sun.org.apache.xalan.internal.xsltc.util.",
+        "com.sun.org.apache.xml.internal.res.",
+        "com.sun.org.apache.xml.internal.security.",
+        "com.sun.org.apache.xml.internal.serializer.utils.",
+        "com.sun.org.apache.xml.internal.utils.",
+        "com.sun.org.glassfish.",
+        "oracle.jrockit.jfr.",
+        "org.jcp.xml.dsig.internal.",
+    };
+
     public static void main(String[] args) throws Exception {
+        List<String> pkgs = new ArrayList<>(Arrays.asList(packages));
+        String osName = System.getProperty("os.name");
+        if (osName.contains("OS X")) {
+            pkgs.add("apple.");  // add apple package for OS X
+        } else if (osName.startsWith("Windows")) {
+            pkgs.add("com.sun.java.accessibility.");
+        }
 
-        String[] pkgs = new String[] {
-            "com.sun.corba.se.impl.",
-            "com.sun.org.apache.xerces.internal.utils.",
-            "com.sun.org.apache.xalan.internal.utils." };
-        SecurityManager sm = new SecurityManager();
-        System.setSecurityManager(sm);
-        for (String pkg : pkgs) {
-            System.out.println("Checking package access for " + pkg);
+        List<String> jspkgs =
+            getPackages(Security.getProperty("package.access"));
+
+        // Sort to ensure lists are comparable
+        Collections.sort(pkgs);
+        Collections.sort(jspkgs);
+
+        if (!pkgs.equals(jspkgs)) {
+            for (String p : pkgs)
+                if (!jspkgs.contains(p))
+                    System.out.println("In golden set, but not in j.s file: " + p);
+            for (String p : jspkgs)
+                if (!pkgs.contains(p))
+                    System.out.println("In j.s file, but not in golden set: " + p);
+
+
+            throw new RuntimeException("restricted packages are not " +
+                                       "consistent with java.security file");
+        }
+        System.setSecurityManager(new SecurityManager());
+        SecurityManager sm = System.getSecurityManager();
+        for (String pkg : packages) {
+            String subpkg = pkg + "foo";
             try {
                 sm.checkPackageAccess(pkg);
-                throw new Exception("Expected PackageAccess SecurityException not thrown");
+                throw new RuntimeException("Able to access " + pkg +
+                                           " package");
+            } catch (SecurityException se) { }
+            try {
+                sm.checkPackageAccess(subpkg);
+                throw new RuntimeException("Able to access " + subpkg +
+                                           " package");
             } catch (SecurityException se) { }
             try {
                 sm.checkPackageDefinition(pkg);
-                throw new Exception("Expected PackageDefinition SecurityException not thrown");
+                throw new RuntimeException("Able to define class in " + pkg +
+                                           " package");
+            } catch (SecurityException se) { }
+            try {
+                sm.checkPackageDefinition(subpkg);
+                throw new RuntimeException("Able to define class in " + subpkg +
+                                           " package");
             } catch (SecurityException se) { }
         }
+        System.out.println("Test passed");
+    }
+
+    private static List<String> getPackages(String p) {
+        List<String> packages = new ArrayList<>();
+        if (p != null && !p.equals("")) {
+            StringTokenizer tok = new StringTokenizer(p, ",");
+            while (tok.hasMoreElements()) {
+                String s = tok.nextToken().trim();
+                packages.add(s);
+            }
+        }
+        return packages;
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/util/logging/LevelResourceBundle.java	Wed Jul 17 23:49:37 2013 +0100
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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.*;
+import java.util.logging.*;
+
+/*
+ * @test
+ * @bug 8020228
+ * @summary test logging.properties localized
+ * @run main LevelResourceBundle
+ */
+
+public class LevelResourceBundle {
+    public static void main(String args[]) throws Exception {
+        final String name = "SEVERE";
+        String en = getLocalizedMessage(Locale.getDefault(), name);
+        String fr = getLocalizedMessage(Locale.FRANCE, name);
+        if (!name.equals(en)) {
+             throw new RuntimeException("Expect " + name + " equals " + en);
+        }
+        if (name.equals(fr)) {
+             throw new RuntimeException("Expect " + name + " not equals " + fr);
+        }
+    }
+
+    private static final String RBNAME = "sun.util.logging.resources.logging";
+    private static String getLocalizedMessage(Locale locale, String key) {
+        ResourceBundle rb = ResourceBundle.getBundle(RBNAME, locale);
+        return rb.getString(key);
+    }
+}
--- a/test/javax/swing/JMenuItem/ActionListenerCalledTwice/ActionListenerCalledTwiceTest.java	Thu Jul 11 09:21:09 2013 +0200
+++ b/test/javax/swing/JMenuItem/ActionListenerCalledTwice/ActionListenerCalledTwiceTest.java	Wed Jul 17 23:49:37 2013 +0100
@@ -35,10 +35,11 @@
 import javax.swing.*;
 
 public class ActionListenerCalledTwiceTest {
-    static String menuItems[] = { "Item1", "Item2" };
+    static String menuItems[] = { "Item1", "Item2", "Item3" };
     static KeyStroke keyStrokes[] = {
         KeyStroke.getKeyStroke(KeyEvent.VK_E, InputEvent.META_MASK),
-        KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0)
+        KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0),
+        KeyStroke.getKeyStroke(KeyEvent.VK_UP, InputEvent.SHIFT_MASK),
     };
 
     static volatile int listenerCallCounter = 0;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/xml/jaxp/common/8020430/JAXP15RegTest.java	Wed Jul 17 23:49:37 2013 +0100
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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 8020430
+ * @summary test that setProperty for XMLOutputFactory works properly
+ * @run main/othervm JAXP15RegTest
+ */
+import java.security.Policy;
+import javax.xml.stream.XMLOutputFactory;
+
+/**
+ * @author huizhe.wang@oracle.com
+ */
+public class JAXP15RegTest extends TestBase {
+
+    public JAXP15RegTest(String name) {
+        super(name);
+    }
+
+    private boolean hasSM;
+    private Policy _orig;
+
+
+    /**
+     * @param args the command line arguments
+     */
+    public static void main(String[] args) {
+        JAXP15RegTest test = new JAXP15RegTest("JAXP 1.5 regression");
+        test.setUp();
+        test.testXMLOutputFactory();
+        test.tearDown();
+    }
+
+
+    public void testXMLOutputFactory() {
+        XMLOutputFactory factory = XMLOutputFactory.newInstance();
+        factory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, true);
+        success("testXMLOutputFactory passed");
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/xml/jaxp/common/8020430/TestBase.java	Wed Jul 17 23:49:37 2013 +0100
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.security.Policy;
+
+/**
+ *
+ *
+ * @author huizhe.wang@oracle.com
+ */
+public class TestBase {
+    String filePath;
+    boolean hasSM;
+    String curDir;
+    Policy origPolicy;
+
+    String testName;
+    static String errMessage;
+
+    int passed = 0, failed = 0;
+
+    /**
+     * Creates a new instance of StreamReader
+     */
+    public TestBase(String name) {
+        testName = name;
+    }
+
+    //junit @Override
+    protected void setUp() {
+        if (System.getSecurityManager() != null) {
+            hasSM = true;
+            System.setSecurityManager(null);
+        }
+
+        filePath = System.getProperty("test.src");
+        if (filePath == null) {
+            //current directory
+            filePath = System.getProperty("user.dir");
+        }
+        origPolicy = Policy.getPolicy();
+
+    }
+
+    //junit @Override
+    public void tearDown() {
+        // turn off security manager and restore policy
+        System.setSecurityManager(null);
+        Policy.setPolicy(origPolicy);
+        if (hasSM) {
+            System.setSecurityManager(new SecurityManager());
+        }
+        System.out.println("\nNumber of tests passed: " + passed);
+        System.out.println("Number of tests failed: " + failed + "\n");
+
+        if (errMessage != null ) {
+            throw new RuntimeException(errMessage);
+        }
+    }
+
+    void fail(String errMsg) {
+        if (errMessage == null) {
+            errMessage = errMsg;
+        } else {
+            errMessage = errMessage + "\n" + errMsg;
+        }
+        failed++;
+    }
+
+    void success(String msg) {
+        passed++;
+        System.out.println(msg);
+    }
+
+}