Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 317803 - [CommonNavigator] NPE in WorkingSetsContentProvider
Summary: [CommonNavigator] NPE in WorkingSetsContentProvider
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.7 M1   Edit
Assignee: Boris Bokowski CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 315839
Blocks:
  Show dependency tree
 
Reported: 2010-06-24 07:01 EDT by Boris Bokowski CLA
Modified: 2010-06-24 17:05 EDT (History)
10 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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!