You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by "Travis (JIRA)" <ji...@apache.org> on 2019/04/04 16:37:00 UTC

[jira] [Commented] (NETBEANS-2354) ArrayIndexOutOfBoundsException during "Find Usages" operation

    [ https://issues.apache.org/jira/browse/NETBEANS-2354?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16810043#comment-16810043 ] 

Travis commented on NETBEANS-2354:
----------------------------------

I peeked at FolderTreeElement.java:119, which is:

 

System.arraycopy(xmlgroups,0,allgroups,allgroups.length-1,xmlgroups.length);

 

If I understand this code correctly, it is just trying to create an "allgroups" array which contains everything from the "javagroups" array followed by everything from the "xmlgroups" array.  So I think the bug is the fourth argument to arraycopy, which is the destPos.  This is "allgroups.length-1" but I think maybe it should be "javagroups.length".

> ArrayIndexOutOfBoundsException during "Find Usages" operation
> -------------------------------------------------------------
>
>                 Key: NETBEANS-2354
>                 URL: https://issues.apache.org/jira/browse/NETBEANS-2354
>             Project: NetBeans
>          Issue Type: Bug
>          Components: java - Refactoring
>    Affects Versions: 11.0
>            Reporter: Travis
>            Priority: Major
>
> I'm using Netbeans 11 vc4 on Java 8 multi-project (on Windows).  I ran "Find Usages" on a method and got the exception below.  After this exception, the find results were empty, despite there being callers of the method within the search scope.
>  
> I have spent a ton of time working with the same project using Netbeans 10, and running "Find Usages" frequently.  I never got this exception there before, and Find Usages has been totally robust until now.  So it seems this is likely a new bug in Netbeans 11.
>  
> I cannot provide the gigantic multi-project where this problem is reproducible.  I could try to reduce it down to a minimal testcase and then obfuscate the code, if you need an example project to reproduce this issue or to test the fix.
>  
> Thanks!
>  
> java.lang.ArrayIndexOutOfBoundsException
>  at java.lang.System.arraycopy(Native Method)
>  at org.netbeans.modules.refactoring.java.ui.tree.FolderTreeElement.getSourceGroup(FolderTreeElement.java:119)
>  at org.netbeans.modules.refactoring.java.ui.tree.TreeElementFactoryImpl.getTreeElement(TreeElementFactoryImpl.java:55)
>  at org.netbeans.modules.refactoring.spi.ui.TreeElementFactory.getTreeElement(TreeElementFactory.java:44)
>  at org.netbeans.modules.refactoring.java.ui.tree.FileTreeElement.getParent(FileTreeElement.java:75)
>  at org.netbeans.modules.refactoring.spi.impl.RefactoringPanel.createNode(RefactoringPanel.java:488)
>  at org.netbeans.modules.refactoring.spi.impl.RefactoringPanel.createNode(RefactoringPanel.java:493)
>  at org.netbeans.modules.refactoring.spi.impl.RefactoringPanel.createNode(RefactoringPanel.java:493)
>  at org.netbeans.modules.refactoring.spi.impl.RefactoringPanel.access$1100(RefactoringPanel.java:80)
>  at org.netbeans.modules.refactoring.spi.impl.RefactoringPanel$3.run(RefactoringPanel.java:765)
>  at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418)
>  at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
>  at org.openide.util.lookup.Lookups.executeWith(Lookups.java:278)
> [catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists