Program: 68374
Project: 68374
Buggy source:
private SDOType processSimpleComponentAnnotations(SDOType owningType,SimpleComponent simpleComponent,SDOProperty p,String targetNamespace,String defaultNamespace,SDOType sdoPropertyType){
  String aliasNamesValue=(String)simpleComponent.getAttributesMap().get(SDOConstants.SDOXML_ALIASNAME_QNAME);
  if (aliasNamesValue != null) {
    XMLConversionManager xmlConversionManager=((SDOXMLHelper)aHelperContext.getXMLHelper()).getXmlConversionManager();
    java.util.List names=(java.util.List)xmlConversionManager.convertObject(aliasNamesValue,java.util.List.class);
    p.setAliasNames(names);
  }
  String readOnlyValue=(String)simpleComponent.getAttributesMap().get(SDOConstants.SDOXML_READONLY_QNAME);
  if (readOnlyValue != null) {
    Boolean readOnlyBoolean=new Boolean(readOnlyValue);
    p.setReadOnly(readOnlyBoolean.booleanValue());
  }
  String dataTypeValue=(String)simpleComponent.getAttributesMap().get(SDOConstants.SDOXML_DATATYPE_QNAME);
  if (dataTypeValue != null) {
    QName xsdQName=((SDOTypeHelper)aHelperContext.getTypeHelper()).getXSDTypeFromSDOType(sdoPropertyType);
    if ((xsdQName == null) && !sdoPropertyType.isDataType()) {
      xsdQName=new QName(sdoPropertyType.getURI(),sdoPropertyType.getName());
    }
    p.setXsdType(xsdQName);
    SDOType sdoType=getSDOTypeForName(targetNamespace,defaultNamespace,dataTypeValue);
    sdoPropertyType=sdoType;
    Property xmlDataTypeProperty=aHelperContext.getTypeHelper().getOpenContentProperty(SDOConstants.ORACLE_SDO_URL,SDOConstants.SDOXML_DATATYPE);
    p.setInstanceProperty(xmlDataTypeProperty,sdoType);
  }
  String stringValue=(String)simpleComponent.getAttributesMap().get(SDOConstants.SDOXML_STRING_QNAME);
  if (stringValue != null) {
    QName xsdTypeQName=getQNameForString(defaultNamespace,simpleComponent.getType());
    p.setXsdType(xsdTypeQName);
    sdoPropertyType=SDOConstants.SDO_STRING;
  }
  String nameValue=(String)simpleComponent.getAttributesMap().get(SDOConstants.SDOXML_NAME_QNAME);
  if (nameValue != null) {
    p.setName(nameValue);
    if (p.isGlobal() && targetNamespace != null) {
      QName propertyName=new QName(targetNamespace,nameValue);
      ((SDOTypeHelper)aHelperContext.getTypeHelper()).getOpenContentProperties().put(propertyName,p);
    }
  }
 else {
    if (p.isGlobal() && targetNamespace != null) {
      QName propertyName=new QName(targetNamespace,p.getName());
      ((SDOTypeHelper)aHelperContext.getTypeHelper()).getOpenContentProperties().put(propertyName,p);
    }
  }
  String propertyTypeValue=(String)simpleComponent.getAttributesMap().get(SDOConstants.SDOXML_PROPERTYTYPE_QNAME);
  if (propertyTypeValue != null) {
    String uri=targetNamespace;
    int colonIndex=propertyTypeValue.indexOf(':');
    if (colonIndex > -1) {
      String prefix=propertyTypeValue.substring(0,colonIndex);
      uri=getURIForPrefix(prefix);
    }
    NonContainmentReference nonContainmentReference=new NonContainmentReference();
    nonContainmentReference.setPropertyTypeName(propertyTypeValue);
    nonContainmentReference.setPropertyTypeURI(uri);
    nonContainmentReference.setOwningType(owningType);
    nonContainmentReference.setOwningProp(p);
    String oppositePropValue=(String)simpleComponent.getAttributesMap().get(SDOConstants.SDOXML_OPPOSITEPROPERTY_QNAME);
    nonContainmentReference.setOppositePropName(oppositePropValue);
    getNonContainmentReferences().add(nonContainmentReference);
  }
  return sdoPropertyType;
}

Fixed version (ground truth):
private SDOType processSimpleComponentAnnotations(SDOType owningType,SimpleComponent simpleComponent,SDOProperty p,String targetNamespace,String defaultNamespace,SDOType sdoPropertyType){
  String aliasNamesValue=(String)simpleComponent.getAttributesMap().get(SDOConstants.SDOXML_ALIASNAME_QNAME);
  if (aliasNamesValue != null) {
    XMLConversionManager xmlConversionManager=((SDOXMLHelper)aHelperContext.getXMLHelper()).getXmlConversionManager();
    java.util.List names=(java.util.List)xmlConversionManager.convertObject(aliasNamesValue,java.util.List.class);
    p.setAliasNames(names);
  }
  String readOnlyValue=(String)simpleComponent.getAttributesMap().get(SDOConstants.SDOXML_READONLY_QNAME);
  if (readOnlyValue != null) {
    Boolean readOnlyBoolean=new Boolean(readOnlyValue);
    p.setReadOnly(readOnlyBoolean.booleanValue());
  }
  String dataTypeValue=(String)simpleComponent.getAttributesMap().get(SDOConstants.SDOXML_DATATYPE_QNAME);
  if (dataTypeValue != null) {
    QName xsdQName=((SDOTypeHelper)aHelperContext.getTypeHelper()).getXSDTypeFromSDOType(sdoPropertyType);
    if ((xsdQName == null) && !sdoPropertyType.isDataType()) {
      xsdQName=new QName(sdoPropertyType.getURI(),sdoPropertyType.getName());
    }
    p.setXsdType(xsdQName);
    SDOType sdoType=getSDOTypeForName(targetNamespace,defaultNamespace,dataTypeValue);
    sdoPropertyType=sdoType;
    Property xmlDataTypeProperty=aHelperContext.getTypeHelper().getOpenContentProperty(SDOConstants.SDOXML_URL,SDOConstants.SDOXML_DATATYPE);
    p.setInstanceProperty(xmlDataTypeProperty,sdoType);
  }
  String stringValue=(String)simpleComponent.getAttributesMap().get(SDOConstants.SDOXML_STRING_QNAME);
  if (stringValue != null) {
    QName xsdTypeQName=getQNameForString(defaultNamespace,simpleComponent.getType());
    p.setXsdType(xsdTypeQName);
    sdoPropertyType=SDOConstants.SDO_STRING;
  }
  String nameValue=(String)simpleComponent.getAttributesMap().get(SDOConstants.SDOXML_NAME_QNAME);
  if (nameValue != null) {
    p.setName(nameValue);
    if (p.isGlobal() && targetNamespace != null) {
      QName propertyName=new QName(targetNamespace,nameValue);
      ((SDOTypeHelper)aHelperContext.getTypeHelper()).getOpenContentProperties().put(propertyName,p);
    }
  }
 else {
    if (p.isGlobal() && targetNamespace != null) {
      QName propertyName=new QName(targetNamespace,p.getName());
      ((SDOTypeHelper)aHelperContext.getTypeHelper()).getOpenContentProperties().put(propertyName,p);
    }
  }
  String propertyTypeValue=(String)simpleComponent.getAttributesMap().get(SDOConstants.SDOXML_PROPERTYTYPE_QNAME);
  if (propertyTypeValue != null) {
    String uri=targetNamespace;
    int colonIndex=propertyTypeValue.indexOf(':');
    if (colonIndex > -1) {
      String prefix=propertyTypeValue.substring(0,colonIndex);
      uri=getURIForPrefix(prefix);
    }
    NonContainmentReference nonContainmentReference=new NonContainmentReference();
    nonContainmentReference.setPropertyTypeName(propertyTypeValue);
    nonContainmentReference.setPropertyTypeURI(uri);
    nonContainmentReference.setOwningType(owningType);
    nonContainmentReference.setOwningProp(p);
    String oppositePropValue=(String)simpleComponent.getAttributesMap().get(SDOConstants.SDOXML_OPPOSITEPROPERTY_QNAME);
    nonContainmentReference.setOppositePropName(oppositePropValue);
    getNonContainmentReferences().add(nonContainmentReference);
  }
  return sdoPropertyType;
}