Program: 68295
Project: 68295
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()) {
        ((SDOType)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 (!((SDOType)getType()).isFinalized()) {
          ((SDOType)getType()).getNonFinalizedReferencingProps().add(this);
          ((SDOType)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 (!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 (!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 {
            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()) {
        ((SDOType)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 (!((SDOType)getType()).isFinalized()) {
          ((SDOType)getType()).getNonFinalizedReferencingProps().add(this);
          ((SDOType)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 {
            xmlMapping=buildXMLDirectMapping(mappingUri);
          }
        }
      }
    }
    addMappingToOwner(sdoMethodAccessor,indexToAdd);
  }
}