Bug 193851 - Opening Call Hierachy from Script Explorer thows NPE
Summary: Opening Call Hierachy from Script Explorer thows NPE
Status: RESOLVED FIXED
Alias: None
Product: DLTK
Classification: Technology
Component: Common (show other bugs)
Version: 0.95   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Andrei Sobolev CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2007-06-21 20:23 EDT by Mark Howe CLA
Modified: 2008-05-26 02:49 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Howe CLA 2007-06-21 20:23:50 EDT
Steps:
1 Select any class in ScriptExplorer
2. Expand class in SCriptExplore
3. Righ click on a method and select action "Open Call Hierarchy"

Thows NPE in run method.

Simple patch:
public void run(IModelElement[] elements) {
   if (elements.length == 0) {
     getShell().getDisplay().beep();
     return;
  }
  
  //REPLACE this
  //CallHierarchyUI.open(elements, getSite().getWorkbenchWindow(), fEditor.getCallHierarchyID());
  //WITH this
 CallHierarchyUI.open(elements, getSite().getWorkbenchWindow(), getCallHierarchyID());
}
    
//Add method. this view is specifed in subclasses of ScriptExplorer but the
//only place it's used is in this class, so makes sense to put it in here 
//(probably remove from ScriptExplorer as well, since it won't be used there 
//anymore
public String getCallHierarchyID() {
  return "org.eclipse.dltk.callhierarchy.view";
}
Comment 1 Andrei Sobolev CLA 2007-06-21 23:42:22 EDT
fixed
Comment 2 Andrey Platov CLA 2008-05-26 02:49:47 EDT
bulk change: fixed in 0.95