Program: 68734
Project: 68734
Buggy source:
/** 
 * INTERNAL: This function is implemented by SDOType.setOpen() in a mapping setGet/SetMethodName call
 * @param openContentPropertiesWithXMLRoots
 */
public void _setOpenContentPropertiesWithXMLRoots(List openContentPropertiesWithXMLRoots){
  for (int i=0, size=openContentPropertiesWithXMLRoots.size(); i < size; i++) {
    Object next=openContentPropertiesWithXMLRoots.get(i);
    String propertyName=null;
    String propertyUri=null;
    Object value=null;
    Type theType=null;
    if (next instanceof XMLRoot) {
      XMLRoot nextXMLRoot=(XMLRoot)next;
      value=nextXMLRoot.getObject();
      propertyName=nextXMLRoot.getLocalName();
      propertyUri=nextXMLRoot.getNamespaceURI();
      if (value instanceof DataObject) {
        theType=((DataObject)value).getType();
      }
 else {
        theType=aHelperContext.getTypeHelper().getType(value.getClass());
      }
    }
 else     if (next instanceof DataObject) {
      value=next;
      String qualifiedName=((SDOType)((DataObject)next).getType()).getXmlDescriptor().getDefaultRootElement();
      int colonIndex=qualifiedName.indexOf("String_Node_Str");
      if (colonIndex > -1) {
        String prefix=qualifiedName.substring(0,colonIndex);
        if ((prefix != null) && !prefix.equals("String_Node_Str")) {
          propertyUri=((SDOType)((DataObject)next).getType()).getXmlDescriptor().getNonNullNamespaceResolver().resolveNamespacePrefix(prefix);
        }
        propertyName=qualifiedName.substring(colonIndex + 1,qualifiedName.length());
      }
 else {
        propertyName=qualifiedName;
      }
      theType=((DataObject)next).getType();
    }
    if (propertyName != null) {
      SDOProperty prop=(SDOProperty)aHelperContext.getXSDHelper().getGlobalProperty(propertyUri,propertyName,true);
      if (prop == null) {
        DataObject propDo=aHelperContext.getDataFactory().create(SDOConstants.SDO_PROPERTY);
        propDo.set("String_Node_Str",propertyName);
        propDo.set("String_Node_Str",theType);
        propDo.set("String_Node_Str",true);
        prop=(SDOProperty)aHelperContext.getTypeHelper().defineOpenContentProperty(null,propDo);
        prop.setUri(propertyUri);
      }
      if (prop.isMany()) {
        ((ListWrapper)getList(prop)).add(value,false);
      }
 else {
        set(prop,value,false);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: This function is implemented by SDOType.setOpen() in a mapping setGet/SetMethodName call
 * @param openContentPropertiesWithXMLRoots
 */
public void _setOpenContentPropertiesWithXMLRoots(List openContentPropertiesWithXMLRoots){
  for (int i=0, size=openContentPropertiesWithXMLRoots.size(); i < size; i++) {
    Object next=openContentPropertiesWithXMLRoots.get(i);
    String propertyName=null;
    String propertyUri=null;
    Object value=null;
    Type theType=null;
    if (next instanceof XMLRoot) {
      XMLRoot nextXMLRoot=(XMLRoot)next;
      value=nextXMLRoot.getObject();
      propertyName=nextXMLRoot.getLocalName();
      propertyUri=nextXMLRoot.getNamespaceURI();
      if (value instanceof DataObject) {
        theType=((DataObject)value).getType();
      }
 else {
        theType=((SDOTypeHelper)aHelperContext.getTypeHelper()).getTypeForSimpleJavaType(value.getClass());
      }
    }
 else     if (next instanceof DataObject) {
      value=next;
      String qualifiedName=((SDOType)((DataObject)next).getType()).getXmlDescriptor().getDefaultRootElement();
      int colonIndex=qualifiedName.indexOf("String_Node_Str");
      if (colonIndex > -1) {
        String prefix=qualifiedName.substring(0,colonIndex);
        if ((prefix != null) && !prefix.equals("String_Node_Str")) {
          propertyUri=((SDOType)((DataObject)next).getType()).getXmlDescriptor().getNonNullNamespaceResolver().resolveNamespacePrefix(prefix);
        }
        propertyName=qualifiedName.substring(colonIndex + 1,qualifiedName.length());
      }
 else {
        propertyName=qualifiedName;
      }
      theType=((DataObject)next).getType();
    }
 else {
      theType=((SDOTypeHelper)aHelperContext.getTypeHelper()).getTypeForSimpleJavaType(value.getClass());
    }
    if (propertyName != null) {
      SDOProperty prop=(SDOProperty)aHelperContext.getXSDHelper().getGlobalProperty(propertyUri,propertyName,true);
      if (prop == null) {
        prop=(SDOProperty)getInstanceProperty(propertyName);
        if (prop != null) {
          if (prop.getUri() == null && propertyUri != null) {
            prop=createNewProperty(propertyName,propertyUri,theType);
          }
 else {
            if (prop.getUri() != null) {
              if (propertyUri == null) {
                prop=createNewProperty(propertyName,propertyUri,theType);
              }
 else               if (!prop.getUri().equals(propertyUri)) {
                prop=createNewProperty(propertyName,propertyUri,theType);
              }
            }
          }
        }
 else {
          prop=createNewProperty(propertyName,propertyUri,theType);
        }
      }
      if (prop.isMany()) {
        ((ListWrapper)getList(prop)).add(value,false);
      }
 else {
        set(prop,value,false);
      }
    }
  }
}