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

Bug 317803

Summary: [CommonNavigator] NPE in WorkingSetsContentProvider
Product: [Eclipse Project] Platform Reporter: Boris Bokowski <bokowski>
Component: UIAssignee: Boris Bokowski <bokowski>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: bokowski, daniel_megert, dluu, dmisic, francisu, john.arthorne, mbarkhou, Mike_Wilson, pwebster, remy.suen
Version: 3.6   
Target Milestone: 3.7 M1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 315839    
Bug Blocks:    

Description Boris Bokowski CLA 2010-06-24 07:01:03 EDT
+++ This bug was initially created as a clone of Bug #315839 +++

Build Identifier: 36I20100521-windows-sdk

Please note that this is the eclipse 3.6 regression bug.

While creating a special file type via the File > New > Other ..., the method updateRootMode() in org.eclipse.ui.internal.navigator.workingsets. WorkingSetsContentProvider class is invoked.

In the eclipse version 3.4, it works properly. Here is the implementation.
Also see the attached debug session eclipse34_workingSetContentProvider.jpg

private void updateRootMode() {
  if( extensionStateModel.getBooleanProperty(SHOW_TOP_LEVEL_WORKING_SETS) )
    rootMode = WORKING_SETS;
  else 
    rootMode = PROJECTS;
}

But in the eclipse version 3.6, the WorkingSetsContentProvider has a new additional class member called projectExplorer. This variable is not initialized properly and it is null when the method updateRootMode() is called. Thus, eclipse throws Null pointer exception and causes our creation dialog failed to function properly.

Here is the implementation in eclipse 3.6 for the method updateRootMode() in the WorkingSetsContentProvider class.
Also see the attached debug session eclipse36_workingSetContentProvider.jpg

private void updateRootMode() {
  if( extensionStateModel.getBooleanProperty(SHOW_TOP_LEVEL_WORKING_SETS) )
    projectExplorer.setRootMode(ProjectExplorer.WORKING_SETS);
  else
    projectExplorer.setRootMode(ProjectExplorer.PROJECTS);
}



Reproducible: Always

Steps to Reproduce:
Plese see debug session images
eclipse36_workingSetContentProvider.jpg
eclipse34_workingSetContentProvider.jpg
Comment 1 Boris Bokowski CLA 2010-06-24 07:16:32 EDT
Released the fix from bug 315839 to HEAD.
Comment 2 Francis Upton IV CLA 2010-06-24 17:05:41 EDT
thanks dood!