changeset 5610:46a953726240

Merge
author coffeys
date Tue, 18 Dec 2012 12:24:53 +0000
parents 74b06b7d2f93 88c54f7a8c51
children 8cca787a38e8
files .hgtags make/sun/javazic/tzdata/VERSION make/sun/javazic/tzdata/asia make/sun/javazic/tzdata/australasia make/sun/javazic/tzdata/northamerica make/sun/javazic/tzdata/southamerica src/macosx/classes/sun/lwawt/LWWindowPeer.java src/macosx/classes/sun/lwawt/macosx/CPlatformEmbeddedFrame.java src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java src/macosx/native/sun/awt/CMenuItem.m src/share/classes/java/beans/IndexedPropertyDescriptor.java src/share/classes/java/beans/Introspector.java src/share/classes/java/beans/PropertyDescriptor.java src/share/classes/sun/awt/AWTAccessor.java src/share/classes/sun/awt/SunToolkit.java src/share/classes/sun/net/www/MessageHeader.java src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java src/share/classes/sun/security/provider/certpath/OCSPResponse.java src/solaris/native/sun/nio/ch/FileDispatcherImpl.c src/windows/classes/sun/net/www/protocol/http/ntlm/NTLMAuthentication.java test/ProblemList.txt test/sun/net/www/messageheader/0 test/sun/net/www/messageheader/1 test/sun/net/www/messageheader/2 test/sun/net/www/messageheader/3 test/sun/net/www/messageheader/4 test/sun/net/www/messageheader/5 test/sun/net/www/messageheader/6 test/sun/net/www/messageheader/HTest.java
diffstat 4 files changed, 203 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Fri Dec 14 03:47:10 2012 +0000
+++ b/.hgtags	Tue Dec 18 12:24:53 2012 +0000
@@ -213,6 +213,16 @@
 901c290c9c8b495a2696f10a87523363239d001b jdk7u9-b02
 7302c386ca9c6cd20c27d0a2adb0b142f679d6b3 jdk7u9-b04
 ffad06d7009576c3098705e05452ebc309a59e56 jdk7u9-b05
+c1efb11d7db509dafd7882811b2562ba593f6431 jdk7u10-b10
+0243e41000c6f76654725cac31ffdc95633c63e7 jdk7u10-b11
+c86a49dd4a0dca3a56f00429cfcffb2ad5f2a224 jdk7u10-b12
+c6de70ed568d190c9c7d9641b88b9b5f1bc36fd5 jdk7u10-b13
+abe96e9e10f973cf0fdacc1475e69a274ef76fcf jdk7u10-b14
+c9a0e381cd8eaf62bcacfd59b01c249de81ae167 jdk7u10-b15
+ed59989fb0635f2d4461173e218c43494f06bb82 jdk7u10-b16
+a1c5bac982a6d4aa58f551cb46cde53f526aca48 jdk7u10-b17
+115d1e4365293846bbc911cf312886c471e37fbd jdk7u10-b18
+84218dff5e4c7bc00fd9266769c0d12bdde866f5 jdk7u10-b30
 df945ef30444adf08f3ef14b0c49c8bda6dda587 jdk7u8-b01
 dd1e513c05b8b8c8402e9ecf9c0d5bdbebb1a089 jdk7u8-b02
 355cf1937d0824b54ac38ee5a5496197647840f9 jdk7u8-b03
--- a/test/java/util/concurrent/Executors/AutoShutdown.java	Fri Dec 14 03:47:10 2012 +0000
+++ b/test/java/util/concurrent/Executors/AutoShutdown.java	Tue Dec 18 12:24:53 2012 +0000
@@ -67,6 +67,11 @@
         e1 = e2 = null;
         for (int i = 0; i < 10 && Thread.activeCount() > count0; i++)
             tryWaitForFinalizersToRun();
+        for (int i = 0; i < 10; ++i) { // give JVM a chance to settle.
+            if (Thread.activeCount() == count0)
+                return;
+            Thread.sleep(1000);
+        }
         equal(Thread.activeCount(), count0);
     }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/JMenuItem/ActionListenerCalledTwice/ActionListenerCalledTwiceTest.java	Tue Dec 18 12:24:53 2012 +0000
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 7160951
+ * @summary [macosx] ActionListener called twice for JMenuItem using ScreenMenuBar
+ * @author vera.akulova@oracle.com
+ * @run main ActionListenerCalledTwiceTest
+ */
+
+import sun.awt.*;
+import java.awt.*;
+import java.awt.event.*;
+import javax.swing.*;
+
+public class ActionListenerCalledTwiceTest {
+    static volatile int listenerCallCounter = 0;
+    public static void main(String[] args) throws Exception {
+        if (sun.awt.OSInfo.getOSType() != sun.awt.OSInfo.OSType.MACOSX) {
+            System.out.println("This test is for MacOS only. Automatically passed on other platforms.");
+            return;
+        }
+        System.setProperty("apple.laf.useScreenMenuBar", "true");
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                createAndShowGUI();
+            }
+        });
+        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+        Robot robot = new Robot();
+        robot.setAutoDelay(100);
+        robot.keyPress(KeyEvent.VK_META);
+        robot.keyPress(KeyEvent.VK_E);
+        robot.keyRelease(KeyEvent.VK_E);
+        robot.keyRelease(KeyEvent.VK_META);
+        toolkit.realSync();
+        if (listenerCallCounter != 1) {
+            throw new Exception("Test failed: ActionListener called " + listenerCallCounter + " times instead of 1!");
+        }
+    }
+
+    private static void createAndShowGUI() {
+        JMenuItem newItem = new JMenuItem("Exit");
+        newItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_E, InputEvent.META_MASK));
+        newItem.addActionListener(
+            new ActionListener(){
+                public void actionPerformed(ActionEvent e) {
+                    listenerCallCounter++;
+                }
+            }
+        );
+        JMenu menu = new JMenu("Menu");
+        menu.add(newItem);
+        JMenuBar bar = new JMenuBar();
+        bar.add(menu);
+        JFrame frame = new JFrame("Test");
+        frame.setJMenuBar(bar);
+        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        frame.pack();
+        frame.setVisible(true);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/JMenuItem/ShortcutNotDiplayed/ShortcutNotDisplayedTest.java	Tue Dec 18 12:24:53 2012 +0000
@@ -0,0 +1,105 @@
+/*
+ * 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 7186371
+ * @summary [macosx] Main menu shortcuts not displayed
+ * @author vera.akulova@oracle.com
+ * @run main/manual ShortcutNotDisplayedTest
+ */
+
+import java.awt.*;
+import java.awt.event.*;
+import javax.swing.*;
+
+public class ShortcutNotDisplayedTest {
+    static volatile boolean done = false;
+    static volatile boolean pass = false;
+    static final String PASS_COMMAND = "pass";
+
+    public static void main(String[] args) throws Exception {
+        if (sun.awt.OSInfo.getOSType() != sun.awt.OSInfo.OSType.MACOSX) {
+            System.out.println("This test is for MacOS only. Automatically passed on other platforms.");
+            return;
+        }
+        System.setProperty("apple.laf.useScreenMenuBar", "true");
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                createAndShowGUI();
+            }
+        });
+
+        do { try { Thread.sleep(300); } catch (Exception e) {} } while (!done) ;
+        if (!pass) {
+            throw new Exception("Shortcuts not displayed as expected in the screen menu bar.");
+        }
+    }
+
+    private static void createAndShowGUI() {
+        JMenuItem newItem = new JMenuItem("Exit");
+        newItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_E, java.awt.event.InputEvent.META_MASK));
+
+        JMenu menu = new JMenu("Test Frame Window Menu");
+        menu.setMnemonic(KeyEvent.VK_M);
+        menu.add(newItem);
+
+        JMenuBar bar = new JMenuBar();
+        bar.add(menu);
+        JTextArea text = new JTextArea(
+            "  Please follow instructions:\n" +
+            "  1. You should see \"Test Frame Window Menu\" menu on the screen menu bar.\n" +
+            "  2. Open \"Test Frame Window Menu\" menu. \n" +
+            "     Check that menu item \"Exit\" has a shortcut with image for Command Key and symbol \"E\". \n" +
+            "     If you see the shortcut press \"Passed\". Otherwise press \"Failed\".\n"
+        );
+        text.setEditable(false);
+
+        JScrollPane sp = new JScrollPane(text);
+        sp.setSize(300,200);
+
+        JButton passBtn = new JButton("Pass");
+        passBtn.setActionCommand(PASS_COMMAND);
+        JButton failBtn = new JButton("Fail");
+        ActionListener listener = new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                if (e.getActionCommand().equals(PASS_COMMAND)) {
+                    pass = true;
+                }
+                done = true;
+            }
+        };
+
+        JFrame testFrame = new JFrame("Test Frame Window");
+        testFrame.setLayout(new FlowLayout());
+        testFrame.setBounds(100, 100, 600, 180);
+        testFrame.setJMenuBar(bar);
+        testFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        passBtn.addActionListener(listener);
+        failBtn.addActionListener(listener);
+        testFrame.getContentPane().add(sp);
+        testFrame.getContentPane().add(passBtn);
+        testFrame.getContentPane().add(failBtn);
+        testFrame.setVisible(true);
+    }
+}