nus-yam/ex-repair huggingface dataset:
Program: 68112
Project: 68112
Buggy source:
private DatabaseMapping buildXMLCompositeDirectCollectionMapping(String mappingUri){
  XMLCompositeDirectCollectionMapping mapping=new XMLCompositeDirectCollectionMapping();
  mapping.setAttributeName(getName());
  String xpath=getQualifiedXPath(mappingUri,true);
  mapping.setXPath(xpath);
  mapping.setAttributeElementClass(getType().getInstanceClass());
  if (getXsdType() != null) {
    ((XMLField)mapping.getField()).setSchemaType(getXsdType());
  }
 else {
  }
  if (getType().getInstanceClass() != null) {
    if (shouldAddInstanceClassConverter()) {
      InstanceClassConverter converter=new InstanceClassConverter();
      converter.setCustomClass(getType().getInstanceClass());
      mapping.setValueConverter(converter);
    }
  }
  return mapping;
}

Fixed version (ground truth):
private DatabaseMapping buildXMLCompositeDirectCollectionMapping(String mappingUri){
  XMLCompositeDirectCollectionMapping mapping=new XMLCompositeDirectCollectionMapping();
  mapping.setAttributeName(getName());
  String xpath=getQualifiedXPath(mappingUri,true);
  mapping.setXPath(xpath);
  mapping.setAttributeElementClass(getType().getInstanceClass());
  if (getXsdType() != null) {
    ((XMLField)mapping.getField()).setSchemaType(getXsdType());
  }
 else {
  }
  if (getType().equals(SDOConstants.SDO_STRINGS)) {
    mapping.setUsesSingleNode(true);
  }
  if (getType().getInstanceClass() != null) {
    if (shouldAddInstanceClassConverter()) {
      InstanceClassConverter converter=new InstanceClassConverter();
      converter.setCustomClass(getType().getInstanceClass());
      mapping.setValueConverter(converter);
    }
  }
  return mapping;
}
Program: 68113
Project: 68113
Buggy source:
private void updateOwnerAndBuildMapping(SDOType owningType,SDOProperty p,String defaultNamespace,String targetNamespace,SimpleComponent simpleComponent,String typeName,String mappingUri){
  boolean buildMapping=true;
  Property lookedUp=owningType.getProperty(p.getName());
  if (lookedUp != null) {
    p=(SDOProperty)lookedUp;
    if (inRestriction) {
      return;
    }
    updateCollisionProperty(owningType,p);
  }
 else {
    owningType.addDeclaredProperty(p);
  }
  QName xsdType=getQNameForString(defaultNamespace,typeName);
  if ((xsdType != null) && xsdType.getNamespaceURI().equals(XMLConstants.SCHEMA_URL)) {
    if (xsdType.getLocalPart().equals(SDOConstants.ID)) {
      owningType.setInstanceProperty(SDOConstants.ID_PROPERTY,p.getName());
    }
 else     if (xsdType.getLocalPart().equals(SDOConstants.IDREF)) {
      p.setContainment(false);
      String propertyTypeValue=(String)simpleComponent.getAttributesMap().get(SDOConstants.SDOXML_PROPERTYTYPE_QNAME);
      if (propertyTypeValue != null) {
        buildMapping=false;
      }
    }
 else     if (xsdType.getLocalPart().equals(SDOConstants.IDREFS)) {
      p.setContainment(false);
      p.setMany(true);
      String propertyTypeValue=(String)simpleComponent.getAttributesMap().get(SDOConstants.SDOXML_PROPERTYTYPE_QNAME);
      if (propertyTypeValue != null) {
        buildMapping=false;
      }
    }
  }
  if (buildMapping) {
    p.buildMapping(mappingUri);
  }
}

Fixed version (ground truth):
private void updateOwnerAndBuildMapping(SDOType owningType,SDOProperty p,String defaultNamespace,String targetNamespace,SimpleComponent simpleComponent,String typeName,String mappingUri){
  boolean buildMapping=true;
  Property lookedUp=owningType.getProperty(p.getName());
  if (lookedUp != null) {
    p=(SDOProperty)lookedUp;
    if (inRestriction) {
      return;
    }
    updateCollisionProperty(owningType,p);
  }
 else {
    owningType.addDeclaredProperty(p);
  }
  QName xsdType=getQNameForString(defaultNamespace,typeName);
  if ((xsdType != null) && xsdType.getNamespaceURI().equals(XMLConstants.SCHEMA_URL)) {
    if (xsdType.getLocalPart().equals(SDOConstants.ID)) {
      owningType.setInstanceProperty(SDOConstants.ID_PROPERTY,p.getName());
    }
 else     if (xsdType.getLocalPart().equals(SDOConstants.IDREF)) {
      p.setContainment(false);
      String propertyTypeValue=(String)simpleComponent.getAttributesMap().get(SDOConstants.SDOXML_PROPERTYTYPE_QNAME);
      if (propertyTypeValue != null) {
        buildMapping=false;
      }
    }
 else     if (xsdType.getLocalPart().equals(SDOConstants.IDREFS)) {
      p.setContainment(false);
      String propertyTypeValue=(String)simpleComponent.getAttributesMap().get(SDOConstants.SDOXML_PROPERTYTYPE_QNAME);
      if (propertyTypeValue != null) {
        buildMapping=false;
        p.setMany(true);
      }
 else {
        p.setMany(false);
      }
    }
  }
  if (buildMapping) {
    p.buildMapping(mappingUri);
  }
}
Program: 68114
Project: 68114
Buggy source:
public void setUp(){
  xmlComparer=new SDOXMLComparer();
  if (customContext) {
    aHelperContext=new SDOHelperContext();
  }
 else {
    aHelperContext=HelperProvider.getDefaultContext();
  }
  typeHelper=aHelperContext.getTypeHelper();
  xmlHelper=aHelperContext.getXMLHelper();
  xsdHelper=aHelperContext.getXSDHelper();
  equalityHelper=aHelperContext.getEqualityHelper();
  copyHelper=aHelperContext.getCopyHelper();
  dataFactory=aHelperContext.getDataFactory();
  dataHelper=(SDODataHelper)aHelperContext.getDataHelper();
  DocumentBuilderFactory builderFactory=DocumentBuilderFactory.newInstance();
  builderFactory.setNamespaceAware(true);
  builderFactory.setIgnoringElementContentWhitespace(true);
  try {
    parser=builderFactory.newDocumentBuilder();
  }
 catch (  Exception e) {
    fail("String_Node_Str");
    e.printStackTrace();
  }
  ((SDOTypeHelper)aHelperContext.getTypeHelper()).reset();
  ((SDOXMLHelper)aHelperContext.getXMLHelper()).reset();
  ((SDOXSDHelper)aHelperContext.getXSDHelper()).reset();
}

Fixed version (ground truth):
public void setUp(){
  xmlComparer=new SDOXMLComparer();
  if (customContext) {
    aHelperContext=new SDOHelperContext();
  }
 else {
    aHelperContext=HelperProvider.getDefaultContext();
  }
  typeHelper=aHelperContext.getTypeHelper();
  xmlHelper=aHelperContext.getXMLHelper();
  xsdHelper=aHelperContext.getXSDHelper();
  equalityHelper=aHelperContext.getEqualityHelper();
  copyHelper=aHelperContext.getCopyHelper();
  dataFactory=aHelperContext.getDataFactory();
  dataHelper=(SDODataHelper)aHelperContext.getDataHelper();
  DocumentBuilderFactory builderFactory=DocumentBuilderFactory.newInstance();
  builderFactory.setNamespaceAware(true);
  builderFactory.setIgnoringElementContentWhitespace(true);
  try {
    parser=builderFactory.newDocumentBuilder();
  }
 catch (  Exception e) {
    fail("String_Node_Str");
    e.printStackTrace();
  }
  if (customContext) {
    ((SDOHelperContext)aHelperContext).reset();
  }
 else {
    SDOHelperContext.resetHelperContext();
  }
}
Program: 68115
Project: 68115
Buggy source:
public void tearDown() throws Exception {
  ((SDOTypeHelper)aHelperContext.getTypeHelper()).reset();
  ((SDOXMLHelper)aHelperContext.getXMLHelper()).reset();
  ((SDOXSDHelper)aHelperContext.getXSDHelper()).reset();
  typeHelper=null;
  xmlHelper=null;
  xsdHelper=null;
  equalityHelper=null;
  copyHelper=null;
  dataFactory=null;
  parser=null;
  aHelperContext=null;
}

Fixed version (ground truth):
public void tearDown() throws Exception {
  if (customContext) {
    ((SDOHelperContext)aHelperContext).reset();
  }
 else {
    SDOHelperContext.resetHelperContext();
  }
  typeHelper=null;
  xmlHelper=null;
  xsdHelper=null;
  equalityHelper=null;
  copyHelper=null;
  dataFactory=null;
  parser=null;
  aHelperContext=null;
}
Program: 68116
Project: 68116
Buggy source:
public void reset(){
  ((SDOXMLHelper)getXMLHelper()).reset();
  ((SDOTypeHelper)getTypeHelper()).reset();
  ((SDOXSDHelper)getXSDHelper()).reset();
}

Fixed version (ground truth):
public void reset(){
  ((SDOTypeHelper)getTypeHelper()).reset();
  ((SDOXMLHelper)getXMLHelper()).reset();
  ((SDOXSDHelper)getXSDHelper()).reset();
}
Program: 68117
Project: 68117
Buggy source:
/** 
 * Creates the <code>PropertyValueModel</code> responsible to handle the External Connection Pooling property.
 * @return A new <code>PropertyValueModel</code>
 */
private PropertyValueModel buildExternalConnectionPoolingHolder(){
  PropertyValueModel subjectHolder=new PropertyAspectAdapter(getSubjectHolder(),"String_Node_Str"){
    protected Object getValueFromSubject(){
      LoginAdapter login=(LoginAdapter)subject;
      return login.getParent();
    }
  }
;
  return new PropertyAspectAdapter(subjectHolder,DatabaseSessionAdapter.EXTERNAL_CONNECTION_POOLING_PROPERTY){
    protected Object getValueFromSubject(){
      DatabaseSessionAdapter session=(DatabaseSessionAdapter)subject;
      return Boolean.valueOf(session.usesExternalConnectionPooling());
    }
    protected void setValueOnSubject(    Object value){
      DatabaseSessionAdapter session=(DatabaseSessionAdapter)subject;
      boolean removeConnectionPool=false;
      if ((Boolean)value && session.isServer()) {
        ServerSessionAdapter serverSession=(ServerSessionAdapter)session;
        if (serverSession.hasAnyConnectionPool()) {
          removeConnectionPool=promptUserToDeleteConnectionPools();
        }
      }
      session.setExternalConnectionPooling(Boolean.TRUE.equals(value));
      if (removeConnectionPool) {
        ServerSessionAdapter serverSession=(ServerSessionAdapter)session;
        serverSession.removeAllConnectionPools();
      }
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Creates the <code>PropertyValueModel</code> responsible to handle the External Connection Pooling property.
 * @return A new <code>PropertyValueModel</code>
 */
private PropertyValueModel buildExternalConnectionPoolingHolder(){
  PropertyValueModel subjectHolder=new PropertyAspectAdapter(getSubjectHolder(),"String_Node_Str"){
    protected Object getValueFromSubject(){
      LoginAdapter login=(LoginAdapter)subject;
      return login.getParent();
    }
  }
;
  return new PropertyAspectAdapter(subjectHolder,DatabaseSessionAdapter.EXTERNAL_CONNECTION_POOLING_PROPERTY){
    protected Object getValueFromSubject(){
      DatabaseSessionAdapter session=(DatabaseSessionAdapter)subject;
      return Boolean.valueOf(session.usesExternalConnectionPooling());
    }
    protected void setValueOnSubject(    Object value){
      DatabaseSessionAdapter session=(DatabaseSessionAdapter)subject;
      boolean removeConnectionPool=false;
      if ((Boolean)value && session.isServer()) {
        ServerSessionAdapter serverSession=(ServerSessionAdapter)session;
        if (serverSession.hasAnyConnectionPool()) {
          removeConnectionPool=promptUserToDeleteConnectionPools();
          if (removeConnectionPool) {
            serverSession.removeAllConnectionPools();
            session.setExternalConnectionPooling(true);
          }
 else {
            session.setExternalConnectionPooling(true);
            session.setExternalConnectionPooling(false);
          }
        }
      }
 else {
        session.setExternalConnectionPooling(((Boolean)value).booleanValue());
      }
    }
  }
;
}
Program: 68118
Project: 68118
Buggy source:
protected void setValueOnSubject(Object value){
  DatabaseSessionAdapter session=(DatabaseSessionAdapter)subject;
  boolean removeConnectionPool=false;
  if ((Boolean)value && session.isServer()) {
    ServerSessionAdapter serverSession=(ServerSessionAdapter)session;
    if (serverSession.hasAnyConnectionPool()) {
      removeConnectionPool=promptUserToDeleteConnectionPools();
    }
  }
  session.setExternalConnectionPooling(Boolean.TRUE.equals(value));
  if (removeConnectionPool) {
    ServerSessionAdapter serverSession=(ServerSessionAdapter)session;
    serverSession.removeAllConnectionPools();
  }
}

Fixed version (ground truth):
protected void setValueOnSubject(Object value){
  DatabaseSessionAdapter session=(DatabaseSessionAdapter)subject;
  boolean removeConnectionPool=false;
  if ((Boolean)value && session.isServer()) {
    ServerSessionAdapter serverSession=(ServerSessionAdapter)session;
    if (serverSession.hasAnyConnectionPool()) {
      removeConnectionPool=promptUserToDeleteConnectionPools();
      if (removeConnectionPool) {
        serverSession.removeAllConnectionPools();
        session.setExternalConnectionPooling(true);
      }
 else {
        session.setExternalConnectionPooling(true);
        session.setExternalConnectionPooling(false);
      }
    }
  }
 else {
    session.setExternalConnectionPooling(((Boolean)value).booleanValue());
  }
}
Program: 68119
Project: 68119
Buggy source:
protected void execute(ApplicationNode selectedNode){
  ServerSessionAdapter session=(ServerSessionAdapter)selectedNode.getValue();
  navigatorSelectionModel().pushExpansionState();
  ConnectionPoolAdapter newPool=session.addReadConnectionPool();
  navigatorSelectionModel().popAndRestoreExpansionState();
  ((AbstractApplicationNode)selectedNode.getProjectRoot()).selectDescendantNodeForValue(newPool,navigatorSelectionModel());
}

Fixed version (ground truth):
protected void execute(ApplicationNode selectedNode){
  ServerSessionAdapter session=(ServerSessionAdapter)selectedNode.getValue();
  if (session.usesExternalConnectionPooling()) {
    promptUserToTurnOffExternalConnectionPooling();
  }
 else {
    navigatorSelectionModel().pushExpansionState();
    ConnectionPoolAdapter newPool=session.addReadConnectionPool();
    navigatorSelectionModel().popAndRestoreExpansionState();
    ((AbstractApplicationNode)selectedNode.getProjectRoot()).selectDescendantNodeForValue(newPool,navigatorSelectionModel());
  }
}
Program: 68120
Project: 68120
Buggy source:
protected void execute(ApplicationNode selectedNode){
  ServerSessionAdapter session=(ServerSessionAdapter)selectedNode.getValue();
  navigatorSelectionModel().pushExpansionState();
  ConnectionPoolAdapter newPool=session.addSequenceConnectionPool();
  navigatorSelectionModel().popAndRestoreExpansionState();
  ((AbstractApplicationNode)selectedNode.getProjectRoot()).selectDescendantNodeForValue(newPool,navigatorSelectionModel());
}

Fixed version (ground truth):
protected void execute(ApplicationNode selectedNode){
  ServerSessionAdapter session=(ServerSessionAdapter)selectedNode.getValue();
  if (session.usesExternalConnectionPooling()) {
    promptUserToTurnOffExternalConnectionPooling();
  }
 else {
    navigatorSelectionModel().pushExpansionState();
    ConnectionPoolAdapter newPool=session.addSequenceConnectionPool();
    navigatorSelectionModel().popAndRestoreExpansionState();
    ((AbstractApplicationNode)selectedNode.getProjectRoot()).selectDescendantNodeForValue(newPool,navigatorSelectionModel());
  }
}
Program: 68121
Project: 68121
Buggy source:
protected void execute(ApplicationNode selectedNode){
  ServerSessionAdapter session=(ServerSessionAdapter)selectedNode.getValue();
  navigatorSelectionModel().pushExpansionState();
  ConnectionPoolAdapter newPool=session.addWriteConnectionPool();
  navigatorSelectionModel().popAndRestoreExpansionState();
  ((AbstractApplicationNode)selectedNode.getProjectRoot()).selectDescendantNodeForValue(newPool,navigatorSelectionModel());
}

Fixed version (ground truth):
protected void execute(ApplicationNode selectedNode){
  ServerSessionAdapter session=(ServerSessionAdapter)selectedNode.getValue();
  if (session.usesExternalConnectionPooling()) {
    promptUserToTurnOffExternalConnectionPooling();
  }
 else {
    navigatorSelectionModel().pushExpansionState();
    ConnectionPoolAdapter newPool=session.addWriteConnectionPool();
    navigatorSelectionModel().popAndRestoreExpansionState();
    ((AbstractApplicationNode)selectedNode.getProjectRoot()).selectDescendantNodeForValue(newPool,navigatorSelectionModel());
  }
}
Program: 68122
Project: 68122
Buggy source:
protected void execute(){
  if (!this.confirmTableCreation()) {
    return;
  }
  try {
    this.checkDevelopmentLoginSpec("String_Node_Str");
  }
 catch (  IllegalStateException ex) {
    return;
  }
  Collection tables=this.buildTables();
  try {
    this.database().generateTables(tables);
  }
 catch (  EclipseLinkException exception) {
    ExceptionDialog dialog=new ExceptionDialog(resourceRepository().getString("String_Node_Str"),exception,this.getWorkbenchContext(),resourceRepository().getString("String_Node_Str"));
    dialog.show();
    return;
  }
  JOptionPane.showMessageDialog(this.getWorkbenchContext().getCurrentWindow(),this.resourceRepository().getString("String_Node_Str",new Object[]{NumberFormat.getInstance().format(tables.size())}),this.resourceRepository().getString("String_Node_Str"),JOptionPane.INFORMATION_MESSAGE);
}

Fixed version (ground truth):
protected void execute(){
  if (!this.confirmTableCreation()) {
    return;
  }
  try {
    this.checkDevelopmentLoginSpec("String_Node_Str");
  }
 catch (  IllegalStateException ex) {
    return;
  }
  Collection tables=this.buildTables();
  try {
    this.database().generateTables(tables);
  }
 catch (  EclipseLinkException exception) {
    if (exception instanceof DatabaseException && ((DatabaseException)exception).getDatabaseErrorCode() == 955) {
      JOptionPane.showMessageDialog(this.getWorkbenchContext().getCurrentWindow(),resourceRepository().getString("String_Node_Str",StringTools.CR),resourceRepository().getString("String_Node_Str"),JOptionPane.WARNING_MESSAGE);
    }
 else     if (exception instanceof DatabaseException && ((DatabaseException)exception).getDatabaseErrorCode() == 2270) {
      JOptionPane.showMessageDialog(this.getWorkbenchContext().getCurrentWindow(),resourceRepository().getString("String_Node_Str",StringTools.CR),resourceRepository().getString("String_Node_Str"),JOptionPane.ERROR_MESSAGE);
    }
 else {
      ExceptionDialog dialog=new ExceptionDialog(resourceRepository().getString("String_Node_Str"),exception,this.getWorkbenchContext(),resourceRepository().getString("String_Node_Str"));
      dialog.show();
    }
    return;
  }
  JOptionPane.showMessageDialog(this.getWorkbenchContext().getCurrentWindow(),this.resourceRepository().getString("String_Node_Str",new Object[]{NumberFormat.getInstance().format(tables.size())}),this.resourceRepository().getString("String_Node_Str"),JOptionPane.INFORMATION_MESSAGE);
}
Program: 68123
Project: 68123
Buggy source:
private PropertyValueModel buildPreallocationSizeHolder(){
  return new PropertyAspectAdapter(getSubjectHolder(),SequenceAdapter.PREALLOCATION_SIZE_PROPERTY){
    @Override protected Object getValueFromSubject(){
      return Integer.valueOf(((SequenceAdapter)subject).getPreallocationSize());
    }
    @Override protected void setValueOnSubject(    Object value){
      ((SequenceAdapter)subject).setPreallocationSize(((Integer)value).intValue());
    }
  }
;
}

Fixed version (ground truth):
private PropertyValueModel buildPreallocationSizeHolder(){
  return new PropertyAspectAdapter(getSubjectHolder(),SequenceAdapter.PREALLOCATION_SIZE_PROPERTY){
    @Override protected Object getValueFromSubject(){
      return Integer.valueOf(((SequenceAdapter)subject).getPreallocationSize());
    }
    @Override protected void setValueOnSubject(    Object value){
      if (value == null) {
        ((SequenceAdapter)subject).setPreallocationSize(0);
      }
 else {
        ((SequenceAdapter)subject).setPreallocationSize(((Integer)value).intValue());
      }
    }
  }
;
}
Program: 68124
Project: 68124
Buggy source:
@Override protected void setValueOnSubject(Object value){
  ((SequenceAdapter)subject).setPreallocationSize(((Integer)value).intValue());
}

Fixed version (ground truth):
@Override protected void setValueOnSubject(Object value){
  if (value == null) {
    ((SequenceAdapter)subject).setPreallocationSize(0);
  }
 else {
    ((SequenceAdapter)subject).setPreallocationSize(((Integer)value).intValue());
  }
}
Program: 68125
Project: 68125
Buggy source:
/** 
 * INTERNAL:
 */
public void openStartElement(XPathFragment xPathFragment,NamespaceResolver namespaceResolver){
  this.addPositionalNodes(xPathFragment,namespaceResolver);
  try {
    if (isStartElementOpen) {
      getWriter().write('>');
    }
    if (!isLastEventText) {
      getWriter().write(Helper.cr());
      for (int x=0; x < numberOfTabs; x++) {
        getWriter().write(TAB);
      }
    }
    isStartElementOpen=true;
    getWriter().write('<');
    getWriter().write(xPathFragment.getShortName());
    numberOfTabs++;
    isLastEventText=false;
  }
 catch (  IOException e) {
    throw XMLMarshalException.marshalException(e);
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
public void openStartElement(XPathFragment xPathFragment,NamespaceResolver namespaceResolver){
  this.addPositionalNodes(xPathFragment,namespaceResolver);
  try {
    if (isStartElementOpen) {
      getWriter().write('>');
    }
    if (!isLastEventText) {
      if (numberOfTabs > 0) {
        getWriter().write(Helper.cr());
      }
      for (int x=0; x < numberOfTabs; x++) {
        getWriter().write(TAB);
      }
    }
    isStartElementOpen=true;
    getWriter().write('<');
    getWriter().write(xPathFragment.getShortName());
    numberOfTabs++;
    isLastEventText=false;
  }
 catch (  IOException e) {
    throw XMLMarshalException.marshalException(e);
  }
}
Program: 68126
Project: 68126
Buggy source:
/** 
 * INTERNAL: Saves the DataObject as an XML document with the specified root element. Same as save(createDocument(dataObject, rootElementURI, rootElementName), writer, null);
 * @param dataObject specifies DataObject to be saved
 * @param rootElementURI the Target Namespace URI of the root XML element
 * @param rootElementName the Name of the root XML element
 * @param writer specifies the Writer to write to.
 * @throws IOException for stream exceptions.
 * @throws IllegalArgumentException if the dataObject treeis not closed or has no container.
 */
private void save(DataObject rootObject,String rootElementURI,String rootElementName,Writer writer) throws XMLMarshalException {
  SDOXMLDocument xmlDocument=(SDOXMLDocument)createDocument(rootObject,rootElementURI,rootElementName);
  XMLMarshaller anXMLMarshaller=getXmlMarshaller();
  ((SDOMarshalListener)anXMLMarshaller.getMarshalListener()).setMarshalledObject(rootObject);
  anXMLMarshaller.marshal(xmlDocument,writer);
}

Fixed version (ground truth):
/** 
 * INTERNAL: Saves the DataObject as an XML document with the specified root element. Same as save(createDocument(dataObject, rootElementURI, rootElementName), writer, null);
 * @param dataObject specifies DataObject to be saved
 * @param rootElementURI the Target Namespace URI of the root XML element
 * @param rootElementName the Name of the root XML element
 * @param writer specifies the Writer to write to.
 * @throws IOException for stream exceptions.
 * @throws IllegalArgumentException if the dataObject treeis not closed or has no container.
 */
private void save(DataObject rootObject,String rootElementURI,String rootElementName,Writer writer) throws XMLMarshalException {
  SDOXMLDocument xmlDocument=(SDOXMLDocument)createDocument(rootObject,rootElementURI,rootElementName);
  XMLMarshaller anXMLMarshaller=getXmlMarshaller();
  anXMLMarshaller.setFragment(!xmlDocument.isXMLDeclaration());
  ((SDOMarshalListener)anXMLMarshaller.getMarshalListener()).setMarshalledObject(rootObject);
  anXMLMarshaller.marshal(xmlDocument,writer);
}
Program: 68127
Project: 68127
Buggy source:
/** 
 * INTERNAL:  Return the helper context for a given key.  The key will either be a ClassLoader or a String (representing an application name). A new context will be created and put in the map if none exists  for the given key.
 * @param key Either a class loader or string (application name)
 */
public static HelperContext getHelperContext(Object key){
  HelperContext hCtx=helperContexts.get(key);
  if (hCtx == null) {
    hCtx=new SDOHelperContext();
    helperContexts.put(key,hCtx);
  }
  return hCtx;
}

Fixed version (ground truth):
/** 
 * INTERNAL:  Return the helper context for a given key.  The key will either be a ClassLoader or a String (representing an application name). A new context will be created and put in the map if none exists  for the given key.
 */
public static HelperContext getHelperContext(){
  Object key=getDelegateMapKey();
  HelperContext hCtx=helperContexts.get(key);
  if (hCtx == null) {
    hCtx=new SDOHelperContext();
    helperContexts.put(key,hCtx);
  }
  return hCtx;
}
Program: 68128
Project: 68128
Buggy source:
private SDODataFactoryDelegate getSDODataFactoryDelegate(){
  HelperContext hCtx=SDOHelperContext.getHelperContext(getDelegateMapKey());
  return (SDODataFactoryDelegate)hCtx.getDataFactory();
}

Fixed version (ground truth):
private SDODataFactoryDelegate getSDODataFactoryDelegate(){
  return (SDODataFactoryDelegate)SDOHelperContext.getHelperContext().getDataFactory();
}
Program: 68129
Project: 68129
Buggy source:
private SDOTypeHelperDelegate getSDOTypeHelperDelegate(){
  HelperContext hCtx=SDOHelperContext.getHelperContext(getDelegateMapKey());
  return (SDOTypeHelperDelegate)hCtx.getTypeHelper();
}

Fixed version (ground truth):
private SDOTypeHelperDelegate getSDOTypeHelperDelegate(){
  return (SDOTypeHelperDelegate)SDOHelperContext.getHelperContext().getTypeHelper();
}
Program: 68130
Project: 68130
Buggy source:
/** 
 * INTERNAL:
 */
private SDOXMLHelperDelegate getSDOXMLHelperDelegate(){
  HelperContext hCtx=SDOHelperContext.getHelperContext(getDelegateMapKey());
  return (SDOXMLHelperDelegate)hCtx.getXMLHelper();
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
private SDOXMLHelperDelegate getSDOXMLHelperDelegate(){
  return (SDOXMLHelperDelegate)SDOHelperContext.getHelperContext().getXMLHelper();
}
Program: 68131
Project: 68131
Buggy source:
/** 
 * INTERNAL:
 */
private SDOXSDHelperDelegate getSDOXSDHelperDelegate(){
  HelperContext hCtx=SDOHelperContext.getHelperContext(getDelegateMapKey());
  return (SDOXSDHelperDelegate)hCtx.getXSDHelper();
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
private SDOXSDHelperDelegate getSDOXSDHelperDelegate(){
  return (SDOXSDHelperDelegate)SDOHelperContext.getHelperContext().getXSDHelper();
}
Program: 68133
Project: 68133
Buggy source:
private void processBaseType(String targetNamespace,String defaultNamespace,SDOType owningType,String qualifiedName,boolean simpleContentExtension){
  if (qualifiedName == null) {
    return;
  }
  SDOType baseType=getSDOTypeForName(targetNamespace,defaultNamespace,qualifiedName);
  if (simpleContentExtension && baseType.isDataType()) {
    if (owningType != null) {
      SDOProperty prop=new SDOProperty(aHelperContext);
      prop.setName("String_Node_Str");
      prop.setType(baseType);
      prop.setValueProperty(true);
      prop.setInstanceProperty(SDOConstants.XMLELEMENT_PROPERTY,Boolean.TRUE);
      ((SDOType)owningType).addDeclaredProperty(prop);
      prop.buildMapping(null,-1);
      prop.setFinalized(true);
    }
    return;
  }
  java.util.List<Type> baseTypes=new ArrayList<Type>();
  baseTypes.add(baseType);
  if (owningType != null) {
    if (owningType.isDataType()) {
      owningType.setInstanceClassName(baseType.getInstanceClassName());
      if (baseType.getInstanceClass() != null) {
        owningType.setInstanceClass(baseType.getInstanceClass());
      }
      QName baseQName=getQNameForString(defaultNamespace,qualifiedName);
      if ((baseQName.equals(XMLConstants.BASE_64_BINARY_QNAME)) || (baseQName.equals(XMLConstants.HEX_BINARY_QNAME)) || (baseQName.equals(XMLConstants.DATE_QNAME))|| (baseQName.equals(XMLConstants.TIME_QNAME))|| (baseQName.equals(XMLConstants.DATE_TIME_QNAME))) {
        owningType.setXsdType(baseQName);
      }
    }
    if (!owningType.getBaseTypes().contains(baseType)) {
      owningType.addBaseType(baseType);
    }
  }
}

Fixed version (ground truth):
private void processBaseType(SDOType baseType,String targetNamespace,String defaultNamespace,SDOType owningType,String qualifiedName,boolean simpleContentExtension){
  if (simpleContentExtension && baseType.isDataType()) {
    if (owningType != null) {
      SDOProperty prop=new SDOProperty(aHelperContext);
      prop.setName("String_Node_Str");
      prop.setType(baseType);
      prop.setValueProperty(true);
      prop.setInstanceProperty(SDOConstants.XMLELEMENT_PROPERTY,Boolean.TRUE);
      ((SDOType)owningType).addDeclaredProperty(prop);
      prop.buildMapping(null,-1);
      prop.setFinalized(true);
    }
    return;
  }
  java.util.List<Type> baseTypes=new ArrayList<Type>();
  baseTypes.add(baseType);
  if (owningType != null) {
    if (owningType.isDataType()) {
      owningType.setInstanceClassName(baseType.getInstanceClassName());
      if (baseType.getInstanceClass() != null) {
        owningType.setInstanceClass(baseType.getInstanceClass());
      }
      QName baseQName=getQNameForString(defaultNamespace,qualifiedName);
      if ((baseQName.equals(XMLConstants.BASE_64_BINARY_QNAME)) || (baseQName.equals(XMLConstants.HEX_BINARY_QNAME)) || (baseQName.equals(XMLConstants.DATE_QNAME))|| (baseQName.equals(XMLConstants.TIME_QNAME))|| (baseQName.equals(XMLConstants.DATE_TIME_QNAME))) {
        owningType.setXsdType(baseQName);
      }
    }
    if (!owningType.getBaseTypes().contains(baseType)) {
      owningType.addBaseType(baseType);
    }
  }
}
Program: 68134
Project: 68134
Buggy source:
private void processExtension(String targetNamespace,String defaultNamespace,SDOType owningType,Extension extension,boolean simpleContent){
  if (extension != null) {
    String qualifiedType=extension.getBaseType();
    processBaseType(targetNamespace,defaultNamespace,owningType,qualifiedType,simpleContent);
    if (extension.getChoice() != null) {
      processChoice(targetNamespace,defaultNamespace,owningType,extension.getChoice(),false);
    }
 else     if (extension.getSequence() != null) {
      processSequence(targetNamespace,defaultNamespace,owningType,extension.getSequence(),false);
    }
 else     if (extension.getAll() != null) {
    }
    processOrderedAttributes(targetNamespace,defaultNamespace,owningType,extension.getOrderedAttributes());
  }
}

Fixed version (ground truth):
private void processExtension(String targetNamespace,String defaultNamespace,SDOType owningType,Extension extension,boolean simpleContent){
  if (extension != null) {
    String qualifiedType=extension.getBaseType();
    if (qualifiedType != null) {
      SDOType baseType=getSDOTypeForName(targetNamespace,defaultNamespace,qualifiedType);
      processBaseType(baseType,targetNamespace,defaultNamespace,owningType,qualifiedType,simpleContent);
    }
    if (extension.getChoice() != null) {
      processChoice(targetNamespace,defaultNamespace,owningType,extension.getChoice(),false);
    }
 else     if (extension.getSequence() != null) {
      processSequence(targetNamespace,defaultNamespace,owningType,extension.getSequence(),false);
    }
 else     if (extension.getAll() != null) {
    }
    processOrderedAttributes(targetNamespace,defaultNamespace,owningType,extension.getOrderedAttributes());
  }
}
Program: 68135
Project: 68135
Buggy source:
private void processRestriction(String targetNamespace,String defaultNamespace,SDOType owningType,Restriction restriction){
  if (restriction != null) {
    String qualifiedType=restriction.getBaseType();
    processBaseType(targetNamespace,defaultNamespace,owningType,qualifiedType,false);
    boolean alreadyIn=inRestriction;
    if (!alreadyIn) {
      inRestriction=true;
    }
    if (restriction.getChoice() != null) {
      processChoice(targetNamespace,defaultNamespace,owningType,restriction.getChoice(),false);
    }
 else     if (restriction.getSequence() != null) {
      processSequence(targetNamespace,defaultNamespace,owningType,restriction.getSequence(),false);
    }
 else     if (restriction.getAll() != null) {
    }
    processAttributes(targetNamespace,defaultNamespace,owningType,restriction.getAttributes());
    if (!alreadyIn) {
      inRestriction=false;
    }
  }
}

Fixed version (ground truth):
private void processRestriction(String targetNamespace,String defaultNamespace,SDOType owningType,Restriction restriction){
  if (restriction != null) {
    String qualifiedType=restriction.getBaseType();
    processBaseType(targetNamespace,defaultNamespace,owningType,qualifiedType,false,restriction);
    boolean alreadyIn=inRestriction;
    if (!alreadyIn) {
      inRestriction=true;
    }
    if (restriction.getChoice() != null) {
      processChoice(targetNamespace,defaultNamespace,owningType,restriction.getChoice(),false);
    }
 else     if (restriction.getSequence() != null) {
      processSequence(targetNamespace,defaultNamespace,owningType,restriction.getSequence(),false);
    }
 else     if (restriction.getAll() != null) {
    }
    processAttributes(targetNamespace,defaultNamespace,owningType,restriction.getAttributes());
    if (!alreadyIn) {
      inRestriction=false;
    }
  }
}
Program: 68136
Project: 68136
Buggy source:
/** 
 * INTERNAL:
 */
private void addMappingToOwner(boolean sdoMethodAttributeAccessor,int indexToAdd){
  if (xmlMapping != null) {
    if (sdoMethodAttributeAccessor) {
      SDOMethodAttributeAccessor accessor=null;
      if (this.getType().isDataType()) {
        Class theClass=getType().getInstanceClass();
        accessor=new SDOMethodAttributeAccessor(this,theClass);
      }
 else {
        accessor=new SDOMethodAttributeAccessor(this);
      }
      xmlMapping.setAttributeAccessor(accessor);
    }
    if ((getContainingType() != null) && !getContainingType().isDataType()) {
      ClassDescriptor containingDescriptor=((SDOType)getContainingType()).getXmlDescriptor();
      xmlMapping.setDescriptor(containingDescriptor);
      XMLMapping mapping=(XMLMapping)((SDOType)getContainingType()).getXmlDescriptor().getMappingForAttributeName(getName());
      if (mapping != null) {
        ((SDOType)getContainingType()).getXmlDescriptor().getMappings().remove(mapping);
      }
      if ((indexToAdd > -1) && (indexToAdd < ((SDOType)getContainingType()).getXmlDescriptor().getMappings().size())) {
        ((SDOType)getContainingType()).getXmlDescriptor().getMappings().add(indexToAdd,xmlMapping);
      }
 else {
        ((SDOType)getContainingType()).getXmlDescriptor().getMappings().add(xmlMapping);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
public void addMappingToOwner(boolean sdoMethodAttributeAccessor,int indexToAdd){
  if (xmlMapping != null) {
    if (sdoMethodAttributeAccessor) {
      SDOMethodAttributeAccessor accessor=null;
      if (this.getType().isDataType()) {
        Class theClass=getType().getInstanceClass();
        accessor=new SDOMethodAttributeAccessor(this,theClass);
      }
 else {
        accessor=new SDOMethodAttributeAccessor(this);
      }
      xmlMapping.setAttributeAccessor(accessor);
    }
    if ((getContainingType() != null) && !getContainingType().isDataType()) {
      ClassDescriptor containingDescriptor=((SDOType)getContainingType()).getXmlDescriptor();
      xmlMapping.setDescriptor(containingDescriptor);
      XMLMapping mapping=(XMLMapping)((SDOType)getContainingType()).getXmlDescriptor().getMappingForAttributeName(getName());
      if (mapping != null) {
        ((SDOType)getContainingType()).getXmlDescriptor().getMappings().remove(mapping);
      }
      if ((indexToAdd > -1) && (indexToAdd < ((SDOType)getContainingType()).getXmlDescriptor().getMappings().size())) {
        ((SDOType)getContainingType()).getXmlDescriptor().getMappings().add(indexToAdd,xmlMapping);
      }
 else {
        ((SDOType)getContainingType()).getXmlDescriptor().getMappings().add(xmlMapping);
      }
    }
  }
}
Program: 68137
Project: 68137
Buggy source:
/** 
 * Return the Type for this interfaceClass or null if not found.
 * @param interfaceClass is the interface for the DataObject's Type -type.getInstanceClass();
 * @return the Type for this interfaceClass or null if not found.
 */
public SDOType getType(Class interfaceClass){
  SDOType type=(SDOType)getInterfacesToSDOTypeHashMap().get(interfaceClass);
  if (type != null) {
    return type;
  }
  type=getTypeForSimpleJavaType(interfaceClass);
  if (type != null) {
    return type;
  }
  Iterator iter=getTypesHashMap().keySet().iterator();
  while (iter.hasNext()) {
    QName key=(QName)iter.next();
    SDOType value=(SDOType)getTypesHashMap().get(key);
    if (value.getInstanceClass() == interfaceClass) {
      return value;
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Return the Type for this interfaceClass or null if not found.
 * @param interfaceClass is the interface for the DataObject's Type -type.getInstanceClass();
 * @return the Type for this interfaceClass or null if not found.
 */
public SDOType getType(Class interfaceClass){
  SDOType type=(SDOType)getInterfacesToSDOTypeHashMap().get(interfaceClass);
  if (type != null) {
    return type;
  }
  type=getTypeForSimpleJavaType(interfaceClass);
  if (type != null) {
    return type;
  }
  Iterator iter=getTypesHashMap().keySet().iterator();
  while (iter.hasNext()) {
    QName key=(QName)iter.next();
    SDOType value=(SDOType)getTypesHashMap().get(key);
    if (value.getInstanceClass() == interfaceClass) {
      return value;
    }
  }
  iter=this.commonjHashMap.keySet().iterator();
  while (iter.hasNext()) {
    Object key=iter.next();
    SDOType value=(SDOType)commonjHashMap.get(key);
    if (value.getInstanceClass() == interfaceClass) {
      return value;
    }
  }
  return null;
}
Program: 68138
Project: 68138
Buggy source:
public Project getTopLinkProject(){
  if (topLinkProject == null) {
    topLinkProject=new Project();
    XMLLogin xmlLogin=new XMLLogin();
    xmlLogin.setEqualNamespaceResolvers(false);
    topLinkProject.setDatasourceLogin(xmlLogin);
    NamespaceResolver nr=new NamespaceResolver();
    SDOTypeHelper sdoTypeHelper=(SDOTypeHelper)aHelperContext.getTypeHelper();
    String sdoPrefix=sdoTypeHelper.getPrefix(SDOConstants.SDO_URL);
    nr.put(sdoPrefix,SDOConstants.SDO_URL);
    SDOType changeSummaryType=(SDOType)sdoTypeHelper.getType(SDOConstants.SDO_URL,SDOConstants.CHANGESUMMARY);
    changeSummaryType.getXmlDescriptor().setNamespaceResolver(nr);
    topLinkProject.addDescriptor(changeSummaryType.getXmlDescriptor());
    SDOType openSequencedType=(SDOType)aHelperContext.getTypeHelper().getType(SDOConstants.ORACLE_SDO_URL,"String_Node_Str");
    topLinkProject.addDescriptor(openSequencedType.getXmlDescriptor());
    ((SDOTypeHelper)aHelperContext.getTypeHelper()).addWrappersToProject(topLinkProject);
  }
  return topLinkProject;
}

Fixed version (ground truth):
public Project getTopLinkProject(){
  if (topLinkProject == null) {
    topLinkProject=new Project();
    XMLLogin xmlLogin=new XMLLogin();
    xmlLogin.setEqualNamespaceResolvers(false);
    topLinkProject.setDatasourceLogin(xmlLogin);
    NamespaceResolver nr=new NamespaceResolver();
    SDOTypeHelper sdoTypeHelper=(SDOTypeHelper)aHelperContext.getTypeHelper();
    String sdoPrefix=sdoTypeHelper.getPrefix(SDOConstants.SDO_URL);
    nr.put(sdoPrefix,SDOConstants.SDO_URL);
    SDOType changeSummaryType=(SDOType)sdoTypeHelper.getType(SDOConstants.SDO_URL,SDOConstants.CHANGESUMMARY);
    changeSummaryType.getXmlDescriptor().setNamespaceResolver(nr);
    topLinkProject.addDescriptor(changeSummaryType.getXmlDescriptor());
    SDOType openSequencedType=(SDOType)aHelperContext.getTypeHelper().getType(SDOConstants.ORACLE_SDO_URL,"String_Node_Str");
    topLinkProject.addDescriptor(openSequencedType.getXmlDescriptor());
    SDOTypeType typeType=(SDOTypeType)aHelperContext.getTypeHelper().getType(SDOConstants.SDO_URL,SDOConstants.TYPE);
    if (!typeType.isInitialized()) {
      typeType.initializeMappings();
    }
    topLinkProject.addDescriptor(typeType.getXmlDescriptor());
    SDOPropertyType propertyType=(SDOPropertyType)aHelperContext.getTypeHelper().getType(SDOConstants.SDO_URL,SDOConstants.PROPERTY);
    if (!propertyType.isInitialized()) {
      propertyType.initializeMappings();
    }
    topLinkProject.addDescriptor(propertyType.getXmlDescriptor());
    ((SDOTypeHelper)aHelperContext.getTypeHelper()).addWrappersToProject(topLinkProject);
  }
  return topLinkProject;
}
Program: 68143
Project: 68143
Buggy source:
public MultipleTableProject(){
  setName("String_Node_Str");
  addDescriptor(buildCowDescriptor());
  addDescriptor(buildHorseDescriptor());
  addDescriptor(buildHumanDescriptor());
  addDescriptor(buildSwanDescriptor());
}

Fixed version (ground truth):
public MultipleTableProject(){
  setName("String_Node_Str");
  addDescriptor(buildCowDescriptor());
  addDescriptor(buildHorseDescriptor());
  addDescriptor(buildHumanDescriptor());
  addDescriptor(buildSwanDescriptor());
  addDescriptor(buildSuperCowDescriptor());
  addDescriptor(buildSuperHorseDescriptor());
  addDescriptor(buildSuperSwanDescriptor());
}
Program: 68145
Project: 68145
Buggy source:
public DataObject createDataObject(Property property,Type aType){
  DataObject created=aHelperContext.getDataFactory().create(aType);
  if (property.isMany()) {
    ((ListWrapper)getList(property)).add(created,false);
  }
 else {
    set(property,created);
  }
  _setModified(true);
  ((SDODataObject)created)._setCreated(true);
  return created;
}

Fixed version (ground truth):
public DataObject createDataObject(Property property,Type aType){
  DataObject created=aHelperContext.getDataFactory().create(aType);
  if (property.isMany()) {
    ((ListWrapper)getList(property)).add(created,true);
  }
 else {
    set(property,created);
  }
  _setModified(true);
  ((SDODataObject)created)._setCreated(true);
  return created;
}
Program: 68146
Project: 68146
Buggy source:
public static ForUpdateClause newInstance(short lockMode){
  if (lockMode == ObjectBuildingQuery.NO_LOCK) {
    return NO_LOCK_CLAUSE;
  }
 else {
    return new ForUpdateClause(lockMode);
  }
}

Fixed version (ground truth):
public static ForUpdateClause newInstance(Integer waitTimeout){
  return new ForUpdateClause(waitTimeout);
}
Program: 68147
Project: 68147
Buggy source:
/** 
 * INTERNAL: Prints the as of clause for an expression inside of the FROM clause.
 */
public void printSQL(ExpressionSQLPrinter printer,SQLSelectStatement statement){
  if (getLockMode() == ObjectBuildingQuery.LOCK) {
    printer.printString(printer.getSession().getPlatform().getSelectForUpdateString());
  }
 else   if (lockMode == ObjectBuildingQuery.LOCK_NOWAIT) {
    printer.printString(printer.getSession().getPlatform().getSelectForUpdateNoWaitString());
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Prints the as of clause for an expression inside of the FROM clause.
 */
public void printSQL(ExpressionSQLPrinter printer,SQLSelectStatement statement){
  if (getLockMode() == ObjectBuildingQuery.LOCK) {
    if (waitTimeout == null) {
      printer.printString(printer.getSession().getPlatform().getSelectForUpdateString());
    }
 else {
      printer.printString(printer.getSession().getPlatform().getSelectForUpdateWaitString(waitTimeout));
    }
  }
 else   if (lockMode == ObjectBuildingQuery.LOCK_NOWAIT) {
    printer.printString(printer.getSession().getPlatform().getSelectForUpdateNoWaitString());
  }
}
Program: 68148
Project: 68148
Buggy source:
public ForUpdateClause(short lockMode){
  this.lockMode=lockMode;
}

Fixed version (ground truth):
public ForUpdateClause(Integer waitTimeout){
  this.lockMode=ObjectBuildingQuery.LOCK;
  this.waitTimeout=waitTimeout;
}
Program: 68149
Project: 68149
Buggy source:
/** 
 * INTERNAL: Create and return a new unit of work with the session as its parent.
 */
public UnitOfWorkImpl(AbstractSession parent,ReferenceMode referenceMode){
  super();
  this.isLoggingOff=parent.isLoggingOff();
  this.referenceMode=referenceMode;
  this.shouldDiscoverNewObjects=true;
  this.name=parent.getName();
  this.parent=parent;
  this.project=parent.getProject();
  this.profiler=parent.getProfiler();
  this.isInProfile=parent.isInProfile;
  this.sessionLog=parent.getSessionLog();
  this.eventManager=parent.getEventManager().clone(this);
  this.exceptionHandler=parent.getExceptionHandler();
  this.setReadOnlyClasses(parent.copyReadOnlyClasses());
  this.validationLevel=Partial;
  this.shouldThrowConformExceptions=DO_NOT_THROW_CONFORM_EXCEPTIONS;
  this.lifecycle=Birth;
  this.shouldCheckWriteLock=parent.getDatasourceLogin().shouldSynchronizedReadOnWrite() || parent.getDatasourceLogin().shouldSynchronizeWrites();
  this.isNestedUnitOfWork=parent.isUnitOfWork();
  this.eventManager.postAcquireUnitOfWork();
  incrementProfile(SessionProfiler.UowCreated);
}

Fixed version (ground truth):
/** 
 * INTERNAL: Create and return a new unit of work with the session as its parent.
 */
public UnitOfWorkImpl(AbstractSession parent,ReferenceMode referenceMode){
  super();
  this.isLoggingOff=parent.isLoggingOff();
  this.referenceMode=referenceMode;
  this.shouldDiscoverNewObjects=true;
  this.name=parent.getName();
  this.parent=parent;
  this.project=parent.getProject();
  this.profiler=parent.getProfiler();
  this.isInProfile=parent.isInProfile;
  this.sessionLog=parent.getSessionLog();
  this.eventManager=parent.getEventManager().clone(this);
  this.exceptionHandler=parent.getExceptionHandler();
  this.pessimisticLockTimeoutDefault=parent.getPessimisticLockTimeoutDefault();
  this.setReadOnlyClasses(parent.copyReadOnlyClasses());
  this.validationLevel=Partial;
  this.shouldThrowConformExceptions=DO_NOT_THROW_CONFORM_EXCEPTIONS;
  this.lifecycle=Birth;
  this.shouldCheckWriteLock=parent.getDatasourceLogin().shouldSynchronizedReadOnWrite() || parent.getDatasourceLogin().shouldSynchronizeWrites();
  this.isNestedUnitOfWork=parent.isUnitOfWork();
  this.eventManager.postAcquireUnitOfWork();
  incrementProfile(SessionProfiler.UowCreated);
}
Program: 68150
Project: 68150
Buggy source:
private DatabaseMapping buildXMLTransformationMapping(String mappingUri){
  XMLTransformationMapping mapping=new XMLTransformationMapping();
  mapping.setAttributeName(getName());
  String xpath=getQualifiedXPath(mappingUri,true);
  QNameTransformer transformer=new QNameTransformer(xpath);
  mapping.setAttributeTransformer(transformer);
  mapping.addFieldTransformer(xpath,transformer);
  return mapping;
}

Fixed version (ground truth):
private DatabaseMapping buildXMLTransformationMapping(String mappingUri){
  XMLTransformationMapping mapping=new XMLTransformationMapping();
  mapping.setAttributeName(getName());
  String xpath=getQualifiedXPath(mappingUri,true);
  String xpathMinusText=xpath.substring(0,xpath.lastIndexOf("String_Node_Str"));
  QNameTransformer transformer=new QNameTransformer(xpath);
  mapping.setAttributeTransformer(transformer);
  mapping.addFieldTransformer(xpath,transformer);
  NamespaceResolver nsr=new NamespaceResolver();
  nsr.put(XMLConstants.XMLNS,XMLConstants.XMLNS_URL);
  XMLField field=new XMLField();
  field.setNamespaceResolver(nsr);
  field.setXPath(xpathMinusText + "String_Node_Str" + XMLConstants.XMLNS+ "String_Node_Str"+ QNameTransformer.QNAME_NAMESPACE_PREFIX);
  mapping.addFieldTransformer(field,new NamespaceURITransformer());
  return mapping;
}
Program: 68151
Project: 68151
Buggy source:
public void testSetPropertyOnNullDataObject(){
  boolean expectedEx=false;
  boolean unexpectedEx=false;
  try {
    SDODataFactory factory=new SDODataFactory(getHelperContext());
    SDODataObject po=(SDODataObject)factory.create("String_Node_Str","String_Node_Str");
    po.set("String_Node_Str","String_Node_Str");
  }
 catch (  SDOException sdoex) {
    if (sdoex.getMessage().lastIndexOf("String_Node_Str") != -1) {
      expectedEx=true;
    }
  }
catch (  Exception x) {
    unexpectedEx=true;
  }
  assertTrue("String_Node_Str",expectedEx);
  assertFalse("String_Node_Str",unexpectedEx);
}

Fixed version (ground truth):
public void testSetPropertyOnNullDataObject(){
  boolean expectedEx=false;
  boolean unexpectedEx=false;
  try {
    SDODataFactory factory=(SDODataFactory)getHelperContext().getDataFactory();
    SDODataObject po=(SDODataObject)factory.create("String_Node_Str","String_Node_Str");
    po.set("String_Node_Str","String_Node_Str");
  }
 catch (  SDOException sdoex) {
    if (sdoex.getMessage().lastIndexOf("String_Node_Str") != -1) {
      expectedEx=true;
    }
  }
catch (  Exception x) {
    unexpectedEx=true;
  }
  assertTrue("String_Node_Str",expectedEx);
  assertFalse("String_Node_Str",unexpectedEx);
}