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

Method JTextComponent.getKeyStrokesForAction() throws StackOverflowError

XMLWordPrintable

    • b130
    • generic
    • generic
    • Verified

        JDK: 1.4, 1.5, 6b105(RI), 6u16, 7
        Platform: Windows, Solaris
        Failing JCK test: api/javax_swing/text/Keymap/index.html#Keymap[Keymap010]

        The following minimized code sample:
        -------------------------------------------------------------
        import javax.swing.*;
        import javax.swing.text.Keymap;
        import java.awt.event.ActionEvent;

        public class MiniTest {

            public static void main(String[] args) {

                Keymap keyMap = new JTextPane().getKeymap();
                keyMap.setResolveParent(keyMap);

                new JTextPane().getKeymap().getKeyStrokesForAction(new AbstractAction() {
                    public void actionPerformed(ActionEvent e) { }
                });
            }
        }
        -------------------------------------------------------------
        Causes:

        Exception in thread "main" java.lang.StackOverflowError
        at javax.swing.text.JTextComponent$DefaultKeymap.getKeyStrokesForAction(JTextComponent.java:4143)
        at javax.swing.text.JTextComponent$DefaultKeymap.getKeyStrokesForAction(JTextComponent.java:4160)
        at javax.swing.text.JTextComponent$DefaultKeymap.getKeyStrokesForAction(JTextComponent.java:4160)
        at javax.swing.text.JTextComponent$DefaultKeymap.getKeyStrokesForAction(JTextComponent.java:4160)
        .........

              rupashka Pavel Porvatov (Inactive)
              dbessono Dmitry Bessonov
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: