Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7056092

Native file dialog fails 1.6u26 win7Pro: Breaks SWT apps, perhaps Eclipse too.

    • b01
    • b07
    • x86
    • windows_7

      FULL PRODUCT VERSION :
      java version "1.6.0_26"
      Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
      Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Windows 7 Professional ,64-bit. ver: Microsoft Windows [Version 6.1.7600]

      A DESCRIPTION OF THE PROBLEM :
      Native file dialogs fail under some circumstances. see
         https://bugs.eclipse.org/bugs/show_bug.cgi?id=349387

      Problem appears only under 1.6u26 (either 32- or 64-bit variants).
      Problem appears on Windows 7Pro (3 machines). Unable to reproduce on Windows XP.


      REGRESSION. Last worked in version 6

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        To repeat https://bugs.eclipse.org/bugs/show_bug.cgi?id=349387:

      -------------------
        To reproduce, use JNLP to run

      http://www.eclipse.org/swt/jws/controlexample.jnlp

      after launching, go to the tab "Dialog" and try to create a FileDialog. The
      creation fails, and the dialog result is null (shown in the debug pane on the
      left). Creation of any other dialog, such as ColorChooser etc, works fine.

      -------------------

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      File dialog appears
      ACTUAL -
      No file dialog appears

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      No error. Result of the call is null as if the user pressed cancel.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      See source code for

        http://www.eclipse.org/swt/jws/controlexample.jnlp
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      For us, we were able to avoid the bug by deferring access to java.awt.Color static field that provoked Color.<clinit> that loaded native library and called initIDs(). It did not help to call the static initializer before initializing the instance.
      The test below PASSES using 6u25 b06 (GA), but FAILS using 6u26 b01 - and GA (b03)
      It also PASSES using JDK 7.

      PASSES means the file dialog appears. FAILS means it does not appear.

      Tested on Windows 7 Ultimate 64 bit using 32 bit JREs and the latest
      (June 2011) SWT.
      -----
      import org.eclipse.swt.SWT;
      import org.eclipse.swt.widgets.FileDialog;
      import org.eclipse.swt.widgets.Shell;

      public class FileDialogTest {
      public static void main(String args[]) {
      Runtime.getRuntime().loadLibrary("awt");
      FileDialog fileDialog = new FileDialog(new Shell(), SWT.OPEN);
      fileDialog.setText("Choose a file or this test will fail!");
      fileDialog.open();
      }

      }
      ---

            dcherepanov Dmitry Cherepanov
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: