Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 358626 - NPE in 'staging' view when hard resetting on local branch
Summary: NPE in 'staging' view when hard resetting on local branch
Status: CLOSED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-22 12:55 EDT by Vadim Dmitriev CLA
Modified: 2013-09-27 13:56 EDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vadim Dmitriev CLA 2011-09-22 12:55:34 EDT
Hi.

Not sure these steps will reproduce the problem, but here is what I did:
1. Made new commit via 'Git Staging' view
2. Made hard reset to another local branch in 'Git Repositories' view with 'Staging' view still opened

EGit 1.1.0.201109151100-r

-- Error Details --
Date: Thu Sep 22 20:46:11 MSD 2011
Message: An internal error occurred during: "Staging view reindexing repository ru.bpc.alfa.p2p".
Severity: Error
Product: Eclipse Platform 3.7.0.v201106131736 (org.eclipse.platform.ide)
Plugin: org.eclipse.core.jobs
Session Data:
eclipse.buildId=I20110613-1736
java.version=1.6.0_27
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments:  -os win32 -ws win32 -arch x86

Exception Stack Trace:
java.lang.NullPointerException
	at org.eclipse.egit.core.ContainerTreeIterator.<init>(ContainerTreeIterator.java:124)
	at org.eclipse.egit.core.ContainerTreeIterator.createSubtreeIterator(ContainerTreeIterator.java:132)
	at org.eclipse.jgit.treewalk.AbstractTreeIterator.createSubtreeIterator(AbstractTreeIterator.java:527)
	at org.eclipse.jgit.treewalk.TreeWalk.enterSubtree(TreeWalk.java:907)
	at org.eclipse.jgit.treewalk.TreeWalk.next(TreeWalk.java:566)
	at org.eclipse.jgit.lib.IndexDiff.diff(IndexDiff.java:281)
	at org.eclipse.egit.ui.internal.staging.StagingView.doReload(StagingView.java:1085)
	at org.eclipse.egit.ui.internal.staging.StagingView.access$24(StagingView.java:1074)
	at org.eclipse.egit.ui.internal.staging.StagingView$24.run(StagingView.java:1014)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Comment 1 Matthias Sohn CLA 2011-09-30 17:54:20 EDT
I failed to reproduce this following your steps
Comment 2 Jens Baumgart CLA 2011-10-06 10:57:42 EDT
Can we avoid such problems at all?
I assume the IndexDiff calculation was running while the reset was performed. Since git allows reading all the time such things can happen in reading threads, right?
Comment 3 Vadim Dmitriev CLA 2011-10-13 08:56:50 EDT
Just hit the same problem again, this time I was frequently switching between branches, creating, removing them etc. In contrast with the original problem this one preserves after eclipse restart.

java.lang.NullPointerException
	at org.eclipse.egit.core.ContainerTreeIterator.<init>(ContainerTreeIterator.java:124)
	at org.eclipse.egit.core.ContainerTreeIterator.createSubtreeIterator(ContainerTreeIterator.java:132)
	at org.eclipse.jgit.treewalk.AbstractTreeIterator.createSubtreeIterator(AbstractTreeIterator.java:527)
	at org.eclipse.jgit.treewalk.TreeWalk.enterSubtree(TreeWalk.java:907)
	at org.eclipse.jgit.treewalk.TreeWalk.next(TreeWalk.java:566)
	at org.eclipse.jgit.lib.IndexDiff.diff(IndexDiff.java:284)
	at org.eclipse.egit.ui.internal.staging.StagingView.doReload(StagingView.java:1085)
	at org.eclipse.egit.ui.internal.staging.StagingView.access$24(StagingView.java:1074)
	at org.eclipse.egit.ui.internal.staging.StagingView$24.run(StagingView.java:1014)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Comment 4 Jens Baumgart CLA 2011-10-13 10:33:47 EDT
Does refreshing all projects help?
Comment 5 elatllat CLA 2012-04-25 10:58:26 EDT
related(In reply to comment #4)
> Does refreshing all projects help?

related bug:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=377644
Comment 6 Jens Baumgart CLA 2012-05-10 11:26:06 EDT
Implementation of ContainerTteeIterator has changed in the mean time.
The repository is no longer queried.
Does the problem also occur with the latest EGit from the nightly build?
Comment 7 Walter Lowe CLA 2012-06-04 14:03:27 EDT
I was running into the same problem and upgrading to the latest Egit nightly build fixed it.