Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.ArrayIndexOutOfBoundsException: -1 #135

Closed
pmouawad opened this issue Apr 10, 2020 · 4 comments
Closed

java.lang.ArrayIndexOutOfBoundsException: -1 #135

pmouawad opened this issue Apr 10, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@pmouawad
Copy link

Hello,
Using JMeter with darklaf on MacOSX I got this errror today.

Unfortunately I cannot give the exact scenario for it, it happens on repaint

Stacktrace:

2020-04-10 16:16:19,586 ERROR o.a.j.JMeter: Uncaught exception in thread Thread[AWT-EventQueue-0,6,main] java.lang.ArrayIndexOutOfBoundsException: -1 at java.util.Vector.elementData(Vector.java:737) ~[?:1.8.0_201] at java.util.Vector.elementAt(Vector.java:480) ~[?:1.8.0_201] at javax.swing.tree.DefaultMutableTreeNode.getChildAt(DefaultMutableTreeNode.java:245) ~[?:1.8.0_201] at javax.swing.tree.DefaultTreeModel.getChild(DefaultTreeModel.java:174) ~[?:1.8.0_201] at com.github.weisj.darklaf.ui.tree.DarkTreeUI.paintVerticalPartOfLeg(DarkTreeUI.java:672) ~[darklaf-core-1.4.3.1.jar:1.4.3.1] at com.github.weisj.darklaf.ui.tree.DarkTreeUI.paint(DarkTreeUI.java:456) ~[darklaf-core-1.4.3.1.jar:1.4.3.1] at javax.swing.plaf.ComponentUI.update(ComponentUI.java:161) ~[?:1.8.0_201] at javax.swing.JComponent.paintComponent(JComponent.java:780) ~[?:1.8.0_201] at javax.swing.JComponent.paint(JComponent.java:1056) ~[?:1.8.0_201] at javax.swing.JComponent.paintToOffscreen(JComponent.java:5210) ~[?:1.8.0_201] at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1579) ~[?:1.8.0_201] at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1502) ~[?:1.8.0_201] at javax.swing.RepaintManager.paint(RepaintManager.java:1272) ~[?:1.8.0_201] at javax.swing.JComponent._paintImmediately(JComponent.java:5158) ~[?:1.8.0_201] at javax.swing.JComponent.paintImmediately(JComponent.java:4969) ~[?:1.8.0_201] at javax.swing.RepaintManager$4.run(RepaintManager.java:831) ~[?:1.8.0_201] at javax.swing.RepaintManager$4.run(RepaintManager.java:814) ~[?:1.8.0_201] at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_201] at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74) ~[?:1.8.0_201] at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:814) ~[?:1.8.0_201] at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:789) ~[?:1.8.0_201] at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:738) ~[?:1.8.0_201] at javax.swing.RepaintManager.access$1200(RepaintManager.java:64) ~[?:1.8.0_201] at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1732) ~[?:1.8.0_201] at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311) ~[?:1.8.0_201] at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758) ~[?:1.8.0_201] at java.awt.EventQueue.access$500(EventQueue.java:97) ~[?:1.8.0_201] at java.awt.EventQueue$3.run(EventQueue.java:709) ~[?:1.8.0_201] at java.awt.EventQueue$3.run(EventQueue.java:703) ~[?:1.8.0_201] at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_201] at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74) ~[?:1.8.0_201] at java.awt.EventQueue.dispatchEvent(EventQueue.java:728) ~[?:1.8.0_201] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205) [?:1.8.0_201] at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) [?:1.8.0_201] at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) [?:1.8.0_201] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) [?:1.8.0_201] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) [?:1.8.0_201] at java.awt.EventDispatchThread.run(EventDispatchThread.java:82) [?:1.8.0_201]

@weisJ weisJ added the bug Something isn't working label Apr 11, 2020
@weisJ
Copy link
Owner

weisJ commented Apr 11, 2020

How to reproduce:

        DefaultMutableTreeNode root = new DefaultMutableTreeNode("Root");
        DefaultMutableTreeNode node = new DefaultMutableTreeNode("Node");
        root.add(node);
        JTree tree = new JTree(root) {
            @Override
            public boolean isExpanded(final TreePath path) {
                return true;
            }
        };

I guess somewhere in your tree there is a node that has no children but is expanded (even though that shouldn't be possible).

@pmouawad
Copy link
Author

Hello @weisJ ,
it looks weird as this does not seem possible on JMeter.
Will double check.
Thanks

@weisJ weisJ closed this as completed in 106c82b Apr 14, 2020
@pmouawad
Copy link
Author

Thanks for fix.
When do you plan to release ? Thanks

@weisJ
Copy link
Owner

weisJ commented Apr 15, 2020

I'll need confirmation that the selection colour does indeed changes appropriately. Then I'll be ready to merge #127 and release the new version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants