nus-yam/ex-repair huggingface dataset:
Program: 65504
Project: 65504
Buggy source:
public ValidatorHandler getValidatorHandler(){
  return this.validatorHandler;
}

Fixed version (ground truth):
public ValidatorHandler getValidatorHandler(){
  return validatorHandler;
}
Program: 65505
Project: 65505
Buggy source:
public void setErrorHandler(ErrorHandler handler){
  if (validatorHandler != null) {
    validatorHandler.setErrorHandler(handler);
  }
 else {
    reader.setErrorHandler(handler);
  }
}

Fixed version (ground truth):
public void setErrorHandler(ErrorHandler errorHandler){
  validatorHandler.setErrorHandler(errorHandler);
}
Program: 65506
Project: 65506
Buggy source:
@Override public void setContentHandler(ContentHandler contentHandler){
  if (null == validatorHandler) {
    if (contentHandler instanceof ExtendedContentHandler) {
      this.contentHandler=(ExtendedContentHandler)contentHandler;
    }
 else {
      this.contentHandler=new ExtendedContentHandlerAdapter(contentHandler);
    }
  }
 else {
    validatorHandler.setContentHandler(contentHandler);
  }
}

Fixed version (ground truth):
@Override public void setContentHandler(ContentHandler contentHandler){
  if (null == validatingContentHandler) {
    if (contentHandler instanceof ExtendedContentHandler) {
      this.contentHandler=(ExtendedContentHandler)contentHandler;
    }
 else {
      this.contentHandler=new ExtendedContentHandlerAdapter(contentHandler);
    }
  }
 else {
    validatingContentHandler.setContentHandler(contentHandler);
  }
}
Program: 65507
Project: 65507
Buggy source:
public XMLReaderAdapter(XMLUnmarshaller xmlUnmarshaller){
  super();
  if (null != xmlUnmarshaller) {
    Schema schema=xmlUnmarshaller.getSchema();
    if (null != schema) {
      validatorHandler=schema.newValidatorHandler();
      this.contentHandler=new ExtendedContentHandlerAdapter(validatorHandler);
    }
    setErrorHandler(xmlUnmarshaller.getErrorHandler());
  }
}

Fixed version (ground truth):
public XMLReaderAdapter(XMLUnmarshaller xmlUnmarshaller){
  super();
  if (null != xmlUnmarshaller) {
    Schema schema=xmlUnmarshaller.getSchema();
    if (null != schema) {
      validatingContentHandler=new ValidatingContentHandler(schema.newValidatorHandler());
      this.contentHandler=new ExtendedContentHandlerAdapter(validatingContentHandler);
    }
    setErrorHandler(xmlUnmarshaller.getErrorHandler());
  }
}
Program: 65508
Project: 65508
Buggy source:
@Override public void setErrorHandler(ErrorHandler errorHandler){
  this.errorHandler=errorHandler;
  if (null != validatorHandler) {
    validatorHandler.setErrorHandler(errorHandler);
  }
}

Fixed version (ground truth):
@Override public void setErrorHandler(ErrorHandler errorHandler){
  this.errorHandler=errorHandler;
  if (null != validatingContentHandler) {
    validatingContentHandler.setErrorHandler(errorHandler);
  }
}
Program: 65509
Project: 65509
Buggy source:
public Object convertDataValueToObjectValue(Object fieldValue,Session session){
  if (fieldValue == null) {
    return null;
  }
  if (((String)fieldValue).startsWith(oldPrefix)) {
    fieldValue=((String)fieldValue).replaceFirst(oldPrefix,newPrefix);
  }
  Object result=platformList.get(fieldValue);
  if (result != null) {
    fieldValue=result;
  }
  Object attributeValue;
  Class attributeClass=(Class)((AbstractSession)session).getDatasourcePlatform().convertObject(fieldValue,ClassConstants.CLASS);
  try {
    if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()) {
      try {
        attributeValue=AccessController.doPrivileged(new PrivilegedNewInstanceFromClass(attributeClass));
      }
 catch (      PrivilegedActionException exception) {
        throw ConversionException.couldNotBeConverted(fieldValue,attributeClass,exception.getException());
      }
    }
 else {
      attributeValue=PrivilegedAccessHelper.newInstanceFromClass(attributeClass);
    }
  }
 catch (  Exception exception) {
    throw ConversionException.couldNotBeConverted(fieldValue,attributeClass,exception);
  }
  return attributeValue;
}

Fixed version (ground truth):
public Object convertDataValueToObjectValue(Object fieldValue,Session session){
  if (fieldValue == null) {
    return null;
  }
  if (((String)fieldValue).startsWith(oldPrefix)) {
    if (((String)fieldValue).startsWith(oldOxmPrefix)) {
      fieldValue=((String)fieldValue).replaceFirst(oldOxmPrefix,newOxmPrefix);
    }
 else {
      fieldValue=((String)fieldValue).replaceFirst(oldPrefix,newPrefix);
    }
  }
  Object result=platformList.get(fieldValue);
  if (result != null) {
    fieldValue=result;
  }
  Object attributeValue;
  Class attributeClass=(Class)((AbstractSession)session).getDatasourcePlatform().convertObject(fieldValue,ClassConstants.CLASS);
  try {
    if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()) {
      try {
        attributeValue=AccessController.doPrivileged(new PrivilegedNewInstanceFromClass(attributeClass));
      }
 catch (      PrivilegedActionException exception) {
        throw ConversionException.couldNotBeConverted(fieldValue,attributeClass,exception.getException());
      }
    }
 else {
      attributeValue=PrivilegedAccessHelper.newInstanceFromClass(attributeClass);
    }
  }
 catch (  Exception exception) {
    throw ConversionException.couldNotBeConverted(fieldValue,attributeClass,exception);
  }
  return attributeValue;
}
Program: 65511
Project: 65511
Buggy source:
public Object convertDataValueToObjectValue(Object dataValue,Session session){
  if (dataValue == null) {
    return null;
  }
  if (((String)dataValue).startsWith(oldPrefix)) {
    dataValue=((String)dataValue).replaceFirst(oldPrefix,newPrefix);
  }
  Object result=platformList.get(dataValue);
  if (result == null) {
    return dataValue;
  }
 else {
    return result;
  }
}

Fixed version (ground truth):
public Object convertDataValueToObjectValue(Object dataValue,Session session){
  if (dataValue == null) {
    return null;
  }
  if (((String)dataValue).startsWith(oldPrefix)) {
    if (((String)dataValue).startsWith(oldOxmPrefix)) {
      dataValue=((String)dataValue).replaceFirst(oldOxmPrefix,newOxmPrefix);
    }
 else {
      dataValue=((String)dataValue).replaceFirst(oldPrefix,newPrefix);
    }
  }
  Object result=platformList.get(dataValue);
  if (result == null) {
    return dataValue;
  }
 else {
    return result;
  }
}
Program: 65518
Project: 65518
Buggy source:
@AfterClass public static void tearDown(){
  if (ddlDrop) {
    runDdl(conn,DROP_COMPLEXPKG2_PACKAGE_BODY,ddlDebug);
    runDdl(conn,DROP_COMPLEXPKG2_PACKAGE,ddlDebug);
    runDdl(conn,DROP_A_CUSTOMER2_TYPE,ddlDebug);
    runDdl(conn,DROP_A_CONTACT2_TYPE,ddlDebug);
    runDdl(conn,DROP_COMPLEXPKG2_SIMPLERECORD_TYPE,ddlDebug);
    runDdl(conn,DROP_COMPLEXPKG2_TAB1_TYPE,ddlDebug);
    runDdl(conn,DROP_A_PHONE2_TYPE_TABLE,ddlDebug);
    runDdl(conn,DROP_A_PHONE2_TYPE,ddlDebug);
    runDdl(conn,DROP_VARCHAR2ARRAY_TYPE,ddlDebug);
  }
}

Fixed version (ground truth):
@AfterClass public static void tearDown(){
  if (ddlDrop) {
    runDdl(conn,DROP_COMPLEXPKG2_PACKAGE_BODY,ddlDebug);
    runDdl(conn,DROP_COMPLEXPKG2_PACKAGE,ddlDebug);
    runDdl(conn,DROP_COMPLEXPKG2_SIMPLERECORD_TYPE,ddlDebug);
    runDdl(conn,DROP_COMPLEXPKG2_COMPLEXRECORD_TYPE,ddlDebug);
    runDdl(conn,DROP_A_CUSTOMER2_TYPE,ddlDebug);
    runDdl(conn,DROP_A_CONTACT2_TYPE,ddlDebug);
    runDdl(conn,DROP_A_PHONE2_TYPE_TABLE,ddlDebug);
    runDdl(conn,DROP_A_PHONE2_TYPE,ddlDebug);
    runDdl(conn,DROP_COMPLEXPKG2_TAB1_TYPE,ddlDebug);
    runDdl(conn,DROP_VARCHAR2ARRAY_TYPE,ddlDebug);
  }
}
Program: 65520
Project: 65520
Buggy source:
private String string(String string){
  string=string.substring(1,string.length() - 1);
  string=string.replace("String_Node_Str","String_Node_Str");
  return string;
}

Fixed version (ground truth):
private String string(String string){
  string=string.substring(1,string.length() - 1);
  String returnString="String_Node_Str";
  int slashIndex=string.indexOf('\\');
  if (slashIndex == -1) {
    return string;
  }
  int position=0;
  while (slashIndex > -1) {
    String subString=string.substring(position,slashIndex);
    returnString+=subString;
    position=slashIndex;
    char nextChar=string.charAt(slashIndex + 1);
switch (nextChar) {
case 'b':
{
        position+=2;
        returnString+='\b';
        break;
      }
case 'r':
{
      position+=2;
      returnString+='\r';
      break;
    }
case 'f':
{
    position+=2;
    returnString+='\f';
    break;
  }
case 'n':
{
  position+=2;
  returnString+='\n';
  break;
}
case 't':
{
position+=2;
returnString+='\t';
break;
}
case '"':
{
position+=2;
returnString+='"';
break;
}
case '\\':
{
position+=2;
returnString+='\\';
break;
}
case '/':
{
position+=2;
returnString+='/';
break;
}
case 'u':
{
position+=6;
String hexValue=string.substring(slashIndex + 2,slashIndex + 6);
returnString+=Character.toString((char)Integer.parseInt(hexValue,16));
break;
}
}
slashIndex=string.indexOf('\\',position);
}
if (position < string.length()) {
String subString=string.substring(position,string.length());
returnString+=subString;
}
return returnString;
}
Program: 65521
Project: 65521
Buggy source:
/** 
 * INTERNAL:
 */
protected void writeValue(String value){
  try {
    if (value.indexOf('"') > -1) {
      char[] chars=value.toCharArray();
      for (int x=0, charsSize=chars.length; x < charsSize; x++) {
        char character=chars[x];
        if ('"' == character) {
          writer.write("String_Node_Str");
        }
 else {
          writer.write(character);
        }
      }
    }
 else {
      writer.write(value);
    }
  }
 catch (  IOException e) {
    throw XMLMarshalException.marshalException(e);
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
protected void writeValue(String value){
  try {
    char[] chars=value.toCharArray();
    for (int x=0, charsSize=chars.length; x < charsSize; x++) {
      char character=chars[x];
switch (character) {
case '"':
{
          writer.write("String_Node_Str");
          break;
        }
case '\b':
{
        writer.write("String_Node_Str");
        writer.write("String_Node_Str");
        break;
      }
case '\f':
{
      writer.write("String_Node_Str");
      writer.write("String_Node_Str");
      break;
    }
case '\n':
{
    writer.write("String_Node_Str");
    writer.write("String_Node_Str");
    break;
  }
case '\r':
{
  writer.write("String_Node_Str");
  writer.write("String_Node_Str");
  break;
}
case '\t':
{
writer.write("String_Node_Str");
writer.write("String_Node_Str");
break;
}
case '\\':
{
writer.write("String_Node_Str");
writer.write("String_Node_Str");
break;
}
case '/':
{
writer.write("String_Node_Str");
break;
}
default :
{
if (Character.isISOControl(character)) {
writer.write("String_Node_Str");
String hex=Integer.toHexString(character).toUpperCase();
for (int i=hex.length(); i < 4; i++) {
writer.write("String_Node_Str");
}
writer.write(hex);
}
 else {
writer.write(character);
}
}
}
}
}
 catch (IOException e) {
throw XMLMarshalException.marshalException(e);
}
}
Program: 65525
Project: 65525
Buggy source:
/** 
 * INTERNAL: Add abstract class indicator information to the database row.  This is required when building a row for an insert or an update of a concrete child descriptor.
 */
public void addClassIndicatorFieldToRow(AbstractRecord databaseRow){
  if (hasClassExtractor()) {
    return;
  }
  DatabaseField field=getClassIndicatorField();
  Object value=getClassIndicatorValue();
  boolean namespaceAware=((XMLRecord)databaseRow).isNamespaceAware();
  if (!namespaceAware && value instanceof String) {
    int colonIndex=((String)value).indexOf(XMLConstants.COLON);
    if (colonIndex > -1) {
      value=((String)value).substring(colonIndex + 1);
    }
  }
 else   if (namespaceAware && value instanceof String) {
    if (((XMLRecord)databaseRow).getNamespaceSeparator() != XMLConstants.COLON) {
      value=((String)value).replace(XMLConstants.COLON,((XMLRecord)databaseRow).getNamespaceSeparator());
    }
  }
  databaseRow.put(field,value);
}

Fixed version (ground truth):
/** 
 * INTERNAL: Add abstract class indicator information to the database row.  This is required when building a row for an insert or an update of a concrete child descriptor.
 */
public void addClassIndicatorFieldToRow(AbstractRecord databaseRow){
  if (hasClassExtractor()) {
    return;
  }
  DatabaseField field=getClassIndicatorField();
  Object value=getClassIndicatorValue();
  boolean namespaceAware=((XMLRecord)databaseRow).isNamespaceAware() || ((XMLRecord)databaseRow).hasCustomNamespaceMapper();
  if (!namespaceAware && value instanceof String) {
    int colonIndex=((String)value).indexOf(XMLConstants.COLON);
    if (colonIndex > -1) {
      value=((String)value).substring(colonIndex + 1);
    }
  }
 else   if (namespaceAware && value instanceof String) {
    if (((XMLRecord)databaseRow).getNamespaceSeparator() != XMLConstants.COLON) {
      value=((String)value).replace(XMLConstants.COLON,((XMLRecord)databaseRow).getNamespaceSeparator());
    }
  }
  databaseRow.put(field,value);
}
Program: 65527
Project: 65527
Buggy source:
/** 
 * INTERNAL: Create a start element tag - this call results in a complete start element,  i.e. closeStartElement() does not need to be called after a call to this  method.
 */
private void openAndCloseStartElement(){
  try {
    String namespaceUri=xPathFragment.getNamespaceURI();
    if (namespaceUri == null) {
      namespaceUri=XMLConstants.EMPTY_STRING;
    }
    contentHandler.startElement(namespaceUri,xPathFragment.getLocalName(),xPathFragment.getShortName(),attributes);
  }
 catch (  SAXException e) {
    throw XMLMarshalException.marshalException(e);
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Create a start element tag - this call results in a complete start element,  i.e. closeStartElement() does not need to be called after a call to this  method.
 */
private void openAndCloseStartElement(){
  try {
    String namespaceUri=xPathFragment.getNamespaceURI();
    if (namespaceUri == null) {
      namespaceUri=XMLConstants.EMPTY_STRING;
    }
    contentHandler.startElement(namespaceUri,xPathFragment.getLocalName(),getNameForFragment(xPathFragment),attributes);
  }
 catch (  SAXException e) {
    throw XMLMarshalException.marshalException(e);
  }
}
Program: 65528
Project: 65528
Buggy source:
/** 
 * INTERNAL:
 */
public void endElement(XPathFragment xPathFragment,NamespaceResolver namespaceResolver){
  if (isStartElementOpen) {
    openAndCloseStartElement();
    isStartElementOpen=false;
  }
  try {
    String uri=xPathFragment.getNamespaceURI();
    if (uri == null) {
      uri=XMLConstants.EMPTY_STRING;
    }
    contentHandler.endElement(uri,xPathFragment.getLocalName(),xPathFragment.getShortName());
    List<String> currentLevelPrefixMappings=prefixMappings.remove(prefixMappings.size() - 1);
    if (null != currentLevelPrefixMappings) {
      for (      String prefix : currentLevelPrefixMappings) {
        contentHandler.endPrefixMapping(prefix);
      }
    }
    isStartElementOpen=false;
  }
 catch (  SAXException e) {
    throw XMLMarshalException.marshalException(e);
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
public void endElement(XPathFragment xPathFragment,NamespaceResolver namespaceResolver){
  if (isStartElementOpen) {
    openAndCloseStartElement();
    isStartElementOpen=false;
  }
  try {
    String uri=xPathFragment.getNamespaceURI();
    if (uri == null) {
      uri=XMLConstants.EMPTY_STRING;
    }
    contentHandler.endElement(uri,xPathFragment.getLocalName(),getNameForFragment(xPathFragment));
    List<String> currentLevelPrefixMappings=prefixMappings.remove(prefixMappings.size() - 1);
    if (null != currentLevelPrefixMappings) {
      for (      String prefix : currentLevelPrefixMappings) {
        contentHandler.endPrefixMapping(prefix);
      }
    }
    isStartElementOpen=false;
  }
 catch (  SAXException e) {
    throw XMLMarshalException.marshalException(e);
  }
}
Program: 65529
Project: 65529
Buggy source:
/** 
 * INTERNAL:
 */
public void element(XPathFragment frag){
  if (isStartElementOpen) {
    openAndCloseStartElement();
    isStartElementOpen=false;
  }
  try {
    this.attributes.clear();
    String namespaceURI=frag.getNamespaceURI();
    if (namespaceURI == null) {
      namespaceURI=XMLConstants.EMPTY_STRING;
    }
    String localName=frag.getLocalName();
    String shortName=frag.getShortName();
    contentHandler.startElement(namespaceURI,localName,shortName,attributes);
    contentHandler.endElement(namespaceURI,localName,shortName);
  }
 catch (  SAXException e) {
    throw XMLMarshalException.marshalException(e);
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
public void element(XPathFragment frag){
  if (isStartElementOpen) {
    openAndCloseStartElement();
    isStartElementOpen=false;
  }
  try {
    this.attributes.clear();
    String namespaceURI=frag.getNamespaceURI();
    if (namespaceURI == null) {
      namespaceURI=XMLConstants.EMPTY_STRING;
    }
    String localName=frag.getLocalName();
    String shortName=getNameForFragment(frag);
    contentHandler.startElement(namespaceURI,localName,shortName,attributes);
    contentHandler.endElement(namespaceURI,localName,shortName);
  }
 catch (  SAXException e) {
    throw XMLMarshalException.marshalException(e);
  }
}
Program: 65531
Project: 65531
Buggy source:
public void attribute(UnmarshalRecord unmarshalRecord,String namespaceURI,String localName,String value){
  ContainerPolicy cp=xmlAnyAttributeMapping.getContainerPolicy();
  Object containerInstance=unmarshalRecord.getContainerInstance(this);
  boolean includeAttribute=true;
  if (!xmlAnyAttributeMapping.isNamespaceDeclarationIncluded() && XMLConstants.XMLNS_URL.equals(namespaceURI)) {
    includeAttribute=false;
  }
 else   if (!xmlAnyAttributeMapping.isSchemaInstanceIncluded() && XMLConstants.SCHEMA_INSTANCE_URL.equals(namespaceURI)) {
    includeAttribute=false;
  }
  if (includeAttribute) {
    QName key=new QName(namespaceURI,localName);
    cp.addInto(key,value,containerInstance,unmarshalRecord.getSession());
  }
}

Fixed version (ground truth):
public void attribute(UnmarshalRecord unmarshalRecord,String namespaceURI,String localName,String value){
  boolean includeAttribute=true;
  if (!xmlAnyAttributeMapping.isNamespaceDeclarationIncluded() && XMLConstants.XMLNS_URL.equals(namespaceURI)) {
    includeAttribute=false;
  }
 else   if (!xmlAnyAttributeMapping.isSchemaInstanceIncluded() && XMLConstants.SCHEMA_INSTANCE_URL.equals(namespaceURI)) {
    includeAttribute=false;
  }
  if (includeAttribute) {
    ContainerPolicy cp=xmlAnyAttributeMapping.getContainerPolicy();
    Object containerInstance=unmarshalRecord.getContainerInstance(this);
    QName key=new QName(namespaceURI,localName);
    cp.addInto(key,value,containerInstance,unmarshalRecord.getSession());
  }
}
Program: 65533
Project: 65533
Buggy source:
/** 
 * INTERNAL:
 */
protected void writeValue(String value){
  try {
    if (value.indexOf('&') > -1 || value.indexOf('<') > -1) {
      char[] chars=value.toCharArray();
      for (int x=0, charsSize=chars.length; x < charsSize; x++) {
        char character=chars[x];
switch (character) {
case '&':
{
            writer.write("String_Node_Str");
            break;
          }
case '<':
{
          writer.write("String_Node_Str");
          break;
        }
case '"':
{
        writer.write("String_Node_Str");
        break;
      }
default :
    writer.write(character);
}
}
}
 else {
writer.write(value);
}
}
 catch (IOException e) {
throw XMLMarshalException.marshalException(e);
}
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
protected void writeValue(String value){
  try {
    if (value.indexOf('"') > -1 || value.indexOf('&') > -1 || value.indexOf('<') > -1) {
      char[] chars=value.toCharArray();
      for (int x=0, charsSize=chars.length; x < charsSize; x++) {
        char character=chars[x];
switch (character) {
case '&':
{
            writer.write("String_Node_Str");
            break;
          }
case '<':
{
          writer.write("String_Node_Str");
          break;
        }
case '"':
{
        writer.write("String_Node_Str");
        break;
      }
default :
    writer.write(character);
}
}
}
 else {
writer.write(value);
}
}
 catch (IOException e) {
throw XMLMarshalException.marshalException(e);
}
}
Program: 65535
Project: 65535
Buggy source:
public void setProjectName(String projectName){
  properties.put(PROJNAME_KEY,projectName);
}

Fixed version (ground truth):
/** 
 * Sets the projectName property.
 */
public void setProjectName(String projectName){
  properties.put(PROJNAME_KEY,projectName);
}
Program: 65536
Project: 65536
Buggy source:
public String getProjectName(){
  return properties.get(PROJNAME_KEY);
}

Fixed version (ground truth):
/** 
 * Return the projectName property or the default (myProject) if not set.
 */
public String getProjectName(){
  String prjName=properties.get(PROJNAME_KEY);
  return (prjName != null && prjName.length() > 0) ? prjName : DEFAULT_PROJECT_NAME;
}
Program: 65537
Project: 65537
Buggy source:
public static String getGeneratedJavaClassName(String tableName,String projectName){
  String first=tableName.substring(0,1).toUpperCase();
  String rest=tableName.toLowerCase().substring(1);
  return projectName.toLowerCase() + "String_Node_Str" + first+ rest;
}

Fixed version (ground truth):
/** 
 * Returns a Java class name based on a given name and project.  The returned string  will be  in the format  'projectname.Name'.   For  example,  given the name 'EMPLOYEE'  and projectName 'TEST', the  method would return  the string 'test.Employee'.
 */
public static String getGeneratedJavaClassName(String name,String projectName){
  String first=name.substring(0,1).toUpperCase();
  String rest=name.toLowerCase().substring(1);
  return projectName.toLowerCase() + DOT + first+ rest;
}
Program: 65541
Project: 65541
Buggy source:
/** 
 * Not supported.
 */
public boolean isSynthetic(){
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Not supported.
 */
public boolean isSynthetic(){
  return false;
}
Program: 65543
Project: 65543
Buggy source:
@Test public void testBoolean(){
  Invocation invocation=new Invocation("String_Node_Str");
  invocation.setParameter("String_Node_Str",Integer.valueOf(1));
  Operation op=xrService.getOperation(invocation.getName());
  Object result=op.invoke(xrService,invocation);
  assertNotNull("String_Node_Str",result);
  Document doc=xmlPlatform.createDocument();
  XMLMarshaller marshaller=xrService.getXMLContext().createMarshaller();
  marshaller.marshal(result,doc);
  Document controlDoc=xmlParser.parse(new StringReader(TEST_BOOLEAN_RESULT));
  assertTrue("String_Node_Str" + documentToString(controlDoc) + "String_Node_Str"+ documentToString(doc),comparer.isNodeEqual(controlDoc,doc));
}

Fixed version (ground truth):
@Test public void testBoolean(){
  Invocation invocation=new Invocation("String_Node_Str");
  invocation.setParameter("String_Node_Str",Integer.valueOf(0));
  Operation op=xrService.getOperation(invocation.getName());
  Object result=op.invoke(xrService,invocation);
  assertNotNull("String_Node_Str",result);
  Document doc=xmlPlatform.createDocument();
  XMLMarshaller marshaller=xrService.getXMLContext().createMarshaller();
  marshaller.marshal(result,doc);
  Document controlDoc=xmlParser.parse(new StringReader(TEST_BOOLEAN_RESULT));
  assertTrue("String_Node_Str" + documentToString(controlDoc) + "String_Node_Str"+ documentToString(doc),comparer.isNodeEqual(controlDoc,doc));
}
Program: 65545
Project: 65545
Buggy source:
@AfterClass public static void tearDown(){
  String ddlDrop=System.getProperty(DATABASE_DDL_DROP_KEY,DEFAULT_DATABASE_DDL_DROP);
  if ("String_Node_Str".equalsIgnoreCase(ddlDrop)) {
    runDdl(conn,DROP_BOOL_IN_PROC,ddlDebug);
  }
}

Fixed version (ground truth):
@AfterClass public static void tearDown(){
  String ddlDrop=System.getProperty(DATABASE_DDL_DROP_KEY,DEFAULT_DATABASE_DDL_DROP);
  if ("String_Node_Str".equalsIgnoreCase(ddlDrop)) {
    runDdl(conn,DROP_BOOL_PROC,ddlDebug);
    runDdl(conn,DROP_BINARY_INT_PROC,ddlDebug);
    runDdl(conn,DROP_PLS_INT_PROC,ddlDebug);
    runDdl(conn,DROP_NATURAL_PROC,ddlDebug);
    runDdl(conn,DROP_POSITIVE_PROC,ddlDebug);
    runDdl(conn,DROP_SIGNTYPE_PROC,ddlDebug);
  }
}
Program: 65547
Project: 65547
Buggy source:
/** 
 * Indicates if a given ArgumentType is considered a PL/SQL scalar argument, i.e. it has a data type that is one of BOOLEAN_TYPE, BINARY_INTEGER_TYPE, or PLS_INTEGER_TYPE
 */
public static boolean isArgPLSQLScalar(ArgumentType argument){
  DatabaseType argType=argument.getDataType();
  return argType == ScalarDatabaseTypeEnum.BOOLEAN_TYPE || argType == ScalarDatabaseTypeEnum.BINARY_INTEGER_TYPE || argType == ScalarDatabaseTypeEnum.PLS_INTEGER_TYPE;
}

Fixed version (ground truth):
/** 
 * Indicates if a given ArgumentType is considered a PL/SQL scalar argument, i.e. it has a data type that is one of BOOLEAN_TYPE,  BINARY_INTEGER_TYPE, PLS_INTEGER_TYPE, etc.
 */
public static boolean isArgPLSQLScalar(ArgumentType argument){
  DatabaseType argType=argument.getDataType();
  return argType == ScalarDatabaseTypeEnum.BINARY_INTEGER_TYPE || argType == ScalarDatabaseTypeEnum.BOOLEAN_TYPE || argType == ScalarDatabaseTypeEnum.NATURAL_TYPE || argType == ScalarDatabaseTypeEnum.PLS_INTEGER_TYPE || argType == ScalarDatabaseTypeEnum.POSITIVE_TYPE || argType == ScalarDatabaseTypeEnum.SIGN_TYPE;
}
Program: 65548
Project: 65548
Buggy source:
/** 
 * Indicates if a given list of ArgumentTypes contains one or more PL/SQL arguments, i.e. PLSQLRecordType, PLSQLCollectionType, BOOLEAN_TYPE, BINARY_INTEGER_TYPE, or PLS_INTEGER_TYPE
 */
public static boolean hasPLSQLArgs(List<ArgumentType> arguments){
  for (  ArgumentType arg : arguments) {
    if (isArgPLSQL(arg)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Indicates if a given list  of ArgumentTypes contains  one or more  PL/SQL arguments, i.e.  PLSQLRecordType, PLSQLCollectionType,  or scalars BOOLEAN_TYPE, BINARY_INTEGER_TYPE, PLS_INTEGER_TYPE, etc.
 */
public static boolean hasPLSQLArgs(List<ArgumentType> arguments){
  for (  ArgumentType arg : arguments) {
    if (isArgPLSQL(arg)) {
      return true;
    }
  }
  return false;
}
Program: 65549
Project: 65549
Buggy source:
/** 
 * Indicates if a given ArgumentType is considered a PL/SQL argument, i.e. it has a data type that is one of PLSQLRecordType, PLSQLCollectionType, BOOLEAN_TYPE, BINARY_INTEGER_TYPE, or PLS_INTEGER_TYPE
 */
public static boolean isArgPLSQL(ArgumentType argument){
  DatabaseType argType=argument.getDataType();
  return argType instanceof PLSQLType || isArgPLSQLScalar(argument);
}

Fixed version (ground truth):
/** 
 * Indicates if a given ArgumentType is considered a PL/SQL argument, i.e. it has a data type that is one of PLSQLRecordType,  PLSQLCollectionType, BOOLEAN_TYPE, BINARY_INTEGER_TYPE,  PLS_INTEGER_TYPE, etc. 
 */
public static boolean isArgPLSQL(ArgumentType argument){
  DatabaseType argType=argument.getDataType();
  return argType instanceof PLSQLType || isArgPLSQLScalar(argument);
}
Program: 65550
Project: 65550
Buggy source:
private JAXBContextState createContextState(Generator generator,JaxbClassLoader loader,TypeMappingInfo[] typesToBeBound,Map properties) throws Exception {
  Project proj=generator.generateProject();
  ConversionManager conversionManager=null;
  if (classLoader != null) {
    conversionManager=new ConversionManager();
    conversionManager.setLoader(loader);
  }
 else {
    conversionManager=ConversionManager.getDefaultManager();
  }
  proj.convertClassNamesToClasses(conversionManager.getLoader());
  for (Iterator<ClassDescriptor> descriptorIt=proj.getOrderedDescriptors().iterator(); descriptorIt.hasNext(); ) {
    ClassDescriptor descriptor=descriptorIt.next();
    if (descriptor.getJavaClass() == null) {
      descriptor.setJavaClass(conversionManager.convertClassNameToClass(descriptor.getJavaClassName()));
    }
  }
  SessionEventListener eventListener=new SessionEventListener();
  eventListener.setShouldValidateInstantiationPolicy(false);
  XMLPlatform platform=new SAXPlatform();
  platform.getConversionManager().setLoader(loader);
  XMLContext xmlContext=new XMLContext(proj,loader,eventListener);
  if (generator.getAnnotationsProcessor().getPackageToPackageInfoMappings().size() > 1) {
    ((XMLLogin)xmlContext.getSession(0).getDatasourceLogin()).setEqualNamespaceResolvers(false);
  }
  return new JAXBContextState(xmlContext,generator,typesToBeBound,properties);
}

Fixed version (ground truth):
private JAXBContextState createContextState(Generator generator,JaxbClassLoader loader,TypeMappingInfo[] typesToBeBound,Map properties) throws Exception {
  Project proj=generator.generateProject();
  ConversionManager conversionManager=null;
  if (classLoader != null) {
    conversionManager=new ConversionManager();
    conversionManager.setLoader(loader);
  }
 else {
    conversionManager=ConversionManager.getDefaultManager();
  }
  proj.convertClassNamesToClasses(conversionManager.getLoader());
  for (Iterator<ClassDescriptor> descriptorIt=proj.getOrderedDescriptors().iterator(); descriptorIt.hasNext(); ) {
    ClassDescriptor descriptor=descriptorIt.next();
    if (descriptor.getJavaClass() == null) {
      descriptor.setJavaClass(conversionManager.convertClassNameToClass(descriptor.getJavaClassName()));
    }
  }
  SessionEventListener eventListener=new SessionEventListener();
  eventListener.setShouldValidateInstantiationPolicy(false);
  XMLPlatform platform=new SAXPlatform();
  platform.getConversionManager().setLoader(loader);
  XMLContext xmlContext=new XMLContext(proj,loader,eventListener);
  ((XMLLogin)xmlContext.getSession(0).getDatasourceLogin()).setEqualNamespaceResolvers(true);
  return new JAXBContextState(xmlContext,generator,typesToBeBound,properties);
}
Program: 65554
Project: 65554
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  String contextPath="String_Node_Str";
  System.setProperty("String_Node_Str",contextPath);
  String platform=System.getProperty("String_Node_Str");
  boolean jaxpPlatform=true;
  suite.addTestSuite(MarshallerTestCases.class);
  suite.addTestSuite(UnmarshallerTestCases.class);
  if (!jaxpPlatform) {
    suite.addTestSuite(ValidatorTestCases.class);
  }
  suite.addTestSuite(UnmarshallValidationTestCases.class);
  suite.addTestSuite(MarshallerPropertiesTestCases.class);
  suite.addTestSuite(MarshallerFormattingTestCases.class);
  suite.addTest(MarshallerEncodingTestCases.suite());
  suite.addTestSuite(MarshallerFragmentTestCases.class);
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  String contextPath="String_Node_Str";
  System.setProperty("String_Node_Str",contextPath);
  String platform=System.getProperty("String_Node_Str");
  boolean jaxpPlatform=true;
  suite.addTestSuite(MarshallerTestCases.class);
  suite.addTestSuite(UnmarshallerTestCases.class);
  if (!jaxpPlatform) {
    suite.addTestSuite(ValidatorTestCases.class);
  }
  suite.addTestSuite(UnmarshallValidationTestCases.class);
  suite.addTestSuite(MarshallerPropertiesTestCases.class);
  suite.addTestSuite(MarshallerFormattingTestCases.class);
  suite.addTest(MarshallerEncodingTestCases.suite());
  suite.addTestSuite(MarshallerFragmentTestCases.class);
  suite.addTestSuite(XMLDeclarationTestCases.class);
  return suite;
}
Program: 65555
Project: 65555
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  String contextPath="String_Node_Str";
  System.setProperty("String_Node_Str",contextPath);
  String platform=System.getProperty("String_Node_Str");
  boolean jaxpPlatform=true;
  suite.addTestSuite(MarshallerTestCases.class);
  suite.addTestSuite(UnmarshallerTestCases.class);
  if (!jaxpPlatform) {
    suite.addTestSuite(ValidatorTestCases.class);
  }
  suite.addTestSuite(UnmarshallValidationTestCases.class);
  suite.addTestSuite(MarshallerPropertiesTestCases.class);
  suite.addTestSuite(MarshallerFormattingTestCases.class);
  suite.addTest(MarshallerEncodingTestCases.suite());
  suite.addTestSuite(MarshallerFragmentTestCases.class);
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  String contextPath="String_Node_Str";
  System.setProperty("String_Node_Str",contextPath);
  String platform=System.getProperty("String_Node_Str");
  boolean jaxpPlatform=true;
  suite.addTestSuite(MarshallerTestCases.class);
  suite.addTestSuite(UnmarshallerTestCases.class);
  if (!jaxpPlatform) {
    suite.addTestSuite(ValidatorTestCases.class);
  }
  suite.addTestSuite(UnmarshallValidationTestCases.class);
  suite.addTestSuite(MarshallerPropertiesTestCases.class);
  suite.addTestSuite(MarshallerFormattingTestCases.class);
  suite.addTest(MarshallerEncodingTestCases.suite());
  suite.addTestSuite(MarshallerFragmentTestCases.class);
  suite.addTestSuite(XMLDeclarationTestCases.class);
  return suite;
}
Program: 65559
Project: 65559
Buggy source:
public void setPrefix(String prefix){
  this.prefix=prefix;
}

Fixed version (ground truth):
public void setPrefix(String prefix){
  this.prefix=prefix;
  resetShortName();
}
Program: 65560
Project: 65560
Buggy source:
public String getShortName(){
  return shortName;
}

Fixed version (ground truth):
public String getShortName(){
  if (shortName == null) {
    if (prefix != null && prefix.length() > 0) {
      shortName=prefix + XMLConstants.COLON + localName;
    }
 else {
      shortName=localName;
    }
  }
  return shortName;
}
Program: 65561
Project: 65561
Buggy source:
public byte[] getShortNameBytes(){
  if (null == shortNameBytes) {
    try {
      shortNameBytes=shortName.getBytes(XMLConstants.DEFAULT_XML_ENCODING);
    }
 catch (    UnsupportedEncodingException e) {
    }
  }
  return shortNameBytes;
}

Fixed version (ground truth):
public byte[] getShortNameBytes(){
  if (null == shortNameBytes) {
    try {
      shortNameBytes=getShortName().getBytes(XMLConstants.DEFAULT_XML_ENCODING);
    }
 catch (    UnsupportedEncodingException e) {
    }
  }
  return shortNameBytes;
}
Program: 65562
Project: 65562
Buggy source:
public void setLocalName(String localName){
  this.localName=localName;
}

Fixed version (ground truth):
public void setLocalName(String localName){
  this.localName=localName;
  resetShortName();
}
Program: 65563
Project: 65563
Buggy source:
private XPathFragment buildRootFragment(Object object,XMLDescriptor descriptor,boolean isXMLRoot,MarshalRecord marshalRecord){
  XPathFragment rootFragment=null;
  if (isXMLRoot) {
    rootFragment=((XMLRoot)object).getRootFragment();
    String xmlRootUri=((XMLRoot)object).getNamespaceURI();
    String xmlRootLocalName=((XMLRoot)object).getLocalName();
    if (xmlRootUri != null) {
      if (descriptor != null) {
        String xmlRootPrefix=marshalRecord.getNamespaceResolver().resolveNamespaceURI(xmlRootUri);
        if (xmlRootPrefix == null && !(xmlRootUri.equals(marshalRecord.getNamespaceResolver().getDefaultNamespaceURI()))) {
          xmlRootPrefix=marshalRecord.getNamespaceResolver().generatePrefix();
          marshalRecord.getNamespaceResolver().put(xmlRootPrefix,xmlRootUri);
        }
        if (xmlRootPrefix == null) {
          rootFragment.setXPath(xmlRootLocalName);
        }
 else {
          rootFragment.setXPath(xmlRootPrefix + XMLConstants.COLON + xmlRootLocalName);
        }
      }
 else {
        String xmlRootPrefix="String_Node_Str";
        marshalRecord.getNamespaceResolver().put(xmlRootPrefix,xmlRootUri);
        rootFragment.setXPath(xmlRootPrefix + XMLConstants.COLON + xmlRootLocalName);
      }
    }
  }
 else {
    XMLField defaultRootField=descriptor.getDefaultRootElementField();
    if (defaultRootField != null) {
      rootFragment=defaultRootField.getXPathFragment();
    }
  }
  return rootFragment;
}

Fixed version (ground truth):
private XPathFragment buildRootFragment(Object object,XMLDescriptor descriptor,boolean isXMLRoot,MarshalRecord marshalRecord){
  XPathFragment rootFragment=null;
  if (isXMLRoot) {
    String xmlRootUri=((XMLRoot)object).getNamespaceURI();
    String xmlRootLocalName=((XMLRoot)object).getLocalName();
    rootFragment=new XPathFragment();
    rootFragment.setLocalName(xmlRootLocalName);
    rootFragment.setNamespaceURI(xmlRootUri);
    if (xmlRootUri != null) {
      if (descriptor != null) {
        String xmlRootPrefix=marshalRecord.getNamespaceResolver().resolveNamespaceURI(xmlRootUri);
        if (xmlRootPrefix == null && !(xmlRootUri.equals(marshalRecord.getNamespaceResolver().getDefaultNamespaceURI()))) {
          xmlRootPrefix=marshalRecord.getNamespaceResolver().generatePrefix();
          marshalRecord.getNamespaceResolver().put(xmlRootPrefix,xmlRootUri);
        }
        if (xmlRootPrefix == null) {
          rootFragment.setXPath(xmlRootLocalName);
        }
 else {
          rootFragment.setPrefix(xmlRootPrefix);
        }
      }
 else {
        String xmlRootPrefix="String_Node_Str";
        marshalRecord.getNamespaceResolver().put(xmlRootPrefix,xmlRootUri);
        rootFragment.setXPath(xmlRootPrefix + XMLConstants.COLON + xmlRootLocalName);
      }
    }
  }
 else {
    XMLField defaultRootField=descriptor.getDefaultRootElementField();
    if (defaultRootField != null) {
      rootFragment=defaultRootField.getXPathFragment();
    }
  }
  return rootFragment;
}
Program: 65564
Project: 65564
Buggy source:
/** 
 * Gets the local name. This should not be null.
 * @return the local name
 */
public String getLocalName(){
  return rootFragment.getLocalName();
}

Fixed version (ground truth):
/** 
 * Gets the local name. This should not be null.
 * @return the local name
 */
public String getLocalName(){
  return localName;
}
Program: 65565
Project: 65565
Buggy source:
/** 
 * Sets the namespace uri associated with the QName of this XMLRoot.
 * @param rootElementUri the new namespace uri
 */
public void setNamespaceURI(String rootElementUri){
  rootFragment.setNamespaceURI(rootElementUri);
}

Fixed version (ground truth):
/** 
 * Sets the namespace uri associated with the QName of this XMLRoot.
 * @param rootElementUri the new namespace uri
 */
public void setNamespaceURI(String rootElementUri){
  if (rootElementUri != null && rootElementUri.length() == 0) {
    this.namespaceUri=null;
  }
 else {
    this.namespaceUri=rootElementUri;
  }
}
Program: 65566
Project: 65566
Buggy source:
/** 
 * Gets the namespace uri.  This may be null.
 * @return the namespace uri
 */
public String getNamespaceURI(){
  return rootFragment.getNamespaceURI();
}

Fixed version (ground truth):
/** 
 * Gets the namespace uri.  This may be null.
 * @return the namespace uri
 */
public String getNamespaceURI(){
  return namespaceUri;
}
Program: 65567
Project: 65567
Buggy source:
/** 
 * Set the element name.  This method will parse the qualified name in an attempt to set the localName fields.  ie: this could be  set to "someLocalName" or "somePrefix:someLocalName"
 * @param name the new local name
 */
public void setLocalName(String name){
  rootFragment.setXPath(name);
}

Fixed version (ground truth):
/** 
 * Set the element name.  This method will parse the qualified name in an attempt to set the localName fields.  ie: this could be  set to "someLocalName" or "somePrefix:someLocalName"
 * @param name the new local name
 */
public void setLocalName(String name){
  int colonIdx=name.indexOf(XMLConstants.COLON);
  if (colonIdx > -1) {
    this.localName=name.substring(colonIdx + 1);
  }
 else {
    this.localName=name;
  }
}
Program: 65568
Project: 65568
Buggy source:
private void writeSimpleValue(XMLField xmlRootField,Object element,Object originalObject,DOMRecord record,org.w3c.dom.Document doc,Node root,boolean wasXMLRoot,AbstractSession session){
  if (wasXMLRoot) {
    if (((XMLRoot)originalObject).getRootFragment().getNamespaceURI() != null) {
      String prefix=record.getNamespaceResolver().resolveNamespaceURI(((XMLRoot)originalObject).getRootFragment().getNamespaceURI());
      if ((prefix == null) || prefix.length() == 0) {
        xmlRootField.getXPathFragment().setGeneratedPrefix(true);
        prefix=record.getNamespaceResolver().generatePrefix();
      }
      xmlRootField.getXPathFragment().setXPath(prefix + XMLConstants.COLON + ((XMLRoot)originalObject).getLocalName());
    }
  }
  if (xmlRootField != null) {
    xmlRootField.setNamespaceResolver(record.getNamespaceResolver());
    QName qname=((XMLRoot)originalObject).getSchemaType();
    if (qname != null) {
      if (!qname.equals(XMLConstants.STRING_QNAME)) {
        xmlRootField.setSchemaType(qname);
        xmlRootField.setIsTypedTextField(true);
        xmlRootField.addJavaConversion(((XMLRoot)originalObject).getObject().getClass(),qname);
      }
    }
    Node newNode=XPathEngine.getInstance().create(xmlRootField,root,element,session);
  }
 else {
    Text textNode=doc.createTextNode((String)element);
    root.appendChild(textNode);
  }
}

Fixed version (ground truth):
private void writeSimpleValue(XMLField xmlRootField,Object element,Object originalObject,DOMRecord record,org.w3c.dom.Document doc,Node root,boolean wasXMLRoot,AbstractSession session){
  if (wasXMLRoot) {
    if (((XMLRoot)originalObject).getNamespaceURI() != null) {
      String prefix=record.getNamespaceResolver().resolveNamespaceURI(((XMLRoot)originalObject).getNamespaceURI());
      if ((prefix == null) || prefix.length() == 0) {
        xmlRootField.getXPathFragment().setGeneratedPrefix(true);
        prefix=record.getNamespaceResolver().generatePrefix();
      }
      xmlRootField.getXPathFragment().setXPath(prefix + XMLConstants.COLON + ((XMLRoot)originalObject).getLocalName());
    }
  }
  if (xmlRootField != null) {
    xmlRootField.setNamespaceResolver(record.getNamespaceResolver());
    QName qname=((XMLRoot)originalObject).getSchemaType();
    if (qname != null) {
      if (!qname.equals(XMLConstants.STRING_QNAME)) {
        xmlRootField.setSchemaType(qname);
        xmlRootField.setIsTypedTextField(true);
        xmlRootField.addJavaConversion(((XMLRoot)originalObject).getObject().getClass(),qname);
      }
    }
    Node newNode=XPathEngine.getInstance().create(xmlRootField,root,element,session);
  }
 else {
    Text textNode=doc.createTextNode((String)element);
    root.appendChild(textNode);
  }
}
Program: 65571
Project: 65571
Buggy source:
private void writeSimpleValue(XMLField xmlRootField,DOMRecord row,AbstractSession session,Object originalObject,Object value,Node root,Node toReplace,boolean wasXMLRoot){
  org.w3c.dom.Document doc=row.getDocument();
  if (wasXMLRoot) {
    if (((XMLRoot)originalObject).getRootFragment().getNamespaceURI() != null) {
      String prefix=row.getNamespaceResolver().resolveNamespaceURI(((XMLRoot)originalObject).getRootFragment().getNamespaceURI());
      if ((prefix == null) || prefix.length() == 0) {
        xmlRootField.getXPathFragment().setGeneratedPrefix(true);
        prefix=row.getNamespaceResolver().generatePrefix();
      }
      xmlRootField.getXPathFragment().setXPath(prefix + XMLConstants.COLON + ((XMLRoot)originalObject).getLocalName());
    }
  }
  if (null == xmlRootField) {
    Text textNode=doc.createTextNode((String)value);
    if (toReplace != null) {
      root.replaceChild(textNode,toReplace);
    }
 else {
      root.appendChild(textNode);
    }
  }
 else {
    QName qname=((XMLRoot)originalObject).getSchemaType();
    if (qname != null && !qname.equals(XMLConstants.STRING_QNAME)) {
      xmlRootField.setSchemaType(qname);
      xmlRootField.setIsTypedTextField(true);
      xmlRootField.addJavaConversion(value.getClass(),qname);
    }
    Node newNode=XPathEngine.getInstance().create(xmlRootField,root,value,session);
  }
}

Fixed version (ground truth):
private void writeSimpleValue(XMLField xmlRootField,DOMRecord row,AbstractSession session,Object originalObject,Object value,Node root,Node toReplace,boolean wasXMLRoot){
  org.w3c.dom.Document doc=row.getDocument();
  if (wasXMLRoot) {
    if (((XMLRoot)originalObject).getNamespaceURI() != null) {
      String prefix=row.getNamespaceResolver().resolveNamespaceURI(((XMLRoot)originalObject).getNamespaceURI());
      if ((prefix == null) || prefix.length() == 0) {
        xmlRootField.getXPathFragment().setGeneratedPrefix(true);
        prefix=row.getNamespaceResolver().generatePrefix();
      }
      xmlRootField.getXPathFragment().setXPath(prefix + XMLConstants.COLON + ((XMLRoot)originalObject).getLocalName());
    }
  }
  if (null == xmlRootField) {
    Text textNode=doc.createTextNode((String)value);
    if (toReplace != null) {
      root.replaceChild(textNode,toReplace);
    }
 else {
      root.appendChild(textNode);
    }
  }
 else {
    QName qname=((XMLRoot)originalObject).getSchemaType();
    if (qname != null && !qname.equals(XMLConstants.STRING_QNAME)) {
      xmlRootField.setSchemaType(qname);
      xmlRootField.setIsTypedTextField(true);
      xmlRootField.addJavaConversion(value.getClass(),qname);
    }
    Node newNode=XPathEngine.getInstance().create(xmlRootField,root,value,session);
  }
}
Program: 65573
Project: 65573
Buggy source:
/** 
 * Add the mapping to the   {@link #entityType}'s descriptor being built or extended. This is where the   {@link ValuesAccessor} is created and theposition of the mapping in the descriptor is captured to use as its index.
 */
public DatabaseMapping addMapping(DatabaseMapping mapping){
  ClassDescriptor descriptor=getType().getDescriptor();
  if (!descriptor.getMappings().contains(mapping)) {
    descriptor.addMapping(mapping);
  }
  int index=descriptor.getMappings().indexOf(mapping);
  if (getType().getParentType() != null) {
    DynamicType current=getType();
    while (current.getParentType() != null) {
      index+=current.getParentType().getDescriptor().getMappings().size();
      current=current.getParentType();
    }
  }
  if (mapping.getAttributeClassification() == null && mapping.isAbstractDirectMapping()) {
    String typeName=((AbstractDirectMapping)mapping).getAttributeClassificationName();
    if (typeName != null) {
      typeName=typeName.trim();
      Class<?> attrType=ConversionManager.getDefaultManager().convertClassNameToClass(typeName);
      ((AbstractDirectMapping)mapping).setAttributeClassification(attrType);
    }
  }
  mapping.setAttributeAccessor(new ValuesAccessor(mapping));
  if (requiresInitialization(mapping)) {
    this.entityType.getMappingsRequiringInitialization().add(mapping);
  }
  return mapping;
}

Fixed version (ground truth):
/** 
 * Add the mapping to the   {@link #entityType}'s descriptor being built or extended. This is where the   {@link ValuesAccessor} is created and theposition of the mapping in the descriptor is captured to use as its index.
 */
public DatabaseMapping addMapping(DatabaseMapping mapping){
  ClassDescriptor descriptor=getType().getDescriptor();
  if (!descriptor.getMappings().contains(mapping)) {
    descriptor.addMapping(mapping);
  }
  int index=descriptor.getMappings().indexOf(mapping);
  if (getType().getParentType() != null) {
    DynamicType current=getType();
    while (current.getParentType() != null) {
      index+=current.getParentType().getDescriptor().getMappings().size();
      current=current.getParentType();
    }
  }
  if (mapping.getAttributeClassification() == null && mapping.isAbstractDirectMapping()) {
    String typeName=((AbstractDirectMapping)mapping).getAttributeClassificationName();
    if (typeName != null) {
      typeName=typeName.trim();
      try {
        Class<?> attrType=ConversionManager.getDefaultManager().convertClassNameToClass(typeName);
        ((AbstractDirectMapping)mapping).setAttributeClassification(attrType);
      }
 catch (      Exception e) {
      }
    }
  }
  mapping.setAttributeAccessor(new ValuesAccessor(mapping));
  if (requiresInitialization(mapping)) {
    this.entityType.getMappingsRequiringInitialization().add(mapping);
  }
  return mapping;
}
Program: 65576
Project: 65576
Buggy source:
/** 
 * Put a bound type class to adapter class entry in the Map.
 * @param adapterClass
 * @param boundType
 */
public void addPackageLevelAdapterClass(JavaClass adapterClass,JavaClass boundType){
  packageLevelAdaptersByClass.put(boundType.getQualifiedName(),adapterClass);
}

Fixed version (ground truth):
/** 
 * Put a bound type class to adapter class entry in the Map.
 * @param adapterClass
 * @param boundType
 */
public void addPackageLevelAdapterClass(JavaClass adapterClass,JavaClass boundType){
  getPackageLevelAdaptersByClass().put(boundType.getQualifiedName(),adapterClass);
}