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

Bug 345204

Summary: NPE compiling toplevel forms
Product: z_Archived Reporter: Justin Spadea <jspadea>
Component: EDTAssignee: Project Inbox <edt.mofmodel-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: pharmon
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Checks for a null container lasher: iplog+

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