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

check for null peekObject in CimXMLHandler.handleFeature()

parent e9b8cfcb
No related branches found
No related tags found
1 merge request!9Resolve "CimXMLHandler.handleFeature() must take into account the absence of object"
Pipeline #1097 passed
......@@ -120,32 +120,34 @@ public abstract class CimXMLHandler extends SAXXMLHandler {
@Override
protected void handleFeature( String prefix, String name ) {
EObject peekObject = objects.peekEObject();
EStructuralFeature feature = getFeature( peekObject, prefix, name, true );
// For compound objects
if( nextIsCompound ) {
if( feature != null ) {
// TODO: Something unexpected ???
}
nextIsCompound = false;
objects.push( peekObject );
types.push( OBJECT_TYPE );
mixedTargets.push( null );
return;
}
if( feature instanceof EReference ) {
EReference eReference = ( EReference ) feature;
EReference opposite = eReference.getEOpposite();
if( eReference.isResolveProxies() && eReference.isTransient() &&
! opposite .isResolveProxies() && ! opposite. isTransient()) {
eReference.setResolveProxies( false );
eReference.setTransient( false );
opposite.setResolveProxies( true );
opposite.setTransient( true );
if( peekObject != null ) {
EStructuralFeature feature = getFeature( peekObject, prefix, name, true );
// For compound objects
if( nextIsCompound ) {
if( feature != null ) {
// TODO: Something unexpected ???
}
nextIsCompound = false;
objects.push( peekObject );
types.push( OBJECT_TYPE );
mixedTargets.push( null );
return;
}
if( eReference.isContainment() ) {
nextIsCompound = true;
if( feature instanceof EReference ) {
EReference eReference = ( EReference ) feature;
EReference opposite = eReference.getEOpposite();
if( eReference.isResolveProxies() && eReference.isTransient() &&
! opposite .isResolveProxies() && ! opposite. isTransient()) {
eReference.setResolveProxies( false );
eReference.setTransient( false );
opposite.setResolveProxies( true );
opposite.setTransient( true );
}
if( eReference.isContainment() ) {
nextIsCompound = true;
}
}
}
super.handleFeature( prefix, name );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment