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

Bug 362378

Summary: NPE during commit
Product: [Technology] EGit Reporter: Sam Davis <sam.davis>
Component: CoreAssignee: Project Inbox <egit.core-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: remy.suen
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Sam Davis CLA 2011-10-28 17:44:59 EDT
I selected some files in the synchronize view and tried to commit. An error dialog with the follow exception appeard, and the commit dialog appeared on top of it.

Error
Fri Oct 28 14:42:38 PDT 2011
Error occurred while building scope for committing changes

java.lang.NullPointerException
at org.eclipse.egit.core.synchronize.GitResourceVariantTreeSubscriber.refresh(GitResourceVariantTreeSubscriber.java:141)
at org.eclipse.team.core.subscribers.SubscriberResourceMappingContext.refresh(SubscriberResourceMappingContext.java:167)
at org.eclipse.team.core.subscribers.SubscriberResourceMappingContext.ensureRefreshed(SubscriberResourceMappingContext.java:207)
at org.eclipse.team.core.subscribers.SubscriberResourceMappingContext.fetchMembers(SubscriberResourceMappingContext.java:132)
at org.eclipse.jdt.internal.corext.util.JavaElementResourceMapping.getRemotePackageFragmentTraversals(JavaElementResourceMapping.java:217)
at org.eclipse.jdt.internal.corext.util.JavaElementResourceMapping.access$0(JavaElementResourceMapping.java:209)
at org.eclipse.jdt.internal.corext.util.JavaElementResourceMapping$PackageFragmentResourceMapping.getTraversals(JavaElementResourceMapping.java:182)
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:1975)
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:1975)
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 Sam Davis CLA 2011-10-28 17:47:18 EDT
This seems to be due to selecting a folder and only some of the files under it (actually, I hit select all and then unselected one file).
Comment 2 Sam Davis CLA 2011-10-28 17:48:24 EDT
Actually, it also happens if I just select all.
Comment 3 Remy Suen CLA 2011-10-28 18:29:16 EDT
Hi Sam, thanks for your bug report. Which version of EGit are you using?
Comment 4 Remy Suen CLA 2011-10-28 18:31:38 EDT

*** This bug has been marked as a duplicate of bug 358302 ***
Comment 5 Sam Davis CLA 2011-10-28 18:38:27 EDT
I have the following installed:

  Eclipse EGit	1.2.0.201109261000	org.eclipse.egit.feature.group
  Eclipse EGit - Source (Incubation)	0.11.3	org.eclipse.egit.source.feature.group
  EGit Mylyn	1.2.0.201109261000	org.eclipse.egit.mylyn.feature.group
  EGit Project Set Support	1.2.0.201109261000	org.eclipse.egit.psf.feature.group