changeset 3953:e39808c3d13e

Merge
author lana
date Mon, 18 Apr 2011 13:29:32 -0700
parents c27a80462285 346b56971f18
children 745a56cb4c16
files
diffstat 26 files changed, 610 insertions(+), 35 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/awt/Dialog.java	Sat Apr 16 23:23:31 2011 -0700
+++ b/src/share/classes/java/awt/Dialog.java	Mon Apr 18 13:29:32 2011 -0700
@@ -903,7 +903,7 @@
             if (peer == null) {
                 addNotify();
             }
-            validate();
+            validateUnconditionally();
             if (visible) {
                 toFront();
                 retval = false;
--- a/src/share/classes/java/awt/GraphicsDevice.java	Sat Apr 16 23:23:31 2011 -0700
+++ b/src/share/classes/java/awt/GraphicsDevice.java	Mon Apr 18 13:29:32 2011 -0700
@@ -243,8 +243,10 @@
      * a non-client of the input method framework.
      * </ul>
      * <p>
-     * Simulated full-screen mode resizes
-     * the window to the size of the screen and positions it at (0,0).
+     * The simulated full-screen mode places and resizes the window to the maximum
+     * possible visible area of the screen. However, the native windowing system
+     * may modify the requested geometry-related data, so that the {@code Window} object
+     * is placed and sized in a way that corresponds closely to the desktop settings.
      * <p>
      * When entering full-screen mode, if the window to be used as a
      * full-screen window is not visible, this method will make it visible.
--- a/src/share/classes/java/awt/Toolkit.java	Sat Apr 16 23:23:31 2011 -0700
+++ b/src/share/classes/java/awt/Toolkit.java	Mon Apr 18 13:29:32 2011 -0700
@@ -466,6 +466,10 @@
      */
     protected void loadSystemColors(int[] systemColors)
         throws HeadlessException {
+        if (GraphicsEnvironment.isHeadless()){
+            throw new HeadlessException();
+        }
+
     }
 
 /**
@@ -500,6 +504,10 @@
      */
     public void setDynamicLayout(boolean dynamic)
         throws HeadlessException {
+        if (GraphicsEnvironment.isHeadless()){
+            throw new HeadlessException();
+        }
+
     }
 
     /**
@@ -523,6 +531,9 @@
      */
     protected boolean isDynamicLayoutSet()
         throws HeadlessException {
+        if (GraphicsEnvironment.isHeadless()){
+            throw new HeadlessException();
+        }
         if (this != Toolkit.getDefaultToolkit()) {
             return Toolkit.getDefaultToolkit().isDynamicLayoutSet();
         } else {
@@ -558,6 +569,9 @@
      */
     public boolean isDynamicLayoutActive()
         throws HeadlessException {
+        if (GraphicsEnvironment.isHeadless()){
+            throw new HeadlessException();
+        }
         if (this != Toolkit.getDefaultToolkit()) {
             return Toolkit.getDefaultToolkit().isDynamicLayoutActive();
         } else {
@@ -601,6 +615,9 @@
      */
     public Insets getScreenInsets(GraphicsConfiguration gc)
         throws HeadlessException {
+        if (GraphicsEnvironment.isHeadless()){
+            throw new HeadlessException();
+        }
         if (this != Toolkit.getDefaultToolkit()) {
             return Toolkit.getDefaultToolkit().getScreenInsets(gc);
         } else {
@@ -1342,6 +1359,9 @@
      * @since 1.4
      */
     public Clipboard getSystemSelection() throws HeadlessException {
+        if (GraphicsEnvironment.isHeadless()){
+            throw new HeadlessException();
+        }
         if (this != Toolkit.getDefaultToolkit()) {
             return Toolkit.getDefaultToolkit().getSystemSelection();
         } else {
@@ -1371,6 +1391,10 @@
      * @since     JDK1.1
      */
     public int getMenuShortcutKeyMask() throws HeadlessException {
+        if (GraphicsEnvironment.isHeadless()){
+            throw new HeadlessException();
+        }
+
         return Event.CTRL_MASK;
     }
 
@@ -1499,6 +1523,9 @@
      */
     public Dimension getBestCursorSize(int preferredWidth,
         int preferredHeight) throws HeadlessException {
+        if (GraphicsEnvironment.isHeadless()){
+            throw new HeadlessException();
+        }
         // Override to implement custom cursor support.
         if (this != Toolkit.getDefaultToolkit()) {
             return Toolkit.getDefaultToolkit().
@@ -1526,6 +1553,9 @@
      * @since     1.2
      */
     public int getMaximumCursorColors() throws HeadlessException {
+        if (GraphicsEnvironment.isHeadless()){
+            throw new HeadlessException();
+        }
         // Override to implement custom cursor support.
         if (this != Toolkit.getDefaultToolkit()) {
             return Toolkit.getDefaultToolkit().getMaximumCursorColors();
@@ -2561,8 +2591,6 @@
     * initialized with {@code true}.
     * Changing this value after the {@code Toolkit} class initialization will have no effect.
     * <p>
-    * The current value could be queried by using the
-    * {@code System.getProperty("sun.awt.enableExtraMouseButtons")} method.
     * @exception HeadlessException if GraphicsEnvironment.isHeadless() returns true
     * @return {@code true} if events from extra mouse buttons are allowed to be processed and posted;
     *         {@code false} otherwise
@@ -2572,6 +2600,9 @@
     * @since 1.7
      */
     public boolean areExtraMouseButtonsEnabled() throws HeadlessException {
+        if (GraphicsEnvironment.isHeadless()){
+            throw new HeadlessException();
+        }
         return Toolkit.getDefaultToolkit().areExtraMouseButtonsEnabled();
     }
 }
--- a/src/share/classes/java/awt/Window.java	Sat Apr 16 23:23:31 2011 -0700
+++ b/src/share/classes/java/awt/Window.java	Mon Apr 18 13:29:32 2011 -0700
@@ -870,6 +870,11 @@
      * are automatically enlarged if either is less than
      * the minimum size as specified by previous call to
      * {@code setMinimumSize}.
+     * <p>
+     * The method changes the geometry-related data. Therefore,
+     * the native windowing system may ignore such requests, or it may modify
+     * the requested data, so that the {@code Window} object is placed and sized
+     * in a way that corresponds closely to the desktop settings.
      *
      * @see #getSize
      * @see #setBounds
@@ -887,6 +892,11 @@
      * are automatically enlarged if either is less than
      * the minimum size as specified by previous call to
      * {@code setMinimumSize}.
+     * <p>
+     * The method changes the geometry-related data. Therefore,
+     * the native windowing system may ignore such requests, or it may modify
+     * the requested data, so that the {@code Window} object is placed and sized
+     * in a way that corresponds closely to the desktop settings.
      *
      * @see #getSize
      * @see #setBounds
@@ -898,6 +908,32 @@
     }
 
     /**
+     * {@inheritDoc}
+     * <p>
+     * The method changes the geometry-related data. Therefore,
+     * the native windowing system may ignore such requests, or it may modify
+     * the requested data, so that the {@code Window} object is placed and sized
+     * in a way that corresponds closely to the desktop settings.
+     */
+    @Override
+    public void setLocation(int x, int y) {
+        super.setLocation(x, y);
+    }
+
+    /**
+     * {@inheritDoc}
+     * <p>
+     * The method changes the geometry-related data. Therefore,
+     * the native windowing system may ignore such requests, or it may modify
+     * the requested data, so that the {@code Window} object is placed and sized
+     * in a way that corresponds closely to the desktop settings.
+     */
+    @Override
+    public void setLocation(Point p) {
+        super.setLocation(p);
+    }
+
+    /**
      * @deprecated As of JDK version 1.1,
      * replaced by <code>setBounds(int, int, int, int)</code>.
      */
@@ -3147,6 +3183,11 @@
      * placed at the left side of the screen. The similar placement
      * will occur if both top and bottom edges are out of the screen.
      * In that case, the window is placed at the top side of the screen.
+     * <p>
+     * The method changes the geometry-related data. Therefore,
+     * the native windowing system may ignore such requests, or it may modify
+     * the requested data, so that the {@code Window} object is placed and sized
+     * in a way that corresponds closely to the desktop settings.
      *
      * @param c  the component in relation to which the window's location
      *           is determined
@@ -3395,6 +3436,11 @@
      * are automatically enlarged if either is less than
      * the minimum size as specified by previous call to
      * {@code setMinimumSize}.
+     * <p>
+     * The method changes the geometry-related data. Therefore,
+     * the native windowing system may ignore such requests, or it may modify
+     * the requested data, so that the {@code Window} object is placed and sized
+     * in a way that corresponds closely to the desktop settings.
      *
      * @see #getBounds
      * @see #setLocation(int, int)
@@ -3424,6 +3470,11 @@
      * will be automatically enlarged if either is less than
      * the minimum size as specified by previous call to
      * {@code setMinimumSize}.
+     * <p>
+     * The method changes the geometry-related data. Therefore,
+     * the native windowing system may ignore such requests, or it may modify
+     * the requested data, so that the {@code Window} object is placed and sized
+     * in a way that corresponds closely to the desktop settings.
      *
      * @see #getBounds
      * @see #setLocation(int, int)
--- a/src/solaris/native/sun/awt/awt_LoadLibrary.c	Sat Apr 16 23:23:31 2011 -0700
+++ b/src/solaris/native/sun/awt/awt_LoadLibrary.c	Mon Apr 18 13:29:32 2011 -0700
@@ -128,12 +128,12 @@
         }
     }
 
-    /* Calculate toolkit name, kind of toolkit (XAWT, Motif) and library to load */
+    /* Calculate library name to load */
     if (AWTIsHeadless()) {
-        strcpy(p, "/headless/libmawt");
+        strncpy(p, "/headless/libmawt.so", MAXPATHLEN-len-1);
     } else {
         /* Default AWT Toolkit on Linux and Solaris is XAWT. */
-        strcpy(p, "/xawt/libmawt");
+        strncpy(p, "/xawt/libmawt.so", MAXPATHLEN-len-1);
     }
 
     if (toolkit) {
@@ -143,23 +143,12 @@
         (*env)->DeleteLocalRef(env, propname);
     }
 
-    strcat(p, ".so");
-
     JNU_CallStaticMethodByName(env, NULL, "java/lang/System", "load",
                                "(Ljava/lang/String;)V",
                                JNU_NewStringPlatform(env, buf));
 
     awtHandle = dlopen(buf, RTLD_LAZY | RTLD_GLOBAL);
 
-/*
-  if (dlsym(awtHandle, "AWTCharRBearing") == NULL) {
-  printf("========= AWTCharRBearing not found\n"); fflush(stdout);
-  }
-  else {
-  printf("========= AWTCharRBearing was found\n"); fflush(stdout);
-  }
-*/
-
     return JNI_VERSION_1_2;
 }
 
--- a/src/solaris/native/sun/awt/awt_mgrsel.c	Sat Apr 16 23:23:31 2011 -0700
+++ b/src/solaris/native/sun/awt/awt_mgrsel.c	Mon Apr 18 13:29:32 2011 -0700
@@ -136,7 +136,7 @@
         || per_scr_owners == NULL || mgrsel == NULL)
     {
         DTRACE_PRINTLN("MG: select: unable to allocate memory");
-        if (namesbuf != NULL) free(per_scr_atoms);
+        if (namesbuf != NULL) free(namesbuf);
         if (names != NULL) free(names);
         if (per_scr_atoms != NULL) free(per_scr_atoms);
         if (per_scr_owners != NULL) free(per_scr_owners);
--- a/src/solaris/native/sun/awt/gtk2_interface.c	Sat Apr 16 23:23:31 2011 -0700
+++ b/src/solaris/native/sun/awt/gtk2_interface.c	Mon Apr 18 13:29:32 2011 -0700
@@ -443,6 +443,8 @@
             "gtk_file_chooser_set_current_folder");
     fp_gtk_file_chooser_set_filename = dl_symbol(
             "gtk_file_chooser_set_filename");
+    fp_gtk_file_chooser_set_current_name = dl_symbol(
+            "gtk_file_chooser_set_current_name");
     fp_gtk_file_filter_add_custom = dl_symbol("gtk_file_filter_add_custom");
     fp_gtk_file_chooser_set_filter = dl_symbol("gtk_file_chooser_set_filter");
     fp_gtk_file_chooser_get_type = dl_symbol("gtk_file_chooser_get_type");
--- a/src/solaris/native/sun/awt/gtk2_interface.h	Sat Apr 16 23:23:31 2011 -0700
+++ b/src/solaris/native/sun/awt/gtk2_interface.h	Mon Apr 18 13:29:32 2011 -0700
@@ -766,6 +766,8 @@
     const gchar *filename);
 gboolean (*fp_gtk_file_chooser_set_filename)(GtkFileChooser *chooser,
     const char *filename);
+void (*fp_gtk_file_chooser_set_current_name)(GtkFileChooser *chooser,
+    const gchar *name);
 void (*fp_gtk_file_filter_add_custom)(GtkFileFilter *filter,
     GtkFileFilterFlags needed, GtkFileFilterFunc func, gpointer data,
     GDestroyNotify notify);
--- a/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.c	Sat Apr 16 23:23:31 2011 -0700
+++ b/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.c	Mon Apr 18 13:29:32 2011 -0700
@@ -4,6 +4,7 @@
 #include <string.h>
 #include "gtk2_interface.h"
 #include "sun_awt_X11_GtkFileDialogPeer.h"
+#include "java_awt_FileDialog.h"
 #include "debug_assert.h"
 
 static JavaVM *jvm;
@@ -220,7 +221,7 @@
 
     const char *title = jtitle == NULL? "": (*env)->GetStringUTFChars(env, jtitle, 0);
 
-    if (mode == 1) {
+    if (mode == java_awt_FileDialog_SAVE) {
         /* Save action */
         dialog = fp_gtk_file_chooser_dialog_new(title, NULL,
                 GTK_FILE_CHOOSER_ACTION_SAVE, GTK_STOCK_CANCEL,
@@ -253,7 +254,11 @@
     /* Set the filename */
     if (jfile != NULL) {
         const char *filename = (*env)->GetStringUTFChars(env, jfile, 0);
-        fp_gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), filename);
+        if (mode == java_awt_FileDialog_SAVE) {
+            fp_gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(dialog), filename);
+        } else {
+            fp_gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), filename);
+        }
         (*env)->ReleaseStringUTFChars(env, jfile, filename);
     }
 
--- a/src/windows/classes/sun/awt/Win32GraphicsEnvironment.java	Sat Apr 16 23:23:31 2011 -0700
+++ b/src/windows/classes/sun/awt/Win32GraphicsEnvironment.java	Mon Apr 18 13:29:32 2011 -0700
@@ -72,12 +72,6 @@
     }
 
     /**
-     * Noop function that just acts as an entry point for someone to force
-     * a static initialization of this class.
-     */
-    public static void init() {}
-
-    /**
      * Initializes native components of the graphics environment.  This
      * includes everything from the native GraphicsDevice elements to
      * the DirectX rendering layer.
--- a/src/windows/classes/sun/awt/windows/WToolkit.java	Sat Apr 16 23:23:31 2011 -0700
+++ b/src/windows/classes/sun/awt/windows/WToolkit.java	Mon Apr 18 13:29:32 2011 -0700
@@ -103,9 +103,6 @@
 
     static {
         loadLibraries();
-        // Force Win32GE to load if it is not already loaded; this loads
-        // various other classes that are required for basic awt functionality
-        Win32GraphicsEnvironment.init();
         initIDs();
 
         // Print out which version of Windows is running
--- a/src/windows/native/sun/windows/awt_Button.cpp	Sat Apr 16 23:23:31 2011 -0700
+++ b/src/windows/native/sun/windows/awt_Button.cpp	Mon Apr 18 13:29:32 2011 -0700
@@ -317,7 +317,9 @@
             badAlloc = 1;
         } else {
             c->SetText(labelStr);
-            JNU_ReleaseStringPlatformChars(env, label, labelStr);
+            if (label != NULL) {
+                JNU_ReleaseStringPlatformChars(env, label, labelStr);
+            }
         }
     }
 
--- a/src/windows/native/sun/windows/awt_Checkbox.cpp	Sat Apr 16 23:23:31 2011 -0700
+++ b/src/windows/native/sun/windows/awt_Checkbox.cpp	Mon Apr 18 13:29:32 2011 -0700
@@ -384,7 +384,9 @@
         {
             c->SetText(labelStr);
             c->VerifyState();
-            JNU_ReleaseStringPlatformChars(env, label, labelStr);
+            if (label != NULL) {
+                JNU_ReleaseStringPlatformChars(env, label, labelStr);
+            }
         }
     }
 
--- a/src/windows/native/sun/windows/awt_FileDialog.cpp	Sat Apr 16 23:23:31 2011 -0700
+++ b/src/windows/native/sun/windows/awt_FileDialog.cpp	Mon Apr 18 13:29:32 2011 -0700
@@ -225,7 +225,6 @@
 {
     JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
     jobject peer;
-    WCHAR unicodeChar = L' ';
     LPTSTR fileBuffer = NULL;
     LPTSTR currentDirectory = NULL;
     jint mode = 0;
@@ -263,7 +262,7 @@
         HWND hwndOwner = awtParent ? awtParent->GetHWnd() : NULL;
 
         if (title == NULL || env->GetStringLength(title)==0) {
-            title = JNU_NewStringPlatform(env, &unicodeChar);
+            title = JNU_NewStringPlatform(env, L" ");
         }
 
         JavaStringBuffer titleBuffer(env, title);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Dialog/ValidateOnShow/ValidateOnShow.java	Mon Apr 18 13:29:32 2011 -0700
@@ -0,0 +1,84 @@
+/*
+ * 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 7027013
+  @summary Dialog.show() should validate the window unconditionally
+  @author anthony.petrov@oracle.com: area=awt.toplevel
+  @run main ValidateOnShow
+*/
+
+import java.awt.*;
+
+public class ValidateOnShow {
+    private static Dialog dialog = new Dialog((Frame)null);
+    private static Panel panel = new Panel() {
+        @Override
+        public boolean isValidateRoot() {
+            return true;
+        }
+    };
+    private static Button button = new Button("Test");
+
+    private static void sleep() {
+        try { Thread.sleep(500); } catch (Exception e) {}
+    }
+
+    private static void test() {
+        System.out.println("Before showing: panel.isValid=" + panel.isValid() + "      dialog.isValid=" + dialog.isValid());
+        dialog.setVisible(true);
+        sleep();
+        System.out.println("After showing:  panel.isValid=" + panel.isValid() + "      dialog.isValid=" + dialog.isValid());
+
+        if (!panel.isValid()) {
+            dialog.dispose();
+            throw new RuntimeException("The panel hasn't been validated upon showing the dialog");
+        }
+
+        dialog.setVisible(false);
+        sleep();
+    }
+
+    public static void main(String[] args) {
+        // setup
+        dialog.add(panel);
+        panel.add(button);
+
+        dialog.setBounds(200, 200, 300, 200);
+
+        // The first test should always succeed since the dialog is invalid initially
+        test();
+
+        // now invalidate the button and the panel
+        button.setBounds(1, 1, 30, 30);
+        sleep();
+        // since the panel is a validate root, the dialog is still valid
+
+        // w/o a fix this would fail
+        test();
+
+        // cleanup
+        dialog.dispose();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/FileDialog/FileNameOverrideTest/FileNameOverrideTest.html	Mon Apr 18 13:29:32 2011 -0700
@@ -0,0 +1,22 @@
+<html>
+<!--  
+  @test
+  @bug 6260659
+  @summary File Name set programmatically in FileDialog is overridden during navigation, XToolkit
+  @author Dmitry.Cherepanov@SUN.COM area=awt.filedialog
+  @library ../../regtesthelpers
+  @build Sysout
+  @run applet/manual=yesno FileNameOverrideTest.html
+  -->
+<head>
+<title> FileNameOverrideTest </title>
+</head>
+<body>
+
+<h1>FileNameOverrideTest<br>Bug ID: 6260659</h1>
+
+<p> See the dialog box (usually in upper left corner) for instructions</p>
+
+<APPLET CODE="FileNameOverrideTest.class" WIDTH=200 HEIGHT=200></APPLET>
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/FileDialog/FileNameOverrideTest/FileNameOverrideTest.java	Mon Apr 18 13:29:32 2011 -0700
@@ -0,0 +1,73 @@
+/*
+  test
+  @bug 6260659
+  @summary File Name set programmatically in FileDialog is overridden during navigation, XToolkit
+  @author Dmitry.Cherepanov@SUN.COM area=awt.filedialog
+  @library ../../regtesthelpers
+  @build Sysout
+  @run applet/manual=yesno FileNameOverrideTest.html
+*/
+
+import test.java.awt.regtesthelpers.Sysout;
+
+import java.applet.Applet;
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.File;
+import java.io.IOException;
+
+public class FileNameOverrideTest extends Applet implements ActionListener {
+    private final static String fileName = "input";
+    private final static String clickDirName = "Directory for double click";
+    private final static String dirPath = ".";
+    private Button showBtn;
+    private FileDialog fd;
+
+    public void init() {
+        this.setLayout(new GridLayout(1, 1));
+
+        fd = new FileDialog(new Frame(), "Open");
+
+        showBtn = new Button("Show File Dialog");
+        showBtn.addActionListener(this);
+        add(showBtn);
+
+        try {
+            File tmpFileUp = new File(dirPath + File.separator + fileName);
+            File tmpDir = new File(dirPath + File.separator + clickDirName);
+            File tmpFileIn = new File(tmpDir.getAbsolutePath() + File.separator + fileName);
+            tmpDir.mkdir();
+            tmpFileUp.createNewFile();
+            tmpFileIn.createNewFile();
+        } catch (IOException ex) {
+            throw new RuntimeException("Cannot create test folder", ex);
+        }
+
+        String[] instructions = {
+                "1) Click on 'Show File Dialog' button. A file dialog will come up.",
+                "2) Double-click on '" + clickDirName + "' and click OK.",
+                "3) See result of the test below"
+        };
+        Sysout.createDialogWithInstructions(instructions);
+    }//End  init()
+
+    public void start() {
+        setSize(200, 200);
+        show();
+    }// start()
+
+    public void actionPerformed(ActionEvent e) {
+        if (e.getSource() == showBtn) {
+            fd.setFile(fileName);
+            fd.setDirectory(dirPath);
+            fd.setVisible(true);
+            String output = fd.getFile();
+            if (fileName.equals(output)) {
+                Sysout.println("TEST PASSED");
+            } else {
+                Sysout.println("TEST FAILED (output file - " + output + ")");
+            }
+        }
+    }
+}// class ManualYesNoTest
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/FileDialog/SaveFileNameOverrideTest/SaveFileNameOverrideTest.html	Mon Apr 18 13:29:32 2011 -0700
@@ -0,0 +1,22 @@
+<html>
+<!--  
+  @test
+  @bug 6998877
+  @summary After double-click on the folder names, FileNameOverrideTest FAILED
+  @author Sergey.Bylokhov@oracle.com area=awt.filedialog
+  @library ../../regtesthelpers
+  @build Sysout
+  @run applet/manual=yesno SaveFileNameOverrideTest.html
+  -->
+<head>
+<title> SaveFileNameOverrideTest </title>
+</head>
+<body>
+
+<h1>SaveFileNameOverrideTest<br>Bug ID: 6260659</h1>
+
+<p> See the dialog box (usually in upper left corner) for instructions</p>
+
+<APPLET CODE="SaveFileNameOverrideTest.class" WIDTH=200 HEIGHT=200></APPLET>
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/FileDialog/SaveFileNameOverrideTest/SaveFileNameOverrideTest.java	Mon Apr 18 13:29:32 2011 -0700
@@ -0,0 +1,65 @@
+/*
+  test
+  @bug 6998877
+  @summary After double-click on the folder names, FileNameOverrideTest FAILED
+  @author Sergey.Bylokhov@oracle.com area=awt.filedialog
+  @library ../../regtesthelpers
+  @build Sysout
+  @run applet/manual=yesno SaveFileNameOverrideTest.html
+*/
+
+import test.java.awt.regtesthelpers.Sysout;
+
+import java.applet.Applet;
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.File;
+
+public class SaveFileNameOverrideTest extends Applet implements ActionListener {
+    private final static String clickDirName = "Directory for double click";
+    private final static String dirPath = ".";
+    private Button showBtn;
+    private FileDialog fd;
+
+    public void init() {
+        this.setLayout(new GridLayout(1, 1));
+
+        fd = new FileDialog(new Frame(), "Save", FileDialog.SAVE);
+
+        showBtn = new Button("Show File Dialog");
+        showBtn.addActionListener(this);
+        add(showBtn);
+
+        File tmpDir = new File(dirPath + File.separator + clickDirName);
+        tmpDir.mkdir();
+
+        String[] instructions = {
+                "1) Click on 'Show File Dialog' button. A file dialog will come up.",
+                "2) Double-click on '" + clickDirName + "' and click OK.",
+                "3) See result of the test below"
+        };
+
+        Sysout.createDialogWithInstructions(instructions);
+
+    }//End  init()
+
+    public void start() {
+        setSize(200, 200);
+        show();
+    }// start()
+
+    public void actionPerformed(ActionEvent e) {
+        if (e.getSource() == showBtn) {
+            fd.setFile("input");
+            fd.setDirectory(dirPath);
+            fd.setVisible(true);
+            String output = fd.getFile();
+            if ("input".equals(output)) {
+                Sysout.println("TEST PASSED");
+            } else {
+                Sysout.println("TEST FAILED (output file - " + output + ")");
+            }
+        }
+    }
+}// class ManualYesNoTest
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/GraphicsEnvironment/LoadLock/GE_init1.java	Mon Apr 18 13:29:32 2011 -0700
@@ -0,0 +1,37 @@
+/*
+ * 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 7002839
+ * @summary Static init deadlock Win32GraphicsEnvironment and WToolkit
+ * @run main GE_init1
+ */
+
+import java.awt.Toolkit;
+
+public class GE_init1 {
+    public static void main(String[] args) {
+        Toolkit.getDefaultToolkit();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/GraphicsEnvironment/LoadLock/GE_init2.java	Mon Apr 18 13:29:32 2011 -0700
@@ -0,0 +1,38 @@
+/*
+ * 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 7002839
+ * @summary Static init deadlock Win32GraphicsEnvironment and WToolkit
+ * @run main GE_init2
+ */
+
+
+import java.awt.GraphicsEnvironment;
+
+public class GE_init2 {
+    public static void main(String[] args) {
+        GraphicsEnvironment.getLocalGraphicsEnvironment();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/GraphicsEnvironment/LoadLock/GE_init3.java	Mon Apr 18 13:29:32 2011 -0700
@@ -0,0 +1,38 @@
+/*
+ * 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 7002839
+ * @summary Static init deadlock Win32GraphicsEnvironment and WToolkit
+ * @run main GE_init3
+ */
+
+
+import java.awt.Frame;
+
+public class GE_init3 {
+    public static void main(String[] args) {
+        new Frame("Test3").setVisible(true);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/GraphicsEnvironment/LoadLock/GE_init4.java	Mon Apr 18 13:29:32 2011 -0700
@@ -0,0 +1,37 @@
+/*
+ * 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 7002839
+ * @summary Static init deadlock Win32GraphicsEnvironment and WToolkit
+ * @run main/othervm -Djava.awt.headless=true GE_init4
+ */
+
+import java.awt.Toolkit;
+
+public class GE_init4 {
+    public static void main(String[] args) {
+        Toolkit.getDefaultToolkit();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/GraphicsEnvironment/LoadLock/GE_init5.java	Mon Apr 18 13:29:32 2011 -0700
@@ -0,0 +1,37 @@
+/*
+ * 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 7002839
+ * @summary Static init deadlock Win32GraphicsEnvironment and WToolkit
+ * @run main/othervm -Djava.awt.headless=true GE_init4
+ */
+
+import java.awt.Toolkit;
+
+public class GE_init5 {
+    public static void main(String[] args) {
+        GraphicsEnvironment.getLocalGraphicsEnvironment();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/GraphicsEnvironment/LoadLock/GE_init6.java	Mon Apr 18 13:29:32 2011 -0700
@@ -0,0 +1,45 @@
+/*
+ * 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 7002839
+ * @summary Static init deadlock Win32GraphicsEnvironment and WToolkit
+ * @run main/othervm -Djava.awt.headless=true GE_init6
+ */
+
+import java.awt.*;
+
+public class GE_init6 {
+    private static boolean passed = false;
+    public static void main(String[] args) {
+         try {
+             new Frame("Test3").setVisible(true);
+         } catch (HeadlessException e){
+             passed = true;
+         }
+         if (!passed){
+             throw new RuntimeException("Should have thrown HE but it either didn't throw any or just passed through.");
+         }
+    }
+}
--- a/test/java/awt/Window/TranslucentJAppletTest/TranslucentJAppletTest.java	Sat Apr 16 23:23:31 2011 -0700
+++ b/test/java/awt/Window/TranslucentJAppletTest/TranslucentJAppletTest.java	Mon Apr 18 13:29:32 2011 -0700
@@ -43,6 +43,7 @@
     private static void initAndShowGUI() {
         frame = new JFrame();
         JApplet applet = new JApplet();
+        applet.setBackground(new Color(0, 0, 0, 0));
         JPanel panel = new JPanel() {
             protected void paintComponent(Graphics g) {
                 paintComponentCalled = true;