Bug 165183 - A review is required for an xml.xam API change
A review is required for an xml.xam API change
Status: RESOLVED WONTFIX
Product: xml
Classification: Unclassified
Component: XAM
6.x
All All
: P2 (vote)
: 6.x
Assigned To: apireviews
issues@xml
: API_REVIEW_FAST
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-05-14 15:34 UTC by Nikita Krjukov
Modified: 2010-03-23 10:05 UTC (History)
3 users (show)

See Also:
Issue Type: ENHANCEMENT
:


Attachments
The diff with the main changes is going to be applied (10.25 KB, text/plain)
2009-05-14 16:41 UTC, Nikita Krjukov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nikita Krjukov 2009-05-14 15:34:44 UTC
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.
Comment 1 Nikita Krjukov 2009-05-14 16:41:33 UTC
Created attachment 82140 [details]
The diff with the main changes is going to be applied
Comment 2 Nikita Krjukov 2009-05-14 16:46:36 UTC
The suggested change violates backward compatibility. But it looks inevitable. 
Please look the issue #162769 for additional descriptions. 
Comment 3 Milos Kleint 2009-05-15 07:53:37 UTC
I suppose you will fix every instance in the main + main/contrib repositories? maven.model also using xam for maven's
xml models.
Comment 4 Nikita Krjukov 2009-05-15 11:51:41 UTC
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?
Comment 5 Antonin Nebuzelsky 2009-05-15 11:55:46 UTC
> 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.
Comment 6 Nikita Krjukov 2009-05-15 17:03:19 UTC
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
Comment 7 Nikita Krjukov 2010-03-23 10:05:24 UTC
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.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo