changeset 5519:88bae220774b

Merge
author asaha
date Tue, 07 Aug 2012 14:30:03 -0700
parents 87d482d3515f (current diff) 1c775da99873 (diff)
children 355cf1937d08
files .hgtags
diffstat 25 files changed, 442 insertions(+), 88 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Mon Aug 06 15:27:20 2012 -0700
+++ b/.hgtags	Tue Aug 07 14:30:03 2012 -0700
@@ -194,5 +194,8 @@
 4a6917092af80481c1fa5b9ec8ccae75411bb72c jdk7u6-b18
 a263f787ced5bc7c14078ae552c82de6bd011611 jdk7u6-b19
 09145b546a2b6ae1f44d5c8a7d2a37d48e4b39e2 jdk7u6-b20
+243717d7fe9589148951ffb5551264af0e446314 jdk7u6-b21
+d78f2b600d393f45d6ace8ca0f29ad677624a775 jdk7u6-b22
+0ae89e53f5300da1961984a7d81c220c7cf717d7 jdk7u6-b23
 df945ef30444adf08f3ef14b0c49c8bda6dda587 jdk7u8-b01
 dd1e513c05b8b8c8402e9ecf9c0d5bdbebb1a089 jdk7u8-b02
--- a/src/macosx/classes/sun/awt/CGraphicsDevice.java	Mon Aug 06 15:27:20 2012 -0700
+++ b/src/macosx/classes/sun/awt/CGraphicsDevice.java	Tue Aug 07 14:30:03 2012 -0700
@@ -48,6 +48,9 @@
 
     private static AWTPermission fullScreenExclusivePermission;
 
+    // Save/restore DisplayMode for the Full Screen mode
+    private DisplayMode originalMode;
+
     public CGraphicsDevice(int displayID) {
         this.displayID = displayID;
         configs = new GraphicsConfiguration[] {
@@ -124,18 +127,22 @@
         }
 
         boolean fsSupported = isFullScreenSupported();
+
         if (fsSupported && old != null) {
             // enter windowed mode (and restore original display mode)
             exitFullScreenExclusive(old);
-
-            // TODO: restore display mode
+            if (originalMode != null) {
+                setDisplayMode(originalMode);
+                originalMode = null;
+            }
         }
 
         super.setFullScreenWindow(w);
 
         if (fsSupported && w != null) {
-            // TODO: save current display mode
-
+            if (isDisplayChangeSupported()) {
+                originalMode = getDisplayMode();
+            }
             // enter fullscreen mode
             enterFullScreenExclusive(w);
         }
--- a/src/macosx/classes/sun/lwawt/macosx/CDataTransferer.java	Mon Aug 06 15:27:20 2012 -0700
+++ b/src/macosx/classes/sun/lwawt/macosx/CDataTransferer.java	Tue Aug 07 14:30:03 2012 -0700
@@ -182,6 +182,10 @@
         Long format = predefinedClipboardNameMap.get(str);
 
         if (format == null) {
+            if (java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().isHeadlessInstance()) {
+                // Do not try to access GUI manager for unknown format
+                return new Long(-1);
+            }
             format = new Long(registerFormatWithPasteboard(str));
             predefinedClipboardNameMap.put(str, format);
             predefinedClipboardFormatMap.put(format, str);
--- a/src/macosx/classes/sun/lwawt/macosx/CToolkitThreadBlockedHandler.java	Mon Aug 06 15:27:20 2012 -0700
+++ b/src/macosx/classes/sun/lwawt/macosx/CToolkitThreadBlockedHandler.java	Tue Aug 07 14:30:03 2012 -0700
@@ -28,7 +28,10 @@
 import sun.awt.datatransfer.ToolkitThreadBlockedHandler;
 
 final class CToolkitThreadBlockedHandler implements ToolkitThreadBlockedHandler {
-    private final LWCToolkit toolkit = (LWCToolkit)java.awt.Toolkit.getDefaultToolkit();
+    private final LWCToolkit toolkit =
+            java.awt.Toolkit.getDefaultToolkit() instanceof LWCToolkit
+                    ? (LWCToolkit)java.awt.Toolkit.getDefaultToolkit()
+                    : null;
 
     public void lock() {
     }
@@ -44,7 +47,9 @@
         // Despite the naming of this method, on MacOS only one
         // event is read and dispatched before this method returns.
         // This call is non-blocking and does not wait for an event
-        toolkit.startNativeNestedEventLoop();
+        if (toolkit != null) {
+            toolkit.startNativeNestedEventLoop();
+        }
     }
 
     public void exit() {
--- a/src/macosx/native/sun/awt/CGraphicsDevice.m	Mon Aug 06 15:27:20 2012 -0700
+++ b/src/macosx/native/sun/awt/CGraphicsDevice.m	Tue Aug 07 14:30:03 2012 -0700
@@ -28,7 +28,7 @@
 /*
  * Convert the mode string to the more convinient bits per pixel value
  */
-static int getBPPFromModeString(CFStringRef mode) 
+static int getBPPFromModeString(CFStringRef mode)
 {
     if ((CFStringCompare(mode, CFSTR(kIO30BitDirectPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo)) {
         // This is a strange mode, where we using 10 bits per RGB component and pack it into 32 bits
@@ -44,7 +44,7 @@
     else if (CFStringCompare(mode, CFSTR(IO8BitIndexedPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
         return 8;
     }
-    
+
     return 0;
 }
 
@@ -68,6 +68,11 @@
             // One of the key parameters does not match
             continue;
         }
+
+        if (refrate == 0) { // REFRESH_RATE_UNKNOWN
+            return cRef;
+        }
+
         // Refresh rate might be 0 in display mode and we ask for specific display rate
         // but if we do not find exact match then 0 refresh rate might be just Ok
         if (CGDisplayModeGetRefreshRate(cRef) == refrate) {
@@ -165,7 +170,10 @@
                 }
             }
         }];
+    } else {
+        [JNFException raise:env as:kIllegalArgumentException reason:"Invalid display mode"];
     }
+
     CFRelease(allModes);
     JNF_COCOA_EXIT(env);
 }
--- a/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java	Mon Aug 06 15:27:20 2012 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java	Tue Aug 07 14:30:03 2012 -0700
@@ -796,9 +796,10 @@
             "Menu.margin", zeroInsets,
             "Menu.cancelMode", "hideMenuTree",
             "Menu.alignAcceleratorText", Boolean.FALSE,
+            "Menu.useMenuBarForTopLevelMenus", Boolean.TRUE,
 
 
-            "MenuBar.windowBindings", new Object[] {
+                "MenuBar.windowBindings", new Object[] {
                 "F10", "takeFocus" },
             "MenuBar.font", new FontLazyValue(Region.MENU_BAR),
 
--- a/src/share/classes/com/sun/java/swing/plaf/gtk/GTKStyleFactory.java	Mon Aug 06 15:27:20 2012 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/gtk/GTKStyleFactory.java	Tue Aug 07 14:30:03 2012 -0700
@@ -92,7 +92,13 @@
                 boolean defaultCapable = btn.isDefaultCapable();
                 key = new ComplexKey(wt, toolButton, defaultCapable);
             }
+        } else if (id == Region.MENU) {
+            if (c instanceof JMenu && ((JMenu) c).isTopLevelMenu() &&
+                    UIManager.getBoolean("Menu.useMenuBarForTopLevelMenus")) {
+                wt = WidgetType.MENU_BAR;
+            }
         }
+
         if (key == null) {
             // Otherwise, just use the WidgetType as the key.
             key = wt;
--- a/src/share/classes/java/awt/EventQueue.java	Mon Aug 06 15:27:20 2012 -0700
+++ b/src/share/classes/java/awt/EventQueue.java	Tue Aug 07 14:30:03 2012 -0700
@@ -36,6 +36,8 @@
 import java.security.PrivilegedAction;
 
 import java.util.EmptyStackException;
+
+import sun.awt.dnd.SunDropTargetEvent;
 import sun.util.logging.PlatformLogger;
 
 import sun.awt.AppContext;
@@ -348,6 +350,10 @@
     }
 
     private boolean coalesceMouseEvent(MouseEvent e) {
+        if (e instanceof SunDropTargetEvent) {
+            // SunDropTargetEvent should not coalesce with MouseEvent
+            return false;
+        }
         EventQueueItem[] cache = ((Component)e.getSource()).eventCache;
         if (cache == null) {
             return false;
@@ -427,6 +433,10 @@
     }
 
     private void cacheEQItem(EventQueueItem entry) {
+        if(entry.event instanceof SunDropTargetEvent) {
+            // Do not cache SunDropTargetEvent, it should not coalesce
+            return;
+        }
         int index = eventToCacheIndex(entry.event);
         if (index != -1 && entry.event.getSource() instanceof Component) {
             Component source = (Component)entry.event.getSource();
--- a/src/share/classes/java/awt/GraphicsEnvironment.java	Mon Aug 06 15:27:20 2012 -0700
+++ b/src/share/classes/java/awt/GraphicsEnvironment.java	Tue Aug 07 14:30:03 2012 -0700
@@ -170,12 +170,12 @@
                         if (System.getProperty("javaplugin.version") != null) {
                             headless = defaultHeadless = Boolean.FALSE;
                         } else {
-                            if ("sun.awt.HeadlessGraphicsEnvironment".equals(
-                                    System.getProperty("java.awt.graphicsenv")))
+                            String osName = System.getProperty("os.name");
+                            if (osName.contains("OS X") && "sun.awt.HToolkit".equals(
+                                    System.getProperty("awt.toolkit")))
                             {
                                 headless = defaultHeadless = Boolean.TRUE;
                             } else {
-                                String osName = System.getProperty("os.name");
                                 headless = defaultHeadless =
                                     Boolean.valueOf(("Linux".equals(osName) ||
                                                      "SunOS".equals(osName) ||
--- a/src/share/classes/java/net/HttpCookie.java	Mon Aug 06 15:27:20 2012 -0700
+++ b/src/share/classes/java/net/HttpCookie.java	Tue Aug 07 14:30:03 2012 -0700
@@ -154,7 +154,7 @@
 
     private HttpCookie(String name, String value, String header) {
         name = name.trim();
-        if (name.length() == 0 || !isToken(name) || isReserved(name)) {
+        if (name.length() == 0 || !isToken(name) || name.charAt(0) == '$') {
             throw new IllegalArgumentException("Illegal cookie name");
         }
 
@@ -909,32 +909,6 @@
 
 
     /*
-     * @param name      the name to be tested
-     * @return          <tt>true</tt> if the name is reserved by cookie
-     *                  specification, <tt>false</tt> if it is not
-     */
-    private static boolean isReserved(String name) {
-        if (name.equalsIgnoreCase("Comment")
-            || name.equalsIgnoreCase("CommentURL")      // rfc2965 only
-            || name.equalsIgnoreCase("Discard")         // rfc2965 only
-            || name.equalsIgnoreCase("Domain")
-            || name.equalsIgnoreCase("Expires")         // netscape draft only
-            || name.equalsIgnoreCase("Max-Age")
-            || name.equalsIgnoreCase("Path")
-            || name.equalsIgnoreCase("Port")            // rfc2965 only
-            || name.equalsIgnoreCase("Secure")
-            || name.equalsIgnoreCase("Version")
-            || name.equalsIgnoreCase("HttpOnly")
-            || name.charAt(0) == '$')
-        {
-            return true;
-        }
-
-        return false;
-    }
-
-
-    /*
      * Parse header string to cookie object.
      *
      * @param header    header string; should contain only one NAME=VALUE pair
--- a/src/share/classes/javax/swing/SwingUtilities.java	Mon Aug 06 15:27:20 2012 -0700
+++ b/src/share/classes/javax/swing/SwingUtilities.java	Tue Aug 07 14:30:03 2012 -0700
@@ -319,7 +319,8 @@
             newEvent = new MouseWheelEvent(newSource,
                                            sourceWheelEvent.getID(),
                                            sourceWheelEvent.getWhen(),
-                                           sourceWheelEvent.getModifiers(),
+                                           sourceWheelEvent.getModifiers()
+                                                   | sourceWheelEvent.getModifiersEx(),
                                            p.x,p.y,
                                            sourceWheelEvent.getXOnScreen(),
                                            sourceWheelEvent.getYOnScreen(),
@@ -334,7 +335,8 @@
             newEvent = new MenuDragMouseEvent(newSource,
                                               sourceMenuDragEvent.getID(),
                                               sourceMenuDragEvent.getWhen(),
-                                              sourceMenuDragEvent.getModifiers(),
+                                              sourceMenuDragEvent.getModifiers()
+                                                      | sourceMenuDragEvent.getModifiersEx(),
                                               p.x,p.y,
                                               sourceMenuDragEvent.getXOnScreen(),
                                               sourceMenuDragEvent.getYOnScreen(),
@@ -347,7 +349,8 @@
             newEvent = new MouseEvent(newSource,
                                       sourceEvent.getID(),
                                       sourceEvent.getWhen(),
-                                      sourceEvent.getModifiers(),
+                                      sourceEvent.getModifiers()
+                                              | sourceEvent.getModifiersEx(),
                                       p.x,p.y,
                                       sourceEvent.getXOnScreen(),
                                       sourceEvent.getYOnScreen(),
--- a/src/share/classes/javax/swing/plaf/synth/SynthMenuUI.java	Mon Aug 06 15:27:20 2012 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthMenuUI.java	Tue Aug 07 14:30:03 2012 -0700
@@ -299,7 +299,8 @@
      */
     @Override
     public void propertyChange(PropertyChangeEvent e) {
-        if (SynthLookAndFeel.shouldUpdateStyle(e)) {
+        if (SynthLookAndFeel.shouldUpdateStyle(e) ||
+                (e.getPropertyName().equals("ancestor") && UIManager.getBoolean("Menu.useMenuBarForTopLevelMenus"))) {
             updateStyle((JMenu)e.getSource());
         }
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/beans/editors/BoolEditor.java	Tue Aug 07 14:30:03 2012 -0700
@@ -0,0 +1,31 @@
+  /*
+   * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+   *
+   * This code is free software; you can redistribute it and/or modify it
+   * under the terms of the GNU General Public License version 2 only, as
+   * published by the Free Software Foundation.  Oracle designates this
+   * particular file as subject to the "Classpath" exception as provided
+   * by Oracle in the LICENSE file that accompanied this code.
+   *
+   * This code is distributed in the hope that it will be useful, but WITHOUT
+   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+   * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+   * version 2 for more details (a copy is included in the LICENSE file that
+   * accompanied this code).
+   *
+   * You should have received a copy of the GNU General Public License version
+   * 2 along with this work; if not, write to the Free Software Foundation,
+   * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+   *
+   * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+   * or visit www.oracle.com if you need additional information or have any
+   * questions.
+   */
+  package sun.beans.editors;
+
+  /**
+   * FOR BACKWARD COMPATIBILITY ONLY - DO NOT USE.
+   */
+  public class BoolEditor extends BooleanEditor {
+  }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/beans/editors/IntEditor.java	Tue Aug 07 14:30:03 2012 -0700
@@ -0,0 +1,31 @@
+  /*
+   * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+   *
+   * This code is free software; you can redistribute it and/or modify it
+   * under the terms of the GNU General Public License version 2 only, as
+   * published by the Free Software Foundation.  Oracle designates this
+   * particular file as subject to the "Classpath" exception as provided
+   * by Oracle in the LICENSE file that accompanied this code.
+   *
+   * This code is distributed in the hope that it will be useful, but WITHOUT
+   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+   * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+   * version 2 for more details (a copy is included in the LICENSE file that
+   * accompanied this code).
+   *
+   * You should have received a copy of the GNU General Public License version
+   * 2 along with this work; if not, write to the Free Software Foundation,
+   * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+   *
+   * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+   * or visit www.oracle.com if you need additional information or have any
+   * questions.
+   */
+  package sun.beans.editors;
+
+  /**
+   * FOR BACKWARD COMPATIBILITY ONLY - DO NOT USE.
+   */
+  public class IntEditor extends IntegerEditor {
+  }
--- a/src/share/classes/sun/font/SunLayoutEngine.java	Mon Aug 06 15:27:20 2012 -0700
+++ b/src/share/classes/sun/font/SunLayoutEngine.java	Tue Aug 07 14:30:03 2012 -0700
@@ -137,8 +137,9 @@
 
         LayoutEngine e = (LayoutEngine)cache.get(key);
         if (e == null) {
-            e = new SunLayoutEngine(key.copy());
-            cache.put(key, e);
+            LayoutEngineKey copy = key.copy();
+            e = new SunLayoutEngine(copy);
+            cache.put(copy, e);
         }
         return e;
     }
--- a/src/share/classes/sun/security/pkcs/SignerInfo.java	Mon Aug 06 15:27:20 2012 -0700
+++ b/src/share/classes/sun/security/pkcs/SignerInfo.java	Tue Aug 07 14:30:03 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -273,6 +273,24 @@
         return certList;
     }
 
+    // Copied from com.sun.crypto.provider.OAEPParameters.
+    private static String convertToStandardName(String internalName) {
+        if (internalName.equals("SHA")) {
+            return "SHA-1";
+        } else if (internalName.equals("SHA224")) {
+            return "SHA-224";
+        } else if (internalName.equals("SHA256")) {
+            return "SHA-256";
+        } else if (internalName.equals("SHA384")) {
+            return "SHA-384";
+        } else if (internalName.equals("SHA512")) {
+            return "SHA-512";
+        } else {
+            return internalName;
+        }
+    }
+
+
     /* Returns null if verify fails, this signerInfo if
        verify succeeds. */
     SignerInfo verify(PKCS7 block, byte[] data)
@@ -311,7 +329,8 @@
                 if (messageDigest == null) // fail if there is no message digest
                     return null;
 
-                MessageDigest md = MessageDigest.getInstance(digestAlgname);
+                MessageDigest md = MessageDigest.getInstance(
+                        convertToStandardName(digestAlgname));
                 byte[] computedMessageDigest = md.digest(data);
 
                 if (messageDigest.length != computedMessageDigest.length)
--- a/src/share/classes/sun/security/provider/certpath/OCSPResponse.java	Mon Aug 06 15:27:20 2012 -0700
+++ b/src/share/classes/sun/security/provider/certpath/OCSPResponse.java	Tue Aug 07 14:30:03 2012 -0700
@@ -349,7 +349,9 @@
             }
         }
 
-        X509Certificate trustedResponderCert = null;
+        // By default, the OCSP responder's cert is the same as the issuer of
+        // the cert being validated. The issuer cert is the first in the list.
+        X509Certificate trustedResponderCert = responderCerts.get(0);
 
         // Check whether the signer cert returned by the responder is trusted
         if (x509Certs != null && x509Certs[0] != null) {
--- a/src/solaris/native/java/lang/java_props_md.c	Mon Aug 06 15:27:20 2012 -0700
+++ b/src/solaris/native/java/lang/java_props_md.c	Tue Aug 07 14:30:03 2012 -0700
@@ -398,6 +398,7 @@
     PreferredToolkit prefToolkit = getPreferredToolkit();
     switch (prefToolkit) {
         case CToolkit:
+        case HToolkit:
             sprops.graphics_env = "sun.awt.CGraphicsEnvironment";
             break;
         case XToolkit:
@@ -405,9 +406,6 @@
     sprops.graphics_env = "sun.awt.X11GraphicsEnvironment";
 #ifdef MACOSX
             break;
-        default:
-            sprops.graphics_env = "sun.java2d.HeadlessGraphicsEnvironment";
-            break;
     }
 #endif
     /* AWT properties */
--- a/src/windows/classes/sun/awt/windows/WComponentPeer.java	Mon Aug 06 15:27:20 2012 -0700
+++ b/src/windows/classes/sun/awt/windows/WComponentPeer.java	Tue Aug 07 14:30:03 2012 -0700
@@ -419,8 +419,12 @@
     public void createScreenSurface(boolean isResize)
     {
         Win32GraphicsConfig gc = (Win32GraphicsConfig)getGraphicsConfiguration();
+        if (gc == null) {
+            surfaceData = null;
+            return;
+        }
+
         ScreenUpdateManager mgr = ScreenUpdateManager.getInstance();
-
         surfaceData = mgr.createScreenSurface(gc, this, numBackBuffers, isResize);
     }
 
--- a/src/windows/native/sun/windows/awt_TextArea.cpp	Mon Aug 06 15:27:20 2012 -0700
+++ b/src/windows/native/sun/windows/awt_TextArea.cpp	Tue Aug 07 14:30:03 2012 -0700
@@ -131,48 +131,13 @@
     MsgRouting mr = mrDoDefault;
 
     switch (message) {
-        case WM_PRINTCLIENT:
-          {
-            FORMATRANGE fr;
-            HDC hPrinterDC = (HDC)wParam;
-            int nHorizRes = ::GetDeviceCaps(hPrinterDC, HORZRES);
-            int nVertRes = ::GetDeviceCaps(hPrinterDC, VERTRES);
-            int nLogPixelsX = ::GetDeviceCaps(hPrinterDC, LOGPIXELSX);
-            int nLogPixelsY = ::GetDeviceCaps(hPrinterDC, LOGPIXELSY);
-
-            // Ensure the printer DC is in MM_TEXT mode.
-            ::SetMapMode ( hPrinterDC, MM_TEXT );
-
-            // Rendering to the same DC we are measuring.
-            ::ZeroMemory(&fr, sizeof(fr));
-            fr.hdc = fr.hdcTarget = hPrinterDC;
-            // Set up the page.
-            fr.rcPage.left     = fr.rcPage.top = 0;
-            fr.rcPage.right    = (nHorizRes/nLogPixelsX) * 1440; // in twips
-            fr.rcPage.bottom   = (nVertRes/nLogPixelsY) * 1440;
-            fr.rc.left   = fr.rcPage.left;
-            fr.rc.top    = fr.rcPage.top;
-            fr.rc.right  = fr.rcPage.right;
-            fr.rc.bottom = fr.rcPage.bottom;
-
-            // start printing from the first visible line
-            LRESULT nLine = SendMessage(EM_GETFIRSTVISIBLELINE, 0, 0);
-            LONG startCh = static_cast<LONG>(SendMessage(EM_LINEINDEX,
-                                                         (WPARAM)nLine, 0));
-            fr.chrg.cpMin = startCh;
-            fr.chrg.cpMax = -1;
-
-            SendMessage(EM_FORMATRANGE, TRUE, (LPARAM)&fr);
-          }
-
-        break;
     case EM_SETCHARFORMAT:
     case WM_SETFONT:
         SetIgnoreEnChange(TRUE);
         break;
     }
 
-    retValue = AwtComponent::WindowProc(message, wParam, lParam);
+    retValue = AwtTextComponent::WindowProc(message, wParam, lParam);
 
     switch (message) {
     case EM_SETCHARFORMAT:
--- a/src/windows/native/sun/windows/awt_TextComponent.cpp	Mon Aug 06 15:27:20 2012 -0700
+++ b/src/windows/native/sun/windows/awt_TextComponent.cpp	Tue Aug 07 14:30:03 2012 -0700
@@ -215,6 +215,50 @@
     return c;
 }
 
+LRESULT
+AwtTextComponent::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) {
+
+    switch (message) {
+        case WM_PRINTCLIENT:
+          {
+            FORMATRANGE fr;
+            HDC hPrinterDC = (HDC)wParam;
+            int nHorizRes = ::GetDeviceCaps(hPrinterDC, HORZRES);
+            int nVertRes = ::GetDeviceCaps(hPrinterDC, VERTRES);
+            int nLogPixelsX = ::GetDeviceCaps(hPrinterDC, LOGPIXELSX);
+            int nLogPixelsY = ::GetDeviceCaps(hPrinterDC, LOGPIXELSY);
+
+            // Ensure the printer DC is in MM_TEXT mode.
+            ::SetMapMode ( hPrinterDC, MM_TEXT );
+
+            // Rendering to the same DC we are measuring.
+            ::ZeroMemory(&fr, sizeof(fr));
+            fr.hdc = fr.hdcTarget = hPrinterDC;
+            // Set up the page.
+            fr.rcPage.left     = fr.rcPage.top = 0;
+            fr.rcPage.right    = (nHorizRes/nLogPixelsX) * 1440; // in twips
+            fr.rcPage.bottom   = (nVertRes/nLogPixelsY) * 1440;
+            fr.rc.left   = fr.rcPage.left;
+            fr.rc.top    = fr.rcPage.top;
+            fr.rc.right  = fr.rcPage.right;
+            fr.rc.bottom = fr.rcPage.bottom;
+
+            // start printing from the first visible line
+            LRESULT nLine = SendMessage(EM_GETFIRSTVISIBLELINE, 0, 0);
+            LONG startCh = static_cast<LONG>(SendMessage(EM_LINEINDEX,
+                                                         (WPARAM)nLine, 0));
+            fr.chrg.cpMin = startCh;
+            fr.chrg.cpMax = -1;
+
+            SendMessage(EM_FORMATRANGE, TRUE, (LPARAM)&fr);
+          }
+
+        break;
+    }
+
+    return AwtComponent::WindowProc(message, wParam, lParam);
+}
+
 LONG AwtTextComponent::EditGetCharFromPos(POINT& pt) {
     return static_cast<LONG>(SendMessage(EM_CHARFROMPOS, 0,
             reinterpret_cast<LPARAM>(&pt)));
--- a/src/windows/native/sun/windows/awt_TextComponent.h	Mon Aug 06 15:27:20 2012 -0700
+++ b/src/windows/native/sun/windows/awt_TextComponent.h	Tue Aug 07 14:30:03 2012 -0700
@@ -50,6 +50,7 @@
     static AwtTextComponent* Create(jobject self, jobject parent, BOOL isMultiline);
 
     virtual LPCTSTR GetClassName();
+    LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
 
     int RemoveCR(WCHAR *pStr);
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/net/HttpCookie/IllegalCookieNameTest.java	Tue Aug 07 14:30:03 2012 -0700
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* @test
+ * @bug 7183292
+ */
+import java.net.*;
+import java.util.*;
+import java.io.*;
+import com.sun.net.httpserver.*;
+
+public class IllegalCookieNameTest {
+    public static void main(String[] args) throws IOException {
+        HttpServer s = null;
+        try {
+            InetSocketAddress addr = new InetSocketAddress(0);
+            s = HttpServer.create(addr, 10);
+            s.createContext("/", new HHandler());
+            s.start();
+            String u = "http://127.0.0.1:" + s.getAddress().getPort() + "/";
+            CookieHandler.setDefault(new TestCookieHandler());
+            URL url = new URL(u);
+            HttpURLConnection c = (HttpURLConnection) url.openConnection();
+            c.getHeaderFields();
+            System.out.println ("OK");
+        } finally {
+            s.stop(1);
+        }
+    }
+}
+
+class TestCookieHandler extends CookieHandler {
+    @Override
+    public Map<String, List<String>> get(URI uri, Map<String, List<String>> requestHeaders) {
+        return new HashMap<String, List<String>>();
+    }
+
+    @Override
+    public void put(URI uri, Map<String, List<String>> responseHeaders) {
+    }
+}
+
+class HHandler implements  HttpHandler {
+    public void handle (HttpExchange e) {
+        try {
+            Headers h = e.getResponseHeaders();
+            h.set ("Set-Cookie", "domain=; expires=Mon, 01-Jan-1990 00:00:00 GMT; path=/; domain=.foo.com");
+            e.sendResponseHeaders(200, -1);
+            e.close();
+        } catch (Exception ex) {
+            System.out.println (ex);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/SwingUtilities/7170657/bug7170657.java	Tue Aug 07 14:30:03 2012 -0700
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Frame;
+import java.awt.event.InputEvent;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseWheelEvent;
+
+import javax.swing.SwingUtilities;
+import javax.swing.event.MenuDragMouseEvent;
+
+/**
+ * @test
+ * @bug 7170657
+ * @author Sergey Bylokhov
+ */
+public final class bug7170657 {
+
+    private static boolean FAILED;
+
+    public static void main(final String[] args) {
+        final int mask = InputEvent.META_DOWN_MASK | InputEvent.CTRL_MASK;
+
+        Frame f = new Frame();
+
+        MouseEvent mwe = new MouseWheelEvent(f, 1, 1, mask, 1, 1, 1, 1, 1, true,
+                                             1, 1, 1);
+        MouseEvent mdme = new MenuDragMouseEvent(f, 1, 1, mask, 1, 1, 1, 1, 1,
+                                                 true, null, null);
+        MouseEvent me = new MouseEvent(f, 1, 1, mask, 1, 1, 1, 1, 1, true,
+                                       MouseEvent.NOBUTTON);
+
+        test(f, mwe);
+        test(f, mdme);
+        test(f, me);
+
+        if (FAILED) {
+            throw new RuntimeException("Wrong mouse event");
+        }
+    }
+
+
+    private static void test(final Frame frame, final MouseEvent me) {
+        MouseEvent newme = SwingUtilities.convertMouseEvent(frame, me, frame);
+        if (me.getModifiersEx() != newme.getModifiersEx()
+                || me.getModifiers() != newme.getModifiers()) {
+            fail(me, newme);
+        }
+    }
+
+    private static void fail(final MouseEvent exp, final MouseEvent act) {
+        System.err.println("Expected: " + exp);
+        System.err.println("Actual: " + act);
+        FAILED = true;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/security/x509/AlgorithmId/NonStandardNames.java	Tue Aug 07 14:30:03 2012 -0700
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 7180907
+ * @summary Jarsigner -verify fails if rsa file used sha-256 with authenticated attributes
+ */
+
+import java.security.MessageDigest;
+import java.security.Signature;
+import java.security.cert.X509Certificate;
+import sun.security.pkcs.ContentInfo;
+import sun.security.pkcs.PKCS7;
+import sun.security.pkcs.PKCS9Attribute;
+import sun.security.pkcs.PKCS9Attributes;
+import sun.security.pkcs.SignerInfo;
+import sun.security.x509.CertAndKeyGen;
+import sun.security.x509.AlgorithmId;
+import sun.security.x509.X500Name;
+
+public class NonStandardNames {
+
+    public static void main(String[] args) throws Exception {
+
+        byte[] data = "Hello".getBytes();
+        X500Name n = new X500Name("cn=Me");
+
+        CertAndKeyGen cakg = new CertAndKeyGen("RSA", "SHA256withRSA");
+        cakg.generate(1024);
+        X509Certificate cert = cakg.getSelfCertificate(n, 1000);
+
+        MessageDigest md = MessageDigest.getInstance("SHA-256");
+        PKCS9Attributes authed = new PKCS9Attributes(new PKCS9Attribute[]{
+            new PKCS9Attribute(PKCS9Attribute.CONTENT_TYPE_OID, ContentInfo.DATA_OID),
+            new PKCS9Attribute(PKCS9Attribute.MESSAGE_DIGEST_OID, md.digest(data)),
+        });
+
+        Signature s = Signature.getInstance("SHA256withRSA");
+        s.initSign(cakg.getPrivateKey());
+        s.update(authed.getDerEncoding());
+        byte[] sig = s.sign();
+
+        SignerInfo signerInfo = new SignerInfo(
+                n,
+                cert.getSerialNumber(),
+                AlgorithmId.get("SHA-256"),
+                authed,
+                AlgorithmId.get("SHA256withRSA"),
+                sig,
+                null
+                );
+
+        PKCS7 pkcs7 = new PKCS7(
+                new AlgorithmId[] {signerInfo.getDigestAlgorithmId()},
+                new ContentInfo(data),
+                new X509Certificate[] {cert},
+                new SignerInfo[] {signerInfo});
+
+        if (pkcs7.verify(signerInfo, data) == null) {
+            throw new Exception("Not verified");
+        }
+    }
+}