JDK-8154325 : Selecting file filter in file open dialog runs several file loading threads
  • Type: Bug
  • Component: client-libs
  • Affected Version: 9
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2016-04-15
  • Updated: 2018-09-05
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
Relates :  
Description
To reproduce the issue run the code below and select "All Files" file format in JFileDialog.
More than one "Aqua L&F File Loading Thread" (see AquaFileSystemModel.FilesLoader) is run.
---------------------
import javax.swing.JFileChooser;
import javax.swing.SwingUtilities;
import javax.swing.filechooser.FileFilter;
import javax.swing.filechooser.FileNameExtensionFilter;

public class JFileChooserSample {

    public static void main(String[] args) throws Exception {
        SwingUtilities.invokeLater(JFileChooserSample::createAndShowGUI);
    }

    private static void createAndShowGUI() {
        JFileChooser fileChooser = new JFileChooser();
        fileChooser.setAcceptAllFileFilterUsed(true);
        fileChooser.setDialogType(JFileChooser.OPEN_DIALOG);

        FileFilter txtFilter = new FileNameExtensionFilter("Text files", "txt");
        fileChooser.addChoosableFileFilter(txtFilter);
        fileChooser.setFileFilter(txtFilter);
        fileChooser.showOpenDialog(null);
    }
}
---------------------
Comments
This may relate to the fact that AquaFileChooserUI.model field is added twice to the property change listener in methods installListeners(JFileChooser) and createList(JFileChooser).
15-04-2016