Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 358719 - PartNotFoundException thrown from WidgetDescriptorFactory
Summary: PartNotFoundException thrown from WidgetDescriptorFactory
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Huo Zhen Zhong CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-23 09:22 EDT by Brian Svihovec CLA
Modified: 2017-02-23 14:19 EST (History)
2 users (show)

See Also:


Attachments
fix (1.11 KB, patch)
2011-10-10 03:01 EDT, Huo Zhen Zhong CLA
lasher: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Svihovec CLA 2011-09-23 09:22:13 EDT
Using a development environment, or running the installable build with the -console option, open a RUIHandler that contains a Box widget in the VE.

In the console window, you will see the following exception being thrown:

org.eclipse.edt.mof.egl.PartNotFoundException: 
	at org.eclipse.edt.ide.core.internal.lookup.ProjectEnvironment.findPart(ProjectEnvironment.java:218)
	at org.eclipse.edt.ide.rui.visualeditor.internal.widget.WidgetDescriptorFactory.processWidgetContainer(WidgetDescriptorFactory.java:531)
	at org.eclipse.edt.ide.rui.visualeditor.internal.widget.WidgetDescriptorFactory.processWidget(WidgetDescriptorFactory.java:213)
	at org.eclipse.edt.ide.rui.visualeditor.internal.widget.WidgetDescriptorFactory.createWidgetDescriptor(WidgetDescriptorFactory.java:132)
	at org.eclipse.edt.ide.rui.visualeditor.internal.widget.WidgetDescriptorRegistry.createWidgetDescriptor(WidgetDescriptorRegistry.java:256)
	at org.eclipse.edt.ide.rui.visualeditor.internal.widget.WidgetDescriptorRegistry$Updater.initializeRegistry(WidgetDescriptorRegistry.java:110)
	at org.eclipse.edt.ide.rui.visualeditor.internal.widget.WidgetDescriptorRegistry$Updater.run(WidgetDescriptorRegistry.java:83)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

I believe this is related to the way that default annotation values have changed in EDT as compared to RBD.  

In WidgetDescriptorFactory, line 509, there is the following code:

Annotation containerAnnotation = (Annotation) widgetAnnotation.getValue( WIDGET_CONTAINER );
		if(containerAnnotation != null){
			isContainer = true;
			String layoutDataTypeTemplate = (String) containerAnnotation.getValue( WIDGET_LAYOUTDATATYPE );
			if (layoutDataTypeTemplate != null ) {

The Box widget specifies the VEContainer annotation as:

container = @VEContainer{}

which means that we get into the first 'if' block.  The default value for the WIDGET_LAYOUTDATATYPE (e.g. "layoutDataType") field is a String, so layoutDataTypeTemplate becomes the empty string, since no value was specified in the annotation.  It looks like our code will have to change so that it checks for the empty string instead of Null, since the field of the VEContainer annotation is not nullable.

NOTE: I think we need to scrub our code for all annotation accesses and see if there are other changes like this to be made.
Comment 1 Huo Zhen Zhong CLA 2011-10-10 03:01:17 EDT
Created attachment 204855 [details]
fix
Comment 2 Huo Zhen Zhong CLA 2011-10-10 03:01:40 EDT
fixed
Comment 3 Lisa Lasher CLA 2012-04-04 22:30:42 EDT
fixed in 0.7 GA