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

In File Loading Thread filechooser.isTraversable is run on COM thread

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 7
    • client-libs
    • None
    • b60
    • 7
    • windows

      JFileChooser uses a background thread, BasicDirectoryModel.FilesLoader, to list the files and update the UI.

      To determine whether a file is traversable, the thread calls filechooser.isTraversable(file) which is executed on the COM thread on Windows. https://github.com/openjdk/jdk/blob/0583f7357480c0500daa82f490b2fcc05f2fb65a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicDirectoryModel.java#L318-L320

      That is for each and every file in list, there's a context switch between threads. This is very inefficient.

      Before the fix for JDK-6713352, this piece of code was executed inside ShellFolder.invoke.

            tr Tejesh R
            aivanov Alexey Ivanov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: