Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 345204 - NPE compiling toplevel forms
Summary: NPE compiling toplevel forms
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-09 16:56 EDT by Justin Spadea CLA
Modified: 2017-02-23 14:15 EST (History)
1 user (show)

See Also:


Attachments
Checks for a null container (1.16 KB, patch)
2011-05-09 16:58 EDT, Justin Spadea CLA
lasher: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Justin Spadea CLA 2011-05-09 16:56:12 EDT
When compiling a Form that's not nested in a FormGroup an NPE is thrown.

java.lang.NullPointerException
	at org.eclipse.edt.mof.egl.impl.FormImpl.getMofSerializationKey(FormImpl.java:77)
	at org.eclipse.edt.mof.egl.egl2mof.Egl2MofPart.handleVisitPart(Egl2MofPart.java:374)
	at org.eclipse.edt.mof.egl.egl2mof.Egl2MofPart.defaultHandleVisitPart(Egl2MofPart.java:330)
	at org.eclipse.edt.mof.egl.egl2mof.Egl2MofPart.visit(Egl2MofPart.java:257)
	at org.eclipse.edt.mof.egl.egl2mof.Egl2Mof.visit(Egl2Mof.java:1)
	at org.eclipse.edt.compiler.core.ast.TopLevelForm.accept(TopLevelForm.java:51)
Comment 1 Justin Spadea CLA 2011-05-09 16:58:07 EDT
Created attachment 195148 [details]
Checks for a null container

Not sure if the patch I attached is all that's needed to fix this.
Comment 2 Paul Harmon CLA 2011-05-20 15:04:41 EDT
I made a small change to your patch. Here is the change that I made to FormImpl:

	public String getMofSerializationKey() {
		if (getContainer() == null) {
			return super.getMofSerializationKey();
		}
		else {
			return getContainer().getMofSerializationKey() + Type.NestedPartDelimiter + getName();
		}
	}
Comment 3 Justin Spadea CLA 2011-05-23 10:37:29 EDT
Verified in CVS 5/23