-
Notifications
You must be signed in to change notification settings - Fork 62
Description
In Eclipse IDE (Version 2026-03; сlean IDE install: just extracted, no plugins, and a newly created workspace), the Expression Evaluator fails to resolve inherited methods when a breakpoint is set inside a system module class (e.g., javax.swing.JFormattedTextField). Even though the class hierarchy is correctly shown in the Type Hierarchy view, the debugger claims that methods from parent classes (like getName() or getParent() from java.awt.Component) are undefined.
Steps to reproduce
- Use Oracle JDK 21 JDK 17 or JDK 25 or embedded/bundled JDK.
- Create a clean Java project in IDE (no Gradle/Maven); See the test code below .
- Set a breakpoint inside javax.swing.JFormattedTextField.JFormattedTextField() source code.
- Add an expression: "getName()".
- Start debugging.
Actual Result:
<error(s)_during_the_evaluation>: The method getName() is undefined for the type JFormattedTextField
<error(s)_during_the_evaluation>: The method isVisible() is undefined for the type JFormattedTextField
<error(s)_during_the_evaluation>: The method getParent() is undefined for the type JFormattedTextField
Expected Result:
The debugger should resolve inherited methods from java.awt.Component and javax.swing.JComponent
Workaround found:
Explicit casting via Object or Dynamic casting using the Class.cast() method works:
- ((java.awt.Component)(Object)this).getName().
- java.awt.Component.class.cast(this).getName()
This suggests a failure in the JDT Debug implicit type resolution for modular JRE classes.
Test code:
public class bbb {
public static void main(String[] args) {
SwingUtilities.invokeLater(() -> {
JFrame frame = new JFrame("test");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(300, 150);
frame.setLayout(new FlowLayout());
JFormattedTextField formattedField = new JFormattedTextField();
frame.add(formattedField);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
});
}
}
Environment:
Eclipse IDE 2026-03; Version: 2026-03 (4.39.0); Build id: 20260305-0817
Java Version: Oracle JDK 17.0.1 / 21.0.9 / JDK 25.0.2 / Embedded OpenJDK Runtime Environment 21.0.10+7-LTS
OS: Windows 10 Pro 22H2, (10.0.19045.6456)
