SonarLint for Eclipse 11.3.0.82692 issue with git working tree (I think)

  • Operating system: Windows 10
  • IDE name and version : Eclipse 2024.12 (or 2025.03)
  • SonarQube for Eclipse plugin version: 11.3.0.82692
  • Programming language you’re coding in: Java
  • Is connected mode used: SonarQube Server

Hello,

Since latest version, I have numerous issue which spawn in the console with a JGit trace : java.lang.NullPointerException: Cannot invoke "org.eclipse.jgit.lib.AnyObjectId.hashCode()" because "id" is null

While I think the problem might be related to the fact I am using git worktree and that some version of JGit did not have support for it, I would like to be able to

  1. disable the git part of SonarLint : if I need the git part for blame and so, I would use our on premise instance of Sonar rather than SonarLint. Anyway, it should not block Sonar analysis.

  2. disable all the notifications that spawn

  • the popup says “Don’t show again”, but somehow it shows again.
  • I very much dislike those notifications and would like to keep them silent : if there is a problem, use the error log or add an icon in the status bar (I know that Eclipse does it when there are some error)

Regards,

The full trace is :

Error occurred while reading .gitignore file: 

java.lang.NullPointerException: Cannot invoke "org.eclipse.jgit.lib.AnyObjectId.hashCode()" because "id" is null
	at org.eclipse.jgit.internal.storage.file.UnpackedObjectCache$Table.index(UnpackedObjectCache.java:115)
	at org.eclipse.jgit.internal.storage.file.UnpackedObjectCache$Table.contains(UnpackedObjectCache.java:76)
	at org.eclipse.jgit.internal.storage.file.UnpackedObjectCache.isUnpacked(UnpackedObjectCache.java:31)
	at org.eclipse.jgit.internal.storage.file.LooseObjects.hasCached(LooseObjects.java:99)
	at org.eclipse.jgit.internal.storage.file.ObjectDirectory.openObjectWithoutRestoring(ObjectDirectory.java:359)
	at org.eclipse.jgit.internal.storage.file.ObjectDirectory.openObject(ObjectDirectory.java:350)
	at org.eclipse.jgit.internal.storage.file.WindowCursor.open(WindowCursor.java:133)
	at org.eclipse.jgit.lib.ObjectReader.open(ObjectReader.java:216)
	at org.eclipse.jgit.revwalk.RevWalk.parseAny(RevWalk.java:1144)
	at org.eclipse.jgit.revwalk.RevWalk.parseCommit(RevWalk.java:1055)
	at org.sonarsource.sonarlint.core.commons.util.git.GitUtils.readFileContentFromGitRepo(GitUtils.java:315)
	at org.sonarsource.sonarlint.core.commons.util.git.GitUtils.readGitIgnoreFileFromBareRepo(GitUtils.java:288)
	at org.sonarsource.sonarlint.core.commons.util.git.GitUtils.buildIgnoreNode(GitUtils.java:280)
	at org.sonarsource.sonarlint.core.commons.util.git.GitUtils.createSonarLintGitIgnore(GitUtils.java:264)
	at org.sonarsource.sonarlint.core.analysis.AnalysisService.toInputFiles(AnalysisService.java:757)
	at org.sonarsource.sonarlint.core.analysis.AnalysisService.getAnalysisConfigForEngine(AnalysisService.java:279)
	at org.sonarsource.sonarlint.core.analysis.AnalysisService.analyze(AnalysisService.java:647)
	at org.sonarsource.sonarlint.core.rpc.impl.AnalysisRpcServiceDelegate.lambda$analyzeFilesAndTrack$7(AnalysisRpcServiceDelegate.java:131)
	at org.sonarsource.sonarlint.core.rpc.impl.AbstractRpcServiceDelegate.lambda$requestAsync$0(AbstractRpcServiceDelegate.java:67)
	at org.sonarsource.sonarlint.core.rpc.impl.AbstractRpcServiceDelegate.computeWithLogger(AbstractRpcServiceDelegate.java:135)
	at org.sonarsource.sonarlint.core.rpc.impl.AbstractRpcServiceDelegate.lambda$requestAsync$1(AbstractRpcServiceDelegate.java:65)
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646)
	at java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.lang.Thread.run(Thread.java:1583)

Hello @d721c822.

Thanks for your reporting. We use the older version of JGit, that doesn’t support Git Worktree.
We working on fixing it. Here are the tickets:
https://sonarsource.atlassian.net/browse/SLCORE-1272
https://sonarsource.atlassian.net/browse/GFB-9
https://sonarsource.atlassian.net/browse/SLE-1153

Can’t make any time commitments, unfortunately. It may take some time. Please track progress using provided links.

Best,