Bug 572101 - NPE in IndexDiffCache.getIndexDiffCacheEntry
Summary: NPE in IndexDiffCache.getIndexDiffCacheEntry
Status: RESOLVED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: 5.12   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 5.12   Edit
Assignee: Thomas Wolf CLA
QA Contact:
URL:
Whiteboard:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2021-03-19 06:56 EDT by Andrey Loskutov CLA
Modified: 2021-03-22 03:53 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Loskutov CLA 2021-03-19 06:56:23 EDT
Just run into this NPE below using latest Egit/Eclipse, no idea what went wrong with EGit, I didn't added/deleted any of my repo directories...

eclipse.buildId=4.20.0.I20210319-0030
java.version=11.0.10
java.vendor=Red Hat, Inc.
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Command-line arguments:  -data /data/4x_platform_workspace -os linux -ws gtk -arch x86_64

org.eclipse.core.jobs
Error
Fri Mar 19 11:47:18 CET 2021
An internal error occurred during: "Git Repository Refresh".

java.lang.NullPointerException
	at org.eclipse.egit.core.internal.indexdiff.IndexDiffCache.getIndexDiffCacheEntry(IndexDiffCache.java:246)
	at org.eclipse.egit.core.internal.ResourceRefreshHandler.refreshIndex(ResourceRefreshHandler.java:172)
	at org.eclipse.egit.core.internal.ResourceRefreshHandler.refreshRepository(ResourceRefreshHandler.java:165)
	at org.eclipse.egit.ui.internal.ExternalRepositoryScanner$ResourceRefreshJob.run(ExternalRepositoryScanner.java:423)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Comment 1 Andrey Loskutov CLA 2021-03-19 06:57:58 EDT
Looks like a regression from bug 571994.
Comment 2 Andrey Loskutov CLA 2021-03-19 07:09:44 EDT
(In reply to Andrey Loskutov from comment #1)
> Looks like a regression from bug 571994.

Yes, it is. The WorkingTreeModifiedEvent created in ResourceRefreshJob doesn't have repo set, and the new code uses event.getRepository() in few places.

Thomas, could you please check?
Comment 3 Eclipse Genie CLA 2021-03-19 07:43:54 EDT
New Gerrit change created: https://git.eclipse.org/r/c/egit/egit/+/178070