JDK-8075086 : [macosx] JVM -splash: option invocation creates race condition with awt.FileDialog
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 7,8,9
  • Priority: P3
  • Status: Open
  • Resolution: Unresolved
  • OS: os_x
  • Submitted: 2013-04-04
  • Updated: 2019-03-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
openjdk version  " 1.7.0-internal " 
OpenJDK Runtime Environment (build 1.7.0-internal-mn_2012_11_17_13_31-b00)
OpenJDK 64-Bit Server VM (build 24.0-b25, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
OS X 10.7.5

A DESCRIPTION OF THE PROBLEM :
When the FileDialog presents itself, the UI contents of the FileDialog's file system representation fails to update itself when clicking thru and navigating the directory structure. The problem presented itself when invoking the SplashScreen VM option
( i.e. java -splash:<path> )  at application launch.


REGRESSION.  Last worked in version 6u31

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Launch a program using java -splash:<path> MainClass that invokes the java.awt.FileDialog, you will see that navigating the file system using the UI will create a race condition.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Using the -splash:<path> option, navigating the file system, the FileDialog should update the requested files in the UI.
ACTUAL -
When using the -splash:<path> option, the FileDialog UI hangs when requesting to change directory paths.

ERROR MESSAGES/STACK TRACES THAT OCCUR :
No error messages displayed.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;

public class SelectFolderFrame extends JFrame{

public static void main(String[] args){
new SelectFolderFrame();
}

public SelectFolderFrame(){

this.getContentPane().setLayout(new FlowLayout());
JButton button = new JButton( " Show FileDialog " );
button.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent ae){
SwingUtilities.invokeLater(new Runnable() {
          public void run() {
          getDirectory();
          }
          });
}
});

this.getContentPane().add(button);
this.setSize(new Dimension(200, 100));
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setLocationRelativeTo(null);
this.setVisible(true);
}

public static String getDirectory() {

String  direct    =  "  " ;

FileDialog chooser = new FileDialog((Frame)null,  " Select a directory " ,FileDialog.LOAD);
System.setProperty( " apple.awt.fileDialogForDirectories " ,  " true " );
chooser.setVisible(true);

if (chooser.getDirectory() != null) {
 String folderName = chooser.getDirectory();
 folderName += chooser.getFile();
 if(folderName.isEmpty()) return direct;
 direct = folderName;
}

return direct;
  }

}
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
Create a splash the way it was done before this feature was added in Java 6.
Comments
Issue is not reproducible with following configuration: java version "1.8.0_60" Java(TM) SE Runtime Environment (build 1.8.0_60-b27) Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode) OS X Version: 10.10.3 (Yosemite)
03-11-2015

Should be investigated
12-03-2015