Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 339136 - Empty tag boolean elements are inputted incorrectly
Summary: Empty tag boolean elements are inputted incorrectly
Status: RESOLVED FIXED
Alias: None
Product: WTP Common Tools
Classification: WebTools
Component: wst.common (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.5   Edit
Assignee: Nitin Dahyabhai CLA
QA Contact: Carl Anderson CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-07 14:20 EST by Karen Butzke CLA
Modified: 2014-07-09 12:36 EDT (History)
4 users (show)

See Also:
ccc: review+
thatnitind: review? (paul.fullbright)


Attachments
test patch (1.50 KB, patch)
2011-08-29 17:50 EDT, Nitin Dahyabhai CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Karen Butzke CLA 2011-03-07 14:20:53 EST
In WTP 3.2 empty tags were inputted into the orm.xml, when editing via the JPA Details, like this:
<xml-mapping-metadata-complete />

In WTP 3.3, current code the empty tags are inputted like this:
<xml-mapping-metadata-complete ></xml-mapping-metadata-complete>

This still works, but is more information than necessary. I have not figured out when this changed in the translator framework.
Comment 1 Neil Hauge CLA 2011-07-01 16:26:03 EDT
Moving JPA specific bugs to new JPA component in bugzilla.
Comment 2 Neil Hauge CLA 2011-08-23 17:54:01 EDT
Nitin...any ideas on this?
Comment 3 Nitin Dahyabhai CLA 2011-08-24 06:34:05 EDT
Which set of APIs is used to add them?
Comment 4 Karen Butzke CLA 2011-08-24 07:07:57 EDT
We create a Translator with the style EMPTY_TAG | BOOLEAN_FEATURE
Comment 5 Nitin Dahyabhai CLA 2011-08-26 11:06:41 EDT
EMF2DOMAdapterImpl is adding a zero-length Text node as a child of the xml-mapping-metadata-complete element.

Thread [main] (Suspended)	
	XMLGeneratorImpl.generateCloseTag(Node) line: 241	
	XMLModelUpdater.replaceChild(Node, Node, Node) line: 1416	
	DOMModelImpl.childReplaced(Node, Node, Node) line: 192	
	ElementImpl(NodeContainer).notifyChildReplaced(Node, Node) line: 361	
	ElementImpl(NodeContainer).insertBefore(Node, Node) line: 302	
	ElementImpl.insertBefore(Node, Node) line: 761	
	ElementImpl(NodeContainer).appendChild(Node) line: 129	
	EMF2DOMSSEAdapter(EMF2DOMAdapterImpl).findOrCreateTextNode(Node, Translator, String) line: 1296	<---- Node is empty xml-mapping-metadata-complete element, String is null.
	EMF2DOMSSEAdapter(EMF2DOMAdapterImpl).updateDOMSubtree(Translator, Node, EObject, Object) line: 1699	
	EMF2DOMSSEAdapter(EMF2DOMAdapterImpl).primUpdateDOMFeature(Translator, Node, EObject) line: 1387	
	EMF2DOMSSEAdapter(EMF2DOMAdapterImpl).updateDOMFeature(Translator, Node, EObject) line: 1621	
	EMF2DOMSSEAdapter(EMF2DOMAdapterImpl).notifyChanged(Notification) line: 1099	
	XmlPersistenceUnitMetadata(BasicNotifierImpl).eNotify(Notification) line: 380	
	XmlPersistenceUnitMetadata(AbstractJpaEObject).eNotify(Notification) line: 94	
	XmlPersistenceUnitMetadata.setXmlMappingMetadataComplete(boolean) line: 189	
	GenericOrmPersistenceUnitMetadata(AbstractOrmPersistenceUnitMetadata).setXmlMappingMetadataComplete(boolean) line: 108	
	PersistenceUnitMetadataComposite$6.setValue_(Boolean) line: 217	
	PersistenceUnitMetadataComposite$6.setValue_(Object) line: 1	
	PersistenceUnitMetadataComposite$6(AspectPropertyValueModelAdapter<S,V>).setValue(V) line: 92	
	BooleanButtonModelBinding.buttonSelected() line: 170	
	BooleanButtonModelBinding$2.widgetSelected(SelectionEvent) line: 119	
	TypedListener.handleEvent(Event) line: 240	
	EventTable.sendEvent(Event) line: 84	
	Button(Widget).sendEvent(Event) line: 1053	
	Display.runDeferredEvents() line: 4165	
	Display.readAndDispatch() line: 3754	
	PartRenderingEngine$9.run() line: 969	
	Realm.runWithDefault(Realm, Runnable) line: 332	
	PartRenderingEngine.run(MApplicationElement, IEclipseContext) line: 885	
	E4Workbench.createAndRunUI(MApplicationElement) line: 90	
	Workbench$3.run() line: 539	
	Realm.runWithDefault(Realm, Runnable) line: 332	
	Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 519	
	PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 149	
	IDEApplication.start(IApplicationContext) line: 123	
	EclipseAppHandle.run(Object) line: 196	
	EclipseAppLauncher.runApplication(Object) line: 110	
	EclipseAppLauncher.start(Object) line: 79	
	EclipseStarter.run(Object) line: 344	
	EclipseStarter.run(String[], Runnable) line: 179	
	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39	
	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
	Method.invoke(Object, Object...) line: 597	
	Main.invokeFramework(String[], URL[]) line: 622	
	Main.basicRun(String[]) line: 577	
	Main.run(String[]) line: 1410	
	Main.main(String[]) line: 1386
Comment 6 Neil Hauge CLA 2011-08-29 16:49:26 EDT
This appears to be a generic problem with EMF2DOMAdapterImpl.  Assigning to WTP Common.
Comment 7 Nitin Dahyabhai CLA 2011-08-29 17:50:17 EDT
Created attachment 202363 [details]
test patch
Comment 8 Carl Anderson CLA 2011-08-29 21:59:07 EDT
Paul, does Nitin's change still fix the scenario you needed fixed for bug 190876 ?
Comment 9 Carl Anderson CLA 2011-09-07 22:43:38 EDT
I am fine with this change.
Comment 10 Paul Fullbright CLA 2011-09-09 15:19:04 EDT
Sorry, just had a chance to look at this after being out of town.

The long-story-short is:  I don't think this change affects our situation regarding the other bug.  We still don't have a great story there, but I don't think the before and after behaviors are different.
Comment 11 Carl Anderson CLA 2011-09-15 14:13:31 EDT
Moving this out to 3.3.2
Comment 12 Nitin Dahyabhai CLA 2012-08-15 22:52:06 EDT
(In reply to comment #10)
> Sorry, just had a chance to look at this after being out of town.
> 
> The long-story-short is:  I don't think this change affects our situation
> regarding the other bug.  We still don't have a great story there, but I
> don't think the before and after behaviors are different.

With the other bug now fixed, is this bug and patch still of interest?  Karen?  Paul?
Comment 13 Karen Butzke CLA 2012-08-16 08:01:32 EDT
I'm not sure I understand, the fix for bug 190876 is what caused this bug. So, yes this bug still exists in 3.4.0 and was a change in functionality from 3.2
Comment 14 Carl Anderson CLA 2014-07-09 12:36:09 EDT
Nitin committed the fix for this to WTP 3.5.0.  I am marking this as resolved.  If the fix was not sufficient, please reopen this bug.