[JIRA] (GLAZEDLISTS-589) java.lang.IllegalArgumentException when selecting an element and filtering the list at the same time

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[JIRA] (GLAZEDLISTS-589) java.lang.IllegalArgumentException when selecting an element and filtering the list at the same time

JIRA jira-no-reply@java.net
fbayle created GLAZEDLISTS-589:
----------------------------------

             Summary: java.lang.IllegalArgumentException when selecting an element and filtering the list at the same time
                 Key: GLAZEDLISTS-589
                 URL: https://java.net/jira/browse/GLAZEDLISTS-589
             Project: glazedlists
          Issue Type: Bug
    Affects Versions: 1.9.1
            Reporter: fbayle
            Assignee: jessewilson


Here is the code sample:

{code:title=TestIllegalArgEx.java.java|borderStyle=solid}
public static void main(String[] args) {
        SwingUtilities.invokeLater(new Runnable() {
                @Override
                public void run() {
                        new JFrame() {
                                {
                                        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

                                        JComboBox<String> jc = new JComboBox<String>();

                                        EventList<String> entries = new BasicEventList<>();
                                        for (int i = 0; i < 10; i++) {
                                                entries.add("sweden");
                                                entries.add("jordan");
                                        }
                                        entries.add("denmark");

                                        AutoCompleteSupport.install(jc, entries);

                                        this.add(jc);
                                        this.pack();
                                        this.setVisible(true);
                                }
                        };
                }
        });
}
{code}

Run this code, open the list of suggestions and scroll to the bottom. When you are on the last element with your mouse, left-click on it, and keep your mouse button pressed. Enter some text to filter the list ("s" for instance). Release your mouse button. You should encounter an IllegalArgumentException.

Stacktrace:
{quote}
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: setSelectedIndex: 20 out of bounds
        at javax.swing.JComboBox.setSelectedIndex(JComboBox.java:620)
        at javax.swing.plaf.basic.BasicComboPopup$Handler.mouseReleased(BasicComboPopup.java:852)
        at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:290)
        at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
        at java.awt.Component.processMouseEvent(Component.java:6535)
        at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
        at javax.swing.plaf.basic.BasicComboPopup$1.processMouseEvent(BasicComboPopup.java:501)
        at java.awt.Component.processEvent(Component.java:6300)
        at java.awt.Container.processEvent(Container.java:2236)
        at java.awt.Component.dispatchEventImpl(Component.java:4891)
        at java.awt.Container.dispatchEventImpl(Container.java:2294)
        at java.awt.Component.dispatchEvent(Component.java:4713)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
        at java.awt.Container.dispatchEventImpl(Container.java:2280)
        at java.awt.Window.dispatchEventImpl(Window.java:2750)
        at java.awt.Component.dispatchEvent(Component.java:4713)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
        at java.awt.EventQueue.access$500(EventQueue.java:97)
        at java.awt.EventQueue$3.run(EventQueue.java:709)
        at java.awt.EventQueue$3.run(EventQueue.java:703)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
        at java.awt.EventQueue$4.run(EventQueue.java:731)
        at java.awt.EventQueue$4.run(EventQueue.java:729)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
{quote}



--
This message was sent by Atlassian JIRA
(v6.2.3#6260)
Loading...