linux-china / zookeeper-intellij

IntelliJ IDEA ZooKeeper Plugin
62 stars 36 forks source link

java.lang.IndexOutOfBoundsException #5

Open alyandon opened 10 years ago

alyandon commented 10 years ago

ZooKeeper instance with lots of nodes. Highlighting the root and press "*" to expand all nodes produces the following error:

Index: 100, Size: 100: Index: 100, Size: 100
java.lang.IndexOutOfBoundsException: Index: 100, Size: 100
    at java.util.ArrayList.rangeCheck(ArrayList.java:604)
    at java.util.ArrayList.get(ArrayList.java:382)
    at org.mvnsearch.intellij.plugin.zookeeper.ui.ZkTreeModel.getChild(ZkTreeModel.java:35)
    at javax.swing.tree.VariableHeightLayoutCache$TreeStateNode.expand(VariableHeightLayoutCache.java:1492)
    at javax.swing.tree.VariableHeightLayoutCache$TreeStateNode.expand(VariableHeightLayoutCache.java:1287)
    at javax.swing.tree.VariableHeightLayoutCache.ensurePathIsExpanded(VariableHeightLayoutCache.java:983)
    at javax.swing.tree.VariableHeightLayoutCache.setExpandedState(VariableHeightLayoutCache.java:181)
    at javax.swing.plaf.basic.BasicTreeUI.updateExpandedDescendants(BasicTreeUI.java:1702)
    at javax.swing.plaf.basic.BasicTreeUI.updateLayoutCacheExpandedNodes(BasicTreeUI.java:1673)
    at javax.swing.plaf.basic.BasicTreeUI.updateLayoutCacheExpandedNodesIfNecessary(BasicTreeUI.java:1680)
    at javax.swing.plaf.basic.BasicTreeUI.configureLayoutCache(BasicTreeUI.java:1821)
    at javax.swing.plaf.basic.BasicTreeUI.completeUIInstall(BasicTreeUI.java:688)
    at com.intellij.util.ui.tree.WideSelectionTreeUI.completeUIInstall(WideSelectionTreeUI.java:153)
    at javax.swing.plaf.basic.BasicTreeUI.installUI(BasicTreeUI.java:648)
    at javax.swing.JComponent.setUI(JComponent.java:664)
    at javax.swing.JTree.setUI(JTree.java:698)
    at com.intellij.ui.treeStructure.Tree.setUI(Tree.java:99)
    at javax.swing.JTree.updateUI(JTree.java:714)
    at org.mvnsearch.intellij.plugin.zookeeper.actions.ZkTreeRefreshAction.actionPerformed(ZkTreeRefreshAction.java:20)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:164)
    at com.intellij.openapi.actionSystem.impl.ActionButton.a(ActionButton.java:170)
    at com.intellij.openapi.actionSystem.impl.ActionButton.a(ActionButton.java:133)
    at com.intellij.openapi.actionSystem.impl.ActionButton.processMouseEvent(ActionButton.java:311)
    at java.awt.Component.processEvent(Component.java:6270)
    at java.awt.Container.processEvent(Container.java:2229)
    at java.awt.Component.dispatchEventImpl(Component.java:4861)
    at java.awt.Container.dispatchEventImpl(Container.java:2287)
    at java.awt.Component.dispatchEvent(Component.java:4687)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
    at java.awt.Container.dispatchEventImpl(Container.java:2273)
    at java.awt.Window.dispatchEventImpl(Window.java:2719)
    at java.awt.Component.dispatchEvent(Component.java:4687)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:729)
    at java.awt.EventQueue.access$200(EventQueue.java:103)
    at java.awt.EventQueue$3.run(EventQueue.java:688)
    at java.awt.EventQueue$3.run(EventQueue.java:686)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
    at java.awt.EventQueue$4.run(EventQueue.java:702)
    at java.awt.EventQueue$4.run(EventQueue.java:700)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:699)
    at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:697)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:520)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:335)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
acs commented 4 years ago

I have this error 5 years later :)

So probably the plugin is not maintained. Right?

In any case, thank you @linux-china for the plugin.

linux-china commented 4 years ago

@acs which version of IntelliJ IDEA and ZooKeeper do you use? and I will take a look. Now it works fine with me.

acs commented 4 years ago

I am using IntelliJ 2019.3 and Zookeeper version: 3.4.13. The plugin started and it show me the nodes at the root of zookeeper. The problem appears when I tried to open a node with 120 child nodes. Maybe there is a 100 limit for some reason?

linux-china commented 4 years ago

sorry. the max size is 100. my bad.

for (int i = 0; i < nodes.size() && i < 100; i++) {
                ZkNode zkNode = new ZkNode(node.getFilePath(), nodes.get(i));
                if (isWhitePath(zkNode.getFilePath())) {
                    children.add(zkNode);
                }
 }
acs commented 4 years ago

Do you plan to fix it? It is useful your plugin for working with Zookeeper. I am using now https://github.com/zzhang5/zooinspector which is old but works nicely. I plan also to test the new admin web ui added to Zookeeper in 3.5 version. But there is a use case for this IntelliJ plugin in any case :)