-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
1.4.1
-
x86
-
windows_xp
Name: gm110360 Date: 01/30/2003
FULL PRODUCT VERSION :
java.lang.StackOverflowError
at java.awt.AWTKeyStroke.getAWTKeyStroke(Unknown Source)
at javax.swing.KeyStroke.getKeyStroke(Unknown Source)
at javax.swing.LookAndFeel.loadKeyBindings(Unknown Source)
at javax.swing.plaf.basic.BasicRootPaneUI.updateDefaultButtonBindings(U
known Source)
at javax.swing.plaf.basic.BasicRootPaneUI.propertyChange(Unknown Source
at javax.swing.plaf.metal.MetalRootPaneUI.propertyChange(Unknown Source
at javax.swing.event.SwingPropertyChangeSupport.firePropertyChange(Unkn
wn Source)
at javax.swing.event.SwingPropertyChangeSupport.firePropertyChange(Unkn
wn Source)
at javax.swing.JComponent.firePropertyChange(Unknown Source)
at javax.swing.JRootPane.setDefaultButton(Unknown Source)
at javax.swing.plaf.basic.BasicOptionPaneUI$6.ancestorAdded(Unknown Sou
ce)
at javax.swing.AncestorNotifier.fireAncestorAdded(Unknown Source)
at javax.swing.AncestorNotifier.propertyChange(Unknown Source)
at javax.swing.event.SwingPropertyChangeSupport.firePropertyChange(Unkn
wn Source)
at javax.swing.event.SwingPropertyChangeSupport.firePropertyChange(Unkn
wn Source)
at javax.swing.JComponent.firePropertyChange(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at javax.swing.JRootPane.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at java.awt.Window.addNotify(Unknown Source)
at java.awt.Dialog.addNotify(Unknown Source)
at java.awt.Window.pack(Unknown Source)
at javax.swing.JOptionPane.createDialog(Unknown Source)
at javax.swing.JOptionPane.showOptionDialog(Unknown Source)
at javax.swing.JOptionPane.showMessageDialog(Unknown Source)
at javax.swing.JOptionPane.showMessageDialog(Unknown Source)
at TextFieldInputVerifier.showError(OptionInputVerifierTest.java:65)
at OptionInputVerifierTest$TestInputVerifier.verify(OptionInputVerifier
est.java:39)
at javax.swing.InputVerifier.shouldYieldFocus(Unknown Source)
at javax.swing.JComponent.runInputVerifier(Unknown Source)
at javax.swing.JComponent.requestFocus(Unknown Source)
at javax.swing.plaf.basic.BasicOptionPaneUI.selectInitialValue(Unknown
ource)
at javax.swing.JOptionPane.selectInitialValue(Unknown Source)
at javax.swing.JOptionPane.showOptionDialog(Unknown Source)
at javax.swing.JOptionPane.showMessageDialog(Unknown Source)
at javax.swing.JOptionPane.showMessageDialog(Unknown Source)
at TextFieldInputVerifier.showError(OptionInputVerifierTest.java:65)
at OptionInputVerifierTest$TestInputVerifier.verify(OptionInputVerifier
est.java:39)
at javax.swing.InputVerifier.shouldYieldFocus(Unknown Source)
at javax.swing.JComponent.runInputVerifier(Unknown Source)
at javax.swing.JComponent.requestFocus(Unknown Source)
at javax.swing.plaf.basic.BasicOptionPaneUI.selectInitialValue(Unknown
ource)
at javax.swing.JOptionPane.selectInitialValue(Unknown Source)
at javax.swing.JOptionPane.showOptionDialog(Unknown Source)
at javax.swing.JOptionPane.showMessageDialog(Unknown Source)
at javax.swing.JOptionPane.showMessageDialog(Unknown Source)
at TextFieldInputVerifier.showError(OptionInputVerifierTest.java:65)
at OptionInputVerifierTest$TestInputVerifier.verify(OptionInputVerifier
est.java:39)
at javax.swing.InputVerifier.shouldYieldFocus(Unknown Source)
at javax.swing.JComponent.runInputVerifier(Unknown Source)
at javax.swing.JComponent.requestFocus(Unknown Source)
at javax.swing.plaf.basic.BasicOptionPaneUI.selectInitialValue(Unknown
ource)
at javax.swing.JOptionPane.selectInitialValue(Unknown Source)
at javax.swing.JOptionPane.showOptionDialog(Unknown Source)
at javax.swing.JOptionPane.showMessageDialog(Unknown Source)
at javax.swing.JOptionPane.showMessageDialog(Unknown Source)
at TextFieldInputVerifier.showError(OptionInputVerifierTest.java:65)
EXTRA RELEVANT SYSTEM CONFIGURATION :
Windows xp Operating System
A DESCRIPTION OF THE PROBLEM :
while showing the JOptionPane in the InputVerifier class's
Verifiy(JComponent comp) method it giving the stackOverflow
error
REGRESSION. Last worked in version 1.3.1
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1.Create InputVerifier for the TextField
2.in verifiy mehod show the JOptionPane.showMessageDialog()
3.while try show the Option pane it will give the error
EXPECTED VERSUS ACTUAL BEHAVIOR :
StackOverFlow
ERROR MESSAGES/STACK TRACES THAT OCCUR :
java.lang.StackOverflowError
at java.awt.AWTKeyStroke.getAWTKeyStroke(Unknown Source)
at javax.swing.KeyStroke.getKeyStroke(Unknown Source)
at javax.swing.LookAndFeel.loadKeyBindings(Unknown Source)
at javax.swing.plaf.basic.BasicRootPaneUI.updateDefaultButtonBindings(U
known Source)
at javax.swing.plaf.basic.BasicRootPaneUI.propertyChange(Unknown Source
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javax.swing.*;
public class OptionInputVerifierTest extends JPanel {
private JTextField test = new JTextField();
private JTextField jTextField2 = new JTextField();
public OptionInputVerifierTest() {
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
OptionInputVerifierTest optionInputVerifierTest1 = new
OptionInputVerifierTest();
optionInputVerifierTest1.showFrame();
}
public void showFrame(){
JFrame frame=new JFrame();
frame.getContentPane().add(this);
frame.pack();
frame.setVisible(true);
}
class TestInputVerifier extends TextFieldInputVerifier{
public boolean verify(JComponent com){
System.err.println("Verifier...");
if(!test.getText().equalsIgnoreCase("Test")){
showError("Error",com);
return false;
}
return true;
}
}
private void jbInit() throws Exception {
test.setColumns(20);
jTextField2.setText("jTextField2");
jTextField2.setColumns(12);
test.setInputVerifier(new TestInputVerifier());
this.add(test, null);
this.add(jTextField2, null);
}
}
abstract class TextFieldInputVerifier extends InputVerifier {
private boolean isVerified=true;
private boolean showError=false;
protected void showError(final String message,final JComponent parent){
javax.swing.JOptionPane.showMessageDialog
(parent,message,"Error!",JOptionPane.ERROR_MESSAGE);
}
}
---------- END SOURCE ----------
Release Regression From : 1.3.1_07
The above release value was the last known release where this
bug was known to work. Since then there has been a regression.
(Review ID: 179516)
======================================================================
- duplicates
-
JDK-4532517 shouldYieldFocus does not allow side effects in 1.4
- Resolved