Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 365491

Summary: NPE replacing with HEAD revision
Product: [Technology] EGit Reporter: Ed Willink <ed>
Component: UIAssignee: Project Inbox <egit.ui-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: matthias.sohn, Szymon.Brandys, tomasz.zarna
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows Vista   
Whiteboard:

Description Ed Willink CLA 2011-12-02 16:36:56 EST
When replacing files from HEAD I sometimes get 

java.lang.NullPointerException
	at org.eclipse.team.core.subscribers.SubscriberResourceMappingContext.wasRefreshedShallow(SubscriberResourceMappingContext.java:219)
	at org.eclipse.team.core.subscribers.SubscriberResourceMappingContext.ensureRefreshed(SubscriberResourceMappingContext.java:204)
	at org.eclipse.team.core.subscribers.SubscriberResourceMappingContext.fetchRemoteContents(SubscriberResourceMappingContext.java:96)
	at org.eclipse.emf.compare.logical.model.EMFResourceMapping.getTraversals(EMFResourceMapping.java:158)
	at org.eclipse.team.core.mapping.provider.SynchronizationScopeManager.addMappingsToScope(SynchronizationScopeManager.java:389)
	at org.eclipse.team.core.mapping.provider.SynchronizationScopeManager.internalPrepareContext(SynchronizationScopeManager.java:200)
	at org.eclipse.team.core.mapping.provider.SynchronizationScopeManager.access$0(SynchronizationScopeManager.java:187)
	at org.eclipse.team.core.mapping.provider.SynchronizationScopeManager$1.run(SynchronizationScopeManager.java:167)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
	at org.eclipse.team.core.mapping.provider.SynchronizationScopeManager.initialize(SynchronizationScopeManager.java:165)
	at org.eclipse.team.core.subscribers.SubscriberScopeManager.access$0(SubscriberScopeManager.java:1)
	at org.eclipse.team.core.subscribers.SubscriberScopeManager$1.run(SubscriberScopeManager.java:81)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
	at org.eclipse.team.core.subscribers.SubscriberScopeManager.initialize(SubscriberScopeManager.java:79)
	at org.eclipse.team.ui.synchronize.ModelOperation.initializeScope(ModelOperation.java:161)
	at org.eclipse.team.ui.synchronize.ModelOperation.beginOperation(ModelOperation.java:124)
	at org.eclipse.team.ui.synchronize.ModelOperation.run(ModelOperation.java:105)
	at org.eclipse.egit.ui.internal.operations.GitScopeUtil.collectRelatedChanges(GitScopeUtil.java:168)
	at org.eclipse.egit.ui.internal.operations.GitScopeUtil.access$0(GitScopeUtil.java:158)
	at org.eclipse.egit.ui.internal.operations.GitScopeUtil$1.run(GitScopeUtil.java:141)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Comment 1 Matthias Sohn CLA 2011-12-06 04:57:55 EST
looks like this is in Team, which platform version are you using ?
Comment 2 Ed Willink CLA 2011-12-06 05:38:16 EST
3.8M3 with some added EGit and UML nightlies.
Comment 3 Matthias Sohn CLA 2011-12-06 08:45:01 EST
Looks like this is in team, could you have a look please ?
Comment 4 Tomasz Zarna CLA 2011-12-08 08:12:35 EST
Edward any chance for steps? I'm using EGit n-builds as well, but I haven't seen the exception.
Comment 5 Ed Willink CLA 2011-12-08 11:58:57 EST
In the same way that EGIT had the dreadful wrong listening in Bug 358898, I suspect that many other projects in the Modeling domain, particularly Acceleo, EMF Compare, Xtext are also overreacting. Whether this is EGIT provoking too much or other being too sensitive is unclear.

In this case EMF Compare appears in the stack trace.

What seems obvious to me is that if I do a replace the sequence of events should be:

a) Verify Replace Request with user
b) Inhibit builds
c) Perform the replace
d) Restore build status

so EMF Compare should not have a chance to participate under step d) at the earliest.

As it is the NPE occurs during step a). So I suspect that EGIT is triggering inappropriate external listening.
Comment 6 Tomasz Zarna CLA 2012-04-18 06:46:23 EDT
Moving to EGit for comment.