nus-yam/ex-repair huggingface dataset:
Program: 67377
Project: 67377
Buggy source:
public List<InputStream> getControlSchemaFiles(){
  InputStream instream=ClassLoader.getSystemResourceAsStream("String_Node_Str");
  List<InputStream> controlSchema=new ArrayList<InputStream>();
  controlSchema.add(instream);
  instream=ClassLoader.getSystemResourceAsStream("String_Node_Str");
  controlSchema.add(instream);
  instream=ClassLoader.getSystemResourceAsStream("String_Node_Str");
  controlSchema.add(instream);
  return controlSchema;
}

Fixed version (ground truth):
public Map<String,InputStream> getControlSchemaFiles(){
  InputStream instream2=ClassLoader.getSystemResourceAsStream("String_Node_Str");
  InputStream instream3=ClassLoader.getSystemResourceAsStream("String_Node_Str");
  InputStream instream1=ClassLoader.getSystemResourceAsStream("String_Node_Str");
  Map<String,InputStream> controlSchema=new HashMap<String,InputStream>();
  controlSchema.put("String_Node_Str",instream2);
  controlSchema.put("String_Node_Str",instream3);
  controlSchema.put("String_Node_Str",instream1);
  return controlSchema;
}
Program: 67378
Project: 67378
Buggy source:
public List<InputStream> getControlSchemaFiles(){
  InputStream instream=ClassLoader.getSystemResourceAsStream("String_Node_Str");
  List<InputStream> controlSchema=new ArrayList<InputStream>();
  controlSchema.add(instream);
  return controlSchema;
}

Fixed version (ground truth):
public Map<String,InputStream> getControlSchemaFiles(){
  InputStream instream=ClassLoader.getSystemResourceAsStream("String_Node_Str");
  Map<String,InputStream> controlSchema=new HashMap<String,InputStream>();
  controlSchema.put("String_Node_Str",instream);
  return controlSchema;
}
Program: 67379
Project: 67379
Buggy source:
public List<InputStream> getControlSchemaFiles(){
  InputStream instream=ClassLoader.getSystemResourceAsStream("String_Node_Str");
  List<InputStream> controlSchema=new ArrayList<InputStream>();
  controlSchema.add(instream);
  return controlSchema;
}

Fixed version (ground truth):
public Map<String,InputStream> getControlSchemaFiles(){
  InputStream instream=ClassLoader.getSystemResourceAsStream("String_Node_Str");
  Map<String,InputStream> controlSchema=new HashMap<String,InputStream>();
  controlSchema.put("String_Node_Str",instream);
  return controlSchema;
}
Program: 67380
Project: 67380
Buggy source:
public List<InputStream> getControlSchemaFiles(){
  InputStream instream=ClassLoader.getSystemResourceAsStream("String_Node_Str");
  List<InputStream> controlSchema=new ArrayList<InputStream>();
  controlSchema.add(instream);
  return controlSchema;
}

Fixed version (ground truth):
public Map<String,InputStream> getControlSchemaFiles(){
  InputStream instream=ClassLoader.getSystemResourceAsStream("String_Node_Str");
  Map<String,InputStream> controlSchema=new HashMap<String,InputStream>();
  controlSchema.put("String_Node_Str",instream);
  return controlSchema;
}
Program: 67381
Project: 67381
Buggy source:
public List<InputStream> getControlSchemaFiles(){
  InputStream instream=ClassLoader.getSystemResourceAsStream("String_Node_Str");
  List<InputStream> controlSchema=new ArrayList<InputStream>();
  controlSchema.add(instream);
  instream=ClassLoader.getSystemResourceAsStream("String_Node_Str");
  controlSchema.add(instream);
  return controlSchema;
}

Fixed version (ground truth):
public Map<String,InputStream> getControlSchemaFiles(){
  InputStream instream2=ClassLoader.getSystemResourceAsStream("String_Node_Str");
  InputStream instream1=ClassLoader.getSystemResourceAsStream("String_Node_Str");
  Map<String,InputStream> controlSchema=new HashMap<String,InputStream>();
  controlSchema.put("String_Node_Str",instream1);
  controlSchema.put("String_Node_Str",instream2);
  return controlSchema;
}
Program: 67382
Project: 67382
Buggy source:
public XMLDirectMapping(){
  super();
  nullPolicy=new NullPolicy();
  isCDATA=false;
}

Fixed version (ground truth):
public XMLDirectMapping(){
  super();
  nullPolicy=new NullPolicy();
  isCDATA=false;
  isWhitespacePreserved=false;
}
Program: 67384
Project: 67384
Buggy source:
public JAXBContext(XMLContext context,Generator generator){
  super();
  this.xmlContext=context;
  this.generator=generator;
  this.qNameToGeneratedClasses=generator.getMappingsGenerator().getQNamesToGeneratedClasses();
  this.qNamesToDeclaredClasses=generator.getMappingsGenerator().getQNamesToDeclaredClasses();
}

Fixed version (ground truth):
public JAXBContext(XMLContext context,Generator generator,Type[] boundTypes){
  super();
  this.xmlContext=context;
  this.generator=generator;
  this.qNameToGeneratedClasses=generator.getMappingsGenerator().getQNamesToGeneratedClasses();
  this.qNamesToDeclaredClasses=generator.getMappingsGenerator().getQNamesToDeclaredClasses();
  this.boundTypes=boundTypes;
}
Program: 67385
Project: 67385
Buggy source:
public void initTypeToSchemaType(){
  this.typeToSchemaType=new HashMap<Type,QName>();
  Iterator descriptors=xmlContext.getSession(0).getProject().getOrderedDescriptors().iterator();
  while (descriptors.hasNext()) {
    XMLDescriptor next=(XMLDescriptor)descriptors.next();
    Class javaClass=next.getJavaClass();
    QName schemaType=next.getSchemaReference().getSchemaContextAsQName(next.getNamespaceResolver());
    Type type;
    if (generator != null) {
      type=generator.getAnnotationsProcessor().getGeneratedClassesToCollectionClasses().get(javaClass);
      if (type == null) {
        JavaClass arrayClass=(JavaClass)generator.getAnnotationsProcessor().getGeneratedClassesToArrayClasses().get(javaClass);
        if (arrayClass != null) {
          String arrayClassName=arrayClass.getName();
          try {
            type=PrivilegedAccessHelper.getClassForName(arrayClassName);
          }
 catch (          Exception ex) {
          }
        }
      }
      if (type == null) {
        type=javaClass;
      }
    }
 else {
      type=javaClass;
    }
    this.typeToSchemaType.put(type,schemaType);
  }
}

Fixed version (ground truth):
public void initTypeToSchemaType(){
  this.typeToSchemaType=new HashMap<Type,QName>();
  Iterator descriptors=xmlContext.getSession(0).getProject().getOrderedDescriptors().iterator();
  HashMap defaults=XMLConversionManager.getDefaultJavaTypes();
  while (descriptors.hasNext()) {
    XMLDescriptor next=(XMLDescriptor)descriptors.next();
    Class javaClass=next.getJavaClass();
    QName schemaType=next.getSchemaReference().getSchemaContextAsQName(next.getNamespaceResolver());
    Type type;
    if (generator != null) {
      type=generator.getAnnotationsProcessor().getGeneratedClassesToCollectionClasses().get(javaClass);
      if (type == null) {
        JavaClass arrayClass=(JavaClass)generator.getAnnotationsProcessor().getGeneratedClassesToArrayClasses().get(javaClass);
        if (arrayClass != null) {
          String arrayClassName=arrayClass.getName();
          try {
            type=PrivilegedAccessHelper.getClassForName(arrayClassName);
          }
 catch (          Exception ex) {
          }
        }
      }
      if (type == null) {
        type=javaClass;
      }
    }
 else {
      type=javaClass;
    }
    this.typeToSchemaType.put(type,schemaType);
  }
  if (boundTypes != null) {
    for (    Type next : this.boundTypes) {
      if (this.typeToSchemaType.get(next) == null) {
        QName name=null;
        if (next instanceof Class) {
          name=this.generator.getAnnotationsProcessor().getUserDefinedSchemaTypes().get(((Class)next).getName());
        }
        if (name == null) {
          if (next == ClassConstants.ABYTE || next == ClassConstants.APBYTE) {
            name=XMLConstants.BASE_64_BINARY_QNAME;
          }
 else {
            name=(QName)defaults.get(next);
          }
        }
        if (name != null) {
          this.typeToSchemaType.put(next,name);
        }
      }
    }
  }
}
Program: 67386
Project: 67386
Buggy source:
public HashMap getUserDefinedSchemaTypes(){
  return userDefinedSchemaTypes;
}

Fixed version (ground truth):
public HashMap<String,QName> getUserDefinedSchemaTypes(){
  return userDefinedSchemaTypes;
}
Program: 67387
Project: 67387
Buggy source:
public CompositePKTableCreator(){
  setName("String_Node_Str");
  addTableDefinition(buildADMIN_CONTRACTTable());
  addTableDefinition(buildADMINTable());
  addTableDefinition(buildSCIENTISTTable());
  addTableDefinition(buildDEPARTMENTTable());
  addTableDefinition(buildDEPT_ADMINTable());
  addTableDefinition(buildCUBICLETable());
  addTableDefinition(buildSARGEANTTable());
  addTableDefinition(buildMASTERCORPORALTable());
  addTableDefinition(buildMAJORTable());
  addTableDefinition(buildMAJORGENERALTable());
  addTableDefinition(buildCAPTAINTable());
  addTableDefinition(buildBRIGADIERGENERALTable());
  addTableDefinition(buildCORPORALTable());
  addTableDefinition(buildPRIVATETable());
  addTableDefinition(buildGENERALTable());
  addTableDefinition(buildLIEUTENANTGENERALTable());
  addTableDefinition(buildLIEUTENANTTable());
  addTableDefinition(buildSECONDLIEUTENANTTable());
}

Fixed version (ground truth):
public CompositePKTableCreator(){
  setName("String_Node_Str");
  addTableDefinition(buildADMIN_CONTRACTTable());
  addTableDefinition(buildADMINTable());
  addTableDefinition(buildSCIENTISTTable());
  addTableDefinition(buildDEPARTMENTTable());
  addTableDefinition(buildDEPT_ADMINTable());
  addTableDefinition(buildCUBICLETable());
  addTableDefinition(buildSARGEANTTable());
  addTableDefinition(buildMASTERCORPORALTable());
  addTableDefinition(buildMAJORTable());
  addTableDefinition(buildMAJORGENERALTable());
  addTableDefinition(buildCAPTAINTable());
  addTableDefinition(buildBRIGADIERGENERALTable());
  addTableDefinition(buildCORPORALTable());
  addTableDefinition(buildPRIVATETable());
  addTableDefinition(buildGENERALTable());
  addTableDefinition(buildLIEUTENANTGENERALTable());
  addTableDefinition(buildLIEUTENANTTable());
  addTableDefinition(buildSECONDLIEUTENANTTable());
  addTableDefinition(buildLACKEYTable());
  addTableDefinition(buildLACKEYCREWTable());
}
Program: 67388
Project: 67388
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite();
  suite.setName("String_Node_Str");
  suite.addTest(new AdvancedCompositePKJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedCompositePKJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedCompositePKJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedCompositePKJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedCompositePKJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedCompositePKJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedCompositePKJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedCompositePKJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedCompositePKJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedCompositePKJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedCompositePKJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedCompositePKJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedCompositePKJunitTest("String_Node_Str"));
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite();
  suite.setName("String_Node_Str");
  suite.addTest(new AdvancedCompositePKJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedCompositePKJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedCompositePKJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedCompositePKJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedCompositePKJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedCompositePKJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedCompositePKJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedCompositePKJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedCompositePKJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedCompositePKJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedCompositePKJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedCompositePKJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedCompositePKJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedCompositePKJunitTest("String_Node_Str"));
  return suite;
}
Program: 67391
Project: 67391
Buggy source:
/** 
 * INTERNAL: Pull the value for the field from the key.
 * @param key Object the primary key to use to get the value for the field
 * @param field DatabaseField the field to find a value for
 * @return Object
 */
public Object getPkValueFromKeyForField(Object key,DatabaseField field,AbstractSession session){
  Object fieldValue=null;
  this.getKeyClassFields(key.getClass());
  KeyElementAccessor accessor=this.fieldToAccessorMap.get(field);
  DatabaseMapping mapping=accessor.getMapping();
  if (mapping.isDirectToFieldMapping()) {
    fieldValue=((AbstractDirectMapping)mapping).getFieldValue(accessor.getValue(key,session),session);
  }
 else {
    fieldValue=accessor.getValue(key,session);
    if (mapping.isOneToOneMapping()) {
      org.eclipse.persistence.mappings.OneToOneMapping refmapping=(org.eclipse.persistence.mappings.OneToOneMapping)mapping;
      DatabaseField targetKey=refmapping.getSourceToTargetKeyFields().get(field);
      CMPPolicy refPolicy=refmapping.getReferenceDescriptor().getCMPPolicy();
      if (refPolicy.isCMP3Policy()) {
        Class pkClass=refPolicy.getPKClass();
        if ((pkClass != null) && (pkClass != fieldValue.getClass()) && (!pkClass.isAssignableFrom(fieldValue.getClass()))) {
          throw new IllegalArgumentException(ExceptionLocalization.buildMessage("String_Node_Str",new Object[]{refPolicy.getPKClass(),fieldValue.getClass()}));
        }
        fieldValue=((CMP3Policy)refPolicy).getPkValueFromKeyForField(fieldValue,targetKey,session);
      }
    }
  }
  return fieldValue;
}

Fixed version (ground truth):
/** 
 * INTERNAL: Pull the value for the field from the key.
 * @param key Object the primary key to use to get the value for the field
 * @param field DatabaseField the field to find a value for
 * @return Object
 */
public Object getPkValueFromKeyForField(Object key,DatabaseField field,AbstractSession session){
  Object fieldValue=null;
  this.getKeyClassFields(key.getClass());
  KeyElementAccessor accessor=this.fieldToAccessorMap.get(field);
  DatabaseMapping mapping=accessor.getMapping();
  if (mapping.isDirectToFieldMapping()) {
    fieldValue=((AbstractDirectMapping)mapping).getFieldValue(accessor.getValue(key,session),session);
  }
 else {
    fieldValue=accessor.getValue(key,session);
    if (mapping.isOneToOneMapping()) {
      OneToOneMapping refmapping=(OneToOneMapping)mapping;
      DatabaseField targetKey=refmapping.getSourceToTargetKeyFields().get(accessor.getDatabaseField());
      CMPPolicy refPolicy=refmapping.getReferenceDescriptor().getCMPPolicy();
      if (refPolicy.isCMP3Policy()) {
        Class pkClass=refPolicy.getPKClass();
        if ((pkClass != null) && (pkClass != fieldValue.getClass()) && (!pkClass.isAssignableFrom(fieldValue.getClass()))) {
          throw new IllegalArgumentException(ExceptionLocalization.buildMessage("String_Node_Str",new Object[]{refPolicy.getPKClass(),fieldValue.getClass()}));
        }
        fieldValue=((CMP3Policy)refPolicy).getPkValueFromKeyForField(fieldValue,targetKey,session);
      }
    }
  }
  return fieldValue;
}
Program: 67392
Project: 67392
Buggy source:
public static XMLDescriptor buildDescriptor(){
  XMLDescriptor descriptor=new XMLDescriptor();
  descriptor.setJavaClass(MWReportAttributeItem.class);
  descriptor.getInheritancePolicy().setParentClass(MWAttributeItem.class);
  descriptor.addDirectMapping("String_Node_Str","String_Node_Str");
  AbstractDirectMapping functionMapping=(AbstractDirectMapping)descriptor.addDirectMapping("String_Node_Str","String_Node_Str");
  ObjectTypeConverter converter=new ObjectTypeConverter(functionMapping);
  converter.addConversionValue(AVERAGE_FUNCTION,AVERAGE_FUNCTION);
  converter.addConversionValue(COUNT_FUNCTION,COUNT_FUNCTION);
  converter.addConversionValue(DISTINCT_FUNCTION,DISTINCT_FUNCTION);
  converter.addConversionValue(MAXIMUM_FUNCTION,MAXIMUM_FUNCTION);
  converter.addConversionValue(MINIMUM_FUNCTION,MINIMUM_FUNCTION);
  converter.addConversionValue(STANDARD_DEVIATION_FUNCTION,STANDARD_DEVIATION_FUNCTION);
  converter.addConversionValue(VARIANCE_FUNCTION,VARIANCE_FUNCTION);
  converter.addConversionValue(SUM_FUNCTION,SUM_FUNCTION);
  functionMapping.setNullValue(NO_FUNCTION);
  return descriptor;
}

Fixed version (ground truth):
public static XMLDescriptor buildDescriptor(){
  XMLDescriptor descriptor=new XMLDescriptor();
  descriptor.setJavaClass(MWReportAttributeItem.class);
  descriptor.getInheritancePolicy().setParentClass(MWAttributeItem.class);
  descriptor.addDirectMapping("String_Node_Str","String_Node_Str");
  AbstractDirectMapping functionMapping=(AbstractDirectMapping)descriptor.addDirectMapping("String_Node_Str","String_Node_Str");
  ObjectTypeConverter converter=new ObjectTypeConverter(functionMapping);
  converter.addConversionValue(AVERAGE_FUNCTION,AVERAGE_FUNCTION);
  converter.addConversionValue(COUNT_FUNCTION,COUNT_FUNCTION);
  converter.addConversionValue(DISTINCT_FUNCTION,DISTINCT_FUNCTION);
  converter.addConversionValue(MAXIMUM_FUNCTION,MAXIMUM_FUNCTION);
  converter.addConversionValue(MINIMUM_FUNCTION,MINIMUM_FUNCTION);
  converter.addConversionValue(STANDARD_DEVIATION_FUNCTION,STANDARD_DEVIATION_FUNCTION);
  converter.addConversionValue(VARIANCE_FUNCTION,VARIANCE_FUNCTION);
  converter.addConversionValue(SUM_FUNCTION,SUM_FUNCTION);
  functionMapping.setConverter(converter);
  functionMapping.setNullValue(NO_FUNCTION);
  return descriptor;
}
Program: 67394
Project: 67394
Buggy source:
/** 
 * INTERNAL: Write LOB value - Oracle 10 deprecates some methods used in the superclass
 */
@Override public void writeLOB(DatabaseField field,Object value,ResultSet resultSet,AbstractSession session) throws SQLException {
  if (isBlob(field.getType())) {
    java.sql.Blob blob=(oracle.sql.BLOB)resultSet.getObject(field.getName());
    blob.setBytes(1,(byte[])value);
    session.log(SessionLog.FINEST,SessionLog.SQL,"String_Node_Str",new Long(blob.length()),field.getName());
  }
 else   if (isClob(field.getType())) {
    java.sql.Clob clob=(oracle.sql.CLOB)resultSet.getObject(field.getName());
    clob.setString(1,(String)value);
    session.log(SessionLog.FINEST,SessionLog.SQL,"String_Node_Str",new Long(clob.length()),field.getName());
  }
 else {
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Write LOB value - Oracle 10 deprecates some methods used in the superclass
 */
@Override public void writeLOB(DatabaseField field,Object value,ResultSet resultSet,AbstractSession session) throws SQLException {
  if (isBlob(field.getType())) {
    java.sql.Blob blob=(java.sql.Blob)resultSet.getObject(field.getName());
    blob.setBytes(1,(byte[])value);
    session.log(SessionLog.FINEST,SessionLog.SQL,"String_Node_Str",new Long(blob.length()),field.getName());
  }
 else   if (isClob(field.getType())) {
    java.sql.Clob clob=(java.sql.Clob)resultSet.getObject(field.getName());
    clob.setString(1,(String)value);
    session.log(SessionLog.FINEST,SessionLog.SQL,"String_Node_Str",new Long(clob.length()),field.getName());
  }
 else {
  }
}
Program: 67395
Project: 67395
Buggy source:
/** 
 * Convenience method that processes a given map of QName-Type entries.  For each an ElementDeclaration is created and added to the given AnnotationsProcessor instance's map of global elements. It is assumed that the map of QName-Type entries contains Type instances that are either a Class or a ParameterizedType.
 * @param additionalGlobalElements
 * @param annotationsProcessor
 */
private void processAdditionalElements(Map<QName,Type> additionalGlobalElements,AnnotationsProcessor annotationsProcessor){
  if (additionalGlobalElements != null) {
    ElementDeclaration declaration;
    for (Iterator<QName> keyIt=additionalGlobalElements.keySet().iterator(); keyIt.hasNext(); ) {
      QName key=keyIt.next();
      Type type=additionalGlobalElements.get(key);
      JavaClass jClass;
      if (type.getClass().isAssignableFrom(Class.class)) {
        Class tClass=(Class)type;
        if (tClass.isArray()) {
          jClass=helper.getJavaClass(annotationsProcessor.getArrayClassesToGeneratedClasses().get(tClass.getCanonicalName()));
        }
 else {
          jClass=helper.getJavaClass(tClass);
        }
      }
 else {
        jClass=helper.getJavaClass(annotationsProcessor.getCollectionClassesToGeneratedClasses().get(type));
      }
      if (jClass != null) {
        declaration=new ElementDeclaration(key,jClass,jClass.getQualifiedName(),false);
        annotationsProcessor.getGlobalElements().put(key,declaration);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Convenience method that processes a given map of QName-Type entries.  For each an ElementDeclaration is created and added to the given AnnotationsProcessor instance's map of global elements. It is assumed that the map of QName-Type entries contains Type instances that are either a Class or a ParameterizedType.
 * @param additionalGlobalElements
 * @param annotationsProcessor
 */
private void processAdditionalElements(Map<QName,Type> additionalGlobalElements,AnnotationsProcessor annotationsProcessor){
  if (additionalGlobalElements != null) {
    ElementDeclaration declaration;
    for (Iterator<QName> keyIt=additionalGlobalElements.keySet().iterator(); keyIt.hasNext(); ) {
      QName key=keyIt.next();
      Type type=additionalGlobalElements.get(key);
      JavaClass jClass;
      if (type instanceof Class) {
        Class tClass=(Class)type;
        if (tClass.isArray()) {
          jClass=helper.getJavaClass(annotationsProcessor.getArrayClassesToGeneratedClasses().get(tClass.getCanonicalName()));
        }
 else {
          jClass=helper.getJavaClass(tClass);
        }
      }
 else {
        jClass=helper.getJavaClass(annotationsProcessor.getCollectionClassesToGeneratedClasses().get(type));
      }
      if (jClass != null) {
        declaration=new ElementDeclaration(key,jClass,jClass.getQualifiedName(),false);
        annotationsProcessor.getGlobalElements().put(key,declaration);
      }
    }
  }
}
Program: 67396
Project: 67396
Buggy source:
/** 
 * Generates a Map of EclipseLink schema model Schema objects for a given list of XMLDescriptors. The descriptors are assumed to have been initialized.  One Schema  object will be generated  per namespace.
 * @param descriptorsToProcess list of XMLDescriptors which will be used to generate Schema objects
 * @param properties holds a namespace to Properties map containing schema settings, such as elementFormDefault 
 * @return a map of namespaces to EclipseLink schema model Schema objects
 * @throws DescriptorException if the reference descriptor for a composite mapping is not in the list of descriptors
 * @see Schema
 */
public Map<String,Schema> generateSchemas(List<XMLDescriptor> descriptorsToProcess,SchemaModelGeneratorProperties properties,SchemaModelOutputResolver outputResolver) throws DescriptorException {
  Map<String,Schema> schemas=generateSchemas(descriptorsToProcess,properties);
  Project proj=new SchemaModelProject();
  XMLContext context=new XMLContext(proj);
  XMLMarshaller marshaller=context.createMarshaller();
  XMLDescriptor schemaDescriptor=(XMLDescriptor)proj.getDescriptor(Schema.class);
  int schemaCount=0;
  for (  String key : schemas.keySet()) {
    Schema schema=schemas.get(key);
    try {
      NamespaceResolver schemaNamespaces=schema.getNamespaceResolver();
      schemaNamespaces.put(XMLConstants.SCHEMA_PREFIX,"String_Node_Str");
      schemaDescriptor.setNamespaceResolver(schemaNamespaces);
      javax.xml.transform.Result target=outputResolver.createOutput(schema.getTargetNamespace(),schema.getName());
      marshaller.marshal(schema,target);
      schemaCount++;
    }
 catch (    IOException ex) {
      ex.printStackTrace();
    }
  }
  return schemas;
}

Fixed version (ground truth):
/** 
 * Generates a Map of EclipseLink schema model Schema objects for a given list of XMLDescriptors. The descriptors are assumed to have been initialized.  One Schema  object will be generated  per namespace.
 * @param descriptorsToProcess list of XMLDescriptors which will be used to generate Schema objects
 * @param properties holds a namespace to Properties map containing schema settings, such as elementFormDefault 
 * @return a map of namespaces to EclipseLink schema model Schema objects
 * @throws DescriptorException if the reference descriptor for a composite mapping is not in the list of descriptors
 * @see Schema
 */
public Map<String,Schema> generateSchemas(List<XMLDescriptor> descriptorsToProcess,SchemaModelGeneratorProperties properties,SchemaModelOutputResolver outputResolver) throws DescriptorException {
  return generateSchemas(descriptorsToProcess,properties,outputResolver,null);
}
Program: 67399
Project: 67399
Buggy source:
public boolean marshal(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,AbstractSession session,NamespaceResolver namespaceResolver){
  Object value=xmlChoiceMapping.getAttributeValueFromObject(object);
  if (value instanceof XMLRoot) {
    XMLRoot root=(XMLRoot)value;
    XPathFragment fragment=this.xmlField.getXPathFragment();
    while (fragment != null && !fragment.nameIsText) {
      if (fragment.getNextFragment() == null || fragment.getHasText()) {
        if (fragment.getLocalName().equals(root.getLocalName())) {
          String fragUri=fragment.getNamespaceURI();
          String namespaceUri=root.getNamespaceURI();
          if ((namespaceUri == null && fragUri == null) || (namespaceUri != null && fragUri != null && namespaceUri.equals(fragUri))) {
            return this.choiceElementNodeValue.marshal(xPathFragment,marshalRecord,object,session,namespaceResolver);
          }
        }
      }
      fragment=fragment.getNextFragment();
    }
  }
 else {
    if (value != null && xmlChoiceMapping.getClassToFieldMappings().get(value.getClass()) == this.xmlField) {
      return this.choiceElementNodeValue.marshal(xPathFragment,marshalRecord,object,session,namespaceResolver);
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean marshal(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,AbstractSession session,NamespaceResolver namespaceResolver){
  Object value=xmlChoiceMapping.getAttributeValueFromObject(object);
  if (value instanceof XMLRoot) {
    XMLRoot root=(XMLRoot)value;
    XPathFragment fragment=this.xmlField.getXPathFragment();
    while (fragment != null && !fragment.nameIsText) {
      if (fragment.getNextFragment() == null || fragment.getHasText()) {
        if (fragment.getLocalName().equals(root.getLocalName())) {
          String fragUri=fragment.getNamespaceURI();
          String namespaceUri=root.getNamespaceURI();
          if ((namespaceUri == null && fragUri == null) || (namespaceUri != null && fragUri != null && namespaceUri.equals(fragUri))) {
            return this.choiceElementNodeValue.marshal(xPathFragment,marshalRecord,object,session,namespaceResolver);
          }
        }
      }
      fragment=fragment.getNextFragment();
    }
    if (root.getObject() != null && xmlChoiceMapping.getClassToFieldMappings().get(root.getObject().getClass()) == this.xmlField) {
      return this.choiceElementNodeValue.marshal(xPathFragment,marshalRecord,object,session,namespaceResolver);
    }
  }
 else {
    if (value != null && xmlChoiceMapping.getClassToFieldMappings().get(value.getClass()) == this.xmlField) {
      return this.choiceElementNodeValue.marshal(xPathFragment,marshalRecord,object,session,namespaceResolver);
    }
  }
  return false;
}
Program: 67400
Project: 67400
Buggy source:
public void initialize(AbstractSession session) throws DescriptorException {
  super.initialize(session);
  if (this.fieldToClassMappings.size() == 0) {
    this.convertClassNamesToClasses(((XMLConversionManager)session.getDatasourcePlatform().getConversionManager()).getLoader());
  }
  Iterator<XMLMapping> mappings=getChoiceElementMappings().values().iterator();
  while (mappings.hasNext()) {
    DatabaseMapping nextMapping=(DatabaseMapping)mappings.next();
    nextMapping.setDescriptor(getDescriptor());
    nextMapping.setAttributeName(this.getAttributeName());
    nextMapping.setAttributeAccessor(getAttributeAccessor());
    Converter converter=null;
    if (fieldsToConverters != null) {
      converter=fieldsToConverters.get(nextMapping.getField());
    }
    if (nextMapping.isAbstractDirectMapping()) {
      if (converter != null) {
        ((AbstractDirectMapping)nextMapping).setConverter(converter);
      }
      XMLConversionManager xmlConversionManager=(XMLConversionManager)session.getDatasourcePlatform().getConversionManager();
      QName schemaType=(QName)xmlConversionManager.getDefaultJavaTypes().get(nextMapping.getAttributeClassification());
      if (schemaType != null) {
        ((XMLField)nextMapping.getField()).setSchemaType(schemaType);
      }
    }
 else {
      if (converter != null) {
        ((AbstractCompositeObjectMapping)nextMapping).setConverter(converter);
      }
    }
    nextMapping.initialize(session);
  }
}

Fixed version (ground truth):
public void initialize(AbstractSession session) throws DescriptorException {
  super.initialize(session);
  if (this.fieldToClassMappings.size() == 0) {
    this.convertClassNamesToClasses(((XMLConversionManager)session.getDatasourcePlatform().getConversionManager()).getLoader());
  }
  Iterator<XMLMapping> mappings=getChoiceElementMappings().values().iterator();
  while (mappings.hasNext()) {
    DatabaseMapping nextMapping=(DatabaseMapping)mappings.next();
    nextMapping.setDescriptor(getDescriptor());
    nextMapping.setAttributeName(this.getAttributeName());
    nextMapping.setAttributeAccessor(getAttributeAccessor());
    Converter converter=null;
    if (fieldsToConverters != null) {
      converter=fieldsToConverters.get(nextMapping.getField());
    }
    if (nextMapping.isAbstractDirectMapping()) {
      if (converter != null) {
        ((AbstractDirectMapping)nextMapping).setConverter(converter);
      }
      XMLConversionManager xmlConversionManager=(XMLConversionManager)session.getDatasourcePlatform().getConversionManager();
      QName schemaType=(QName)xmlConversionManager.getDefaultJavaTypes().get(nextMapping.getAttributeClassification());
      if (schemaType != null && ((XMLField)nextMapping.getField()).getSchemaType() == null) {
        ((XMLField)nextMapping.getField()).setSchemaType(schemaType);
      }
    }
 else {
      if (converter != null) {
        ((AbstractCompositeObjectMapping)nextMapping).setConverter(converter);
      }
    }
    nextMapping.initialize(session);
  }
}
Program: 67403
Project: 67403
Buggy source:
public XmlAdapterCompositeTestCases(String name) throws Exception {
  super(name);
  setControlDocument(XML_RESOURCE);
  Class[] classes=new Class[3];
  classes[0]=MyMap.class;
  classes[1]=MyHashMapType.class;
  classes[2]=MyHashMapEntryType.class;
  setClasses(classes);
}

Fixed version (ground truth):
public XmlAdapterCompositeTestCases(String name) throws Exception {
  super(name);
  setControlDocument(XML_RESOURCE);
  Class[] classes=new Class[1];
  classes[0]=MyMap.class;
  setClasses(classes);
}
Program: 67407
Project: 67407
Buggy source:
public void setAdapterClass(JavaClass adapterCls){
  adapterClass=adapterCls;
  valueType=helper.getJavaClass(Object.class);
  for (Iterator<JavaMethod> methodIt=adapterClass.getMethods().iterator(); methodIt.hasNext(); ) {
    JavaMethod method=methodIt.next();
    if (method.getName().equals("String_Node_Str")) {
      valueType=(JavaClass)method.getReturnType();
      break;
    }
  }
}

Fixed version (ground truth):
public void setAdapterClass(JavaClass adapterCls){
  adapterClass=adapterCls;
  valueType=helper.getJavaClass(Object.class);
  for (Iterator<JavaMethod> methodIt=adapterClass.getDeclaredMethods().iterator(); methodIt.hasNext(); ) {
    JavaMethod method=methodIt.next();
    if (method.getName().equals("String_Node_Str")) {
      valueType=(JavaClass)method.getReturnType();
      break;
    }
  }
}
Program: 67408
Project: 67408
Buggy source:
/** 
 * Default constructor.
 */
public AggregateObjectMapping(){
  aggregateToSourceFieldNames=new HashMap(5);
  isNullAllowed=true;
}

Fixed version (ground truth):
/** 
 * Default constructor.
 */
public AggregateObjectMapping(){
  aggregateToSourceFieldNames=new HashMap(5);
  overrideManyToManyMappings=new ArrayList<ManyToManyMapping>();
  overrideUnidirectionalOneToManyMappings=new ArrayList<UnidirectionalOneToManyMapping>();
  isNullAllowed=true;
}
Program: 67410
Project: 67410
Buggy source:
/** 
 * INTERNAL: The mapping clones itself to create deep copy.
 */
public Object clone(){
  ManyToManyMapping clone=(ManyToManyMapping)super.clone();
  clone.setTargetKeyFields(cloneFields(getTargetKeyFields()));
  clone.setSourceKeyFields(cloneFields(getSourceKeyFields()));
  clone.setTargetRelationKeyFields(cloneFields(getTargetRelationKeyFields()));
  clone.setSourceRelationKeyFields(cloneFields(getSourceRelationKeyFields()));
  return clone;
}

Fixed version (ground truth):
/** 
 * INTERNAL: The mapping clones itself to create deep copy.
 */
public Object clone(){
  ManyToManyMapping clone=(ManyToManyMapping)super.clone();
  clone.setTargetKeyFields(cloneFields(getTargetKeyFields()));
  clone.setSourceKeyFields(cloneFields(getSourceKeyFields()));
  clone.setTargetRelationKeyFields(cloneFields(getTargetRelationKeyFields()));
  clone.setSourceRelationKeyFields(cloneFields(getSourceRelationKeyFields()));
  clone.setInsertQuery((DataModifyQuery)insertQuery.clone());
  clone.setDeleteQuery((DataModifyQuery)deleteQuery.clone());
  return clone;
}
Program: 67411
Project: 67411
Buggy source:
/** 
 * INTERNAL: Clone the appropriate attributes.
 */
public Object clone(){
  OneToManyMapping clone=(OneToManyMapping)super.clone();
  clone.setTargetForeignKeysToSourceKeys(new HashMap(getTargetForeignKeysToSourceKeys()));
  return clone;
}

Fixed version (ground truth):
/** 
 * INTERNAL: Clone the appropriate attributes.
 */
public Object clone(){
  OneToManyMapping clone=(OneToManyMapping)super.clone();
  clone.setTargetForeignKeysToSourceKeys(new HashMap(getTargetForeignKeysToSourceKeys()));
  clone.addTargetQuery=(DataModifyQuery)this.addTargetQuery.clone();
  clone.removeTargetQuery=(DataModifyQuery)this.removeTargetQuery.clone();
  clone.removeAllTargetsQuery=(DataModifyQuery)this.removeAllTargetsQuery.clone();
  return clone;
}
Program: 67412
Project: 67412
Buggy source:
/** 
 * Initialize the type of the target foreign key, as it will be null as it is not mapped in the target.
 */
public void postInitialize(AbstractSession session){
  super.postInitialize(session);
  Iterator<DatabaseField> targetForeignKeys=getTargetForeignKeyFields().iterator();
  Iterator<DatabaseField> sourceKeys=getSourceKeyFields().iterator();
  while (targetForeignKeys.hasNext()) {
    DatabaseField targetForeignKey=targetForeignKeys.next();
    DatabaseField sourcePrimaryKey=sourceKeys.next();
    if (targetForeignKey.getType() == null) {
      targetForeignKey.setType(getDescriptor().getObjectBuilder().getMappingForField(sourcePrimaryKey).getFieldClassification(sourcePrimaryKey));
    }
  }
}

Fixed version (ground truth):
/** 
 * Initialize the type of the target foreign key, as it will be null as it is not mapped in the target.
 */
public void postInitialize(AbstractSession session){
  super.postInitialize(session);
  Iterator<DatabaseField> targetForeignKeys=getTargetForeignKeyFields().iterator();
  Iterator<DatabaseField> sourceKeys=getSourceKeyFields().iterator();
  while (targetForeignKeys.hasNext()) {
    DatabaseField targetForeignKey=targetForeignKeys.next();
    DatabaseField sourcePrimaryKey=sourceKeys.next();
    if (targetForeignKey.getType() == null) {
      DatabaseMapping mapping=getDescriptor().getObjectBuilder().getMappingForField(sourcePrimaryKey);
      if (mapping != null) {
        targetForeignKey.setType(mapping.getFieldClassification(sourcePrimaryKey));
      }
    }
  }
}
Program: 67413
Project: 67413
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTestSuite(SchemaGenEmployeeTestCases.class);
  suite.addTestSuite(SchemaGenXMLTypeTestCases.class);
  suite.addTestSuite(SchemaGenXMLRootElementTestCases.class);
  suite.addTestSuite(DeploymentXMLSchemaGenTestCases.class);
  suite.addTestSuite(SchemaGenXmlElementWrapperTestCases.class);
  suite.addTestSuite(SchemaGenXmlElementRefTestCases.class);
  suite.addTestSuite(SchemaGenXmlListTestCases.class);
  suite.addTestSuite(SchemaGenXmlIDTestCases.class);
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTestSuite(SchemaGenEmployeeTestCases.class);
  suite.addTestSuite(SchemaGenXMLTypeTestCases.class);
  suite.addTestSuite(SchemaGenXMLRootElementTestCases.class);
  suite.addTestSuite(DeploymentXMLSchemaGenTestCases.class);
  suite.addTestSuite(SchemaGenXmlElementWrapperTestCases.class);
  suite.addTestSuite(SchemaGenXmlElementRefTestCases.class);
  suite.addTestSuite(SchemaGenXmlListTestCases.class);
  suite.addTestSuite(SchemaGenXmlIDTestCases.class);
  suite.addTestSuite(SchemaGenXmlIDREFTestCases.class);
  return suite;
}
Program: 67416
Project: 67416
Buggy source:
/** 
 * INTERNAL: Return if add/remove should trigger instantiation or avoid. Current instantiation is avoided is using change tracking.
 */
protected boolean shouldAvoidInstantiation(){
  return (!isInstantiated()) && (_persistence_getPropertyChangeListener() instanceof AttributeChangeListener) && !usesListOrderField();
}

Fixed version (ground truth):
/** 
 * INTERNAL: Return if add/remove should trigger instantiation or avoid. Current instantiation is avoided is using change tracking.
 */
protected boolean shouldAvoidInstantiation(){
  return (!isInstantiated()) && (_persistence_getPropertyChangeListener() instanceof AttributeChangeListener) && !usesListOrderField()&& ((WeavedAttributeValueHolderInterface)getValueHolder()).shouldAllowInstantiationDeferral();
}
Program: 67417
Project: 67417
Buggy source:
/** 
 * INTERNAL: Return if add/remove should trigger instantiation or avoid. Current instantiation is avoided is using change tracking.
 */
protected boolean shouldAvoidInstantiation(){
  return (!isInstantiated()) && (_persistence_getPropertyChangeListener() instanceof AttributeChangeListener);
}

Fixed version (ground truth):
/** 
 * INTERNAL: Return if add/remove should trigger instantiation or avoid. Current instantiation is avoided is using change tracking.
 */
protected boolean shouldAvoidInstantiation(){
  return (!isInstantiated()) && (_persistence_getPropertyChangeListener() instanceof AttributeChangeListener) && ((WeavedAttributeValueHolderInterface)getValueHolder()).shouldAllowInstantiationDeferral();
}
Program: 67419
Project: 67419
Buggy source:
public void addRequiredSystems(){
  addRequiredSystem(new org.eclipse.persistence.testing.models.employee.relational.EmployeeSystem());
}

Fixed version (ground truth):
public void addRequiredSystems(){
  addRequiredSystem(new org.eclipse.persistence.testing.models.employee.relational.EmployeeSystem());
  addRequiredSystem(new org.eclipse.persistence.testing.models.insurance.InsuranceSystem());
}
Program: 67421
Project: 67421
Buggy source:
/** 
 * Clean up the cached object data and only revert the fetch group data back to the cached object.
 */
private void revertFetchGroupData(Object domainObject,ClassDescriptor concreteDescriptor,CacheKey cacheKey,ObjectBuildingQuery query,JoinedAttributeManager joinManager,AbstractRecord databaseRow,AbstractSession session){
  concreteDescriptor.getFetchGroupManager().reset(domainObject);
  concreteDescriptor.getFetchGroupManager().setObjectFetchGroup(domainObject,query.getFetchGroup(),session);
  concreteDescriptor.getObjectBuilder().buildAttributesIntoObject(domainObject,databaseRow,query,joinManager,false);
  concreteDescriptor.getFetchGroupManager().setRefreshOnFetchGroupToObject(domainObject,(query.shouldRefreshIdentityMapResult() || concreteDescriptor.shouldAlwaysRefreshCache()));
  cacheKey.setLastUpdatedQueryId(query.getQueryId());
  if (concreteDescriptor.usesOptimisticLocking()) {
    OptimisticLockingPolicy policy=concreteDescriptor.getOptimisticLockingPolicy();
    cacheKey.setWriteLockValue(policy.getValueToPutInCache(databaseRow,session));
  }
  cacheKey.setReadTime(query.getExecutionTime());
  cacheKey.setInvalidationState(CacheKey.CHECK_INVALIDATION_POLICY);
}

Fixed version (ground truth):
/** 
 * Clean up the cached object data and only revert the fetch group data back to the cached object.
 */
private void revertFetchGroupData(Object domainObject,ClassDescriptor concreteDescriptor,CacheKey cacheKey,ObjectBuildingQuery query,JoinedAttributeManager joinManager,AbstractRecord databaseRow,AbstractSession session){
  concreteDescriptor.getFetchGroupManager().reset(domainObject);
  concreteDescriptor.getFetchGroupManager().setObjectFetchGroup(domainObject,query.getFetchGroup(),session);
  cacheKey.setReadTime(query.getExecutionTime());
  concreteDescriptor.getObjectBuilder().buildAttributesIntoObject(domainObject,databaseRow,query,joinManager,false);
  concreteDescriptor.getFetchGroupManager().setRefreshOnFetchGroupToObject(domainObject,(query.shouldRefreshIdentityMapResult() || concreteDescriptor.shouldAlwaysRefreshCache()));
  cacheKey.setLastUpdatedQueryId(query.getQueryId());
  if (concreteDescriptor.usesOptimisticLocking()) {
    OptimisticLockingPolicy policy=concreteDescriptor.getOptimisticLockingPolicy();
    cacheKey.setWriteLockValue(policy.getValueToPutInCache(databaseRow,session));
  }
}
Program: 67423
Project: 67423
Buggy source:
public XMLRoot unmarshal(org.w3c.dom.Node node,Class javaClass){
  validateNode(node);
  XMLRoot root=null;
  reader.setDocPresPolicy(documentPreservationPolicy);
  root=(XMLRoot)saxUnmarshaller.unmarshal(reader,node,javaClass);
  return root;
}

Fixed version (ground truth):
public XMLRoot unmarshal(org.w3c.dom.Node node,Class javaClass){
  validateNode(node);
  reader.setDocPresPolicy(documentPreservationPolicy);
  return buildXMLRootFromObject(saxUnmarshaller.unmarshal(reader,node,javaClass));
}
Program: 67428
Project: 67428
Buggy source:
protected Node objectToXMLNode(Object object,Node rootNode,XMLDescriptor descriptor,boolean isXMLRoot) throws XMLMarshalException {
  AbstractSession session=xmlContext.getSession(descriptor);
  DocumentPreservationPolicy docPresPolicy=xmlContext.getDocumentPreservationPolicy(session);
  if (docPresPolicy != null && docPresPolicy.shouldPreserveDocument()) {
    XMLRecord xmlRow=null;
    if (!isXMLRoot) {
      xmlRow=(XMLRecord)((XMLObjectBuilder)descriptor.getObjectBuilder()).createRecordFor(object,xmlContext.getDocumentPreservationPolicy(session));
      xmlRow.setMarshaller(this);
      if (xmlRow.getDOM().getNodeType() == Node.ELEMENT_NODE) {
        addDescriptorNamespacesToXMLRecord(descriptor,xmlRow);
      }
    }
    Document doc=objectToXML(object,rootNode,descriptor,xmlRow,isXMLRoot,docPresPolicy);
    if ((xmlRow != null) && (xmlRow.getDOM().getNodeType() == Node.DOCUMENT_FRAGMENT_NODE)) {
      return xmlRow.getDOM();
    }
 else {
      return doc;
    }
  }
  MarshalRecord marshalRecord=new NodeRecord();
  marshalRecord.setMarshaller(this);
  marshalRecord.getNamespaceResolver().setDOM(rootNode);
  marshal(object,marshalRecord,descriptor,isXMLRoot);
  return marshalRecord.getDocument();
}

Fixed version (ground truth):
protected Node objectToXMLNode(Object object,Node rootNode,XMLDescriptor descriptor,boolean isXMLRoot) throws XMLMarshalException {
  AbstractSession session=xmlContext.getSession(descriptor);
  DocumentPreservationPolicy docPresPolicy=xmlContext.getDocumentPreservationPolicy(session);
  if (docPresPolicy != null && docPresPolicy.shouldPreserveDocument()) {
    XMLRecord xmlRow=null;
    if (!isXMLRoot) {
      xmlRow=(XMLRecord)((XMLObjectBuilder)descriptor.getObjectBuilder()).createRecordFor(object,xmlContext.getDocumentPreservationPolicy(session));
      xmlRow.setMarshaller(this);
      if (getAttachmentMarshaller() != null) {
        xmlRow.setXOPPackage(getAttachmentMarshaller().isXOPPackage());
      }
      if (xmlRow.getDOM().getNodeType() == Node.ELEMENT_NODE) {
        addDescriptorNamespacesToXMLRecord(descriptor,xmlRow);
      }
    }
    Document doc=objectToXML(object,rootNode,descriptor,xmlRow,isXMLRoot,docPresPolicy);
    if ((xmlRow != null) && (xmlRow.getDOM().getNodeType() == Node.DOCUMENT_FRAGMENT_NODE)) {
      return xmlRow.getDOM();
    }
 else {
      return doc;
    }
  }
  MarshalRecord marshalRecord=new NodeRecord();
  marshalRecord.setMarshaller(this);
  marshalRecord.getNamespaceResolver().setDOM(rootNode);
  marshal(object,marshalRecord,descriptor,isXMLRoot);
  return marshalRecord.getDocument();
}
Program: 67431
Project: 67431
Buggy source:
public void writeSingleValue(Object value,Object parent,XMLRecord record,AbstractSession session){
  XMLMarshaller marshaller=record.getMarshaller();
  XMLField field=(XMLField)getField();
  NamespaceResolver resolver=field.getNamespaceResolver();
  boolean isAttribute=field.getLastXPathFragment().isAttribute();
  String prefix=null;
  XMLField includeField=null;
  if (!isAttribute) {
    if ((marshaller.getAttachmentMarshaller() != null) && marshaller.getAttachmentMarshaller().isXOPPackage() && !isSwaRef()&& !shouldInlineBinaryData()) {
      field=(XMLField)getField();
      if (resolver != null) {
        prefix=resolver.resolveNamespaceURI(XMLConstants.XOP_URL);
      }
      if (prefix == null) {
        prefix=XMLConstants.XOP_PREFIX;
        resolver=new NamespaceResolver();
        resolver.put(prefix,XMLConstants.XOP_URL);
      }
      includeField=new XMLField(prefix + "String_Node_Str" + INCLUDE+ "String_Node_Str");
      includeField.setNamespaceResolver(resolver);
    }
 else {
      XMLField textField=new XMLField(field.getXPath() + "String_Node_Str");
      textField.setNamespaceResolver(field.getNamespaceResolver());
      textField.setSchemaType(field.getSchemaType());
      field=textField;
    }
  }
  Object valueToWrite=getValueToWrite(value,parent,record,field,includeField,session);
  record.add(field,valueToWrite);
}

Fixed version (ground truth):
public void writeSingleValue(Object value,Object parent,XMLRecord record,AbstractSession session){
  XMLMarshaller marshaller=record.getMarshaller();
  XMLField field=(XMLField)getField();
  NamespaceResolver resolver=field.getNamespaceResolver();
  boolean isAttribute=field.getLastXPathFragment().isAttribute();
  String prefix=null;
  XMLField includeField=null;
  if (!isAttribute) {
    if (record.isXOPPackage() && !isSwaRef() && !shouldInlineBinaryData()) {
      field=(XMLField)getField();
      if (resolver != null) {
        prefix=resolver.resolveNamespaceURI(XMLConstants.XOP_URL);
      }
      if (prefix == null) {
        prefix=XMLConstants.XOP_PREFIX;
        resolver=new NamespaceResolver();
        resolver.put(prefix,XMLConstants.XOP_URL);
      }
      includeField=new XMLField(prefix + "String_Node_Str" + INCLUDE+ "String_Node_Str");
      includeField.setNamespaceResolver(resolver);
    }
 else {
      XMLField textField=new XMLField(field.getXPath() + "String_Node_Str");
      textField.setNamespaceResolver(field.getNamespaceResolver());
      textField.setSchemaType(field.getSchemaType());
      field=textField;
    }
  }
  Object valueToWrite=getValueToWrite(value,parent,record,field,includeField,session);
  record.add(field,valueToWrite);
}
Program: 67434
Project: 67434
Buggy source:
private void startElementProcessText(UnmarshalRecord unmarshalRecord,Object collection){
  Object value=unmarshalRecord.getStringBuffer().toString().trim();
  unmarshalRecord.resetStringBuffer();
  if (!EMPTY_STRING.equals(value) && xmlAnyCollectionMapping.isMixedContent()) {
    unmarshalRecord.addAttributeValue(this,value);
  }
}

Fixed version (ground truth):
private void startElementProcessText(UnmarshalRecord unmarshalRecord,Object collection){
  Object value=unmarshalRecord.getStringBuffer().toString();
  unmarshalRecord.resetStringBuffer();
  if (!EMPTY_STRING.equals(value) && xmlAnyCollectionMapping.isMixedContent()) {
    unmarshalRecord.addAttributeValue(this,value);
  }
}