Skip to content
Snippets Groups Projects
Commit 16391f2e authored by Dominique Marcadet's avatar Dominique Marcadet
Browse files

Merge branch '10-avoid-creation-of-eobjecttoidmap-in-xmlhandler' into 'master'

Resolve "Avoid creation of eObjectToIDMap in XMLHandler"

Closes #10

See merge request RiseClipseGroup/RiseClipseMetamodel_Cim!6
parents 014cd63b 9594dea6
No related branches found
No related tags found
1 merge request!6Resolve "Avoid creation of eObjectToIDMap in XMLHandler"
Pipeline #1108 passed
...@@ -65,7 +65,17 @@ public abstract class CimResourceImpl extends XMLResourceImpl implements IRiseCl ...@@ -65,7 +65,17 @@ public abstract class CimResourceImpl extends XMLResourceImpl implements IRiseCl
*/ */
@Override @Override
public void setID( EObject obj, String id ) { public void setID( EObject obj, String id ) {
super.setID( obj, id ); // XMLResourceImpl.setID( EObject obj, String id ) updates both eObjectToIDMap and idToEObjectMap
// We do not need the first, and if it is constructed, we have a problem in finalizeLoad():
// when we do remove( object ), the setID will be called with null, but the lookup of rdf:ID will fail
// because namespaceSupport in XMLHelper is empty (popContext() called at XMLHandler.endDocument) and
// prefix rdf cannot be resolved, so we get an unknown feature error !
// So we do not call the method of the superclass
//super.setID( obj, id );
if( id != null ) {
getIDToEObjectMap().put( id, obj );
}
// CimObjectWithID is unknown here // CimObjectWithID is unknown here
// TODO : put this class in this package ? // TODO : put this class in this package ?
cimXMLHandler.setIDAttribValue( obj, id ); cimXMLHandler.setIDAttribValue( obj, id );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment