Merge
authorjgodinez
Tue, 03 May 2011 22:14:39 -0700
changeset 9496 60957339f2b5
parent 9485 2aa800293a90 (current diff)
parent 9495 f0b0ad903f6f (diff)
child 9552 2d4eeef2bea2
Merge
--- a/jdk/make/sun/javazic/tzdata/VERSION	Tue May 03 22:13:02 2011 -0700
+++ b/jdk/make/sun/javazic/tzdata/VERSION	Tue May 03 22:14:39 2011 -0700
@@ -21,4 +21,4 @@
 # or visit www.oracle.com if you need additional information or have any
 # questions.
 #
-tzdata2011e
+tzdata2011g
--- a/jdk/make/sun/javazic/tzdata/africa	Tue May 03 22:13:02 2011 -0700
+++ b/jdk/make/sun/javazic/tzdata/africa	Tue May 03 22:14:39 2011 -0700
@@ -234,7 +234,21 @@
 Rule	Egypt	1990	1994	-	May	 1	1:00	1:00	S
 # IATA (after 1990) says transitions are at 0:00.
 # Go with IATA starting in 1995, except correct 1995 entry from 09-30 to 09-29.
-Rule	Egypt	1995	max	-	Apr	lastFri	 0:00s	1:00	S
+
+# From Alexander Krivenyshev (2011-04-20):
+# "...Egypt's interim cabinet decided on Wednesday to cancel daylight
+# saving time after a poll posted on its website showed the majority of
+# Egyptians would approve the cancellation."
+#
+# Egypt to cancel daylight saving time
+# <a href="http://www.almasryalyoum.com/en/node/407168">
+# http://www.almasryalyoum.com/en/node/407168
+# </a>
+# or
+# <a href="http://www.worldtimezone.com/dst_news/dst_news_egypt04.html">
+# http://www.worldtimezone.com/dst_news/dst_news_egypt04.html
+# </a>
+Rule	Egypt	1995	2010	-	Apr	lastFri	 0:00s	1:00	S
 Rule	Egypt	1995	2005	-	Sep	lastThu	23:00s	0	-
 # From Steffen Thorsen (2006-09-19):
 # The Egyptian Gazette, issue 41,090 (2006-09-18), page 1, reports:
@@ -335,7 +349,7 @@
 Rule	Egypt	2009	only	-	Aug	20	23:00s	0	-
 Rule	Egypt	2010	only	-	Aug	11	0:00	0	-
 Rule	Egypt	2010	only	-	Sep	10	0:00	1:00	S
-Rule	Egypt	2010	max	-	Sep	lastThu	23:00s	0	-
+Rule	Egypt	2010	only	-	Sep	lastThu	23:00s	0	-
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Africa/Cairo	2:05:00 -	LMT	1900 Oct
--- a/jdk/make/sun/javazic/tzdata/europe	Tue May 03 22:13:02 2011 -0700
+++ b/jdk/make/sun/javazic/tzdata/europe	Tue May 03 22:14:39 2011 -0700
@@ -168,7 +168,7 @@
 # A monument to Willett was unveiled on 1927-05-21, in an open space in
 # a 45-acre wood near Chislehurst, Kent that was purchased by popular
 # subscription and open to the public.  On the south face of the monolith,
-# designed by G. W. Miller, is the the William Willett Memorial Sundial,
+# designed by G. W. Miller, is the...William Willett Memorial Sundial,
 # which is permanently set to Summer Time.
 
 # From Winston Churchill (1934-04-28):
@@ -1808,7 +1808,7 @@
 #
 # All these events predate our cutoff date of 1970.  Unless we can
 # come up with more definitive info about the timekeeping during the
-# war years it's probably best just do do the following for now:
+# war years it's probably best just do...the following for now:
 Link	Europe/Oslo	Arctic/Longyearbyen
 
 # Poland
--- a/jdk/make/sun/javazic/tzdata/southamerica	Tue May 03 22:13:02 2011 -0700
+++ b/jdk/make/sun/javazic/tzdata/southamerica	Tue May 03 22:14:39 2011 -0700
@@ -767,7 +767,7 @@
 #
 # As a result of the above Decree I believe the America/Rio_Branco
 # timezone shall be modified from UTC-5 to UTC-4 and a new timezone shall
-# be created to represent the the west side of the Para State. I
+# be created to represent the...west side of the Para State. I
 # suggest this new timezone be called Santarem as the most
 # important/populated city in the affected area.
 #
@@ -1365,6 +1365,24 @@
 # For now, we'll just record the time in Stanley, since we have no
 # better info.
 
+# From Steffen Thorsen (2011-04-01):
+# The Falkland Islands will not turn back clocks this winter, but stay on
+# daylight saving time.
+#
+# One source:
+# <a href="http://www.falklandnews.com/public/story.cfm?get=5914&source=3">
+# http://www.falklandnews.com/public/story.cfm?get=5914&source=3
+# </a>
+#
+# We have gotten this confirmed by a clerk of the legislative assembly:
+# Normally the clocks revert to Local Mean Time (UTC/GMT -4 hours) on the
+# third Sunday of April at 0200hrs and advance to Summer Time (UTC/GMT -3
+# hours) on the first Sunday of September at 0200hrs.
+#
+# IMPORTANT NOTE: During 2011, on a trial basis, the Falkland Islands
+# will not revert to local mean time, but clocks will remain on Summer
+# time (UTC/GMT - 3 hours) throughout the whole of 2011.  Any long term
+# change to local time following the trial period will be notified.
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Falk	1937	1938	-	Sep	lastSun	0:00	1:00	S
 Rule	Falk	1938	1942	-	Mar	Sun>=19	0:00	0	-
@@ -1376,7 +1394,8 @@
 Rule	Falk	1984	only	-	Sep	16	0:00	1:00	S
 Rule	Falk	1985	2000	-	Sep	Sun>=9	0:00	1:00	S
 Rule	Falk	1986	2000	-	Apr	Sun>=16	0:00	0	-
-Rule	Falk	2001	max	-	Apr	Sun>=15	2:00	0	-
+Rule	Falk	2001	2010	-	Apr	Sun>=15	2:00	0	-
+Rule	Falk	2012	max	-	Apr	Sun>=15	2:00	0	-
 Rule	Falk	2001	max	-	Sep	Sun>=1	2:00	1:00	S
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Atlantic/Stanley	-3:51:24 -	LMT	1890
--- a/jdk/src/share/classes/javax/swing/JPopupMenu.java	Tue May 03 22:13:02 2011 -0700
+++ b/jdk/src/share/classes/javax/swing/JPopupMenu.java	Tue May 03 22:14:39 2011 -0700
@@ -342,8 +342,8 @@
 
         // Calculate the screen size that popup should fit
         Dimension popupSize = JPopupMenu.this.getPreferredSize();
-        int popupRightX = popupLocation.x + popupSize.width;
-        int popupBottomY = popupLocation.y + popupSize.height;
+        long popupRightX = (long)popupLocation.x + (long)popupSize.width;
+        long popupBottomY = (long)popupLocation.y + (long)popupSize.height;
         int scrWidth = scrBounds.width;
         int scrHeight = scrBounds.height;
         if (!canPopupOverlapTaskBar()) {
@@ -358,13 +358,13 @@
         int scrBottomY = scrBounds.y + scrHeight;
 
         // Ensure that popup menu fits the screen
-        if (popupRightX > scrRightX) {
+        if (popupRightX > (long)scrRightX) {
             popupLocation.x = scrRightX - popupSize.width;
             if( popupLocation.x < scrBounds.x ) {
                 popupLocation.x = scrBounds.x ;
             }
         }
-        if (popupBottomY > scrBottomY) {
+        if (popupBottomY > (long)scrBottomY) {
             popupLocation.y = scrBottomY - popupSize.height;
             if( popupLocation.y < scrBounds.y ) {
                 popupLocation.y = scrBounds.y;
--- a/jdk/src/share/classes/javax/swing/JSplitPane.java	Tue May 03 22:13:02 2011 -0700
+++ b/jdk/src/share/classes/javax/swing/JSplitPane.java	Tue May 03 22:14:39 2011 -0700
@@ -671,7 +671,7 @@
      * which must be <code>true</code> for the child components
      * to be continuously
      * redisplayed and laid out during user intervention.
-     * The default value of this property is <code>false</code>.
+     * The default value of this property is look and feel dependent.
      * Some look and feels might not support continuous layout;
      * they will ignore this property.
      *
--- a/jdk/src/share/classes/sun/awt/ExtendedKeyCodes.java	Tue May 03 22:13:02 2011 -0700
+++ b/jdk/src/share/classes/sun/awt/ExtendedKeyCodes.java	Tue May 03 22:14:39 2011 -0700
@@ -13,7 +13,7 @@
      */
      // Keycodes declared in KeyEvent.java with corresponding Unicode values.
      private final static HashMap<Integer, Integer>  regularKeyCodesMap =
-                                          new HashMap<Integer,Integer>(83, 1.0f);
+                                          new HashMap<Integer,Integer>(98, 1.0f);
 
      // Keycodes derived from Unicode values. Here should be collected codes
      // for characters appearing on the primary layer of at least one
@@ -108,6 +108,21 @@
          regularKeyCodesMap.put(0x5E, KeyEvent.VK_CIRCUMFLEX);
          regularKeyCodesMap.put(0x5F, KeyEvent.VK_UNDERSCORE);
          regularKeyCodesMap.put(0x60, KeyEvent.VK_BACK_QUOTE);
+         regularKeyCodesMap.put(0x61, KeyEvent.VK_A);
+         regularKeyCodesMap.put(0x62, KeyEvent.VK_B);
+         regularKeyCodesMap.put(0x63, KeyEvent.VK_C);
+         regularKeyCodesMap.put(0x64, KeyEvent.VK_D);
+         regularKeyCodesMap.put(0x65, KeyEvent.VK_E);
+         regularKeyCodesMap.put(0x66, KeyEvent.VK_F);
+         regularKeyCodesMap.put(0x67, KeyEvent.VK_G);
+         regularKeyCodesMap.put(0x68, KeyEvent.VK_H);
+         regularKeyCodesMap.put(0x69, KeyEvent.VK_I);
+         regularKeyCodesMap.put(0x6A, KeyEvent.VK_J);
+         regularKeyCodesMap.put(0x6B, KeyEvent.VK_K);
+         regularKeyCodesMap.put(0x6C, KeyEvent.VK_L);
+         regularKeyCodesMap.put(0x6D, KeyEvent.VK_M);
+         regularKeyCodesMap.put(0x6E, KeyEvent.VK_N);
+         regularKeyCodesMap.put(0x6F, KeyEvent.VK_O);
          regularKeyCodesMap.put(0x70, KeyEvent.VK_P);
          regularKeyCodesMap.put(0x71, KeyEvent.VK_Q);
          regularKeyCodesMap.put(0x72, KeyEvent.VK_R);
--- a/jdk/src/share/classes/sun/swing/FilePane.java	Tue May 03 22:13:02 2011 -0700
+++ b/jdk/src/share/classes/sun/swing/FilePane.java	Tue May 03 22:14:39 2011 -0700
@@ -763,7 +763,7 @@
 
         public void setValueAt(Object value, int row, int col) {
             if (col == COLUMN_FILENAME) {
-                JFileChooser chooser = getFileChooser();
+                final JFileChooser chooser = getFileChooser();
                 File f = (File)getValueAt(row, col);
                 if (f != null) {
                     String oldDisplayName = chooser.getName(f);
@@ -782,18 +782,25 @@
 
                         // rename
                         FileSystemView fsv = chooser.getFileSystemView();
-                        File f2 = fsv.createFileObject(f.getParentFile(), newFileName);
+                        final File f2 = fsv.createFileObject(f.getParentFile(), newFileName);
                         if (f2.exists()) {
                             JOptionPane.showMessageDialog(chooser, MessageFormat.format(renameErrorFileExistsText,
                                     oldFileName), renameErrorTitleText, JOptionPane.ERROR_MESSAGE);
                         } else {
                             if (FilePane.this.getModel().renameFile(f, f2)) {
                                 if (fsv.isParent(chooser.getCurrentDirectory(), f2)) {
-                                    if (chooser.isMultiSelectionEnabled()) {
-                                        chooser.setSelectedFiles(new File[]{f2});
-                                    } else {
-                                        chooser.setSelectedFile(f2);
-                                    }
+                                    // The setSelectedFile method produces a new setValueAt invocation while the JTable
+                                    // is editing. Postpone file selection to be sure that edit mode of the JTable
+                                    // is completed
+                                    SwingUtilities.invokeLater(new Runnable() {
+                                        public void run() {
+                                            if (chooser.isMultiSelectionEnabled()) {
+                                                chooser.setSelectedFiles(new File[]{f2});
+                                            } else {
+                                                chooser.setSelectedFile(f2);
+                                            }
+                                        }
+                                    });
                                 } else {
                                     // Could be because of delay in updating Desktop folder
                                     // chooser.setSelectedFile(null);
--- a/jdk/src/share/classes/sun/swing/WindowsPlacesBar.java	Tue May 03 22:13:02 2011 -0700
+++ b/jdk/src/share/classes/sun/swing/WindowsPlacesBar.java	Tue May 03 22:14:39 2011 -0700
@@ -29,6 +29,8 @@
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
 import java.io.*;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 
 import javax.swing.*;
 import javax.swing.border.*;
@@ -79,7 +81,12 @@
         setBackground(bgColor);
         FileSystemView fsv = fc.getFileSystemView();
 
-        files = (File[])ShellFolder.get("fileChooserShortcutPanelFolders");
+        files = AccessController.doPrivileged(new PrivilegedAction<File[]>() {
+            public File[] run() {
+                return (File[]) ShellFolder.get("fileChooserShortcutPanelFolders");
+            }
+        });
+
         buttons = new JToggleButton[files.length];
         buttonGroup = new ButtonGroup();
         for (int i = 0; i < files.length; i++) {
--- a/jdk/src/solaris/native/com/sun/media/sound/PLATFORM_API_LinuxOS_ALSA_PCM.c	Tue May 03 22:13:02 2011 -0700
+++ b/jdk/src/solaris/native/com/sun/media/sound/PLATFORM_API_LinuxOS_ALSA_PCM.c	Tue May 03 22:14:39 2011 -0700
@@ -239,6 +239,13 @@
     snd_pcm_close(handle);
 }
 
+/** Workaround for cr 7033899, 7030629:
+ * dmix plugin doesn't like flush (snd_pcm_drop) when the buffer is empty
+ * (just opened, underruned or already flushed).
+ * Sometimes it causes PCM falls to -EBADFD error,
+ * sometimes causes bufferSize change.
+ * To prevent unnecessary flushes AlsaPcmInfo::isRunning & isFlushed are used.
+ */
 /* ******* ALSA PCM INFO ******************** */
 typedef struct tag_AlsaPcmInfo {
     snd_pcm_t* handle;
@@ -248,6 +255,8 @@
     int frameSize; // storage size in Bytes
     unsigned int periods;
     snd_pcm_uframes_t periodSize;
+    short int isRunning;    // see comment above
+    short int isFlushed;    // see comment above
 #ifdef GET_POSITION_METHOD2
     // to be used exclusively by getBytePosition!
     snd_pcm_status_t* positionStatus;
@@ -432,6 +441,9 @@
         return NULL;
     }
     memset(info, 0, sizeof(AlsaPcmInfo));
+    // initial values are: stopped, flushed
+    info->isRunning = 0;
+    info->isFlushed = 1;
 
     ret = openPCMfromDeviceID(deviceID, &(info->handle), isSource, FALSE /* do open device*/);
     if (ret == 0) {
@@ -587,6 +599,14 @@
         || (state == SND_PCM_STATE_RUNNING)
         || (state == SND_PCM_STATE_XRUN)
         || (state == SND_PCM_STATE_SUSPENDED);
+    if (ret) {
+        info->isRunning = 1;
+        // source line should keep isFlushed value until Write() is called;
+        // for target data line reset it right now.
+        if (!isSource) {
+            info->isFlushed = 0;
+        }
+    }
     TRACE1("< DAUDIO_Start %s\n", ret?"success":"error");
     return ret?TRUE:FALSE;
 }
@@ -606,6 +626,7 @@
         ERROR1("ERROR in snd_pcm_pause: %s\n", snd_strerror(ret));
         return FALSE;
     }
+    info->isRunning = 0;
     TRACE0("< DAUDIO_Stop success\n");
     return TRUE;
 }
@@ -651,8 +672,7 @@
             return -1;
         }
         return 1;
-    }
-    else if (err == -ESTRPIPE) {
+    } else if (err == -ESTRPIPE) {
         TRACE0("xrun_recovery: suspended.\n");
         ret = snd_pcm_resume(info->handle);
         if (ret < 0) {
@@ -667,11 +687,11 @@
             return -1;
         }
         return 1;
-    }
-    else if (err == -EAGAIN) {
+    } else if (err == -EAGAIN) {
         TRACE0("xrun_recovery: EAGAIN try again flag.\n");
         return 0;
     }
+
     TRACE2("xrun_recovery: unexpected error %d: %s\n", err, snd_strerror(err));
     return -1;
 }
@@ -691,6 +711,7 @@
         TRACE0("< DAUDIO_Write returning -1\n");
         return -1;
     }
+
     count = 2; // maximum number of trials to recover from underrun
     //frameSize = snd_pcm_bytes_to_frames(info->handle, byteSize);
     frameSize = (snd_pcm_sframes_t) (byteSize / info->frameSize);
@@ -712,6 +733,12 @@
         }
     } while (TRUE);
     //ret =  snd_pcm_frames_to_bytes(info->handle, writtenFrames);
+
+    if (writtenFrames > 0) {
+        // reset "flushed" flag
+        info->isFlushed = 0;
+    }
+
     ret =  (int) (writtenFrames * info->frameSize);
     TRACE1("< DAUDIO_Write: returning %d bytes.\n", ret);
     return ret;
@@ -736,6 +763,11 @@
         TRACE0("< DAUDIO_Read returning -1\n");
         return -1;
     }
+    if (!info->isRunning && info->isFlushed) {
+        // PCM has nothing to read
+        return 0;
+    }
+
     count = 2; // maximum number of trials to recover from error
     //frameSize = snd_pcm_bytes_to_frames(info->handle, byteSize);
     frameSize = (snd_pcm_sframes_t) (byteSize / info->frameSize);
@@ -784,12 +816,22 @@
     int ret;
 
     TRACE0("DAUDIO_Flush\n");
+
+    if (info->isFlushed) {
+        // nothing to drop
+        return 1;
+    }
+
     ret = snd_pcm_drop(info->handle);
     if (ret != 0) {
         ERROR1("ERROR in snd_pcm_drop: %s\n", snd_strerror(ret));
         return FALSE;
     }
-    ret = DAUDIO_Start(id, isSource);
+
+    info->isFlushed = 1;
+    if (info->isRunning) {
+        ret = DAUDIO_Start(id, isSource);
+    }
     return ret;
 }
 
@@ -800,7 +842,7 @@
     int ret;
 
     state = snd_pcm_state(info->handle);
-    if (state == SND_PCM_STATE_XRUN) {
+    if (info->isFlushed || state == SND_PCM_STATE_XRUN) {
         // if in xrun state then we have the entire buffer available,
         // not 0 as alsa reports
         ret = info->bufferSizeInBytes;
@@ -841,7 +883,7 @@
     snd_pcm_state_t state;
     state = snd_pcm_state(info->handle);
 
-    if (state != SND_PCM_STATE_XRUN) {
+    if (!info->isFlushed && state != SND_PCM_STATE_XRUN) {
 #ifdef GET_POSITION_METHOD2
         snd_timestamp_t* ts;
         snd_pcm_uframes_t framesAvail;
--- a/jdk/src/windows/native/sun/java2d/d3d/D3DPipelineManager.cpp	Tue May 03 22:13:02 2011 -0700
+++ b/jdk/src/windows/native/sun/java2d/d3d/D3DPipelineManager.cpp	Tue May 03 22:14:39 2011 -0700
@@ -187,6 +187,7 @@
     }
 
     JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
+    RETURN_IF_NULL(env);
 
     pMgr = D3DPipelineManager::GetInstance();
     RETURN_IF_NULL(pMgr);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/keyboard/EqualKeyCode/EqualKeyCode.java	Tue May 03 22:14:39 2011 -0700
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+  @test
+  @bug 6799551
+  @library ../../regtesthelpers
+  @build Util Sysout
+  @summary Extended key codes for small letters undefined
+  @author Andrei Dmitriev: area=awt.keyboard
+  @run main EqualKeyCode
+*/
+
+
+import sun.awt.*;
+import java.awt.*;
+import test.java.awt.regtesthelpers.Util;
+import test.java.awt.regtesthelpers.Sysout;
+
+public class EqualKeyCode {
+
+    final static String LETTERS = "abcdefghijklmnopqrstuvwxyz";
+
+    public static void main(String []s) {
+        for (int i = 0; i < LETTERS.length(); i++){
+            char cSmall = LETTERS.charAt(i);
+            char cLarge = Character.toUpperCase(cSmall);
+
+            int iSmall = ExtendedKeyCodes.getExtendedKeyCodeForChar(cSmall);
+            int iLarge = ExtendedKeyCodes.getExtendedKeyCodeForChar(cLarge);
+
+            System.out.print(" " + cSmall + ":" + iSmall + " ---- ");
+            System.out.println(" " + cLarge + " : " + iLarge);
+            if (ExtendedKeyCodes.getExtendedKeyCodeForChar(cSmall) !=
+                ExtendedKeyCodes.getExtendedKeyCodeForChar(cLarge))
+            {
+                throw new RuntimeException("ExtendedKeyCode doesn't exist or doesn't match between capital and small letters.");
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JFileChooser/7036025/bug7036025.java	Tue May 03 22:14:39 2011 -0700
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* @test
+   @bug 7036025
+   @summary java.security.AccessControlException when creating JFileChooser in signed applet
+   @author Pavel Porvatov
+   @run main/othervm/policy=security.policy bug7036025
+*/
+
+import javax.swing.*;
+import java.io.File;
+
+public class bug7036025 {
+    public static final String DIR = "c:/temp";
+
+    public static void main(String[] args) throws Exception {
+        String systemLookAndFeelClassName = UIManager.getSystemLookAndFeelClassName();
+
+        if (!systemLookAndFeelClassName.toLowerCase().contains("windows")) {
+            System.out.println("The test is only for Windows OS.");
+
+            return;
+        }
+
+        File file = new File(DIR);
+
+        if (!file.exists()) {
+            if (!file.mkdir()) {
+                throw new RuntimeException("Cannot create " + DIR);
+            }
+
+            file.deleteOnExit();
+        }
+
+        UIManager.setLookAndFeel(systemLookAndFeelClassName);
+
+        new JFileChooser(file);
+
+        System.out.println("Test passed for LookAndFeel " + UIManager.getLookAndFeel().getName());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JFileChooser/7036025/security.policy	Tue May 03 22:14:39 2011 -0700
@@ -0,0 +1,5 @@
+grant {
+    permission java.io.FilePermission "C:\\temp\\*", "read";
+    permission java.io.FilePermission "C:\\temp", "read,write,delete";
+    permission java.util.PropertyPermission "*", "read";
+};
--- a/jdk/test/javax/swing/JLabel/6596966/bug6596966.java	Tue May 03 22:13:02 2011 -0700
+++ b/jdk/test/javax/swing/JLabel/6596966/bug6596966.java	Tue May 03 22:14:39 2011 -0700
@@ -24,13 +24,13 @@
 /* @test
    @bug 6596966
    @summary Some JFileChooser mnemonics do not work with sticky keys
- * @library ../../regtesthelpers
- * @build Util
    @run main bug6596966
    @author Pavel Porvatov
 */
 
 
+import sun.awt.SunToolkit;
+
 import javax.swing.*;
 import java.awt.*;
 import java.awt.event.KeyEvent;
@@ -44,6 +44,7 @@
 
     public static void main(String[] args) throws Exception {
         Robot robot = new Robot();
+        SunToolkit toolkit = (SunToolkit) SunToolkit.getDefaultToolkit();
 
         SwingUtilities.invokeAndWait(new Runnable() {
             public void run() {
@@ -68,17 +69,17 @@
             }
         });
 
-        Util.blockTillDisplayed(frame);
+        toolkit.realSync();
 
         robot.keyPress(KeyEvent.VK_ALT);
         robot.keyPress(KeyEvent.VK_L);
 
-        robot.waitForIdle();
+        toolkit.realSync();
 
-        Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(new KeyEvent(label, KeyEvent.KEY_RELEASED,
+        toolkit.getSystemEventQueue().postEvent(new KeyEvent(label, KeyEvent.KEY_RELEASED,
                 EventQueue.getMostRecentEventTime(), 0, KeyEvent.VK_L, 'L'));
 
-        robot.waitForIdle();
+        toolkit.realSync();
 
         try {
             SwingUtilities.invokeAndWait(new Runnable() {