This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
A new abstract method is necessary to be added to the xml.xam/src/org/netbeans/modules/xml/xam/dom/AbstractDocumentModel.java in order to fix the issue #162769 /** * Removes the root component from the model. * It is intended to be called automatically when a user delete corresponding root component from * xml sources. Avoid calling it without necessity. */ public abstract void removeRootComponent(); The adding of the method breaks backward compatibility. But it is required to fix the mentioned issue.
Created attachment 82140 [details] The diff with the main changes is going to be applied
The suggested change violates backward compatibility. But it looks inevitable. Please look the issue #162769 for additional descriptions.
I suppose you will fix every instance in the main + main/contrib repositories? maven.model also using xam for maven's xml models.
Thank you for mentioning maven model. I'll take care about it. I'll definitely fix all modules dependent from XAM. Although some additional actions can be required because some modules relies on unconditional presence of the root component. For example, it can be necessary to add new checks by the following pattern. Where the following code happens if (model != null && model.getState() == State.VALID) { it usually has to be changed to if (model != null && model.getRootComponent() != null && model.getState() == State.VALID) { I'm going to provide simple implementation of the removeRootComponent() method like you can see in the attached diff. Sometimes it can be necessary to add a write check or fire an event. But it depends on the specific implementation of the model. I hope it is acceptable support, which I'm going to provide?
> Sometimes it can be necessary to add a write check or fire an event. So, my understanding is that you expect people will do these additional fixes in their code after your change in xml.xam. Right? > I hope it is acceptable support, which I'm going to provide? No, not a 1 week before 6.7 code-freeze.
I've applied changes to all related modules locally. But there are too many modules, which depend on XAM. So there is big risk of damaging something. So I decided postpone applying the changes until the new branch for NetBeans 6.7 will appear. Here is the list of modules: -- MAIN -- bpel.model compapp.casaeditor iep.model maven.model web.jsf websvc.axis2 websvc.jaxwsmodel websvc.rest.wadl.model xml.axi xml.schema.model xml.retriever xml.wsdl.model xslt.model xslt.tmap -- MAIN/CONTRIB -- org.sample.registry.model I'm going to waive the issue #162769
We don't have to do the described changes because I managed to fix the issue #162769 another way, which doesn't require API changes.