Program: 65810
Project: 65810
Buggy source:
/** 
 * INTERNAL:
 */
public void postInitialize(){
  String idPropName=(String)get(SDOConstants.ID_PROPERTY);
  if (idPropName != null) {
    SDOProperty idProp=getProperty(idPropName);
    if (idProp != null) {
      String targetxpath=idProp.getQualifiedXPath(getURI(),true);
      getXmlDescriptor().addPrimaryKeyFieldName(targetxpath);
    }
  }
  setFinalized(true);
  for (int i=0; i < getNonFinalizedReferencingProps().size(); i++) {
    SDOProperty nextProp=(SDOProperty)getNonFinalizedReferencingProps().get(i);
    String nextURI=(String)getNonFinalizedMappingURIs().get(i);
    nextProp.buildMapping(nextURI,nextProp.getIndexInType());
  }
  if (!isDataType() && !isSubType() && getSubTypes().size() == 0) {
    String sdoPrefix=((SDOTypeHelper)aHelperContext.getTypeHelper()).getPrefix(SDOConstants.SDO_URL);
    XMLDirectMapping sdoRefMapping=new XMLDirectMapping();
    sdoRefMapping.setAttributeName(SDO_REF_MAPPING_ATTRIBUTE_NAME);
    XMLField xmlField=new XMLField("String_Node_Str" + sdoPrefix + SDOConstants.SDO_XPATH_NS_SEPARATOR_FRAGMENT+ SDOConstants.CHANGESUMMARY_REF);
    xmlField.getXPathFragment().setNamespaceURI(SDOConstants.SDO_URL);
    xmlField.getLastXPathFragment().setNamespaceURI(SDOConstants.SDO_URL);
    sdoRefMapping.setField(xmlField);
    xmlDescriptor.addMapping(sdoRefMapping);
  }
  if (!isDataType()) {
    getImplClass();
    if (!isAbstract() && !isWrapperType()) {
      TypeInstantiationPolicy tip=new TypeInstantiationPolicy(this);
      this.xmlDescriptor.setInstantiationPolicy(tip);
    }
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
public void postInitialize(){
  String idPropName=(String)get(SDOConstants.ID_PROPERTY);
  if (idPropName != null) {
    SDOProperty idProp=getProperty(idPropName);
    if (idProp != null) {
      String targetxpath=idProp.getQualifiedXPath(getURI(),true);
      getXmlDescriptor().addPrimaryKeyFieldName(targetxpath);
    }
  }
  setFinalized(true);
  if (null != nonFinalizedReferencingProps) {
    for (int i=0; i < nonFinalizedReferencingProps.size(); i++) {
      SDOProperty nextProp=nonFinalizedReferencingProps.get(i);
      String nextURI=(String)getNonFinalizedMappingURIs().get(i);
      nextProp.buildMapping(nextURI,nextProp.getIndexInType());
    }
    nonFinalizedReferencingProps=null;
    nonFinalizedMappingURIs=null;
  }
  if (!isDataType() && !isSubType() && !isBaseType()) {
    String sdoPrefix=((SDOTypeHelper)aHelperContext.getTypeHelper()).getPrefix(SDOConstants.SDO_URL);
    XMLDirectMapping sdoRefMapping=new XMLDirectMapping();
    sdoRefMapping.setAttributeName(SDO_REF_MAPPING_ATTRIBUTE_NAME);
    XMLField xmlField=new XMLField("String_Node_Str" + sdoPrefix + SDOConstants.SDO_XPATH_NS_SEPARATOR_FRAGMENT+ SDOConstants.CHANGESUMMARY_REF);
    xmlField.getXPathFragment().setNamespaceURI(SDOConstants.SDO_URL);
    xmlField.getLastXPathFragment().setNamespaceURI(SDOConstants.SDO_URL);
    sdoRefMapping.setField(xmlField);
    xmlDescriptor.addMapping(sdoRefMapping);
  }
  if (!isDataType()) {
    getImplClass();
    if (!isAbstract() && !isWrapperType()) {
      TypeInstantiationPolicy tip=new TypeInstantiationPolicy(this);
      this.xmlDescriptor.setInstantiationPolicy(tip);
    }
  }
}