nus-yam/ex-repair huggingface dataset:
Program: 63588
Project: 63588
Buggy source:
/** 
 * INTERNAL: This method is used to clear the batched statements without the need to execute the statements first This is used in the case of rollback.
 */
public void clear(){
  this.sqlStrings.clear();
  this.statementCount=executionCount=0;
  this.usesOptimisticLocking=false;
  this.batchSize=0;
  this.queryTimeoutCache=DescriptorQueryManager.NoTimeout;
  this.lastCallAppended=null;
}

Fixed version (ground truth):
/** 
 * INTERNAL: This method is used to clear the batched statements without the need to execute the statements first This is used in the case of rollback.
 */
public void clear(){
  this.sqlStrings=new ArrayList();
  this.statementCount=executionCount=0;
  this.usesOptimisticLocking=false;
  this.batchSize=0;
  this.queryTimeoutCache=DescriptorQueryManager.NoTimeout;
  this.lastCallAppended=null;
}
Program: 63589
Project: 63589
Buggy source:
/** 
 * INTERNAL: This method is used by the DatabaseAccessor to clear the batched statements in the case that a non batchable statement is being executed
 */
public void executeBatchedStatements(AbstractSession session){
  if (this.parameters.isEmpty()) {
    return;
  }
  if (this.parameters.size() == 1) {
    try {
      int rowCount=(Integer)this.databaseAccessor.basicExecuteCall(this.previousCall,null,session,false);
      if (this.previousCall.hasOptimisticLock()) {
        if (rowCount != 1) {
          throw OptimisticLockException.batchStatementExecutionFailure();
        }
      }
    }
  finally {
      clear();
    }
    return;
  }
  try {
    this.databaseAccessor.incrementCallCount(session);
    if (session.shouldLog(SessionLog.FINE,SessionLog.SQL)) {
      session.log(SessionLog.FINER,SessionLog.SQL,"String_Node_Str",null,this.databaseAccessor);
      session.log(SessionLog.FINE,SessionLog.SQL,this.previousCall.getSQLString(),null,this.databaseAccessor,false);
      for (      List callParameters : this.parameters) {
        StringWriter writer=new StringWriter();
        DatabaseCall.appendLogParameters(callParameters,this.databaseAccessor,writer,session);
        session.log(SessionLog.FINE,SessionLog.SQL,writer.toString(),null,this.databaseAccessor,false);
      }
      session.log(SessionLog.FINER,SessionLog.SQL,"String_Node_Str",null,this.databaseAccessor);
    }
    PreparedStatement statement=prepareBatchStatements(session);
    this.executionCount+=this.databaseAccessor.executeJDK12BatchStatement(statement,this.lastCallAppended,session,true);
    this.databaseAccessor.writeStatementsCount++;
    if (this.previousCall.hasOptimisticLock() && (this.executionCount != this.statementCount)) {
      throw OptimisticLockException.batchStatementExecutionFailure();
    }
  }
  finally {
    this.clear();
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: This method is used by the DatabaseAccessor to clear the batched statements in the case that a non batchable statement is being executed
 */
public void executeBatchedStatements(AbstractSession session){
  if (this.parameters.isEmpty()) {
    return;
  }
  ParameterizedSQLBatchWritingMechanism currentBatch=(ParameterizedSQLBatchWritingMechanism)this.clone();
  this.clear();
  currentBatch.executeBatch(session);
}
Program: 63590
Project: 63590
Buggy source:
/** 
 * INTERNAL: This method is used to clear the batched statements without the need to execute the statements first This is used in the case of rollback.
 */
public void clear(){
  this.previousCall=null;
  this.parameters.clear();
  this.statementCount=0;
  this.executionCount=0;
  this.queryTimeoutCache=DescriptorQueryManager.NoTimeout;
  this.lastCallAppended=null;
}

Fixed version (ground truth):
/** 
 * INTERNAL: This method is used to clear the batched statements without the need to execute the statements first This is used in the case of rollback.
 */
public void clear(){
  this.previousCall=null;
  this.parameters=new ArrayList();
  this.statementCount=0;
  this.executionCount=0;
  this.queryTimeoutCache=DescriptorQueryManager.NoTimeout;
  this.lastCallAppended=null;
}
Program: 63591
Project: 63591
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTest(new AdvancedJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedJunitTest("String_Node_Str"));
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTest(new AdvancedJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedJunitTest("String_Node_Str"));
  return suite;
}
Program: 63592
Project: 63592
Buggy source:
public boolean marshal(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,CoreAbstractSession session,NamespaceResolver namespaceResolver,MarshalContext marshalContext){
  if (xmlCompositeObjectMapping.isReadOnly()) {
    return false;
  }
  int size=marshalRecord.getCycleDetectionStack().size();
  Object objectValue=marshalContext.getAttributeValue(object,xmlCompositeObjectMapping);
  if ((isInverseReference || xmlCompositeObjectMapping.getInverseReferenceMapping() != null) && objectValue != null && size >= 2) {
    Object owner=marshalRecord.getCycleDetectionStack().get(size - 2);
    if (owner.equals(objectValue)) {
      return false;
    }
  }
  return this.marshalSingleValue(xPathFragment,marshalRecord,object,objectValue,session,namespaceResolver,marshalContext);
}

Fixed version (ground truth):
public boolean marshal(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,CoreAbstractSession session,NamespaceResolver namespaceResolver,MarshalContext marshalContext){
  if (xmlCompositeObjectMapping.isReadOnly()) {
    return false;
  }
  int size=marshalRecord.getCycleDetectionStack().size();
  Object objectValue=marshalContext.getAttributeValue(object,xmlCompositeObjectMapping);
  if ((isInverseReference || xmlCompositeObjectMapping.getInverseReferenceMapping() != null) && objectValue != null && size >= 2) {
    Object owner=marshalRecord.getCycleDetectionStack().get(size - 2);
    if (objectValue.equals(owner)) {
      return false;
    }
  }
  return this.marshalSingleValue(xPathFragment,marshalRecord,object,objectValue,session,namespaceResolver,marshalContext);
}
Program: 63593
Project: 63593
Buggy source:
/** 
 * INTERNAL: Return the value of the field from the row or a value holder on the query to obtain the object. Check for batch + aggregation reading.
 */
@Override protected Object valueFromRowInternalWithJoin(AbstractRecord row,JoinedAttributeManager joinManager,ObjectBuildingQuery sourceQuery,CacheKey parentCacheKey,AbstractSession executionSession,boolean isTargetProtected) throws DatabaseException {
  Object referenceObject;
  AbstractRecord targetRow=trimRowForJoin(row,joinManager,executionSession);
  if (((joinManager != null) && joinManager.hasOuterJoinedAttributeQuery()) && !sourceQuery.hasPartialAttributeExpressions()) {
    Object key=this.referenceDescriptor.getObjectBuilder().extractPrimaryKeyFromRow(targetRow,executionSession);
    if (key == null) {
      return this.indirectionPolicy.nullValueFromRow();
    }
  }
  ObjectLevelReadQuery nestedQuery=prepareNestedJoinQueryClone(row,null,joinManager,sourceQuery,executionSession);
  nestedQuery.setTranslationRow(targetRow);
  nestedQuery.setRequiresDeferredLocks(sourceQuery.requiresDeferredLocks());
  nestedQuery.setPrefetchedCacheKeys(sourceQuery.getPrefetchedCacheKeys());
  referenceObject=this.referenceDescriptor.getObjectBuilder().buildObject(nestedQuery,targetRow);
  if (nestedQuery.shouldUseWrapperPolicy() && executionSession.isUnitOfWork()) {
    referenceObject=this.referenceDescriptor.getObjectBuilder().wrapObject(referenceObject,executionSession);
  }
  return this.indirectionPolicy.valueFromRow(referenceObject);
}

Fixed version (ground truth):
/** 
 * INTERNAL: Return the value of the field from the row or a value holder on the query to obtain the object. Check for batch + aggregation reading.
 */
@Override protected Object valueFromRowInternalWithJoin(AbstractRecord row,JoinedAttributeManager joinManager,ObjectBuildingQuery sourceQuery,CacheKey parentCacheKey,AbstractSession executionSession,boolean isTargetProtected) throws DatabaseException {
  Object referenceObject;
  AbstractRecord targetRow=trimRowForJoin(row,joinManager,executionSession);
  if (((joinManager != null) && joinManager.hasOuterJoinedAttributeQuery()) && !sourceQuery.hasPartialAttributeExpressions()) {
    Object key=this.referenceDescriptor.getObjectBuilder().extractPrimaryKeyFromRow(targetRow,executionSession);
    if (key == null) {
      return this.indirectionPolicy.nullValueFromRow();
    }
  }
  ObjectLevelReadQuery nestedQuery=prepareNestedJoinQueryClone(row,null,joinManager,sourceQuery,executionSession);
  nestedQuery.setTranslationRow(targetRow);
  nestedQuery.setRequiresDeferredLocks(sourceQuery.requiresDeferredLocks());
  nestedQuery.setPrefetchedCacheKeys(sourceQuery.getPrefetchedCacheKeys());
  nestedQuery.setShouldRefreshIdentityMapResult(sourceQuery.shouldRefreshIdentityMapResult());
  referenceObject=this.referenceDescriptor.getObjectBuilder().buildObject(nestedQuery,targetRow);
  if (nestedQuery.shouldUseWrapperPolicy() && executionSession.isUnitOfWork()) {
    referenceObject=this.referenceDescriptor.getObjectBuilder().wrapObject(referenceObject,executionSession);
  }
  return this.indirectionPolicy.valueFromRow(referenceObject);
}
Program: 63596
Project: 63596
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTest(new TestSuite(LoadWithDataHandlerGetStringTestCases.class));
  suite.addTest(new TestSuite(LoadWithDataHandlerIsSetTestCases.class));
  suite.addTest(new TestSuite(LoadSchemasWithImportAndInheritance.class));
  suite.addTest(new TestSuite(StringWrapperBug268335TestCases.class));
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTest(new TestSuite(LoadWithDataHandlerGetStringTestCases.class));
  suite.addTest(new TestSuite(LoadWithDataHandlerIsSetTestCases.class));
  suite.addTest(new TestSuite(LoadSchemasWithImportAndInheritance.class));
  suite.addTest(new TestSuite(LoadSchemasWithImportCloseStream.class));
  suite.addTest(new TestSuite(StringWrapperBug268335TestCases.class));
  return suite;
}
Program: 63598
Project: 63598
Buggy source:
/** 
 * INTERNAL: Write null values for all aggregate fields into the parent row.
 */
protected void writeNullReferenceRow(AbstractRecord record){
  List<DatabaseField> fields=getReferenceFields();
  int size=fields.size();
  for (int index=0; index < size; index++) {
    record.put(fields.get(index),null);
  }
  if (size > 0) {
    record.setNullValueInFields(true);
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Write null values for all aggregate fields into the parent row.
 */
protected void writeNullReferenceRow(AbstractRecord record){
  List<DatabaseField> fields=getReferenceFields();
  int size=fields.size();
  boolean nullInserted=false;
  for (int index=0; index < size; index++) {
    DatabaseField field=fields.get(index);
    if (!field.isReadOnly() && (field.isUpdatable() || field.isInsertable())) {
      record.put(field,null);
      nullInserted=true;
    }
  }
  if (size > 0 && nullInserted) {
    record.setNullValueInFields(true);
  }
}
Program: 63601
Project: 63601
Buggy source:
@Override public void setTableNames(Vector tableNames){
  super.setTableNames(tableNames);
}

Fixed version (ground truth):
@Override public void setTableNames(Vector tableNames){
  if (null != tableNames && tableNames.size() > 0) {
    setDefaultRootElementField((String)tableNames.get(0));
  }
  super.setTableNames(tableNames);
}
Program: 63602
Project: 63602
Buggy source:
public static RelationalDescriptor descriptor(){
  RelationalDescriptor descriptor=new RelationalDescriptor();
  descriptor.setJavaClass(TimestampInAggregateObject.class);
  descriptor.setTableName("String_Node_Str");
  descriptor.setPrimaryKeyFieldName("String_Node_Str");
  descriptor.setSequenceNumberName("String_Node_Str");
  descriptor.setSequenceNumberFieldName("String_Node_Str");
  descriptor.useTimestampLocking("String_Node_Str",false);
  descriptor.addDirectMapping("String_Node_Str","String_Node_Str");
  descriptor.addDirectMapping("String_Node_Str","String_Node_Str");
  org.eclipse.persistence.mappings.AggregateObjectMapping aggregateobjectmapping=new org.eclipse.persistence.mappings.AggregateObjectMapping();
  aggregateobjectmapping.setAttributeName("String_Node_Str");
  aggregateobjectmapping.setIsReadOnly(false);
  aggregateobjectmapping.setReferenceClass(TimestampVersion.class);
  aggregateobjectmapping.setIsNullAllowed(false);
  descriptor.addMapping(aggregateobjectmapping);
  return descriptor;
}

Fixed version (ground truth):
public static RelationalDescriptor descriptor(){
  RelationalDescriptor descriptor=new RelationalDescriptor();
  descriptor.setJavaClass(TimestampInAggregateObject.class);
  descriptor.setTableName("String_Node_Str");
  descriptor.setPrimaryKeyFieldName("String_Node_Str");
  descriptor.setSequenceNumberName("String_Node_Str");
  descriptor.setSequenceNumberFieldName("String_Node_Str");
  descriptor.useTimestampLocking("String_Node_Str",false);
  descriptor.addDirectMapping("String_Node_Str","String_Node_Str");
  descriptor.addDirectMapping("String_Node_Str","String_Node_Str");
  org.eclipse.persistence.mappings.AggregateObjectMapping aggregateobjectmapping=new org.eclipse.persistence.mappings.AggregateObjectMapping();
  aggregateobjectmapping.setAttributeName("String_Node_Str");
  aggregateobjectmapping.setIsReadOnly(false);
  aggregateobjectmapping.setReferenceClass(TimestampVersion.class);
  aggregateobjectmapping.setIsNullAllowed(true);
  descriptor.addMapping(aggregateobjectmapping);
  return descriptor;
}
Program: 63604
Project: 63604
Buggy source:
/** 
 * Return the base value that is mapped to for given field.
 */
public Object getBaseValueForField(DatabaseField databaseField,Object domainObject){
  Object valueIntoObject=domainObject;
  DatabaseMapping mapping=getMappingForField(databaseField);
  while (mapping.isAggregateObjectMapping()) {
    valueIntoObject=mapping.getAttributeValueFromObject(valueIntoObject);
    mapping=((AggregateMapping)mapping).getReferenceDescriptor().getObjectBuilder().getMappingForField(databaseField);
  }
  return mapping.getAttributeValueFromObject(valueIntoObject);
}

Fixed version (ground truth):
/** 
 * Return the base value that is mapped to for given field.
 */
public Object getBaseValueForField(DatabaseField databaseField,Object domainObject){
  Object valueIntoObject=domainObject;
  DatabaseMapping mapping=getMappingForField(databaseField);
  while (mapping.isAggregateObjectMapping()) {
    valueIntoObject=mapping.getAttributeValueFromObject(valueIntoObject);
    mapping=((AggregateMapping)mapping).getReferenceDescriptor().getObjectBuilder().getMappingForField(databaseField);
  }
  if (valueIntoObject == null) {
    return null;
  }
  return mapping.getAttributeValueFromObject(valueIntoObject);
}
Program: 63605
Project: 63605
Buggy source:
/** 
 * Override to control order of uniqueTables, child tablenames should be first since  getDefaultRootElement on an XMLDescriptor will return the first table.
 */
protected void updateTables(){
  Vector<DatabaseTable> childTables=getDescriptor().getTables();
  Vector<DatabaseTable> parentTables=getParentDescriptor().getTables();
  Vector<DatabaseTable> uniqueTables=Helper.concatenateUniqueVectors(childTables,parentTables);
  getDescriptor().setTables(uniqueTables);
  if (childTables.isEmpty()) {
    getDescriptor().setInternalDefaultTable();
  }
 else {
    getDescriptor().setInternalDefaultTable(uniqueTables.get(uniqueTables.indexOf(childTables.get(0))));
  }
}

Fixed version (ground truth):
/** 
 * Override to control order of uniqueTables, child tablenames should be first since  getDefaultRootElement on an XMLDescriptor will return the first table.
 */
protected void updateTables(){
  Vector<DatabaseTable> childTables=getDescriptor().getTables();
  Vector<DatabaseTable> parentTables=getParentDescriptor().getTables();
  Vector<DatabaseTable> uniqueTables=Helper.concatenateUniqueVectors(childTables,parentTables);
  getDescriptor().setTables(uniqueTables);
  if (getDescriptor().isXMLDescriptor() && getParentDescriptor().isXMLDescriptor()) {
    if (((XMLDescriptor)getDescriptor()).getDefaultRootElementField() == null) {
      ((XMLDescriptor)getDescriptor()).setDefaultRootElementField(((XMLDescriptor)getParentDescriptor()).getDefaultRootElementField());
    }
  }
  if (childTables.isEmpty()) {
    getDescriptor().setInternalDefaultTable();
  }
 else {
    getDescriptor().setInternalDefaultTable(uniqueTables.get(uniqueTables.indexOf(childTables.get(0))));
  }
}
Program: 63606
Project: 63606
Buggy source:
public Object getObject(){
  if (object == null) {
    if (this.descriptor != null) {
      if (this.unmarshaller.isResultAlwaysXMLRoot() || shouldWrap || descriptor.isResultAlwaysXMLRoot()) {
        object=this.descriptor.wrapObjectInXMLRoot(this.rootRecord,this.unmarshaller.isResultAlwaysXMLRoot());
      }
 else {
        object=this.rootRecord.getCurrentObject();
      }
    }
 else     if (documentBuilder != null) {
      Node node=documentBuilder.getDocument().getDocumentElement();
      Root root=unmarshaller.createRoot();
      root.setLocalName(node.getLocalName());
      root.setNamespaceURI(node.getNamespaceURI());
      root.setObject(node);
      object=root;
    }
 else {
      if (rootRecord != null) {
        object=this.rootRecord.getCurrentObject();
      }
    }
  }
  return this.object;
}

Fixed version (ground truth):
public Object getObject(){
  if (object == null) {
    if (this.descriptor != null) {
      if (this.unmarshaller.isResultAlwaysXMLRoot() || shouldWrap) {
        object=this.descriptor.wrapObjectInXMLRoot(this.rootRecord,this.unmarshaller.isResultAlwaysXMLRoot());
      }
 else {
        object=this.rootRecord.getCurrentObject();
      }
    }
 else     if (documentBuilder != null) {
      Node node=documentBuilder.getDocument().getDocumentElement();
      Root root=unmarshaller.createRoot();
      root.setLocalName(node.getLocalName());
      root.setNamespaceURI(node.getNamespaceURI());
      root.setObject(node);
      object=root;
    }
 else {
      if (rootRecord != null) {
        object=this.rootRecord.getCurrentObject();
      }
    }
  }
  return this.object;
}
Program: 63608
Project: 63608
Buggy source:
/** 
 * INTERNAL: Sets the tables
 */
public void setTables(Vector<DatabaseTable> theTables){
  if (null != theTables && theTables.size() > 0) {
    setDefaultRootElementField(theTables.get(0).getName());
  }
  super.setTables(theTables);
}

Fixed version (ground truth):
/** 
 * INTERNAL: Sets the tables
 */
public void setTables(Vector<DatabaseTable> theTables){
  super.setTables(theTables);
}
Program: 63609
Project: 63609
Buggy source:
@Override public void setTableNames(Vector tableNames){
  if (null != tableNames && tableNames.size() > 0) {
    setDefaultRootElementField((String)tableNames.get(0));
  }
  super.setTableNames(tableNames);
}

Fixed version (ground truth):
@Override public void setTableNames(Vector tableNames){
  super.setTableNames(tableNames);
}
Program: 63612
Project: 63612
Buggy source:
/** 
 * INTERNAL: The method validateAttributeOfInstantiatedObject(Object attributeValue) fixes the value of the attributeValue  in cases where it is null and indirection requires that it contain some specific data structure.  Return whether this will happen. This method is used to help determine if indirection has been triggered
 * @param attributeValue
 * @return
 * @see validateAttributeOfInstantiatedObject(Object attributeValue)
 */
@Override public boolean isAttributeValueFullyBuilt(Object attributeValue){
  return attributeValue != null;
}

Fixed version (ground truth):
/** 
 * INTERNAL: The method validateAttributeOfInstantiatedObject(Object attributeValue) fixes the value of the attributeValue  in cases where it is null and indirection requires that it contain some specific data structure.  Return whether this will happen. This method is used to help determine if indirection has been triggered
 * @param attributeValue
 * @return
 * @see validateAttributeOfInstantiatedObject(Object attributeValue)
 */
@Override public boolean isAttributeValueFullyBuilt(Object attributeValue){
  return attributeValue != null && !(attributeValue instanceof ValueHolder && ((ValueHolder)attributeValue).isNewlyWeavedValueHolder());
}
Program: 63618
Project: 63618
Buggy source:
/** 
 * @return true for all media types of the pattern *&#47;json and *&#47;*+json.
 */
protected boolean supportsMediaType(MediaType mediaType){
  String subtype=mediaType.getSubtype();
  return subtype.equals(JSON) || subtype.endsWith(PLUS_JSON);
}

Fixed version (ground truth):
/** 
 * @return true for all media types of the pattern *&#47;json and *&#47;*+json.
 */
protected boolean supportsMediaType(MediaType mediaType){
  if (null == mediaType) {
    return true;
  }
  String subtype=mediaType.getSubtype();
  return subtype.equals(JSON) || subtype.endsWith(PLUS_JSON);
}
Program: 63621
Project: 63621
Buggy source:
public IsolatedEmployeeProject(){
  setName("String_Node_Str");
  applyLogin();
  addDescriptor(buildAddressDescriptor());
  addDescriptor(buildEmployeeDescriptor());
  addDescriptor(buildEmploymentPeriodDescriptor());
  addDescriptor(buildPhoneNumberDescriptor());
}

Fixed version (ground truth):
public IsolatedEmployeeProject(){
  setName("String_Node_Str");
  applyLogin();
  addDescriptor(buildAddressDescriptor());
  addDescriptor(buildEmployeeDescriptor());
  addDescriptor(buildEmploymentPeriodDescriptor());
  addDescriptor(buildPhoneNumberDescriptor());
  addDescriptor(buildIsolatedParentDescriptor());
  addDescriptor(buildIsolatedChildDescriptor());
}
Program: 63626
Project: 63626
Buggy source:
public XmlSeeAlsoTest(String name) throws Exception {
  super(name);
  setControlDocument(XML_RESOURCE);
  setControlJSON(JSON_RESOURCE);
  Class[] classes=new Class[1];
  classes[0]=Animal.class;
  setClasses(classes);
}

Fixed version (ground truth):
public XmlSeeAlsoTest(String name) throws Exception {
  super(name);
  setControlDocument(XML_RESOURCE);
  setControlJSON(JSON_RESOURCE);
  Class[] classes=new Class[1];
  classes[0]=Organism.class;
  setClasses(classes);
}
Program: 63627
Project: 63627
Buggy source:
/** 
 * Process any additional classes (i.e. inner classes, @XmlSeeAlso, etc.) for a given set of JavaClasses, then completebuilding all of the required TypeInfo objects. This method is typically called after init and preBuildTypeInfo have been called.
 * @param javaClasses
 * @return updated array of JavaClasses, made up of the original classesplus any additional ones
 */
public JavaClass[] postBuildTypeInfo(JavaClass[] javaClasses){
  if (javaClasses.length == 0) {
    return javaClasses;
  }
  javaClasses=processAdditionalClasses(javaClasses);
  preBuildTypeInfo(javaClasses);
  buildTypeInfo(javaClasses);
  updateGlobalElements(javaClasses);
  return javaClasses;
}

Fixed version (ground truth):
/** 
 * Process any additional classes (i.e. inner classes, @XmlSeeAlso, etc.) for a given set of JavaClasses, then completebuilding all of the required TypeInfo objects. This method is typically called after init and preBuildTypeInfo have been called.
 * @param javaClasses
 * @return updated array of JavaClasses, made up of the original classesplus any additional ones
 */
public JavaClass[] postBuildTypeInfo(JavaClass[] javaClasses){
  if (javaClasses.length == 0) {
    return javaClasses;
  }
  ArrayList<JavaClass> originalList=new ArrayList<JavaClass>(javaClasses.length);
  for (  JavaClass next : javaClasses) {
    originalList.add(next);
  }
  javaClasses=processAdditionalClasses(javaClasses);
  preBuildTypeInfo(javaClasses);
  buildTypeInfo(javaClasses);
  updateGlobalElements(javaClasses);
  if (javaClasses.length > originalList.size()) {
    ArrayList<JavaClass> newClasses=new ArrayList(javaClasses.length - originalList.size());
    for (    JavaClass next : javaClasses) {
      if (!(originalList.contains(next))) {
        newClasses.add(next);
      }
    }
    postBuildTypeInfo(newClasses.toArray(new JavaClass[newClasses.size()]));
  }
  return javaClasses;
}
Program: 63628
Project: 63628
Buggy source:
public void endElement(String namespaceURI,String localName,String qName) throws SAXException {
  if (super.nodes.size() == 2) {
    Element endedElement=(Element)nodes.get(nodes.size() - 1);
    if (stringBuffer.length() > 0) {
      Text text=getInitializedDocument().createTextNode(stringBuffer.toString());
      endedElement.appendChild(text);
      stringBuffer.reset();
      processNamespacesForText(text.getTextContent(),endedElement);
    }
    owningRecord.getXMLReader().setContentHandler(owningRecord);
    owningRecord.endElement(namespaceURI,localName,qName);
  }
 else {
    super.endElement(namespaceURI,localName,qName);
  }
}

Fixed version (ground truth):
public void endElement(String namespaceURI,String localName,String qName) throws SAXException {
  if (super.nodes.size() == 2) {
    Element endedElement=(Element)nodes.get(nodes.size() - 1);
    if (stringBuffer.length() > 0) {
      Text text=getInitializedDocument().createTextNode(stringBuffer.toString());
      endedElement.appendChild(text);
      stringBuffer.reset();
      processNamespacesForText(text.getTextContent(),endedElement);
    }
    while (owningRecord.isSelfRecord() && owningRecord.getParentRecord() != null) {
      owningRecord=owningRecord.getParentRecord();
    }
    owningRecord.getXMLReader().setContentHandler(owningRecord);
    owningRecord.endElement(namespaceURI,localName,qName);
  }
 else {
    super.endElement(namespaceURI,localName,qName);
  }
}
Program: 63629
Project: 63629
Buggy source:
private void addSimpleAttribute(List attributes,String uri,String attributeLocalName,Tree childValueTree){
switch (childValueTree.getType()) {
case JSONLexer.STRING:
{
      String stringValue=JSONReader.string(childValueTree.getChild(0).getText());
      attributes.add(new Attribute(uri,attributeLocalName,attributeLocalName,stringValue));
      break;
    }
case JSONLexer.NUMBER:
{
    attributes.add(new Attribute(uri,attributeLocalName,attributeLocalName,childValueTree.getChild(0).getText()));
    break;
  }
case JSONLexer.TRUE:
{
  attributes.add(new Attribute(uri,attributeLocalName,attributeLocalName,TRUE));
  break;
}
case JSONLexer.FALSE:
{
attributes.add(new Attribute(uri,attributeLocalName,attributeLocalName,FALSE));
break;
}
case JSONLexer.NULL:
{
attributes.add(new Attribute(uri,attributeLocalName,attributeLocalName,Constants.EMPTY_STRING));
break;
}
}
}

Fixed version (ground truth):
private void addSimpleAttribute(List attributes,String uri,String attributeLocalName,Tree childValueTree){
switch (childValueTree.getType()) {
case JSONLexer.STRING:
{
      String stringValue=JSONReader.string(childValueTree.getChild(0).getText());
      attributes.add(new Attribute(uri,attributeLocalName,attributeLocalName,stringValue));
      break;
    }
case JSONLexer.NUMBER:
{
    attributes.add(new Attribute(uri,attributeLocalName,attributeLocalName,childValueTree.getChild(0).getText()));
    break;
  }
case JSONLexer.TRUE:
{
  attributes.add(new Attribute(uri,attributeLocalName,attributeLocalName,TRUE));
  break;
}
case JSONLexer.FALSE:
{
attributes.add(new Attribute(uri,attributeLocalName,attributeLocalName,FALSE));
break;
}
case JSONLexer.NULL:
{
break;
}
}
}
Program: 63631
Project: 63631
Buggy source:
private void addSimpleAttribute(List attributes,String uri,String attributeLocalName,JsonValue childValue){
  if (childValue.getValueType() == ValueType.STRING) {
    String stringValue=((JsonString)childValue).getString();
    attributes.add(new Attribute(uri,attributeLocalName,attributeLocalName,stringValue));
  }
 else   if (childValue.getValueType() == ValueType.NUMBER) {
    attributes.add(new Attribute(uri,attributeLocalName,attributeLocalName,((JsonNumber)childValue).toString()));
  }
 else   if (childValue.getValueType() == ValueType.NULL) {
    attributes.add(new Attribute(uri,attributeLocalName,attributeLocalName,Constants.EMPTY_STRING));
  }
 else   if (childValue.getValueType() == ValueType.FALSE) {
    attributes.add(new Attribute(uri,attributeLocalName,attributeLocalName,FALSE));
  }
 else   if (childValue.getValueType() == ValueType.TRUE) {
    attributes.add(new Attribute(uri,attributeLocalName,attributeLocalName,TRUE));
  }
}

Fixed version (ground truth):
private void addSimpleAttribute(List attributes,String uri,String attributeLocalName,JsonValue childValue){
  if (childValue.getValueType() == ValueType.STRING) {
    String stringValue=((JsonString)childValue).getString();
    attributes.add(new Attribute(uri,attributeLocalName,attributeLocalName,stringValue));
  }
 else   if (childValue.getValueType() == ValueType.NUMBER) {
    attributes.add(new Attribute(uri,attributeLocalName,attributeLocalName,((JsonNumber)childValue).toString()));
  }
 else   if (childValue.getValueType() == ValueType.NULL) {
  }
 else   if (childValue.getValueType() == ValueType.FALSE) {
    attributes.add(new Attribute(uri,attributeLocalName,attributeLocalName,FALSE));
  }
 else   if (childValue.getValueType() == ValueType.TRUE) {
    attributes.add(new Attribute(uri,attributeLocalName,attributeLocalName,TRUE));
  }
}
Program: 63637
Project: 63637
Buggy source:
private String getXPathForProperty(SDOProperty prop,boolean removeText){
  if ((prop).getXmlMapping() != null) {
    String xpath=prop.getXmlMapping().getField().getName();
    if (removeText && xpath.endsWith("String_Node_Str")) {
      xpath=xpath.substring(0,xpath.length() - 7);
    }
    return xpath;
  }
 else {
    String name=prop.getName();
    if (prop.isOpenContent()) {
      String uri=prop.getUri();
      if (uri != null) {
        String prefix=typeHelper.getNamespaceResolver().resolveNamespaceURI(uri);
        if ((prefix != null) && !prefix.equals(SDOConstants.EMPTY_STRING)) {
          return prefix + XMLConstants.COLON + name;
        }
      }
    }
    return name;
  }
}

Fixed version (ground truth):
private String getXPathForProperty(SDOProperty prop,boolean removeText,NamespaceResolver namespaceResolver){
  if ((prop).getXmlMapping() != null) {
    String xpath=prop.getXmlMapping().getField().getName();
    if (removeText && xpath.endsWith("String_Node_Str")) {
      xpath=xpath.substring(0,xpath.length() - 7);
    }
    return xpath;
  }
 else {
    String name=prop.getName();
    if (prop.isOpenContent()) {
      String uri=prop.getUri();
      if (uri != null) {
        String prefix=namespaceResolver.resolveNamespaceURI(uri);
        if ((prefix != null) && !prefix.equals(SDOConstants.EMPTY_STRING)) {
          return prefix + XMLConstants.COLON + name;
        }
      }
    }
    return name;
  }
}
Program: 63638
Project: 63638
Buggy source:
private void marshalNilAttribute(SDOProperty property,DOMRecord row){
  NamespaceResolver resolver;
  if (this.resolver == null) {
    resolver=typeHelper.getNamespaceResolver();
  }
 else {
    resolver=this.resolver;
  }
  String xsiPrefix=resolver.resolveNamespaceURI(javax.xml.XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI);
  if ((xsiPrefix == null) || xsiPrefix.equals(SDOConstants.EMPTY_STRING)) {
    this.resolver=new NamespaceResolver();
    resolver=this.resolver;
    copyNamespaces(typeHelper.getNamespaceResolver(),resolver);
    xsiPrefix=resolver.generatePrefix(XMLConstants.SCHEMA_INSTANCE_PREFIX);
    resolver.put(xsiPrefix,javax.xml.XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI);
  }
  String xPath=getXPathForProperty(property,true);
  xPath=xPath + "String_Node_Str" + xsiPrefix+ XMLConstants.COLON+ XMLConstants.SCHEMA_NIL_ATTRIBUTE;
  XMLField field=new XMLField(xPath);
  field.setNamespaceResolver(resolver);
  row.put(field,XMLConstants.BOOLEAN_STRING_TRUE);
}

Fixed version (ground truth):
private void marshalNilAttribute(SDOProperty property,DOMRecord row){
  NamespaceResolver resolver=null;
  if (property.getContainingType() != null) {
    resolver=property.getContainingType().getXmlDescriptor().getNamespaceResolver();
  }
  if (null == resolver) {
    resolver=typeHelper.getNamespaceResolver();
  }
  String xsiPrefix=resolver.resolveNamespaceURI(javax.xml.XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI);
  if ((xsiPrefix == null) || xsiPrefix.equals(SDOConstants.EMPTY_STRING)) {
    NamespaceResolver nsResolverWithXsi=new NamespaceResolver();
    copyNamespaces(resolver,nsResolverWithXsi);
    resolver=nsResolverWithXsi;
    xsiPrefix=resolver.generatePrefix(XMLConstants.SCHEMA_INSTANCE_PREFIX);
    resolver.put(xsiPrefix,javax.xml.XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI);
  }
  String xPath=getXPathForProperty(property,true,resolver);
  xPath=xPath + "String_Node_Str" + xsiPrefix+ XMLConstants.COLON+ XMLConstants.SCHEMA_NIL_ATTRIBUTE;
  XMLField field=new XMLField(xPath);
  field.setNamespaceResolver(resolver);
  row.put(field,XMLConstants.BOOLEAN_STRING_TRUE);
}
Program: 63641
Project: 63641
Buggy source:
/** 
 * INTERNAL:
 */
protected void writeValue(String value,boolean isAttribute,Writer writer){
  CharacterEscapeHandler escapeHandler=null;
  if (marshaller != null) {
    escapeHandler=marshaller.getCharacterEscapeHandler();
  }
  if (escapeHandler != null) {
    try {
      escapeHandler.escape(value.toCharArray(),0,value.length(),isAttribute,writer);
    }
 catch (    IOException e) {
      throw XMLMarshalException.marshalException(e);
    }
    return;
  }
  try {
    if ((null != encoder && encoder.maxBytesPerChar() < 4) || 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 :
    if (encoder.canEncode(character)) {
      writer.write(character);
    }
 else {
      writer.write("String_Node_Str");
      writer.write(String.valueOf((int)character));
      writer.write(';');
    }
}
}
}
 else {
writer.write(value);
}
}
 catch (IOException e) {
throw XMLMarshalException.marshalException(e);
}
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
protected void writeValue(String value,boolean isAttribute,Writer writer){
  CharacterEscapeHandler escapeHandler=null;
  if (marshaller != null) {
    escapeHandler=marshaller.getCharacterEscapeHandler();
  }
  if (escapeHandler != null) {
    try {
      escapeHandler.escape(value.toCharArray(),0,value.length(),isAttribute,writer);
    }
 catch (    IOException e) {
      throw XMLMarshalException.marshalException(e);
    }
    return;
  }
  try {
    if ((null != encoder && encoder.maxBytesPerChar() < 4) || value.indexOf('"') > -1 || value.indexOf('&') > -1 || value.indexOf('<') > -1 || value.indexOf('\n') > -1 || value.indexOf('\r') > -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;
      }
case '\n':
{
      if (isAttribute) {
        writer.write("String_Node_Str");
      }
 else {
        writer.write('\n');
      }
      break;
    }
case '\r':
{
    writer.write("String_Node_Str");
    break;
  }
default :
if (null == encoder) {
  encoder=Constants.DEFAULT_CHARSET.newEncoder();
}
if (encoder.canEncode(character)) {
writer.write(character);
}
 else {
writer.write("String_Node_Str");
writer.write(String.valueOf((int)character));
writer.write(';');
}
}
}
}
 else {
writer.write(value);
}
}
 catch (IOException e) {
throw XMLMarshalException.marshalException(e);
}
}
Program: 63642
Project: 63642
Buggy source:
/** 
 * INTERNAL: This method resolves generic types based on the ASM class metadata. Unless every other factory (e.g. APT mirror factory) respects the generic format as built from ASM this method will not work since it is very tied to it.
 */
public void resolveGenericTypes(MetadataClass child,List<String> genericTypes,MetadataClass parent,MetadataDescriptor descriptor){
  if (genericTypes != null) {
    List<String> parentGenericTypes=parent.getGenericType();
    if (parentGenericTypes != null) {
      List genericParentTemp=new ArrayList(genericTypes);
      genericParentTemp.removeAll(child.getInterfaces());
      int size=genericParentTemp.size();
      int parentIndex=0;
      for (int index=genericTypes.indexOf(parent.getName()) + 1; index < size; index++) {
        String actualTypeArgument=genericTypes.get(index);
        if (parentIndex >= parentGenericTypes.size()) {
          break;
        }
        String variable=parentGenericTypes.get(parentIndex);
        parentIndex=parentIndex + 3;
        if (actualTypeArgument.length() == 1) {
          index++;
          actualTypeArgument=genericTypes.get(index);
          descriptor.addGenericType(variable,descriptor.getGenericType(actualTypeArgument));
        }
 else {
          descriptor.addGenericType(variable,actualTypeArgument);
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: This method resolves generic types based on the ASM class metadata. Unless every other factory (e.g. APT mirror factory) respects the generic format as built from ASM this method will not work since it is very tied to it.
 */
public void resolveGenericTypes(MetadataClass child,List<String> genericTypes,MetadataClass parent,MetadataDescriptor descriptor){
  if (genericTypes != null) {
    List<String> parentGenericTypes=parent.getGenericType();
    if (parentGenericTypes != null) {
      List genericParentTemp=new ArrayList(genericTypes);
      genericParentTemp.removeAll(child.getInterfaces());
      int size=genericParentTemp.size();
      int parentIndex=0;
      for (int index=genericTypes.indexOf(parent.getName()) + 1; index < size; index++) {
        String actualTypeArgument=genericTypes.get(index);
        if (parentIndex >= parentGenericTypes.size()) {
          break;
        }
        String variable=parentGenericTypes.get(parentIndex);
        if (variable.equals(parent.getSuperclassName())) {
          break;
        }
        parentIndex=parentIndex + 3;
        if (actualTypeArgument.length() == 1) {
          index++;
          actualTypeArgument=genericTypes.get(index);
          descriptor.addGenericType(variable,descriptor.getGenericType(actualTypeArgument));
        }
 else {
          descriptor.addGenericType(variable,actualTypeArgument);
        }
      }
    }
  }
}
Program: 63644
Project: 63644
Buggy source:
/** 
 * Post process XmlAccessorType. In some cases, such as @XmlSeeAlso classes, the access type may not have been set
 * @param info
 */
private void postProcessXmlAccessorType(TypeInfo info,PackageInfo packageNamespace){
  if (!info.isSetXmlAccessType()) {
    JavaClass next=helper.getJavaClass(info.getJavaClassName()).getSuperclass();
    while (next != null && !(next.getName().equals(JAVA_LANG_OBJECT))) {
      TypeInfo parentInfo=this.typeInfo.get(next.getName());
      if (shouldGenerateTypeInfo(next)) {
        buildNewTypeInfo(new JavaClass[]{next});
        parentInfo=this.typeInfo.get(next.getName());
      }
      if (parentInfo != null && parentInfo.isSetXmlAccessType()) {
        info.setXmlAccessType(parentInfo.getXmlAccessType());
        break;
      }
      next=next.getSuperclass();
    }
    if (!(info.isSetXmlAccessType())) {
      info.setXmlAccessType(org.eclipse.persistence.jaxb.xmlmodel.XmlAccessType.fromValue(packageNamespace.getAccessType().name()));
    }
  }
}

Fixed version (ground truth):
/** 
 * Post process XmlAccessorType. In some cases, such as @XmlSeeAlso classes, the access type may not have been set
 * @param info
 */
private void postProcessXmlAccessorType(TypeInfo info,PackageInfo packageNamespace){
  if (!info.isSetXmlAccessType()) {
    JavaClass next=helper.getJavaClass(info.getJavaClassName()).getSuperclass();
    while (next != null && !(next.getName().equals(JAVA_LANG_OBJECT))) {
      TypeInfo parentInfo=this.typeInfo.get(next.getName());
      if (shouldGenerateTypeInfo(next) && typeInfo.get(next.getQualifiedName()) == null) {
        buildNewTypeInfo(new JavaClass[]{next});
        parentInfo=this.typeInfo.get(next.getName());
      }
      if (parentInfo != null && parentInfo.isSetXmlAccessType()) {
        info.setXmlAccessType(parentInfo.getXmlAccessType());
        break;
      }
      next=next.getSuperclass();
    }
    if (!(info.isSetXmlAccessType())) {
      info.setXmlAccessType(org.eclipse.persistence.jaxb.xmlmodel.XmlAccessType.fromValue(packageNamespace.getAccessType().name()));
    }
  }
}
Program: 63646
Project: 63646
Buggy source:
/** 
 * Process a given TypeInfo instance's properties.
 * @param info
 */
private void processTypeInfoProperties(JavaClass javaClass,TypeInfo info){
  ArrayList<Property> properties=info.getPropertyList();
  for (  Property property : properties) {
    processXmlID(property,javaClass,info);
    processXmlIDREF(property);
    if (property.isMap()) {
      JavaClass keyType=property.getKeyType();
      if (shouldGenerateTypeInfo(keyType)) {
        JavaClass[] jClassArray=new JavaClass[]{keyType};
        buildNewTypeInfo(jClassArray);
      }
      JavaClass valueType=property.getValueType();
      if (shouldGenerateTypeInfo(valueType)) {
        JavaClass[] jClassArray=new JavaClass[]{valueType};
        buildNewTypeInfo(jClassArray);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Process a given TypeInfo instance's properties.
 * @param info
 */
private void processTypeInfoProperties(JavaClass javaClass,TypeInfo info){
  ArrayList<Property> properties=info.getPropertyList();
  for (  Property property : properties) {
    processXmlID(property,javaClass,info);
    processXmlIDREF(property);
    if (property.isMap()) {
      JavaClass keyType=property.getKeyType();
      if (shouldGenerateTypeInfo(keyType) && typeInfo.get(keyType.getQualifiedName()) == null) {
        JavaClass[] jClassArray=new JavaClass[]{keyType};
        buildNewTypeInfo(jClassArray);
      }
      JavaClass valueType=property.getValueType();
      if (shouldGenerateTypeInfo(valueType) && typeInfo.get(valueType.getQualifiedName()) == null) {
        JavaClass[] jClassArray=new JavaClass[]{valueType};
        buildNewTypeInfo(jClassArray);
      }
    }
  }
}
Program: 63648
Project: 63648
Buggy source:
/** 
 * Process any factory methods.
 * @param javaClass
 * @param info
 */
private void processFactoryMethods(JavaClass javaClass,TypeInfo info){
  JavaMethod factoryMethod=this.factoryMethods.get(javaClass.getRawName());
  if (factoryMethod != null) {
    info.setFactoryMethodName(factoryMethod.getName());
    info.setObjectFactoryClassName(factoryMethod.getOwningClass().getQualifiedName());
    JavaClass[] paramTypes=factoryMethod.getParameterTypes();
    if (paramTypes != null && paramTypes.length > 0) {
      String[] paramTypeNames=new String[paramTypes.length];
      for (int i=0; i < paramTypes.length; i++) {
        if (shouldGenerateTypeInfo(paramTypes[i])) {
          JavaClass[] jClassArray=new JavaClass[]{paramTypes[i]};
          buildNewTypeInfo(jClassArray);
        }
        paramTypeNames[i]=paramTypes[i].getQualifiedName();
      }
      info.setFactoryMethodParamTypes(paramTypeNames);
    }
  }
}

Fixed version (ground truth):
/** 
 * Process any factory methods.
 * @param javaClass
 * @param info
 */
private void processFactoryMethods(JavaClass javaClass,TypeInfo info){
  JavaMethod factoryMethod=this.factoryMethods.get(javaClass.getRawName());
  if (factoryMethod != null) {
    info.setFactoryMethodName(factoryMethod.getName());
    info.setObjectFactoryClassName(factoryMethod.getOwningClass().getQualifiedName());
    JavaClass[] paramTypes=factoryMethod.getParameterTypes();
    if (paramTypes != null && paramTypes.length > 0) {
      String[] paramTypeNames=new String[paramTypes.length];
      for (int i=0; i < paramTypes.length; i++) {
        if (shouldGenerateTypeInfo(paramTypes[i]) && typeInfo.get(paramTypes[i].getQualifiedName()) == null) {
          JavaClass[] jClassArray=new JavaClass[]{paramTypes[i]};
          buildNewTypeInfo(jClassArray);
        }
        paramTypeNames[i]=paramTypes[i].getQualifiedName();
      }
      info.setFactoryMethodParamTypes(paramTypeNames);
    }
  }
}
Program: 63652
Project: 63652
Buggy source:
public EnumTypeInfo(Helper helper){
  super(helper);
  m_fieldNames=new ArrayList<String>();
  m_xmlEnumValues=new ArrayList<Object>();
}

Fixed version (ground truth):
public EnumTypeInfo(Helper helper,JavaClass javaClass){
  super(helper,javaClass);
  m_fieldNames=new ArrayList<String>();
  m_xmlEnumValues=new ArrayList<Object>();
}
Program: 63653
Project: 63653
Buggy source:
/** 
 * This constructor sets the Helper to be used throughout XML and Annotations processing.  Other fields are initialized here as well.
 * @param helper
 */
public TypeInfo(Helper helper){
  propertyNames=new ArrayList<String>();
  properties=new HashMap<String,Property>();
  originalProperties=new HashMap<String,Property>();
  propertyList=new ArrayList<Property>();
  xmlNameTransformer=DEFAULT_NAME_TRANSFORMER;
  isSetXmlTransient=false;
  isPreBuilt=false;
  isPostBuilt=false;
}

Fixed version (ground truth):
/** 
 * This constructor sets the Helper to be used throughout XML and Annotations processing.  Other fields are initialized here as well.
 * @param helper
 */
public TypeInfo(Helper helper,JavaClass javaClass){
  propertyNames=new ArrayList<String>();
  properties=new HashMap<String,Property>();
  originalProperties=new HashMap<String,Property>();
  propertyList=new ArrayList<Property>();
  xmlNameTransformer=DEFAULT_NAME_TRANSFORMER;
  isSetXmlTransient=false;
  isPreBuilt=false;
  isPostBuilt=false;
  this.javaClass=javaClass;
}
Program: 63654
Project: 63654
Buggy source:
private boolean hasCustomSuperClass(JavaClass arg0){
  if (arg0 == null) {
    return false;
  }
  if (!(arg0.getClass() == this.getClass())) {
    return false;
  }
  if (arg0.getName().equals("String_Node_Str")) {
    return false;
  }
  JavaClassImpl jClass=(JavaClassImpl)arg0;
  if (jClass.getSuperClassOverride() != null) {
    return true;
  }
  return hasCustomSuperClass(jClass.getSuperclass());
}

Fixed version (ground truth):
private boolean hasCustomSuperClass(JavaClass arg0){
  if (arg0 == null) {
    return false;
  }
  if (!this.javaModelImpl.hasXmlBindings()) {
    return false;
  }
  if (!(arg0.getClass() == this.getClass())) {
    return false;
  }
  if (arg0.getName().equals("String_Node_Str")) {
    return false;
  }
  JavaClassImpl jClass=(JavaClassImpl)arg0;
  if (jClass.getSuperClassOverride() != null) {
    return true;
  }
  return hasCustomSuperClass(jClass.getSuperclass());
}