Program: 66247
Project: 66247
Buggy source:
/** 
 * INTERNAL:
 */
public void buildMapping(String mappingUri,int indexToAdd){
  if (getContainingType().isDataType()) {
    return;
  }
  if (getType().isChangeSummaryType()) {
    buildChangeSummaryMapping();
    addMappingToOwner(false,indexToAdd);
  }
 else   if (isNameCollision()) {
    xmlMapping=new XMLAnyCollectionMapping();
    xmlMapping.setAttributeName(getName());
    addMappingToOwner(true,indexToAdd);
  }
 else {
    boolean sdoMethodAccessor=true;
    if (!getType().isDataType()) {
      if (getType().isDataObjectType()) {
        getType().setImplClassName(SDOConstants.SDO_DATA_OBJECT_IMPL_CLASS_NAME);
        if (getXsdType() != null && !getXsdType().equals(SDOConstants.ANY_TYPE_QNAME)) {
          if (isMany()) {
            xmlMapping=buildXMLCompositeCollectionMapping(mappingUri);
          }
 else {
            xmlMapping=buildXMLCompositeObjectMapping(mappingUri);
          }
        }
 else {
          sdoMethodAccessor=false;
          if (isMany()) {
            xmlMapping=buildXMLFragmentCollectionMapping(mappingUri);
          }
 else {
            xmlMapping=buildXMLFragmentMapping(mappingUri);
          }
        }
      }
 else {
        if (!getType().isFinalized()) {
          getType().getNonFinalizedReferencingProps().add(this);
          getType().getNonFinalizedMappingURIs().add(mappingUri);
          return;
        }
        if (isSubstitutable()) {
          if (isMany()) {
            xmlMapping=buildXMLChoiceCollectionMapping(mappingUri);
          }
 else {
            xmlMapping=buildXMLChoiceObjectMapping(mappingUri);
          }
        }
 else         if (isMany()) {
          if (isContainment()) {
            xmlMapping=buildXMLCompositeCollectionMapping(mappingUri);
          }
 else {
            xmlMapping=buildXMLCollectionReferenceMapping(mappingUri);
          }
        }
 else {
          if (isContainment()) {
            xmlMapping=buildXMLCompositeObjectMapping(mappingUri);
          }
 else {
            xmlMapping=buildXMLObjectReferenceMapping(mappingUri);
          }
        }
      }
    }
 else {
      if (isMany()) {
        MimeTypePolicy mimeTypePolicy=getMimeTypePolicy();
        if (isActivationAvailable && (!aHelperContext.getXSDHelper().isAttribute(this) && ((mimeTypePolicy != null) || ((getType().getInstanceClass() != null) && getType().getInstanceClass().getName().equals("String_Node_Str")) || (getXsdType() != null && getXsdType().equals(XMLConstants.BASE_64_BINARY_QNAME))))) {
          xmlMapping=buildXMLBinaryDataCollectionMapping(mappingUri,mimeTypePolicy);
        }
 else {
          if (isSubstitutable()) {
            xmlMapping=buildXMLChoiceCollectionMapping(mappingUri);
          }
 else {
            xmlMapping=buildXMLCompositeDirectCollectionMapping(mappingUri);
          }
        }
      }
 else {
        MimeTypePolicy mimeTypePolicy=getMimeTypePolicy();
        if (isActivationAvailable && (!aHelperContext.getXSDHelper().isAttribute(this) && ((mimeTypePolicy != null) || ((getType().getInstanceClass() != null) && getType().getInstanceClass().getName().equals("String_Node_Str")) || (getXsdType() != null && getXsdType().equals(XMLConstants.BASE_64_BINARY_QNAME))))) {
          xmlMapping=buildXMLBinaryDataMapping(mappingUri,mimeTypePolicy);
        }
 else {
          if (isSubstitutable()) {
            xmlMapping=buildXMLChoiceObjectMapping(mappingUri);
          }
 else {
            if (XMLConstants.QNAME_QNAME.equals(xsdType)) {
              xmlMapping=buildXMLTransformationMapping(mappingUri);
            }
 else {
              xmlMapping=buildXMLDirectMapping(mappingUri);
            }
          }
        }
      }
    }
    addMappingToOwner(sdoMethodAccessor,indexToAdd);
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
public void buildMapping(String mappingUri,int indexToAdd){
  if (getContainingType().isDataType()) {
    return;
  }
  if (getType().isChangeSummaryType()) {
    buildChangeSummaryMapping();
    addMappingToOwner(false,indexToAdd);
  }
 else   if (isNameCollision()) {
    xmlMapping=new XMLAnyCollectionMapping();
    xmlMapping.setAttributeName(getName());
    addMappingToOwner(true,indexToAdd);
  }
 else {
    boolean sdoMethodAccessor=true;
    if (!getType().isDataType()) {
      if (getType().isDataObjectType()) {
        getType().setImplClassName(SDOConstants.SDO_DATA_OBJECT_IMPL_CLASS_NAME);
        if (getXsdType() != null && !getXsdType().equals(SDOConstants.ANY_TYPE_QNAME)) {
          if (isMany()) {
            xmlMapping=buildXMLCompositeCollectionMapping(mappingUri);
          }
 else {
            xmlMapping=buildXMLCompositeObjectMapping(mappingUri);
          }
        }
 else {
          sdoMethodAccessor=false;
          if (isMany()) {
            xmlMapping=buildXMLFragmentCollectionMapping(mappingUri);
          }
 else {
            xmlMapping=buildXMLFragmentMapping(mappingUri);
          }
        }
      }
 else {
        if (!getType().isFinalized()) {
          getType().getNonFinalizedReferencingProps().add(this);
          getType().getNonFinalizedMappingURIs().add(mappingUri);
          return;
        }
        if (isSubstitutable()) {
          if (isMany()) {
            xmlMapping=buildXMLChoiceCollectionMapping(mappingUri);
          }
 else {
            xmlMapping=buildXMLChoiceObjectMapping(mappingUri);
          }
        }
 else         if (isMany()) {
          if (isContainment()) {
            xmlMapping=buildXMLCompositeCollectionMapping(mappingUri);
          }
 else {
            xmlMapping=buildXMLCollectionReferenceMapping(mappingUri);
          }
        }
 else {
          if (isContainment()) {
            xmlMapping=buildXMLCompositeObjectMapping(mappingUri);
          }
 else {
            xmlMapping=buildXMLObjectReferenceMapping(mappingUri);
          }
        }
      }
    }
 else {
      if (isMany()) {
        MimeTypePolicy mimeTypePolicy=getMimeTypePolicy();
        if (isActivationAvailable && (!aHelperContext.getXSDHelper().isAttribute(this) && ((mimeTypePolicy != null) || ((getType().getInstanceClass() != null) && getType().getInstanceClass().getName().equals("String_Node_Str")) || (getXsdType() != null && getXsdType().equals(XMLConstants.BASE_64_BINARY_QNAME))))) {
          xmlMapping=buildXMLBinaryDataCollectionMapping(mappingUri,mimeTypePolicy);
        }
 else {
          if (!isActivationAvailable && ((getType().getInstanceClass() != null) && getType().getInstanceClass().getName().equals("String_Node_Str"))) {
            throw SDOException.unableToMapDataHandlerDueToMissingDependency(this.propertyName,this.getContainingType().getQName().toString());
          }
          if (isSubstitutable()) {
            xmlMapping=buildXMLChoiceCollectionMapping(mappingUri);
          }
 else {
            xmlMapping=buildXMLCompositeDirectCollectionMapping(mappingUri);
          }
        }
      }
 else {
        MimeTypePolicy mimeTypePolicy=getMimeTypePolicy();
        if (isActivationAvailable && (!aHelperContext.getXSDHelper().isAttribute(this) && ((mimeTypePolicy != null) || ((getType().getInstanceClass() != null) && getType().getInstanceClass().getName().equals("String_Node_Str")) || (getXsdType() != null && getXsdType().equals(XMLConstants.BASE_64_BINARY_QNAME))))) {
          xmlMapping=buildXMLBinaryDataMapping(mappingUri,mimeTypePolicy);
        }
 else {
          if (!isActivationAvailable && ((getType().getInstanceClass() != null) && getType().getInstanceClass().getName().equals("String_Node_Str"))) {
            throw SDOException.unableToMapDataHandlerDueToMissingDependency(this.propertyName,this.getContainingType().getQName().toString());
          }
          if (isSubstitutable()) {
            xmlMapping=buildXMLChoiceObjectMapping(mappingUri);
          }
 else {
            if (XMLConstants.QNAME_QNAME.equals(xsdType)) {
              xmlMapping=buildXMLTransformationMapping(mappingUri);
            }
 else {
              xmlMapping=buildXMLDirectMapping(mappingUri);
            }
          }
        }
      }
    }
    addMappingToOwner(sdoMethodAccessor,indexToAdd);
  }
}