apache / apache/netbeans

SFBQ.Result: org.netbeans.modules.java.source.classpath.SourceNextToBinaryQueryImpl$1 returned null in roots.

Open
#6,454 5 comments 0 reactions 0 assignees View on GitHub
kind:bug More info needed needs:triage pending-response
Dominant language
Java
Stars
3.1k
Forks
935
Avg merge
2d 3h
Merged PRs (30d)
17

Description

### Apache NetBeans version

Apache NetBeans 19

### What happened

Very often in notifications I can see Unexpexted exception error, when I click details there is such stack trace:
```
java.lang.NullPointerException: SFBQ.Result: org.netbeans.modules.java.source.classpath.SourceNextToBinaryQueryImpl$1 returned null in roots.
at org.netbeans.modules.java.queries.SFBQImpl2Result.preferSources(SFBQImpl2Result.java:47)
at org.netbeans.api.java.queries.SourceForBinaryQuery$Result2.preferSources(SourceForBinaryQuery.java:203)
at org.netbeans.modules.parsing.impl.indexing.PathRegistry.getSources(PathRegistry.java:783)
at org.netbeans.modules.parsing.impl.indexing.PathRegistry.createResources(PathRegistry.java:742)
at org.netbeans.modules.parsing.impl.indexing.PathRegistry.getSources(PathRegistry.java:277)
at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$RootsWork.getDone(RepositoryUpdater.java:4925)
[catch] at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Work.doTheWork(RepositoryUpdater.java:3452)
at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Task._run(RepositoryUpdater.java:6197)
at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Task.access$3400(RepositoryUpdater.java:5855)
at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Task$2.lambda$call$0(RepositoryUpdater.java:6116)
at org.openide.util.lookup.Lookups.executeWith(Lookups.java:288)
at org.netbeans.modules.parsing.impl.RunWhenScanFinishedSupport.performScan(RunWhenScanFinishedSupport.java:83)
at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Task$2.call(RepositoryUpdater.java:6116)
at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Task$2.call(RepositoryUpdater.java:6112)
at org.netbeans.modules.masterfs.filebasedfs.utils.FileChangedManager.priorityIO(FileChangedManager.java:153)
at org.netbeans.modules.masterfs.providers.ProvidedExtensions.priorityIO(ProvidedExtensions.java:335)
at org.netbeans.modules.parsing.nb.DataObjectEnvFactory.runPriorityIO(DataObjectEnvFactory.java:118)
at org.netbeans.modules.parsing.impl.Utilities.runPriorityIO(Utilities.java:67)
at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Task.run(RepositoryUpdater.java:6112)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1419)
at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
at org.openide.util.lookup.Lookups.executeWith(Lookups.java:287)
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2034)

```

### How to reproduce

I don't know, it happens on different situations while using Netbeans

### Did this work correctly in an earlier version?

Apache NetBeans 15

### Operating System

Windows 10 version 10.0 running on amd64; UTF-8; pl_PL (nb)

### JDK

17.0.8; Java HotSpot(TM) 64-Bit Server VM 17.0.8+9-LTS-211

### Apache NetBeans packaging

Apache NetBeans provided installer

### Anything else

_No response_

### Are you willing to submit a pull request?

No

Contributor guide

Open the contributing guide

Research direction

Start with org.netbeans.modules.java.source.classpath.SourceNextToBinaryQueryImpl$1 and the null-handling path in SFBQImpl2Result.java, then follow the callers shown in PathRegistry.java and RepositoryUpdater.java. Investigate why roots can be null and confirm that the notification no longer reports this exception; reproduction is currently unspecified.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.