nus-yam/ex-repair huggingface dataset:
Program: 64250
Project: 64250
Buggy source:
/** 
 * Identify the preferred   {@link MediaType} from the list provided. Thiswill check for JSON string or  {@link MediaType} first then XML.
 * @param types List of  {@link String} or {@link MediaType} values;
 * @return selected {@link MediaType}
 * @throws WebApplicationException with Status.UNSUPPORTED_MEDIA_TYPE if neither the JSON or XML values are found.
 */
public static MediaType mediaType(List<?> types){
  JPARSLogger.fine("String_Node_Str",new Object[]{types});
  for (int i=0; i < types.size(); i++) {
    if (isCompatible(types.get(i),new MediaType[]{MediaType.APPLICATION_JSON_TYPE})) {
      return MediaType.APPLICATION_JSON_TYPE;
    }
    if (isCompatible(types.get(i),new MediaType[]{MediaType.APPLICATION_XML_TYPE})) {
      return MediaType.APPLICATION_XML_TYPE;
    }
    if (isCompatible(types.get(i),new MediaType[]{MediaType.APPLICATION_OCTET_STREAM_TYPE})) {
      return MediaType.APPLICATION_OCTET_STREAM_TYPE;
    }
  }
  throw new WebApplicationException(Status.UNSUPPORTED_MEDIA_TYPE);
}

Fixed version (ground truth):
/** 
 * Identify the preferred   {@link MediaType} from the list provided. Thiswill check for JSON string or  {@link MediaType} first then XML.
 * @param types List of  {@link MediaType} values;
 * @return selected {@link MediaType}
 * @throws WebApplicationException with Status.UNSUPPORTED_MEDIA_TYPE if neither the JSON or XML values are found.
 */
public static MediaType mediaType(List<MediaType> types){
  if ((types != null) && (!types.isEmpty())) {
    JPARSLogger.fine("String_Node_Str",new Object[]{types});
    for (int i=0; i < types.size(); i++) {
      MediaType aMediaType=types.get(i);
      if (aMediaType.isCompatible(MediaType.APPLICATION_JSON_TYPE)) {
        return MediaType.APPLICATION_JSON_TYPE;
      }
      if (aMediaType.isCompatible(MediaType.APPLICATION_XML_TYPE)) {
        return MediaType.APPLICATION_XML_TYPE;
      }
      if (aMediaType.isCompatible(MediaType.APPLICATION_OCTET_STREAM_TYPE)) {
        return MediaType.APPLICATION_OCTET_STREAM_TYPE;
      }
    }
  }
  throw new WebApplicationException(Status.UNSUPPORTED_MEDIA_TYPE);
}
Program: 64251
Project: 64251
Buggy source:
@SuppressWarnings("String_Node_Str") @Test public void getVeeArrayEmployees(){
  Invocation invocation=new Invocation("String_Node_Str");
  Operation op=xrService.getOperation(invocation.getName());
  Object result=op.invoke(xrService,invocation);
  assertNotNull("String_Node_Str",result);
  Document doc=xmlPlatform.createDocument();
  Element ec=doc.createElement("String_Node_Str");
  doc.appendChild(ec);
  XMLMarshaller marshaller=xrService.getXMLContext().createMarshaller();
  for (  Object r : (Vector)result) {
    marshaller.marshal(r,ec);
  }
  Document controlDoc=xmlParser.parse(new StringReader(INITIAL_EMPLOYEE_COLLECTION_XML));
  assertTrue("String_Node_Str",comparer.isNodeEqual(controlDoc,doc));
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str"}) @Test public void getVeeArrayEmployees(){
  Invocation invocation=new Invocation("String_Node_Str");
  Operation op=xrService.getOperation(invocation.getName());
  Object result=op.invoke(xrService,invocation);
  assertNotNull("String_Node_Str",result);
  Document doc=xmlPlatform.createDocument();
  Element ec=doc.createElement("String_Node_Str");
  doc.appendChild(ec);
  XMLMarshaller marshaller=xrService.getXMLContext().createMarshaller();
  for (  Object r : (Vector)result) {
    marshaller.marshal(r,ec);
  }
  Document controlDoc=xmlParser.parse(new StringReader(INITIAL_EMPLOYEE_COLLECTION_XML));
  assertTrue("String_Node_Str",comparer.isNodeEqual(controlDoc,doc));
}
Program: 64253
Project: 64253
Buggy source:
@SuppressWarnings("String_Node_Str") @Test public void resetVeeArrayPhones(){
  Invocation invocation=new Invocation("String_Node_Str");
  invocation.setParameter("String_Node_Str",2);
  Phone newPhone1=new Phone();
  newPhone1.areaCode="String_Node_Str";
  newPhone1.phonenumber="String_Node_Str";
  newPhone1.type="String_Node_Str";
  Phone newPhone2=new Phone();
  newPhone2.areaCode="String_Node_Str";
  newPhone2.phonenumber="String_Node_Str";
  newPhone2.type="String_Node_Str";
  Vector newPhones=new NonSynchronizedVector();
  newPhones.add(newPhone1);
  newPhones.add(newPhone2);
  invocation.setParameter("String_Node_Str",newPhones);
  Operation op=xrService.getOperation(invocation.getName());
  Object result=op.invoke(xrService,invocation);
  assertNotNull("String_Node_Str",result);
  Document doc=xmlPlatform.createDocument();
  XMLMarshaller marshaller=xrService.getXMLContext().createMarshaller();
  marshaller.marshal(result,doc);
  Document controlDoc=xmlParser.parse(new StringReader(VALUE_1_XML));
  assertTrue("String_Node_Str",comparer.isNodeEqual(controlDoc,doc));
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Test public void resetVeeArrayPhones(){
  Invocation invocation=new Invocation("String_Node_Str");
  invocation.setParameter("String_Node_Str",2);
  Phone newPhone1=new Phone();
  newPhone1.areaCode="String_Node_Str";
  newPhone1.phonenumber="String_Node_Str";
  newPhone1.type="String_Node_Str";
  Phone newPhone2=new Phone();
  newPhone2.areaCode="String_Node_Str";
  newPhone2.phonenumber="String_Node_Str";
  newPhone2.type="String_Node_Str";
  Vector newPhones=new NonSynchronizedVector();
  newPhones.add(newPhone1);
  newPhones.add(newPhone2);
  invocation.setParameter("String_Node_Str",newPhones);
  Operation op=xrService.getOperation(invocation.getName());
  Object result=op.invoke(xrService,invocation);
  assertNotNull("String_Node_Str",result);
  Document doc=xmlPlatform.createDocument();
  XMLMarshaller marshaller=xrService.getXMLContext().createMarshaller();
  marshaller.marshal(result,doc);
  Document controlDoc=xmlParser.parse(new StringReader(VALUE_1_XML));
  assertTrue("String_Node_Str",comparer.isNodeEqual(controlDoc,doc));
}
Program: 64257
Project: 64257
Buggy source:
public boolean add(Object e){
  return ((Collection<Object>)propertiesMap.get(ITEMS_PROPERTY).getValue()).add(e);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public boolean add(Object e){
  return ((Collection<Object>)propertiesMap.get(ITEMS_PROPERTY).getValue()).add(e);
}
Program: 64258
Project: 64258
Buggy source:
public boolean containsAll(Collection<?> c){
  return ((Collection<Object>)propertiesMap.get(ITEMS_PROPERTY).getValue()).containsAll(c);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public boolean containsAll(Collection<?> c){
  return ((Collection<Object>)propertiesMap.get(ITEMS_PROPERTY).getValue()).containsAll(c);
}
Program: 64259
Project: 64259
Buggy source:
public void clear(){
  ((Collection<Object>)propertiesMap.get(ITEMS_PROPERTY).getValue()).clear();
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public void clear(){
  ((Collection<Object>)propertiesMap.get(ITEMS_PROPERTY).getValue()).clear();
}
Program: 64260
Project: 64260
Buggy source:
public boolean isEmpty(){
  return ((Collection<Object>)propertiesMap.get(ITEMS_PROPERTY).getValue()).isEmpty();
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public boolean isEmpty(){
  return ((Collection<Object>)propertiesMap.get(ITEMS_PROPERTY).getValue()).isEmpty();
}
Program: 64261
Project: 64261
Buggy source:
public boolean remove(Object o){
  return ((Collection<Object>)propertiesMap.get(ITEMS_PROPERTY).getValue()).remove(o);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public boolean remove(Object o){
  return ((Collection<Object>)propertiesMap.get(ITEMS_PROPERTY).getValue()).remove(o);
}
Program: 64262
Project: 64262
Buggy source:
public boolean contains(Object o){
  return ((Collection<Object>)propertiesMap.get(ITEMS_PROPERTY).getValue()).contains(o);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public boolean contains(Object o){
  return ((Collection<Object>)propertiesMap.get(ITEMS_PROPERTY).getValue()).contains(o);
}
Program: 64263
Project: 64263
Buggy source:
public Iterator<Object> iterator(){
  return ((Collection<Object>)propertiesMap.get(ITEMS_PROPERTY).getValue()).iterator();
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public Iterator<Object> iterator(){
  return ((Collection<Object>)propertiesMap.get(ITEMS_PROPERTY).getValue()).iterator();
}
Program: 64264
Project: 64264
Buggy source:
public boolean removeAll(Collection<?> c){
  return ((Collection<Object>)propertiesMap.get(ITEMS_PROPERTY).getValue()).removeAll(c);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public boolean removeAll(Collection<?> c){
  return ((Collection<Object>)propertiesMap.get(ITEMS_PROPERTY).getValue()).removeAll(c);
}
Program: 64265
Project: 64265
Buggy source:
public int size(){
  return ((Collection<Object>)propertiesMap.get(ITEMS_PROPERTY).getValue()).size();
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public int size(){
  return ((Collection<Object>)propertiesMap.get(ITEMS_PROPERTY).getValue()).size();
}
Program: 64266
Project: 64266
Buggy source:
public boolean addAll(Collection<? extends Object> c){
  return ((Collection<Object>)propertiesMap.get(ITEMS_PROPERTY).getValue()).addAll(c);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public boolean addAll(Collection<? extends Object> c){
  return ((Collection<Object>)propertiesMap.get(ITEMS_PROPERTY).getValue()).addAll(c);
}
Program: 64267
Project: 64267
Buggy source:
public <T>T[] toArray(T[] a){
  return ((Collection<Object>)propertiesMap.get(ITEMS_PROPERTY).getValue()).toArray(a);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public <T>T[] toArray(T[] a){
  return ((Collection<Object>)propertiesMap.get(ITEMS_PROPERTY).getValue()).toArray(a);
}
Program: 64268
Project: 64268
Buggy source:
public boolean retainAll(Collection<?> c){
  return ((Collection<Object>)propertiesMap.get(ITEMS_PROPERTY).getValue()).retainAll(c);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public boolean retainAll(Collection<?> c){
  return ((Collection<Object>)propertiesMap.get(ITEMS_PROPERTY).getValue()).retainAll(c);
}
Program: 64269
Project: 64269
Buggy source:
public boolean load(SessionManager sessionManager,ClassLoader loader){
  Document document=loadDocument(loader);
  if (getExceptionStore().isEmpty()) {
    if (document.getDocumentElement().getTagName().equals("String_Node_Str")) {
      XMLContext context=new XMLContext(new XMLSessionConfigProject_11_1_1());
      XMLUnmarshaller unmarshaller=context.createUnmarshaller();
      SessionConfigs configs=(SessionConfigs)unmarshaller.unmarshal(document);
      XRSessionsFactory factory=new XRSessionsFactory();
      Map<String,Session> sessions=factory.buildSessionConfigs(configs,loader);
      for (      Map.Entry<String,Session> entry : sessions.entrySet()) {
        if (!sessionManager.getSessions().containsKey(entry.getKey())) {
          sessionManager.addSession(entry.getKey(),entry.getValue());
        }
      }
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public boolean load(SessionManager sessionManager,ClassLoader loader){
  Document document=loadDocument(loader);
  if (getExceptionStore().isEmpty()) {
    if (document.getDocumentElement().getTagName().equals("String_Node_Str")) {
      XMLContext context=new XMLContext(new XMLSessionConfigProject_11_1_1());
      XMLUnmarshaller unmarshaller=context.createUnmarshaller();
      SessionConfigs configs=(SessionConfigs)unmarshaller.unmarshal(document);
      XRSessionsFactory factory=new XRSessionsFactory();
      Map<String,Session> sessions=factory.buildSessionConfigs(configs,loader);
      for (      Map.Entry<String,Session> entry : sessions.entrySet()) {
        if (!sessionManager.getSessions().containsKey(entry.getKey())) {
          sessionManager.addSession(entry.getKey(),entry.getValue());
        }
      }
      return true;
    }
  }
  return false;
}
Program: 64271
Project: 64271
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Test public void findAll(){
  Invocation invocation=new Invocation("String_Node_Str");
  Operation op=xrService.getOperation(invocation.getName());
  Object result=op.invoke(xrService,invocation);
  assertNotNull("String_Node_Str",result);
  XMLMarshaller marshaller=xrService.getXMLContext().createMarshaller();
  Document doc=xmlPlatform.createDocument();
  Element ec=doc.createElement("String_Node_Str");
  doc.appendChild(ec);
  for (  Object r : (Vector)result) {
    marshaller.marshal(r,ec);
  }
  Document controlDoc=xmlParser.parse(new StringReader(INLINEBINARY_COLLECTION_XML));
  assertTrue("String_Node_Str" + documentToString(controlDoc) + "String_Node_Str"+ documentToString(doc),comparer.isNodeEqual(controlDoc,doc));
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str"}) @Test public void findAll(){
  Invocation invocation=new Invocation("String_Node_Str");
  Operation op=xrService.getOperation(invocation.getName());
  Object result=op.invoke(xrService,invocation);
  assertNotNull("String_Node_Str",result);
  XMLMarshaller marshaller=xrService.getXMLContext().createMarshaller();
  Document doc=xmlPlatform.createDocument();
  Element ec=doc.createElement("String_Node_Str");
  doc.appendChild(ec);
  for (  Object r : (Vector)result) {
    marshaller.marshal(r,ec);
  }
  Document controlDoc=xmlParser.parse(new StringReader(INLINEBINARY_COLLECTION_XML));
  assertTrue("String_Node_Str" + documentToString(controlDoc) + "String_Node_Str"+ documentToString(doc),comparer.isNodeEqual(controlDoc,doc));
}
Program: 64273
Project: 64273
Buggy source:
@SuppressWarnings({"String_Node_Str"}) public Connection getConnection(){
  if (conn == null) {
    String driverClassName=getDriver();
    try {
      @SuppressWarnings("String_Node_Str") Class driverClass=null;
      if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()) {
        driverClass=(Class)AccessController.doPrivileged(new PrivilegedClassForName(driverClassName));
      }
 else {
        driverClass=PrivilegedAccessHelper.getClassForName(driverClassName);
      }
      Properties props=new Properties();
      props.put("String_Node_Str",getUsername());
      props.put("String_Node_Str",getPassword());
      if (getPlatformClassname().contains("String_Node_Str")) {
        props.put("String_Node_Str","String_Node_Str");
      }
      conn=DriverManager.getConnection(getUrl(),props);
    }
 catch (    Exception e) {
      logMessage(SEVERE,"String_Node_Str" + driverClassName,e);
    }
  }
  return conn;
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public Connection getConnection(){
  if (conn == null) {
    String driverClassName=getDriver();
    try {
      @SuppressWarnings("String_Node_Str") Class driverClass=null;
      if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()) {
        driverClass=(Class)AccessController.doPrivileged(new PrivilegedClassForName(driverClassName));
      }
 else {
        driverClass=PrivilegedAccessHelper.getClassForName(driverClassName);
      }
      Properties props=new Properties();
      props.put("String_Node_Str",getUsername());
      props.put("String_Node_Str",getPassword());
      if (getPlatformClassname().contains("String_Node_Str")) {
        props.put("String_Node_Str","String_Node_Str");
      }
      conn=DriverManager.getConnection(getUrl(),props);
    }
 catch (    Exception e) {
      logMessage(SEVERE,"String_Node_Str" + driverClassName,e);
    }
  }
  return conn;
}
Program: 64274
Project: 64274
Buggy source:
@SuppressWarnings({"String_Node_Str"}) public DatabasePlatform getDatabasePlatform(){
  if (databasePlatform == null) {
    String platformClassname=getPlatformClassname();
    try {
      Class platformClass=null;
      if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()) {
        platformClass=(Class)AccessController.doPrivileged(new PrivilegedClassForName(platformClassname));
      }
 else {
        platformClass=PrivilegedAccessHelper.getClassForName(platformClassname);
      }
      databasePlatform=(DatabasePlatform)Helper.getInstanceFromClass(platformClass);
    }
 catch (    Exception e) {
      databasePlatform=new MySQLPlatform();
    }
  }
  return databasePlatform;
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public DatabasePlatform getDatabasePlatform(){
  if (databasePlatform == null) {
    String platformClassname=getPlatformClassname();
    try {
      Class platformClass=null;
      if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()) {
        platformClass=(Class)AccessController.doPrivileged(new PrivilegedClassForName(platformClassname));
      }
 else {
        platformClass=PrivilegedAccessHelper.getClassForName(platformClassname);
      }
      databasePlatform=(DatabasePlatform)Helper.getInstanceFromClass(platformClass);
    }
 catch (    Exception e) {
      databasePlatform=new MySQLPlatform();
    }
  }
  return databasePlatform;
}
Program: 64275
Project: 64275
Buggy source:
public DBWSBuilderModelProject(){
  setName("String_Node_Str");
  ns=new NamespaceResolver();
  ns.put("String_Node_Str",W3C_XML_SCHEMA_NS_URI);
  addDescriptor(buildAssociationDescriptor());
  addDescriptor(buildDBWSBuilderModelDescriptor());
  addDescriptor(buildTableOperationModelDescriptor());
  addDescriptor(buildProcedureOperationModelDescriptor());
  addDescriptor(buildPLSQLProcedureOperationModelDescriptor());
  addDescriptor(buildSQLOperationModelDescriptor());
  addDescriptor(buildBindingModelDescriptor());
  addDescriptor(buildBatchSQLOperationModelDescriptor());
  for (Iterator descriptors=getDescriptors().values().iterator(); descriptors.hasNext(); ) {
    XMLDescriptor descriptor=(XMLDescriptor)descriptors.next();
    descriptor.setNamespaceResolver(ns);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public DBWSBuilderModelProject(){
  setName("String_Node_Str");
  ns=new NamespaceResolver();
  ns.put("String_Node_Str",W3C_XML_SCHEMA_NS_URI);
  addDescriptor(buildAssociationDescriptor());
  addDescriptor(buildDBWSBuilderModelDescriptor());
  addDescriptor(buildTableOperationModelDescriptor());
  addDescriptor(buildProcedureOperationModelDescriptor());
  addDescriptor(buildPLSQLProcedureOperationModelDescriptor());
  addDescriptor(buildSQLOperationModelDescriptor());
  addDescriptor(buildBindingModelDescriptor());
  addDescriptor(buildBatchSQLOperationModelDescriptor());
  for (Iterator descriptors=getDescriptors().values().iterator(); descriptors.hasNext(); ) {
    XMLDescriptor descriptor=(XMLDescriptor)descriptors.next();
    descriptor.setNamespaceResolver(ns);
  }
}
Program: 64280
Project: 64280
Buggy source:
public static void buildDatabaseSessionConfig(SessionConfigs ts,DatabaseSessionConfig tmpConfig,DBWSBuilder builder){
  ProjectConfig orProject=tmpConfig.getPrimaryProject();
  LogConfig logConfig=tmpConfig.getLogConfig();
  String sessionName=tmpConfig.getName();
  DatabaseSessionConfig orSessionConfig=new ServerSessionConfig();
  orSessionConfig.setPrimaryProject(orProject);
  orSessionConfig.setName(sessionName);
  orSessionConfig.setLogConfig(logConfig);
  CustomServerPlatformConfig customServerPlatformConfig=new CustomServerPlatformConfig();
  customServerPlatformConfig.setEnableJTA(true);
  customServerPlatformConfig.setEnableRuntimeServices(true);
  customServerPlatformConfig.setServerClassName("String_Node_Str");
  customServerPlatformConfig.setExternalTransactionControllerClass("String_Node_Str");
  orSessionConfig.setServerPlatformConfig(customServerPlatformConfig);
  DatabaseLoginConfig dlc=new DatabaseLoginConfig();
  dlc.setPlatformClass(builder.getPlatformClassname());
  dlc.setExternalConnectionPooling(true);
  dlc.setExternalTransactionController(true);
  dlc.setDatasource(builder.getDataSource());
  dlc.setBindAllParameters(true);
  dlc.setStreamsForBinding(true);
  orSessionConfig.setLoginConfig(dlc);
  ts.getSessionConfigs().set(0,orSessionConfig);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public static void buildDatabaseSessionConfig(SessionConfigs ts,DatabaseSessionConfig tmpConfig,DBWSBuilder builder){
  ProjectConfig orProject=tmpConfig.getPrimaryProject();
  LogConfig logConfig=tmpConfig.getLogConfig();
  String sessionName=tmpConfig.getName();
  DatabaseSessionConfig orSessionConfig=new ServerSessionConfig();
  orSessionConfig.setPrimaryProject(orProject);
  orSessionConfig.setName(sessionName);
  orSessionConfig.setLogConfig(logConfig);
  CustomServerPlatformConfig customServerPlatformConfig=new CustomServerPlatformConfig();
  customServerPlatformConfig.setEnableJTA(true);
  customServerPlatformConfig.setEnableRuntimeServices(true);
  customServerPlatformConfig.setServerClassName("String_Node_Str");
  customServerPlatformConfig.setExternalTransactionControllerClass("String_Node_Str");
  orSessionConfig.setServerPlatformConfig(customServerPlatformConfig);
  DatabaseLoginConfig dlc=new DatabaseLoginConfig();
  dlc.setPlatformClass(builder.getPlatformClassname());
  dlc.setExternalConnectionPooling(true);
  dlc.setExternalTransactionController(true);
  dlc.setDatasource(builder.getDataSource());
  dlc.setBindAllParameters(true);
  dlc.setStreamsForBinding(true);
  orSessionConfig.setLoginConfig(dlc);
  ts.getSessionConfigs().set(0,orSessionConfig);
}
Program: 64286
Project: 64286
Buggy source:
private void addUnmarshalValue(UnmarshalRecord unmarshalRecord,Object value,Object collection){
  if (unmarshalRecord.isNil() && xmlCompositeDirectCollectionMapping.getNullPolicy().isNullRepresentedByXsiNil()) {
    value=null;
  }
 else   if (!isWhitespaceAware() && Constants.EMPTY_STRING.equals(value)) {
    value=null;
  }
  Field xmlField=(Field)xmlCompositeDirectCollectionMapping.getField();
  XMLConversionManager xmlConversionManager=(XMLConversionManager)unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager();
  if (unmarshalRecord.getTypeQName() != null) {
    Class typeClass=xmlField.getJavaClass(unmarshalRecord.getTypeQName());
    value=xmlConversionManager.convertObject(value,typeClass,unmarshalRecord.getTypeQName());
  }
 else {
    value=unmarshalRecord.getXMLReader().convertValueBasedOnSchemaType(xmlField,value,xmlConversionManager,unmarshalRecord);
  }
  value=xmlCompositeDirectCollectionMapping.convertDataValueToObjectValue(value,unmarshalRecord.getSession(),unmarshalRecord.getUnmarshaller());
  if (value != null && value.getClass() == CoreClassConstants.STRING) {
    if (xmlCompositeDirectCollectionMapping.isCollapsingStringValues()) {
      value=XMLConversionManager.getDefaultXMLManager().collapseStringValue((String)value);
    }
 else     if (xmlCompositeDirectCollectionMapping.isNormalizingStringValues()) {
      value=XMLConversionManager.getDefaultXMLManager().normalizeStringValue((String)value);
    }
  }
  unmarshalRecord.addAttributeValue(this,value,collection);
}

Fixed version (ground truth):
private void addUnmarshalValue(UnmarshalRecord unmarshalRecord,Object value,Object collection){
  if (unmarshalRecord.isNil() && unmarshalRecord.getXMLReader().isNullRepresentedByXsiNil(xmlCompositeDirectCollectionMapping.getNullPolicy())) {
    value=null;
  }
 else   if (!isWhitespaceAware() && Constants.EMPTY_STRING.equals(value)) {
    value=null;
  }
  Field xmlField=(Field)xmlCompositeDirectCollectionMapping.getField();
  XMLConversionManager xmlConversionManager=(XMLConversionManager)unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager();
  if (unmarshalRecord.getTypeQName() != null) {
    Class typeClass=xmlField.getJavaClass(unmarshalRecord.getTypeQName());
    value=xmlConversionManager.convertObject(value,typeClass,unmarshalRecord.getTypeQName());
  }
 else {
    value=unmarshalRecord.getXMLReader().convertValueBasedOnSchemaType(xmlField,value,xmlConversionManager,unmarshalRecord);
  }
  value=xmlCompositeDirectCollectionMapping.convertDataValueToObjectValue(value,unmarshalRecord.getSession(),unmarshalRecord.getUnmarshaller());
  if (value != null && value.getClass() == CoreClassConstants.STRING) {
    if (xmlCompositeDirectCollectionMapping.isCollapsingStringValues()) {
      value=XMLConversionManager.getDefaultXMLManager().collapseStringValue((String)value);
    }
 else     if (xmlCompositeDirectCollectionMapping.isNormalizingStringValues()) {
      value=XMLConversionManager.getDefaultXMLManager().normalizeStringValue((String)value);
    }
  }
  unmarshalRecord.addAttributeValue(this,value,collection);
}
Program: 64287
Project: 64287
Buggy source:
public void endElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord,Object collection){
  String value=unmarshalRecord.getCharacters().toString();
  unmarshalRecord.resetStringBuffer();
  Field xmlField=(Field)xmlCompositeDirectCollectionMapping.getField();
  if (xmlField.usesSingleNode()) {
    StringTokenizer stringTokenizer=new StringTokenizer(value);
    while (stringTokenizer.hasMoreTokens()) {
      addUnmarshalValue(unmarshalRecord,stringTokenizer.nextToken(),collection);
    }
  }
 else {
    if (xmlField.getLastXPathFragment().nameIsText()) {
      addUnmarshalValue(unmarshalRecord,value,collection);
    }
  }
}

Fixed version (ground truth):
public void endElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord,Object collection){
  String value=unmarshalRecord.getCharacters().toString();
  unmarshalRecord.resetStringBuffer();
  Field xmlField=(Field)xmlCompositeDirectCollectionMapping.getField();
  if (xmlField.usesSingleNode()) {
    StringTokenizer stringTokenizer=new StringTokenizer(value);
    while (stringTokenizer.hasMoreTokens()) {
      addUnmarshalValue(unmarshalRecord,stringTokenizer.nextToken(),collection);
    }
  }
 else {
    if (xmlField.getLastXPathFragment().nameIsText()) {
      if (!unmarshalRecord.getXMLReader().isInCollection() && unmarshalRecord.isNil()) {
        unmarshalRecord.setAttributeValueNull(this);
      }
 else {
        addUnmarshalValue(unmarshalRecord,value,collection);
      }
    }
  }
}
Program: 64294
Project: 64294
Buggy source:
public void testRootTargetScriptFileName(){
  Map properties=new HashMap();
  properties.putAll(JUnitTestCaseHelper.getDatabaseProperties(getPersistenceUnitName()));
  properties.put(PersistenceUnitProperties.SESSION_NAME,"String_Node_Str");
  properties.put(PersistenceUnitProperties.ORM_SCHEMA_VALIDATION,"String_Node_Str");
  properties.put(PersistenceUnitProperties.SCHEMA_GENERATION_ACTION,PersistenceUnitProperties.SCHEMA_DROP_AND_CREATE);
  properties.put(PersistenceUnitProperties.SCHEMA_GENERATION_TARGET,PersistenceUnitProperties.SCHEMA_SCRIPTS_GENERATION);
  properties.put(PersistenceUnitProperties.SCHEMA_DROP_SCRIPT_TARGET,"String_Node_Str");
  properties.put(PersistenceUnitProperties.SCHEMA_CREATE_SCRIPT_TARGET,"String_Node_Str");
  Persistence.generateSchema(getPersistenceUnitName(),properties);
}

Fixed version (ground truth):
public void testRootTargetScriptFileName(){
  if (!getPlatform().isMySQL()) {
    Map properties=new HashMap();
    properties.putAll(JUnitTestCaseHelper.getDatabaseProperties(getPersistenceUnitName()));
    properties.put(PersistenceUnitProperties.SESSION_NAME,"String_Node_Str");
    properties.put(PersistenceUnitProperties.ORM_SCHEMA_VALIDATION,"String_Node_Str");
    properties.put(PersistenceUnitProperties.SCHEMA_GENERATION_ACTION,PersistenceUnitProperties.SCHEMA_DROP_AND_CREATE);
    properties.put(PersistenceUnitProperties.SCHEMA_GENERATION_TARGET,PersistenceUnitProperties.SCHEMA_SCRIPTS_GENERATION);
    properties.put(PersistenceUnitProperties.SCHEMA_DROP_SCRIPT_TARGET,"String_Node_Str");
    properties.put(PersistenceUnitProperties.SCHEMA_CREATE_SCRIPT_TARGET,"String_Node_Str");
    Persistence.generateSchema(getPersistenceUnitName(),properties);
  }
}
Program: 64300
Project: 64300
Buggy source:
/** 
 * Validates the given   {@link InExpression}. The test to perform is: <ul> <li>If the expression is a path expression, validation makes sure it is an association mapping, a basic field is not allowed.</li> </ul>
 * @param expression The {@link InExpression} to validate
 */
protected void validateInExpression(InExpression expression){
  expression.getExpression().accept(this);
  expression.getInItems().accept(this);
}

Fixed version (ground truth):
/** 
 * Validates the given   {@link InExpression}. The test to perform is: <ul> <li>If the expression is a path expression, validation makes sure it is an association mapping, a basic field is not allowed.</li> </ul>
 * @param expression The {@link InExpression} to validate
 */
protected void validateInExpression(InExpression expression){
  if (expression.hasExpression()) {
    Expression stringExpression=expression.getExpression();
    StateFieldPathExpression pathExpression=getStateFieldPathExpression(stringExpression);
    if (pathExpression != null) {
      validateStateFieldPathExpression(pathExpression,validPathExpressionTypeForInExpression());
    }
 else {
      stringExpression.accept(this);
    }
  }
  expression.getInItems().accept(this);
}
Program: 64302
Project: 64302
Buggy source:
public boolean marshalSingleValue(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,Object objectValue,CoreAbstractSession session,NamespaceResolver namespaceResolver,MarshalContext marshalContext){
  Object fieldValue=xmlDirectMapping.getFieldValue(objectValue,(AbstractSession)session,marshalRecord);
  if (null == fieldValue) {
    return xmlDirectMapping.getNullPolicy().directMarshal(xPathFragment,marshalRecord,object,session,namespaceResolver);
  }
 else {
    QName schemaType=((Field)xmlDirectMapping.getField()).getSchemaTypeForValue(fieldValue,session);
    XPathFragment groupingFragment=null;
    boolean isQName=false;
    if (Constants.QNAME_QNAME.equals(schemaType)) {
      groupingFragment=openGroupingElementsForQName((QName)fieldValue,marshalRecord);
      isQName=true;
    }
    if (groupingFragment == null) {
      groupingFragment=marshalRecord.openStartGroupingElements(namespaceResolver);
    }
    if (xPathFragment.hasAttribute) {
      marshalRecord.attribute(xPathFragment,namespaceResolver,fieldValue,schemaType);
      marshalRecord.closeStartGroupingElements(groupingFragment);
    }
 else {
      marshalRecord.closeStartGroupingElements(groupingFragment);
      marshalRecord.characters(schemaType,fieldValue,null,xmlDirectMapping.isCDATA());
    }
    if (isQName) {
      XPathFragment fragment=getLastGroupingFragment();
      if (fragment != groupingFragment) {
        marshalRecord.endElement(groupingFragment,namespaceResolver);
        return false;
      }
    }
    return true;
  }
}

Fixed version (ground truth):
public boolean marshalSingleValue(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,Object objectValue,CoreAbstractSession session,NamespaceResolver namespaceResolver,MarshalContext marshalContext){
  Object fieldValue=xmlDirectMapping.getFieldValue(objectValue,session,marshalRecord);
  if (null == fieldValue) {
    return xmlDirectMapping.getNullPolicy().directMarshal(xPathFragment,marshalRecord,object,session,namespaceResolver);
  }
 else {
    QName schemaType=((Field)xmlDirectMapping.getField()).getSchemaTypeForValue(fieldValue,session);
    XPathFragment groupingFragment=null;
    boolean isQName=false;
    if (Constants.QNAME_QNAME.equals(schemaType)) {
      groupingFragment=openGroupingElementsForQName((QName)fieldValue,marshalRecord);
      isQName=true;
    }
    if (groupingFragment == null) {
      groupingFragment=marshalRecord.openStartGroupingElements(namespaceResolver);
    }
    if (xPathFragment.hasAttribute) {
      marshalRecord.attribute(xPathFragment,namespaceResolver,fieldValue,schemaType);
      marshalRecord.closeStartGroupingElements(groupingFragment);
    }
 else {
      marshalRecord.closeStartGroupingElements(groupingFragment);
      marshalRecord.characters(schemaType,fieldValue,null,xmlDirectMapping.isCDATA());
    }
    if (isQName) {
      XPathFragment fragment=getLastGroupingFragment();
      if (fragment != groupingFragment) {
        marshalRecord.endElement(groupingFragment,namespaceResolver);
        return false;
      }
    }
    return true;
  }
}
Program: 64303
Project: 64303
Buggy source:
public void attribute(UnmarshalRecord unmarshalRecord,String namespaceURI,String localName,String value){
  unmarshalRecord.removeNullCapableValue(this);
  Field xmlField=(Field)xmlDirectMapping.getField();
  CoreAbstractSession session=unmarshalRecord.getSession();
  Object realValue=unmarshalRecord.getXMLReader().convertValueBasedOnSchemaType(xmlField,value,(XMLConversionManager)session.getDatasourcePlatform().getConversionManager(),unmarshalRecord);
  Object convertedValue=xmlDirectMapping.getAttributeValue(realValue,(AbstractSession)session,unmarshalRecord);
  xmlDirectMapping.setAttributeValueInObject(unmarshalRecord.getCurrentObject(),convertedValue);
}

Fixed version (ground truth):
public void attribute(UnmarshalRecord unmarshalRecord,String namespaceURI,String localName,String value){
  unmarshalRecord.removeNullCapableValue(this);
  Field xmlField=(Field)xmlDirectMapping.getField();
  CoreAbstractSession session=unmarshalRecord.getSession();
  Object realValue=unmarshalRecord.getXMLReader().convertValueBasedOnSchemaType(xmlField,value,(XMLConversionManager)session.getDatasourcePlatform().getConversionManager(),unmarshalRecord);
  Object convertedValue=xmlDirectMapping.getAttributeValue(realValue,session,unmarshalRecord);
  xmlDirectMapping.setAttributeValueInObject(unmarshalRecord.getCurrentObject(),convertedValue);
}
Program: 64304
Project: 64304
Buggy source:
/** 
 * Create a new row/record for the object builder with the given name. This allows subclasses to define different record types.
 */
public AbstractRecord createRecord(String rootName,Node parent,AbstractSession session){
  NamespaceResolver namespaceResolver=getNamespaceResolver();
  XMLRecord xmlRec=new DOMRecord(rootName,namespaceResolver,parent);
  xmlRec.setSession(session);
  return xmlRec;
}

Fixed version (ground truth):
/** 
 * Create a new row/record for the object builder with the given name. This allows subclasses to define different record types.
 */
public AbstractMarshalRecord createRecord(String rootName,Node parent,AbstractSession session){
  NamespaceResolver namespaceResolver=getNamespaceResolver();
  XMLRecord xmlRec=new DOMRecord(rootName,namespaceResolver,parent);
  xmlRec.setSession(session);
  return xmlRec;
}
Program: 64306
Project: 64306
Buggy source:
protected ClassDescriptor buildDatabaseTypeWrapperDescriptor(){
  XMLDescriptor descriptor=new XMLDescriptor();
  descriptor.setJavaClass(DatabaseTypeWrapper.class);
  descriptor.getInheritancePolicy().setClassIndicatorField(new XMLField("String_Node_Str"));
  descriptor.getInheritancePolicy().addClassIndicator(JDBCTypeWrapper.class,getPrimaryNamespaceXPath() + "String_Node_Str");
  descriptor.getInheritancePolicy().addClassIndicator(SimplePLSQLTypeWrapper.class,getPrimaryNamespaceXPath() + "String_Node_Str");
  descriptor.getInheritancePolicy().addClassIndicator(PLSQLRecordWrapper.class,getPrimaryNamespaceXPath() + "String_Node_Str");
  descriptor.getInheritancePolicy().addClassIndicator(PLSQLCollectionWrapper.class,getPrimaryNamespaceXPath() + "String_Node_Str");
  descriptor.getInheritancePolicy().addClassIndicator(OracleArrayTypeWrapper.class,getPrimaryNamespaceXPath() + "String_Node_Str");
  descriptor.getInheritancePolicy().addClassIndicator(OracleObjectTypeWrapper.class,getPrimaryNamespaceXPath() + "String_Node_Str");
  descriptor.getInheritancePolicy().addClassIndicator(PLSQLCursorWrapper.class,getPrimaryNamespaceXPath() + "String_Node_Str");
  descriptor.getInheritancePolicy().addClassIndicator(XMLTypeWrapper.class,getPrimaryNamespaceXPath() + "String_Node_Str");
  return descriptor;
}

Fixed version (ground truth):
protected ClassDescriptor buildDatabaseTypeWrapperDescriptor(){
  XMLDescriptor descriptor=new XMLDescriptor();
  descriptor.setJavaClass(DatabaseTypeWrapper.class);
  descriptor.getInheritancePolicy().setClassIndicatorField(new XMLField("String_Node_Str"));
  descriptor.getInheritancePolicy().addClassIndicator(JDBCTypeWrapper.class,getPrimaryNamespaceXPath() + "String_Node_Str");
  descriptor.getInheritancePolicy().addClassIndicator(SimplePLSQLTypeWrapper.class,getPrimaryNamespaceXPath() + "String_Node_Str");
  descriptor.getInheritancePolicy().addClassIndicator(PLSQLRecordWrapper.class,getPrimaryNamespaceXPath() + "String_Node_Str");
  descriptor.getInheritancePolicy().addClassIndicator(PLSQLCollectionWrapper.class,getPrimaryNamespaceXPath() + "String_Node_Str");
  descriptor.getInheritancePolicy().addClassIndicator(OracleArrayTypeWrapper.class,getPrimaryNamespaceXPath() + "String_Node_Str");
  descriptor.getInheritancePolicy().addClassIndicator(OracleObjectTypeWrapper.class,getPrimaryNamespaceXPath() + "String_Node_Str");
  descriptor.getInheritancePolicy().addClassIndicator(PLSQLCursorWrapper.class,getPrimaryNamespaceXPath() + "String_Node_Str");
  return descriptor;
}
Program: 64308
Project: 64308
Buggy source:
protected Object getControlObject(){
  Employee emp=new Employee();
  emp.a=1;
  emp.b="String_Node_Str";
  emp.stuff=new ArrayList();
  emp.stuff.add("String_Node_Str");
  Element elem=parser.newDocument().createElementNS("String_Node_Str","String_Node_Str");
  elem.setTextContent("String_Node_Str");
  emp.stuff.add(elem);
  emp.stuff.add("String_Node_Str");
  return emp;
}

Fixed version (ground truth):
protected Object getControlObject(){
  Employee emp=new Employee();
  emp.a=1;
  emp.b="String_Node_Str";
  emp.stuff=new ArrayList();
  emp.stuff.add("String_Node_Str");
  Element elem=parser.newDocument().createElementNS("String_Node_Str","String_Node_Str");
  elem.setTextContent("String_Node_Str");
  elem.setAttributeNS(XMLConstants.XMLNS_URL,XMLConstants.XMLNS,"String_Node_Str");
  emp.stuff.add(elem);
  emp.stuff.add("String_Node_Str");
  return emp;
}
Program: 64309
Project: 64309
Buggy source:
/** 
 * Testcase for Bug 387464
 */
public void testDuplicateDefaultNamespace() throws Exception {
  String testXmlData="String_Node_Str";
  EmployeeLax employeeLax=createEmployeeLax(testXmlData);
  JAXBContext ctx=JAXBContextFactory.createContext(new Class[]{EmployeeLax.class},null);
  StringWriter writer=new StringWriter();
  XMLOutputFactory factory=XMLOutputFactory.newInstance();
  factory.setProperty(factory.IS_REPAIRING_NAMESPACES,new Boolean(true));
  XMLStreamWriter streamWriter=factory.createXMLStreamWriter(writer);
  Marshaller marshaller=ctx.createMarshaller();
  marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,true);
  marshaller.marshal(employeeLax,streamWriter);
  streamWriter.flush();
  String xml="String_Node_Str" + testXmlData + "String_Node_Str";
  String writerString=writer.toString();
  assertTrue("String_Node_Str" + writerString,writerString.equals(xml));
}

Fixed version (ground truth):
/** 
 * Testcase for Bug 387464
 */
public void testDuplicateDefaultNamespace() throws Exception {
  String testXmlData="String_Node_Str";
  EmployeeLax employeeLax=createEmployeeLax(testXmlData);
  JAXBContext ctx=JAXBContextFactory.createContext(new Class[]{EmployeeLax.class},null);
  StringWriter writer=new StringWriter();
  XMLOutputFactory factory=XMLOutputFactory.newInstance();
  factory.setProperty(factory.IS_REPAIRING_NAMESPACES,new Boolean(true));
  XMLStreamWriter streamWriter=factory.createXMLStreamWriter(writer);
  Marshaller marshaller=ctx.createMarshaller();
  marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,true);
  marshaller.marshal(employeeLax,streamWriter);
  streamWriter.flush();
  String xml="String_Node_Str" + testXmlData + "String_Node_Str";
  String xml2="String_Node_Str" + testXmlData + "String_Node_Str";
  String writerString=writer.toString();
  boolean equals=writerString.equals(xml) || writerString.equals(xml2);
  if (!equals) {
    log("String_Node_Str" + xml);
    log("String_Node_Str" + xml2);
    log("String_Node_Str" + writerString);
  }
  assertTrue("String_Node_Str" + writerString,equals);
}
Program: 64310
Project: 64310
Buggy source:
protected static Element parseXml(InputStream in) throws Exception {
  DocumentBuilderFactory docBuilderFactory=DocumentBuilderFactory.newInstance();
  DocumentBuilder docBuilder=docBuilderFactory.newDocumentBuilder();
  Document xmlDocument=docBuilder.parse(in);
  return xmlDocument.getDocumentElement();
}

Fixed version (ground truth):
protected static Element parseXml(InputStream in) throws Exception {
  DocumentBuilderFactory docBuilderFactory=DocumentBuilderFactory.newInstance();
  docBuilderFactory.setNamespaceAware(true);
  DocumentBuilder docBuilder=docBuilderFactory.newDocumentBuilder();
  Document xmlDocument=docBuilder.parse(in);
  return xmlDocument.getDocumentElement();
}
Program: 64311
Project: 64311
Buggy source:
protected Object getControlObject(){
  Customer cust=new Customer();
  DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
  factory.setNamespaceAware(true);
  factory.setIgnoringElementContentWhitespace(true);
  try {
    DocumentBuilder builder=factory.newDocumentBuilder();
    Document doc=builder.newDocument();
    cust.anyElem=doc.createElementNS("String_Node_Str","String_Node_Str");
  }
 catch (  Exception ex) {
    fail("String_Node_Str");
  }
  return cust;
}

Fixed version (ground truth):
protected Object getControlObject(){
  Customer cust=new Customer();
  DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
  factory.setNamespaceAware(true);
  factory.setIgnoringElementContentWhitespace(true);
  try {
    DocumentBuilder builder=factory.newDocumentBuilder();
    Document doc=builder.newDocument();
    Element elem=doc.createElementNS("String_Node_Str","String_Node_Str");
    elem.setAttributeNS(XMLConstants.XMLNS_URL,"String_Node_Str","String_Node_Str");
    cust.anyElem=elem;
  }
 catch (  Exception ex) {
    fail("String_Node_Str");
  }
  return cust;
}
Program: 64312
Project: 64312
Buggy source:
/** 
 * Creates the shell jaxb element list.
 * @param reportItems the report items
 * @return the list
 */
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) protected List<JAXBElement> createShellJAXBElementList(List<ReportItem> reportItems){
  List<JAXBElement> jaxbElements=new ArrayList<JAXBElement>(reportItems.size());
  if ((reportItems != null) && (reportItems.size() > 0)) {
    for (    ReportItem reportItem : reportItems) {
      String reportItemName=reportItem.getName();
      Class resultType=reportItem.getResultType();
      if (resultType == null) {
        DatabaseMapping dbMapping=reportItem.getMapping();
        if (dbMapping != null) {
          resultType=dbMapping.getAttributeClassification();
        }
 else {
          ClassDescriptor desc=reportItem.getDescriptor();
          if (desc != null) {
            resultType=desc.getJavaClass();
          }
 else {
            return null;
          }
        }
      }
      JAXBElement element=new JAXBElement(new QName(reportItemName),resultType,null);
      jaxbElements.add(reportItem.getResultIndex(),element);
    }
  }
  return jaxbElements;
}

Fixed version (ground truth):
/** 
 * Creates the shell jaxb element list.
 * @param reportItems the report items
 * @return the list
 */
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) protected List<JAXBElement> createShellJAXBElementList(List<ReportItem> reportItems,Object record){
  List<JAXBElement> jaxbElements=new ArrayList<JAXBElement>(reportItems.size());
  if ((reportItems != null) && (reportItems.size() > 0)) {
    for (int index=0; index < reportItems.size(); index++) {
      ReportItem reportItem=reportItems.get(index);
      Object reportItemValue=record;
      if (record instanceof Object[]) {
        reportItemValue=((Object[])record)[index];
      }
      Class reportItemValueType=null;
      if (reportItemValue != null) {
        reportItemValueType=reportItemValue.getClass();
      }
      if (reportItemValueType == null) {
        DatabaseMapping dbMapping=reportItem.getMapping();
        if (dbMapping != null) {
          reportItemValueType=dbMapping.getAttributeClassification();
        }
 else {
          ClassDescriptor desc=reportItem.getDescriptor();
          if (desc != null) {
            reportItemValueType=desc.getJavaClass();
          }
        }
      }
      if (reportItemValueType == null) {
        return null;
      }
      JAXBElement element=new JAXBElement(new QName(reportItem.getName()),reportItemValueType,reportItemValue);
      jaxbElements.add(reportItem.getResultIndex(),element);
    }
  }
  return jaxbElements;
}
Program: 64313
Project: 64313
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) private MultiResultQueryList populateReportQueryResponse(List<Object[]> results,List<ReportItem> reportItems){
  MultiResultQueryList response=new MultiResultQueryList();
  for (  Object result : results) {
    MultiResultQueryListItem queryResultListItem=new MultiResultQueryListItem();
    List<JAXBElement> jaxbFields=createShellJAXBElementList(reportItems);
    if (jaxbFields == null) {
      return null;
    }
    if (result instanceof Object[]) {
      for (int i=0; i < ((Object[])result).length; i++) {
        jaxbFields.get(i).setValue(((Object[])result)[i]);
      }
    }
 else     if (result instanceof Object) {
      jaxbFields.get(0).setValue(((Object)result));
    }
    queryResultListItem.setFields(jaxbFields);
    response.addItem(queryResultListItem);
  }
  return response;
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str"}) private MultiResultQueryList populateReportQueryResponse(List<Object[]> results,List<ReportItem> reportItems){
  MultiResultQueryList response=new MultiResultQueryList();
  for (  Object result : results) {
    MultiResultQueryListItem queryResultListItem=new MultiResultQueryListItem();
    List<JAXBElement> jaxbFields=createShellJAXBElementList(reportItems,result);
    if (jaxbFields == null) {
      return null;
    }
    queryResultListItem.setFields(jaxbFields);
    response.addItem(queryResultListItem);
  }
  return response;
}
Program: 64314
Project: 64314
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) private SingleResultQueryList populateReportQueryResponse(Object[] result,List<ReportItem> reportItems){
  SingleResultQueryList response=new SingleResultQueryList();
  List<JAXBElement> fields=createShellJAXBElementList(reportItems);
  if (fields == null) {
    return null;
  }
  for (int i=0; i < result.length; i++) {
    Object resultItem=result[i];
    fields.get(i).setValue(((Object)resultItem));
  }
  response.setFields(fields);
  return response;
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str"}) private SingleResultQueryList populateReportQueryResponse(Object result,List<ReportItem> reportItems){
  SingleResultQueryList response=new SingleResultQueryList();
  List<JAXBElement> fields=createShellJAXBElementList(reportItems,result);
  if (fields == null) {
    return null;
  }
  response.setFields(fields);
  return response;
}