-
Bug
-
Resolution: Fixed
-
P3
-
8u351, 11.0.17-oracle, 17.0.2, 18, 21, 22
-
b10
-
b06
-
aarch64
-
os_x
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8328622 | 21.0.4-oracle | Renjith Kannath Pariyangad | P3 | Resolved | Fixed | b01 |
JDK-8324216 | 21.0.3 | Johannes Bechberger | P3 | Resolved | Fixed | b01 |
JDK-8328624 | 17.0.12-oracle | Renjith Kannath Pariyangad | P3 | Resolved | Fixed | b01 |
JDK-8324191 | 17.0.11 | Johannes Bechberger | P3 | Resolved | Fixed | b01 |
JDK-8328625 | 11.0.24-oracle | Renjith Kannath Pariyangad | P3 | Resolved | Fixed | b01 |
Apple Silicon M1/M2 32GB, Sonoma 14.0
The problem is visible in these tested Java versions:
- Java HotSpot(TM) 64-Bit Server VM, 17.0.8+9-LTS-211, Oracle Corporation
- OpenJDK 64-Bit Server VM, 17.0.8.1+1, Eclipse Adoptium
- OpenJDK 64-Bit Server VM, 21+35, Azul Systems, Inc.
A DESCRIPTION OF THE PROBLEM :
Having a simple JTree with one root and 10 000 child nodes. Toggle the root expansion state using double-click works fine, as well does toggling using the expand/collapse icon. However, using the keyboard right/left keys eventually freezes the Java VM for a long time.
The app works fine in Apple Silicon M1/M2, Ventura 13.x
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Launch the attached sample app
1. Select the "Root" node
2. Press left keyboard key collapse the root
3. Press right keyboard key to expand
Now the app is frozen
Using double-click or the expansion icon to expand/collapse works fine
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The tree should instantly expand/collapse when double-click, using the expansion icon, or the keyboard
ACTUAL -
The application hangs showing the macOS beachball. After many minutes the app comes back to usable state but the problem will reappear at following expand/collapse using keyboard
---------- BEGIN SOURCE ----------
import javax.swing.*;
import javax.swing.tree.DefaultMutableTreeNode;
import java.awt.*;
/**
* Shows a simple JTree with one root and 10 000 child nodes.
* Toggle the root expansion state using double-click works fine, as well when toggle using the expand/collapse icon.
* However, using the keyboard right/left keys eventually freezes the Java VM for a long time.
*/
class SonomaARMJTreeBug {
public static void main(String[] args) {
SwingUtilities.invokeLater(() -> {
String javaInfo = System.getProperty("os.name") + " " +
System.getProperty("os.version") + " (" +
System.getProperty("os.arch") + "), " +
System.getProperty("java.vm.name") + ", " +
System.getProperty("java.vm.version") + ", " +
System.getProperty("java.vm.vendor");
System.out.println(javaInfo);
DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode("Root");
for (int i = 0; i < 10000; i++) {
rootNode.add(new DefaultMutableTreeNode("Child " + i));
}
JTree tree = new JTree(rootNode);
tree.setShowsRootHandles(true);
// t.setLargeModel(true); // This makes no difference
JFrame frame = new JFrame();
frame.add(new JLabel("<html>- Toggle the handle icon next to 'Root' or double-click it a few times. Expand/collapse works fine." +
"<br>- Now use keyboard right/left to expand/collapse, the app eventually freeze for a long time.</html>"), BorderLayout.NORTH);
frame.add(new JScrollPane(tree), BorderLayout.CENTER);
frame.add(new JLabel(javaInfo), BorderLayout.SOUTH);
frame.setSize(700, 700);
frame.setVisible(true);
});
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
In macOS 14 use "OpenJDK 64-Bit Server VM, 17.0.7+7-b966.2, JetBrains s.r.o." or downgrade any other Java VM to version 11.x.
FREQUENCY : always
- backported by
-
JDK-8324191 [macos14] Expand/collapse a JTree using keyboard freezes the application in macOS 14 Sonoma
- Resolved
-
JDK-8324216 [macos14] Expand/collapse a JTree using keyboard freezes the application in macOS 14 Sonoma
- Resolved
-
JDK-8328622 [macos14] Expand/collapse a JTree using keyboard freezes the application in macOS 14 Sonoma
- Resolved
-
JDK-8328624 [macos14] Expand/collapse a JTree using keyboard freezes the application in macOS 14 Sonoma
- Resolved
-
JDK-8328625 [macos14] Expand/collapse a JTree using keyboard freezes the application in macOS 14 Sonoma
- Resolved
- duplicates
-
JDK-8320664 Performance issue with large JTree on macOS
- Closed
- relates to
-
JDK-8323965 modify fix for 8317771 to remove reflection instantiation of the inner class
- Open
-
JDK-8329667 [macos] Issue with JTree related fix for JDK-8317771
- Resolved
-
JDK-8267385 Create NSAccessibilityElement implementation for JavaComponentAccessibility
- Resolved
- links to
-
Commit openjdk/jdk17u-dev/e113ab7c
-
Commit openjdk/jdk21u-dev/c3657ee0
-
Commit openjdk/jdk/ffa33d7b
-
Review openjdk/jdk17u-dev/2140
-
Review openjdk/jdk21u-dev/193
-
Review openjdk/jdk/17165
-
Review(master) openjdk/jdk22u/196