sdedic opened a new pull request, #6852:
URL: https://github.com/apache/netbeans/pull/6852

   From an offline report:
   
   Open a Maven GCN project in VSCode with NBLS installed (no RH Java). Go to 
'Projects' view an try to invoke 'Compile Project' action on the top level 
project's node. The following exception is thrown
   
   ````
   WARNING [org.netbeans.modules.java.lsp.server.protocol.Server]: Error 
occurred during LSP message dispatch
   java.lang.IndexOutOfBoundsException: Index 1 out of bounds for length 1
        at 
java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
        at 
java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
        at 
java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266)
        at java.base/java.util.Objects.checkIndex(Objects.java:359)
        at java.base/java.util.ArrayList.get(ArrayList.java:427)
        at 
org.netbeans.modules.java.lsp.server.protocol.WorkspaceServiceImpl.lambda$executeCommand$3(WorkspaceServiceImpl.java:226)
        at 
java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1150)
   Caused: java.util.concurrent.CompletionException
   ```
   
   This exception happes because if a multiproject root directory (or a file 
with the root project itself, not a subproject) is passed, NBLS opens all 
contained projects - and returns the whole subtree. The original intention of 
`asyncOpenSelectedProjects` was to return projects that correspond to the 
candidates after their open / prime.
   
   This PR changes the behaviour so that `asyncOpenSeelectedProjects` will 
return Project objects that correspond to individual input FileObjects, in the 
same order. If a FileObject is not part of any project, its corresponding array 
slot will be `null`.  I adjusted the callers to check for `null` values, 
hopefully.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

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

Reply via email to