Bug 295

Summary: Null Pointer Exception entering Body Text (1GFL5O3)
Product: [Eclipse Project] PDE Reporter: Tod Creasey <Tod_Creasey>
Component: UIAssignee: Dejan Glozic <dejan>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 2.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Tod Creasey CLA 2001-10-10 21:39:41 EDT
When you Apply Body Text from the Extensions page you get a null pointer exception

STEPS
	1) Create an Extension
	2) Enter something into the Body Text
	3) Hit Apply

java.lang.NullPointerException
	at org.eclipse.pde.internal.editor.manifest.DetailChildrenSection.handleApply(DetailChildrenSection.java:235)
	at org.eclipse.pde.internal.editor.manifest.DetailChildrenSection.access$5(DetailChildrenSection.java:233)
	at org.eclipse.pde.internal.editor.manifest.DetailChildrenSection$3.widgetSelected(DetailChildrenSection.java:147)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java(Compiled Code))
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code))
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code))
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java(Compiled Code))
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java(Compiled Code))
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java(Compiled Code))
	at org.eclipse.ui.internal.Workbench.run(Workbench.java:622)
	at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:815)
	at org.eclipse.core.boot.BootLoader.run(BootLoader.java:285)
	at java.lang.reflect.Method.invoke(Native Method)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:119)
	at org.eclipse.core.launcher.Main.run(Main.java:401)
	at org.eclipse.core.launcher.Main.main(Main.java:274)



NOTES:
Comment 1 DJ Houghton CLA 2001-10-24 07:08:02 EDT
PRODUCT VERSION: 125


Comment 2 Dejan Glozic CLA 2001-12-02 14:04:47 EST
This can happen if an extension is selected. Body text can only be applied to
extension elements, not to the 'extension' itself. Because of this, the current
element field is set to null. An attempt to 'apply' text to null element
results in null pointer exception. 

The fix is to make text area read-only when selected element is not of the right
type and/or is null. When text cannot be entered, 'Apply' button cannot be
enabled, thus avoiding the null pointer problem.