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

Bug 501274

Summary: NPE after project creation if PHP Explorer isn't available
Product: z_Archived Reporter: Dawid Pakula <zulus>
Component: PDTAssignee: PHP UI <php.ui-inbox>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P3 CC: silviya, thierryblind, wywrzal
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/80969
https://git.eclipse.org/c/pdt/org.eclipse.pdt.git/commit/?id=7c57c36adba9e6361d15ac29c030562c8fa4c882
https://git.eclipse.org/r/82975
https://git.eclipse.org/c/pdt/org.eclipse.pdt.git/commit/?id=6385f8d37aad567ef0937a58d4e89c901c71acbd
Whiteboard:
Bug Depends on:    
Bug Blocks: 478814    

Description Dawid Pakula CLA 2016-09-12 12:32:31 EDT
1. Close PHP Explorer
2. Create PHP Project

Stack:
java.lang.NullPointerException
	at org.eclipse.dltk.internal.ui.navigator.ScriptExplorerContentProvider.executeRunnables(ScriptExplorerContentProvider.java:143)
	at org.eclipse.php.internal.ui.explorer.PHPExplorerContentProvider.refresh(PHPExplorerContentProvider.java:532)
	at org.eclipse.php.internal.core.includepath.IncludePathManager.refresh(IncludePathManager.java:427)
	at org.eclipse.php.internal.core.includepath.IncludePathManager$2.runInWorkspace(IncludePathManager.java:240)
	at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:39)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Comment 1 Thierry BLIND CLA 2016-09-12 13:53:36 EDT
Dawid, I can't reproduce this bug :(
Comment 2 Dawid Pakula CLA 2016-09-12 14:57:14 EDT
OK, more detailed instruction:
1. Create any PHP Project in Project Explorer.
2. Expand it in Project Explorer (I
3. Create second PHP Project.

Problem appear, because PHPExplorerContentProvider haven't view instance.
Comment 3 Eclipse Genie CLA 2016-09-12 18:11:04 EDT
New Gerrit change created: https://git.eclipse.org/r/80969
Comment 4 Thierry BLIND CLA 2016-09-12 18:13:53 EDT
Dawid, for me that's a little bug in DLTK, but to make it in 4.1.0 I propose a workaround, is my patch ok for you ? I'll send a nice patch for DLTK once 4.1.0 is released ;)
Comment 5 Dawid Pakula CLA 2016-09-12 19:26:37 EDT
As a temporary workaround it's ok, but I think it's a PDT bug. PHPNavigatorLabelProvider create internal version of PHPExplorerContentProvider. This instance never receive #inputChanged call and cause mentioned bug. This probably also resource leak.
Comment 7 Thierry BLIND CLA 2016-09-13 06:13:20 EDT
Yes, you're right Dawid, problem lies in PDT :/ Let's see that quietly after the 4.1.0 release ;)
Comment 8 Thierry BLIND CLA 2016-09-15 10:45:19 EDT
Hi Dawid, 
Just a little question : do you plan to work on this one? I had bo deep look into this one, and i have no access to my computer next days, just to know if you're inspired by this bug ;)
Comment 9 Dawid Pakula CLA 2016-09-15 13:34:42 EDT
Not now. I plan focus on bug 150506, bug 475525 and composer in general.
Comment 10 Thierry BLIND CLA 2016-09-15 16:41:07 EDT
Ok, i understand, you will already have enough work with what you're planning to do ;)
Comment 11 Eclipse Genie CLA 2016-10-11 16:57:09 EDT
New Gerrit change created: https://git.eclipse.org/r/82975
Comment 13 Michal Niewrzal CLA 2016-10-11 17:34:17 EDT
Now it should be fixed. Main problem was that PHP Explorer content provider is registering as include path listener and additional instance of this provider is created in PHPNavigatorLabelProvider. My solution is not perfect but should be ok until we will be able to clean up label provider for Project Explorer.
Comment 14 Sylvia Tancheva CLA 2017-05-29 06:25:30 EDT
Don't see any errors, closing