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

Bug 436328

Summary: NPE importing projects with RC2
Product: [Eclipse Project] Platform Reporter: Laurent Goubet <laurent.goubet>
Component: UIAssignee: Platform-UI-Inbox <Platform-UI-Inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: bsd, daniel_megert, Lars.Vogel, pwebster
Version: 4.4   
Target Milestone: ---   
Hardware: PC   
OS: Windows NT   
Whiteboard:
Bug Depends on:    
Bug Blocks: 436358    

Description Laurent Goubet CLA 2014-06-02 03:14:30 EDT
Tested with a fresh install of Eclipse 4.4RC3, EGit 3.4.0.201405281120-rc2, JGit 3.4.0.201405281120-rc2 and the optional Java 7 JGit libraries   3.4.0.201405281120-rc2.

The following error is thrown when using the "import projects..." wizard from the Git repositories view. Doesn't seem to be a blocking issue since the projects were all imported in my workspace anyway... But it did pop an "error" dialog.

eclipse.buildId=4.4.0.I20140528-2000
java.version=1.7.0_45
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=fr_FR
Command-line arguments:  -os win32 -ws win32 -arch x86_64

org.eclipse.egit.ui
Error
Mon Jun 02 09:03:21 CEST 2014


java.lang.NullPointerException
	at org.eclipse.jface.operation.AccumulatingProgressMonitor.setTaskName(AccumulatingProgressMonitor.java:206)
	at org.eclipse.core.runtime.ProgressMonitorWrapper.setTaskName(ProgressMonitorWrapper.java:144)
	at org.eclipse.core.runtime.ProgressMonitorWrapper.setTaskName(ProgressMonitorWrapper.java:144)
	at org.eclipse.egit.core.op.ConnectProviderOperation.execute(ConnectProviderOperation.java:108)
	at org.eclipse.egit.ui.internal.clone.ProjectUtils$1.run(ProjectUtils.java:121)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2313)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2295)
	at org.eclipse.egit.ui.internal.clone.ProjectUtils.createProjects(ProjectUtils.java:129)
	at org.eclipse.egit.ui.internal.clone.ProjectUtils.createProjects(ProjectUtils.java:60)
	at org.eclipse.egit.ui.internal.clone.GitCreateProjectViaWizardWizard.importProjects(GitCreateProjectViaWizardWizard.java:164)
	at org.eclipse.egit.ui.internal.clone.GitCreateProjectViaWizardWizard.access$1(GitCreateProjectViaWizardWizard.java:147)
	at org.eclipse.egit.ui.internal.clone.GitCreateProjectViaWizardWizard$3.run(GitCreateProjectViaWizardWizard.java:131)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)
Comment 1 Laurent Goubet CLA 2014-06-02 05:11:04 EDT
Re-assigning. I did not manage to reproduce this, and looking at the code, it seems like the AccumulatingProgressMonitor is missing a "synchronized" on setTaskName since it is the only access to the "collector" field that's not protected.
Comment 2 Dani Megert CLA 2014-06-02 07:47:26 EDT
(In reply to Laurent Goubet from comment #1)
> Re-assigning. I did not manage to reproduce this, and looking at the code,
> it seems like the AccumulatingProgressMonitor is missing a "synchronized" on
> setTaskName since it is the only access to the "collector" field that's not
> protected.

It was until M7. The fix for bug 432826 introduced this bug.
Comment 3 Dani Megert CLA 2014-06-02 07:49:44 EDT
Paul, this is something we might consider for RC4.
Comment 4 Brian de Alwis CLA 2014-06-02 10:35:00 EDT
I'm unable to reproduce this with my testing.  Unlike bug 436356, this bug seems more sporadic.
Comment 5 Laurent Goubet CLA 2014-06-02 10:45:43 EDT
(In reply to Brian de Alwis from comment #4)
> I'm unable to reproduce this with my testing.

I have only had this pop once, though that was only after minutes of testing the RC3. Seems a little dangerous because of its location though, since it may create random error popups from anything that uses IWorkspaceRunnables.
Comment 6 Brian de Alwis CLA 2014-06-02 15:52:30 EDT
I've been able to reproduce this by using the "Import projects…" from the Git Repositories view and hammering on the "Search" button from the Add Local Git Repositories wizard.  Can't reproduce when running the fix for bug 436358.

!ENTRY org.eclipse.egit.core 4 0 2014-06-02 15:51:50.624
!MESSAGE 
!STACK 0
java.lang.NullPointerException
	at org.eclipse.jface.operation.AccumulatingProgressMonitor.setTaskName(AccumulatingProgressMonitor.java:206)
	at org.eclipse.egit.ui.internal.repository.RepositorySearchDialog.findGitDirsRecursive(RepositorySearchDialog.java:420)
	at org.eclipse.egit.ui.internal.repository.RepositorySearchDialog.access$10(RepositorySearchDialog.java:386)
	at org.eclipse.egit.ui.internal.repository.RepositorySearchDialog$10.run(RepositorySearchDialog.java:467)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)
Comment 7 Brian de Alwis CLA 2014-06-02 16:12:46 EDT
(In reply to Brian de Alwis from comment #6)
> I've been able to reproduce this by using the "Import projects…" from the
> Git Repositories view and hammering on the "Search" button from the Add
> Local Git Repositories wizard.  Can't reproduce when running the fix for bug
> 436358.

That's a bit unclear: I've found a different way to reliably reproduce an NPE that occurs for a similar reason.  It's not the same execution path.
Comment 8 Paul Webster CLA 2014-06-13 10:26:53 EDT
Laurent, we think we've fixed this in RC4.  Could you please re-test?

PW
Comment 9 Laurent Goubet CLA 2014-06-16 02:46:43 EDT
(In reply to Paul Webster from comment #8)
> Laurent, we think we've fixed this in RC4.  Could you please re-test?

I have, and couldn't reproduce this. It was already a very rare occurence before the fix, though. Anyway, even using Brian's method from comment c6 didn't allow me to reproduce the issue with RC4.
Comment 10 Lars Vogel CLA 2014-08-13 18:33:14 EDT
(In reply to Laurent Goubet from comment #9)
> (In reply to Paul Webster from comment #8)
> > Laurent, we think we've fixed this in RC4.  Could you please re-test?
> 
> I have, and couldn't reproduce this. It was already a very rare occurence
> before the fix, though. Anyway, even using Brian's method from comment c6
> didn't allow me to reproduce the issue with RC4.

Thanks Laurent for validating. 

Marking as WORKFORME, even though this was actually FIXED, I don't have a commit to point to and in this case I prefer the other status.