nus-yam/ex-repair huggingface dataset:
Program: 17901
Project: 17901
Buggy source:
@SuppressWarnings("String_Node_Str") private void setNavigationProperties(Object jpaEntity,EdmEntitySet entitySet,Map<String,Object> propertyValueMap,String entityName,Map<String,Class<?>> relatedClassMap) throws ODataJPARuntimeException {
  if (jpaEntity == null || entitySet == null || propertyValueMap == null || propertyValueMap.size() == 0)   return;
  List<HashMap<?,?>> mapList=getSettersForNavigationProperties(jpaEntity,entitySet,relatedClassMap);
  HashMap<String,Method> setters=(HashMap<String,Method>)mapList.get(0);
  HashMap<String,EdmMultiplicity> multiplicityMap=(HashMap<String,EdmMultiplicity>)mapList.get(1);
  for (  String key : setters.keySet()) {
    Method method=setters.get(key);
    Object propertyValue=propertyValueMap.get(key);
    if (propertyValue == null)     continue;
    try {
      if (multiplicityMap.get(key) == EdmMultiplicity.MANY) {
        List<Object> propertyList=new ArrayList<Object>();
        propertyList.add(propertyValue);
        propertyValue=propertyList;
      }
      method.invoke(jpaEntity,propertyValue);
    }
 catch (    IllegalAccessException e) {
      throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.GENERAL.addContent(e.getMessage()),e);
    }
catch (    IllegalArgumentException e) {
      throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.GENERAL.addContent(e.getMessage()),e);
    }
catch (    InvocationTargetException e) {
      throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.GENERAL.addContent(e.getMessage()),e);
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void setNavigationProperties(Object jpaEntity,EdmEntitySet entitySet,Map<String,Object> propertyValueMap,String entityName,Map<String,Class<?>> relatedClassMap) throws ODataJPARuntimeException {
  if (jpaEntity == null || entitySet == null || propertyValueMap == null || propertyValueMap.size() == 0)   return;
  List<HashMap<?,?>> mapList=getSettersForNavigationProperties(jpaEntity,entitySet,relatedClassMap);
  HashMap<String,Method> setters=(HashMap<String,Method>)mapList.get(0);
  HashMap<String,EdmMultiplicity> multiplicityMap=(HashMap<String,EdmMultiplicity>)mapList.get(1);
  for (  String key : setters.keySet()) {
    Method method=setters.get(key);
    List<Object> propertyValue=(List<Object>)propertyValueMap.get(key);
    if (propertyValue == null || propertyValue.size() == 0)     continue;
    try {
      if (multiplicityMap.get(key) == EdmMultiplicity.MANY) {
        method.invoke(jpaEntity,propertyValue);
      }
 else       method.invoke(jpaEntity,propertyValue.get(0));
    }
 catch (    IllegalAccessException e) {
      throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.GENERAL.addContent(e.getMessage()),e);
    }
catch (    IllegalArgumentException e) {
      throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.GENERAL.addContent(e.getMessage()),e);
    }
catch (    InvocationTargetException e) {
      throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.GENERAL.addContent(e.getMessage()),e);
    }
  }
}
Program: 17904
Project: 17904
Buggy source:
private void appendCustomProperties(final XMLStreamWriter writer,final EntityInfoAggregator eia,final Map<String,Object> data) throws EntityProviderException {
  List<String> noneSyndicationTargetPaths=eia.getNoneSyndicationTargetPathNames();
  for (  String tpName : noneSyndicationTargetPaths) {
    EntityPropertyInfo info=eia.getTargetPathInfo(tpName);
    if (!isKeepInContent(info)) {
      XmlPropertyEntityProducer aps=new XmlPropertyEntityProducer();
      final String name=info.getName();
      aps.append(writer,name,info,data.get(name));
    }
  }
}

Fixed version (ground truth):
private void appendCustomProperties(final XMLStreamWriter writer,final EntityInfoAggregator eia,final Map<String,Object> data) throws EntityProviderException {
  List<String> noneSyndicationTargetPaths=eia.getNoneSyndicationTargetPathNames();
  for (  String tpName : noneSyndicationTargetPaths) {
    EntityPropertyInfo info=eia.getTargetPathInfo(tpName);
    final String name=info.getName();
    XmlPropertyEntityProducer aps=new XmlPropertyEntityProducer();
    aps.appendCustomProperty(writer,name,info,data.get(name));
  }
}
Program: 17905
Project: 17905
Buggy source:
/** 
 * @param writer
 * @param prop
 * @param name
 * @throws XMLStreamException
 */
private void writeStartElementWithCustomNamespace(final XMLStreamWriter writer,final EntityPropertyInfo prop,final String name) throws XMLStreamException {
  EdmCustomizableFeedMappings mapping=prop.getCustomMapping();
  String nsPrefix=mapping.getFcNsPrefix();
  String nsUri=mapping.getFcNsUri();
  writer.writeStartElement(nsPrefix,name,nsUri);
  writer.writeNamespace(nsPrefix,nsUri);
}

Fixed version (ground truth):
/** 
 * @param writer
 * @param prop
 * @param name
 * @throws XMLStreamException
 * @throws EntityProviderException
 */
private void writeStartElementWithCustomNamespace(final XMLStreamWriter writer,final EntityPropertyInfo prop,final String name) throws XMLStreamException, EntityProviderException {
  EdmCustomizableFeedMappings mapping=prop.getCustomMapping();
  String nsPrefix=mapping.getFcNsPrefix();
  String nsUri=mapping.getFcNsUri();
  if (nsUri == null || nsPrefix == null) {
    throw new EntityProviderException(EntityProviderException.INVALID_NAMESPACE.addContent(name));
  }
  writer.writeStartElement(nsPrefix,name,nsUri);
  writer.writeNamespace(nsPrefix,nsUri);
}
Program: 17906
Project: 17906
Buggy source:
/** 
 * Do the callback based on given parameters.
 * @param readProperties
 * @param navigationProperty
 * @param callback
 * @param isFeed
 * @param entry
 */
private void doCallback(final EntityProviderReadProperties readProperties,final EdmNavigationProperty navigationProperty,final OnReadInlineContent callback,boolean isFeed,Object entry){
  if (isFeed) {
    @SuppressWarnings("String_Node_Str") ReadFeedResult callbackInfo=new ReadFeedResult(readProperties,navigationProperty,(List<ODataEntry>)entry);
    callback.handleReadFeed(callbackInfo);
  }
 else {
    ReadEntryResult callbackInfo=new ReadEntryResult(readProperties,navigationProperty,(ODataEntry)entry);
    callback.handleReadEntry(callbackInfo);
  }
}

Fixed version (ground truth):
/** 
 * Do the callback based on given parameters.
 * @param readProperties
 * @param navigationProperty
 * @param callback
 * @param isFeed
 * @param entry
 */
private void doCallback(final EntityProviderReadProperties readProperties,final EdmNavigationProperty navigationProperty,final OnReadInlineContent callback,final boolean isFeed,final Object entry){
  if (isFeed) {
    @SuppressWarnings("String_Node_Str") ReadFeedResult callbackInfo=new ReadFeedResult(readProperties,navigationProperty,(List<ODataEntry>)entry);
    callback.handleReadFeed(callbackInfo);
  }
 else {
    ReadEntryResult callbackInfo=new ReadEntryResult(readProperties,navigationProperty,(ODataEntry)entry);
    callback.handleReadEntry(callbackInfo);
  }
}
Program: 17907
Project: 17907
Buggy source:
/** 
 * Create   {@link EntityProviderReadProperties} which can be used for reading of inline properties/entrys of navigation links withinthis current read entry.
 * @param readProperties
 * @param navigationProperty
 * @return
 */
private EntityProviderReadProperties createInlineProperties(final EntityProviderReadProperties readProperties,EdmNavigationProperty navigationProperty){
  final OnReadInlineContent callback=readProperties.getCallback();
  EntityProviderReadProperties currentReadProperties=EntityProviderReadProperties.initFrom(readProperties).addValidatedPrefixes(foundPrefix2NamespaceUri).build();
  if (callback == null) {
    return currentReadProperties;
  }
 else {
    return callback.receiveReadProperties(currentReadProperties,navigationProperty);
  }
}

Fixed version (ground truth):
/** 
 * Create   {@link EntityProviderReadProperties} which can be used for reading of inline properties/entrys of navigation links withinthis current read entry.
 * @param readProperties
 * @param navigationProperty
 * @return
 */
private EntityProviderReadProperties createInlineProperties(final EntityProviderReadProperties readProperties,final EdmNavigationProperty navigationProperty){
  final OnReadInlineContent callback=readProperties.getCallback();
  EntityProviderReadProperties currentReadProperties=EntityProviderReadProperties.initFrom(readProperties).addValidatedPrefixes(foundPrefix2NamespaceUri).build();
  if (callback == null) {
    return currentReadProperties;
  }
 else {
    return callback.receiveReadProperties(currentReadProperties,navigationProperty);
  }
}
Program: 17910
Project: 17910
Buggy source:
/** 
 * Updates the read properties (  {@link #properties}) for this   {@link ReadEntryResult} ({@link #readEntryResult}).
 * @param readProperties
 * @param navigationPropertyName
 * @param navigationProperty
 * @param isFeed
 * @param inlineEntries
 */
private void updateReadProperties(final EntityProviderReadProperties readProperties,String navigationPropertyName,EdmNavigationProperty navigationProperty,boolean isFeed,List<ODataEntry> inlineEntries){
  Object entry=extractODataEntity(isFeed,inlineEntries);
  OnReadInlineContent callback=readProperties.getCallback();
  if (callback == null) {
    readEntryResult.setContainsInlineEntry(true);
    properties.put(navigationPropertyName,entry);
  }
 else {
    doCallback(readProperties,navigationProperty,callback,isFeed,entry);
  }
}

Fixed version (ground truth):
/** 
 * Updates the read properties (  {@link #properties}) for this   {@link ReadEntryResult} ({@link #readEntryResult}).
 * @param readProperties
 * @param navigationPropertyName
 * @param navigationProperty
 * @param isFeed
 * @param inlineEntries
 */
private void updateReadProperties(final EntityProviderReadProperties readProperties,final String navigationPropertyName,final EdmNavigationProperty navigationProperty,final boolean isFeed,final List<ODataEntry> inlineEntries){
  Object entry=extractODataEntity(isFeed,inlineEntries);
  OnReadInlineContent callback=readProperties.getCallback();
  if (callback == null) {
    readEntryResult.setContainsInlineEntry(true);
    properties.put(navigationPropertyName,entry);
  }
 else {
    doCallback(readProperties,navigationProperty,callback,isFeed,entry);
  }
}
Program: 17912
Project: 17912
Buggy source:
@Test public void readWithInlineContentEmployeeRoomEntry() throws Exception {
  EdmEntitySet entitySet=MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("String_Node_Str");
  InputStream reqContent=createContentAsStream(EMPLOYEE_1_ROOM_XML);
  XmlEntityConsumer xec=new XmlEntityConsumer();
  ODataEntry entry=xec.readEntry(entitySet,reqContent,EntityProviderReadProperties.init().mergeSemantic(true).build());
  assertNotNull(entry);
  Map<String,Object> properties=entry.getProperties();
  assertEquals("String_Node_Str",properties.get("String_Node_Str"));
  assertEquals("String_Node_Str",properties.get("String_Node_Str"));
  ODataEntry room=(ODataEntry)properties.get("String_Node_Str");
  Map<String,Object> roomProperties=room.getProperties();
  assertEquals(4,roomProperties.size());
  assertEquals("String_Node_Str",roomProperties.get("String_Node_Str"));
  assertEquals("String_Node_Str",roomProperties.get("String_Node_Str"));
  assertEquals(Short.valueOf("String_Node_Str"),roomProperties.get("String_Node_Str"));
  assertEquals(Short.valueOf("String_Node_Str"),roomProperties.get("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * Read an inline Room at an Employee
 * @throws Exception
 */
@Test public void readWithInlineContentEmployeeRoomEntry() throws Exception {
  EdmEntitySet entitySet=MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("String_Node_Str");
  InputStream reqContent=createContentAsStream(EMPLOYEE_1_ROOM_XML);
  XmlEntityConsumer xec=new XmlEntityConsumer();
  ODataEntry entry=xec.readEntry(entitySet,reqContent,EntityProviderReadProperties.init().mergeSemantic(true).build());
  assertNotNull(entry);
  Map<String,Object> properties=entry.getProperties();
  assertEquals("String_Node_Str",properties.get("String_Node_Str"));
  assertEquals("String_Node_Str",properties.get("String_Node_Str"));
  ODataEntry room=(ODataEntry)properties.get("String_Node_Str");
  Map<String,Object> roomProperties=room.getProperties();
  assertEquals(4,roomProperties.size());
  assertEquals("String_Node_Str",roomProperties.get("String_Node_Str"));
  assertEquals("String_Node_Str",roomProperties.get("String_Node_Str"));
  assertEquals(Short.valueOf("String_Node_Str"),roomProperties.get("String_Node_Str"));
  assertEquals(Short.valueOf("String_Node_Str"),roomProperties.get("String_Node_Str"));
}
Program: 17913
Project: 17913
Buggy source:
private InputStream createContentAsStream(final String xml) throws UnsupportedEncodingException {
  return new ByteArrayInputStream(xml.getBytes("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * @param xml
 * @param replaceWhitespaces if <code>true</code> all XML not necessary whitespaces between tags are
 * @return
 * @throws UnsupportedEncodingException
 */
private InputStream createContentAsStream(final String xml,boolean replaceWhitespaces) throws UnsupportedEncodingException {
  String contentForStream=xml;
  if (replaceWhitespaces) {
    contentForStream=xml.replaceAll("String_Node_Str","String_Node_Str");
  }
  LOG.info("String_Node_Str" + contentForStream + "String_Node_Str");
  return new ByteArrayInputStream(contentForStream.getBytes("String_Node_Str"));
}
Program: 17914
Project: 17914
Buggy source:
private void appendCustomProperties(final XMLStreamWriter writer,final EntityInfoAggregator eia,final Map<String,Object> data) throws EntityProviderException {
  List<String> noneSyndicationTargetPaths=eia.getNoneSyndicationTargetPathNames();
  for (  String tpName : noneSyndicationTargetPaths) {
    EntityPropertyInfo info=eia.getTargetPathInfo(tpName);
    if (!isKeepInContent(info)) {
      XmlPropertyEntityProducer aps=new XmlPropertyEntityProducer();
      final String name=info.getName();
      aps.append(writer,name,info,data.get(name));
    }
  }
}

Fixed version (ground truth):
private void appendCustomProperties(final XMLStreamWriter writer,final EntityInfoAggregator eia,final Map<String,Object> data) throws EntityProviderException {
  List<String> noneSyndicationTargetPaths=eia.getNoneSyndicationTargetPathNames();
  for (  String tpName : noneSyndicationTargetPaths) {
    EntityPropertyInfo info=eia.getTargetPathInfo(tpName);
    final String name=info.getName();
    XmlPropertyEntityProducer aps=new XmlPropertyEntityProducer();
    aps.appendCustomProperty(writer,name,info,data.get(name));
  }
}
Program: 17915
Project: 17915
Buggy source:
/** 
 * @param writer
 * @param prop
 * @param name
 * @throws XMLStreamException
 */
private void writeStartElementWithCustomNamespace(final XMLStreamWriter writer,final EntityPropertyInfo prop,final String name) throws XMLStreamException {
  EdmCustomizableFeedMappings mapping=prop.getCustomMapping();
  String nsPrefix=mapping.getFcNsPrefix();
  String nsUri=mapping.getFcNsUri();
  writer.writeStartElement(nsPrefix,name,nsUri);
  writer.writeNamespace(nsPrefix,nsUri);
}

Fixed version (ground truth):
/** 
 * @param writer
 * @param prop
 * @param name
 * @throws XMLStreamException
 * @throws EntityProviderException
 */
private void writeStartElementWithCustomNamespace(final XMLStreamWriter writer,final EntityPropertyInfo prop,final String name) throws XMLStreamException, EntityProviderException {
  EdmCustomizableFeedMappings mapping=prop.getCustomMapping();
  String nsPrefix=mapping.getFcNsPrefix();
  String nsUri=mapping.getFcNsUri();
  if (nsUri == null || nsPrefix == null) {
    throw new EntityProviderException(EntityProviderException.INVALID_NAMESPACE.addContent(name));
  }
  writer.writeStartElement(nsPrefix,name,nsUri);
  writer.writeNamespace(nsPrefix,nsUri);
}
Program: 17916
Project: 17916
Buggy source:
/** 
 * Skip the tag to which the   {@link XMLStreamReader} currently points.Therefore it is read until an end element tag with current local name is found.
 * @param reader
 * @throws XMLStreamException
 */
private void skipStartedTag(XMLStreamReader reader) throws XMLStreamException {
  final String name=reader.getLocalName();
  boolean read=reader.hasNext();
  while (read) {
    reader.next();
    if (reader.hasName()) {
      read=!(reader.isEndElement() && name.equals(reader.getLocalName()));
    }
  }
}

Fixed version (ground truth):
/** 
 * Skip the tag to which the   {@link XMLStreamReader} currently points.Therefore it is read until an end element tag with current local name is found.
 * @param reader
 * @throws XMLStreamException
 */
private void skipStartedTag(XMLStreamReader reader) throws XMLStreamException {
  final String name=reader.getLocalName();
  int read=1;
  while (read > 0 && reader.hasNext()) {
    reader.next();
    if (reader.hasName() && name.equals(reader.getLocalName())) {
      if (reader.isEndElement()) {
        read--;
      }
 else       if (reader.isStartElement()) {
        read++;
      }
    }
  }
}
Program: 17918
Project: 17918
Buggy source:
public static void crossProcessLockAcquire(final Class<?> c,final long waitMS){
  RandomAccessFile randomAccessFile=null;
  if ((fileLock == null) && (c != null) && (waitMS > 0)) {
    try {
      final long dropDeadTime=System.currentTimeMillis() + waitMS;
      final File file=new File(lockTempDir,c.getName() + "String_Node_Str");
      randomAccessFile=new RandomAccessFile(file,"String_Node_Str");
      final FileChannel fileChannel=randomAccessFile.getChannel();
      while (System.currentTimeMillis() < dropDeadTime) {
        fileLock=fileChannel.tryLock();
        if (fileLock != null) {
          break;
        }
        Thread.sleep(250);
      }
    }
 catch (    final Exception e) {
      throw new RuntimeException(e);
    }
  }
  if (fileLock == null) {
    throw new RuntimeException("String_Node_Str" + waitMS);
  }
}

Fixed version (ground truth):
public static void crossProcessLockAcquire(final Class<?> c,final long waitMS){
  RandomAccessFile randomAccessFile=null;
  if ((fileLock == null) && (c != null) && (waitMS > 0)) {
    try {
      final long dropDeadTime=System.currentTimeMillis() + waitMS;
      final File file=new File(lockTempDir,c.getName() + "String_Node_Str");
      randomAccessFile=new RandomAccessFile(file,"String_Node_Str");
      final FileChannel fileChannel=randomAccessFile.getChannel();
      while (System.currentTimeMillis() < dropDeadTime) {
        fileLock=fileChannel.tryLock();
        if (fileLock != null) {
          break;
        }
        Thread.sleep(250);
      }
    }
 catch (    final Exception e) {
      throw new RuntimeException(e);
    }
  }
  if (fileLock == null) {
    throw new ProcessLockerRuntimeException("String_Node_Str" + waitMS);
  }
}
Program: 17919
Project: 17919
Buggy source:
public static void crossProcessLockRelease(){
  if (fileLock != null) {
    try {
      fileLock.release();
      fileLock=null;
    }
 catch (    final IOException e) {
      throw new RuntimeException(e);
    }
  }
}

Fixed version (ground truth):
public static void crossProcessLockRelease(){
  if (fileLock != null) {
    try {
      fileLock.release();
      fileLock=null;
    }
 catch (    final IOException e) {
      throw new ProcessLockerRuntimeException(e);
    }
  }
}
Program: 17920
Project: 17920
Buggy source:
public void stopServer(){
  try {
    if (server != null) {
      FitStaticServiceFactory.unbindService(this);
      server.stop();
      log.trace("String_Node_Str" + getEndpoint().toASCIIString());
    }
  }
 catch (  final Exception e) {
    throw new ServerException(e);
  }
}

Fixed version (ground truth):
public void stopServer(){
  try {
    if (server != null) {
      FitStaticServiceFactory.unbindService(this);
      server.stop();
      log.trace("String_Node_Str" + getEndpoint().toASCIIString());
    }
  }
 catch (  final Exception e) {
    throw new ServerRuntimeException(e);
  }
}
Program: 17922
Project: 17922
Buggy source:
@Before public void before(){
  try {
    service=createService();
    server.startServer(service);
  }
 catch (  final ODataException e) {
    throw new TestUtilException(e);
  }
}

Fixed version (ground truth):
@Before public void before(){
  try {
    service=createService();
    server.startServer(service);
  }
 catch (  final ODataException e) {
    throw new TestUtilRuntimeException(e);
  }
}
Program: 17923
Project: 17923
Buggy source:
@After public void after(){
  try {
    server.stopServer();
  }
 catch (  final Exception e) {
    throw new TestUtilException(e);
  }
}

Fixed version (ground truth):
@After public void after(){
  try {
    server.stopServer();
  }
 catch (  final Exception e) {
    throw new TestUtilRuntimeException(e);
  }
}
Program: 17924
Project: 17924
Buggy source:
public static void crossProcessLockAcquire(final Class<?> c,final long waitMS){
  RandomAccessFile randomAccessFile=null;
  if ((fileLock == null) && (c != null) && (waitMS > 0)) {
    try {
      final long dropDeadTime=System.currentTimeMillis() + waitMS;
      final File file=new File(lockTempDir,c.getName() + "String_Node_Str");
      randomAccessFile=new RandomAccessFile(file,"String_Node_Str");
      final FileChannel fileChannel=randomAccessFile.getChannel();
      while (System.currentTimeMillis() < dropDeadTime) {
        fileLock=fileChannel.tryLock();
        if (fileLock != null) {
          break;
        }
        Thread.sleep(250);
      }
    }
 catch (    final Exception e) {
      throw new RuntimeException(e);
    }
  }
  if (fileLock == null) {
    throw new ProcessLockerRuntimeException("String_Node_Str" + waitMS);
  }
}

Fixed version (ground truth):
public static void crossProcessLockAcquire(final Class<?> c,final long waitMS){
  RandomAccessFile randomAccessFile=null;
  if ((fileLock == null) && (c != null) && (waitMS > 0)) {
    try {
      final long dropDeadTime=System.currentTimeMillis() + waitMS;
      final File file=new File(lockTempDir,c.getName() + "String_Node_Str");
      randomAccessFile=new RandomAccessFile(file,"String_Node_Str");
      final FileChannel fileChannel=randomAccessFile.getChannel();
      while (System.currentTimeMillis() < dropDeadTime) {
        fileLock=fileChannel.tryLock();
        if (fileLock != null) {
          break;
        }
        Thread.sleep(250);
      }
    }
 catch (    final Exception e) {
      throw new TestUtilRuntimeException(e);
    }
  }
  if (fileLock == null) {
    throw new TestUtilRuntimeException("String_Node_Str" + waitMS);
  }
}
Program: 17925
Project: 17925
Buggy source:
public static void crossProcessLockRelease(){
  if (fileLock != null) {
    try {
      fileLock.release();
      fileLock=null;
    }
 catch (    final IOException e) {
      throw new ProcessLockerRuntimeException(e);
    }
  }
}

Fixed version (ground truth):
public static void crossProcessLockRelease(){
  if (fileLock != null) {
    try {
      fileLock.release();
      fileLock=null;
    }
 catch (    final IOException e) {
      throw new TestUtilRuntimeException(e);
    }
  }
}
Program: 17926
Project: 17926
Buggy source:
/** 
 * simple main to start the tool
 * @param args not used
 */
public static void main(final String[] args) throws Exception {
  activateLoggingToJiraMarkupFile(ACCEPT_HEADER_REQUEST_JIRA_FILENAME);
  final List<String> paths=Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  final List<String> headerValues=Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  final List<TestPath> testPaths=TestPath.createTestPaths(paths,headerValues);
  final CallerResultHandler handler=new CallerResultHandler();
  final String localBaseUrl="String_Node_Str";
  final CallerConfig localConfig=new CallerConfig(localBaseUrl,handler,testPaths);
  AcceptHeaderCaller.create(localConfig).call();
  final String result=handler.getResult();
  LOG.info("String_Node_Str" + new SimpleDateFormat().format(new Date()) + "String_Node_Str");
  LOG.info(result);
}

Fixed version (ground truth):
/** 
 * simple main to start the tool
 * @param args not used
 */
public static void main(final String[] args){
  try {
    activateLoggingToJiraMarkupFile(ACCEPT_HEADER_REQUEST_JIRA_FILENAME);
    final List<String> paths=Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
    final List<String> headerValues=Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
    final List<TestPath> testPaths=TestPath.createTestPaths(paths,headerValues);
    final CallerResultHandler handler=new CallerResultHandler();
    final String localBaseUrl="String_Node_Str";
    final CallerConfig localConfig=new CallerConfig(localBaseUrl,handler,testPaths);
    AcceptHeaderCaller.create(localConfig).call();
    final String result=handler.getResult();
    LOG.info("String_Node_Str" + new SimpleDateFormat().format(new Date()) + "String_Node_Str");
    LOG.info(result);
  }
 catch (  Exception e) {
    throw new TestUtilRuntimeException(e);
  }
}
Program: 17927
Project: 17927
Buggy source:
private void initProxy() throws IllegalArgumentException {
  final String proxyUrl=config.getProxy();
  final String[] hostAndPort=proxyUrl.split("String_Node_Str");
  if (hostAndPort.length != 2) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final String host=hostAndPort[0];
  int port;
  try {
    port=Integer.parseInt(hostAndPort[1]);
  }
 catch (  final NumberFormatException e) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final HttpHost proxy=new HttpHost(host,port);
  LOG.info("String_Node_Str",proxy.getHostName(),proxy.getPort());
  httpClient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY,proxy);
}

Fixed version (ground truth):
private void initProxy() throws IllegalArgumentException {
  final String proxyUrl=config.getProxy();
  final String[] hostAndPort=proxyUrl.split("String_Node_Str");
  if (hostAndPort.length != 2) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final String host=hostAndPort[0];
  int port;
  try {
    port=Integer.parseInt(hostAndPort[1]);
  }
 catch (  final NumberFormatException e) {
    throw new IllegalArgumentException("String_Node_Str",e);
  }
  final HttpHost proxy=new HttpHost(host,port);
  LOG.info("String_Node_Str",proxy.getHostName(),proxy.getPort());
  httpClient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY,proxy);
}
Program: 17928
Project: 17928
Buggy source:
public void validate(final EntityInfoAggregator eia,final ODataEntryImpl entry) throws EntityProviderException {
  Collection<EntityPropertyInfo> propertyInfos=eia.getPropertyInfos();
  Map<String,Object> data=entry.getProperties();
  for (  EntityPropertyInfo entityPropertyInfo : propertyInfos) {
    boolean mandatory=entityPropertyInfo.isMandatory();
    if (mandatory) {
      if (!data.containsKey(entityPropertyInfo.getName())) {
        throw new EntityProviderException(EntityProviderException.MISSING_PROPERTY.addContent(entityPropertyInfo.getName()));
      }
    }
  }
}

Fixed version (ground truth):
public void validate(final EntityInfoAggregator eia,final ODataEntryImpl entry) throws EntityProviderException {
  Collection<EntityPropertyInfo> propertyInfos=new ArrayList<EntityPropertyInfo>(eia.getPropertyInfos());
  propertyInfos.removeAll(eia.getKeyPropertyInfos());
  Map<String,Object> data=entry.getProperties();
  for (  EntityPropertyInfo entityPropertyInfo : propertyInfos) {
    boolean mandatory=entityPropertyInfo.isMandatory();
    if (mandatory) {
      if (!data.containsKey(entityPropertyInfo.getName())) {
        throw new EntityProviderException(EntityProviderException.MISSING_PROPERTY.addContent(entityPropertyInfo.getName()));
      }
    }
  }
}
Program: 17929
Project: 17929
Buggy source:
@Test(expected=EntityProviderException.class) public void validationOfNamespacesMissingD_NamespaceAtRequiredTag() throws Exception {
  String roomWithValidNamespaces="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  EdmEntitySet entitySet=MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("String_Node_Str");
  InputStream reqContent=createContentAsStream(roomWithValidNamespaces);
  readAndExpectException(entitySet,reqContent,false,EntityProviderException.MISSING_PROPERTY.addContent("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * Missing _d_ namespace at mandatory property/tag (_Version_) results in an exception.
 * @throws Exception
 */
@Test(expected=EntityProviderException.class) public void validationOfNamespacesMissingD_NamespaceAtRequiredTag() throws Exception {
  String roomWithValidNamespaces="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  EdmEntitySet entitySet=MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("String_Node_Str");
  InputStream reqContent=createContentAsStream(roomWithValidNamespaces);
  readAndExpectException(entitySet,reqContent,false,EntityProviderException.MISSING_PROPERTY.addContent("String_Node_Str"));
}
Program: 17930
Project: 17930
Buggy source:
/** 
 * Duplicated occurrence of <code>d:Name</code> tag must result in an exception.
 * @throws Exception
 */
@Test public void validationOfDoublePropertyDifferentTagHierachyD_Namespace() throws Exception {
  String room="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  EdmEntitySet entitySet=MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("String_Node_Str");
  InputStream reqContent=createContentAsStream(room);
  XmlEntityConsumer xec=new XmlEntityConsumer();
  ODataEntry result=xec.readEntry(entitySet,reqContent,false);
  assertNotNull(result);
}

Fixed version (ground truth):
/** 
 * Double occurrence of <code>d:Name</code> tag within an unknown (and hence ignored) property is allowed.
 * @throws Exception
 */
@Test public void validationOfDoublePropertyDifferentTagHierachyD_Namespace() throws Exception {
  String room="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  EdmEntitySet entitySet=MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("String_Node_Str");
  InputStream reqContent=createContentAsStream(room);
  XmlEntityConsumer xec=new XmlEntityConsumer();
  ODataEntry result=xec.readEntry(entitySet,reqContent,false);
  assertNotNull(result);
}
Program: 17931
Project: 17931
Buggy source:
/** 
 * Duplicated occurrence of <code>d:Name</code> tag must result in an exception.
 * @throws Exception
 */
@Test(expected=EntityProviderException.class) public void validationOfDuplicatedPropertyException() throws Exception {
  String room="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  EdmEntitySet entitySet=MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("String_Node_Str");
  InputStream reqContent=createContentAsStream(room);
  readAndExpectException(entitySet,reqContent,EntityProviderException.DOUBLE_PROPERTY.addContent("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * Double occurrence of <code>d:Name</code> tag must result in an exception.
 * @throws Exception
 */
@Test(expected=EntityProviderException.class) public void validationOfDuplicatedPropertyException() throws Exception {
  String room="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  EdmEntitySet entitySet=MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("String_Node_Str");
  InputStream reqContent=createContentAsStream(room);
  readAndExpectException(entitySet,reqContent,EntityProviderException.DOUBLE_PROPERTY.addContent("String_Node_Str"));
}
Program: 17932
Project: 17932
Buggy source:
/** 
 * Duplicated occurrence of <code>d:Name</code> tag must result in an exception.
 * @throws Exception
 */
@Test public void validationOfDoublePropertyDifferentTagHierachy() throws Exception {
  String room="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  EdmEntitySet entitySet=MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("String_Node_Str");
  InputStream reqContent=createContentAsStream(room);
  XmlEntityConsumer xec=new XmlEntityConsumer();
  ODataEntry result=xec.readEntry(entitySet,reqContent,false);
  assertNotNull(result);
}

Fixed version (ground truth):
/** 
 * Double occurrence of <code>Name</code> tag within ignored/unknown property AND different namespace is allowed.
 * @throws Exception
 */
@Test public void validationOfDoublePropertyDifferentTagHierachy() throws Exception {
  String room="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  EdmEntitySet entitySet=MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("String_Node_Str");
  InputStream reqContent=createContentAsStream(room);
  XmlEntityConsumer xec=new XmlEntityConsumer();
  ODataEntry result=xec.readEntry(entitySet,reqContent,false);
  assertNotNull(result);
}
Program: 17933
Project: 17933
Buggy source:
/** 
 * @param reader
 * @param entitySet
 * @throws XMLStreamException
 * @throws EdmException
 * @throws EntityProviderException
 */
private void readProperties(final XMLStreamReader reader,final EntityInfoAggregator entitySet) throws XMLStreamException, EdmException, EntityProviderException {
  checkAllMandatoryNamespacesAvailable();
  validateNamespace(reader.getName(),Edm.NAMESPACE_M_2007_08);
  if (entitySet.getEntityType().hasStream()) {
    checkCurrentHandledStartTag(FormatXml.M_PROPERTIES);
  }
 else {
    checkCurrentHandledStartTag(ATOM_CONTENT);
  }
  int nextTagEventType=reader.next();
  XmlPropertyConsumer xpc=new XmlPropertyConsumer();
  boolean run=true;
  EntityPropertyInfo property;
  while (run) {
    if (nextTagEventType == XMLStreamConstants.START_ELEMENT) {
      if (isEdmNamespaceProperty(reader)) {
        String name=getValidPropertyName(reader);
        property=getValidatedPropertyInfo(entitySet,name);
        Object value=xpc.readStartedElement(reader,property,typeMappings);
        properties.put(name,value);
      }
    }
 else     if (nextTagEventType == XMLStreamConstants.END_ELEMENT) {
      String name=reader.getLocalName();
      if (M_PROPERTIES.equals(name)) {
        run=false;
      }
    }
    nextTagEventType=reader.next();
  }
}

Fixed version (ground truth):
/** 
 * @param reader
 * @param entitySet
 * @throws XMLStreamException
 * @throws EdmException
 * @throws EntityProviderException
 */
private void readProperties(final XMLStreamReader reader,final EntityInfoAggregator entitySet) throws XMLStreamException, EdmException, EntityProviderException {
  checkAllMandatoryNamespacesAvailable();
  validateNamespace(reader.getName(),Edm.NAMESPACE_M_2007_08);
  if (entitySet.getEntityType().hasStream()) {
    checkCurrentHandledStartTag(FormatXml.M_PROPERTIES);
  }
 else {
    checkCurrentHandledStartTag(ATOM_CONTENT);
  }
  EntityPropertyInfo property;
  String closeTag=null;
  int nextTagEventType=reader.next();
  XmlPropertyConsumer xpc=new XmlPropertyConsumer();
  boolean run=true;
  while (run) {
    if (nextTagEventType == XMLStreamConstants.START_ELEMENT && closeTag == null) {
      closeTag=reader.getLocalName();
      if (isEdmNamespaceProperty(reader)) {
        String name=getValidPropertyName(reader);
        property=getValidatedPropertyInfo(entitySet,name);
        Object value=xpc.readStartedElement(reader,property,typeMappings);
        properties.put(name,value);
        closeTag=null;
      }
    }
 else     if (nextTagEventType == XMLStreamConstants.END_ELEMENT) {
      String name=reader.getLocalName();
      if (M_PROPERTIES.equals(name)) {
        run=false;
      }
 else       if (name.equals(closeTag)) {
        closeTag=null;
      }
    }
    nextTagEventType=reader.next();
  }
}
Program: 17934
Project: 17934
Buggy source:
/** 
 * Duplicated occurrence of <code>d:Name</code> tag must result in an exception.
 * @throws Exception
 */
@Test @Ignore("String_Node_Str") public void validationOfDoublePropertyDifferentTagHierachyD_Namespace() throws Exception {
  String room="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  EdmEntitySet entitySet=MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("String_Node_Str");
  InputStream reqContent=createContentAsStream(room);
  XmlEntityConsumer xec=new XmlEntityConsumer();
  ODataEntry result=xec.readEntry(entitySet,reqContent,false);
  assertNotNull(result);
}

Fixed version (ground truth):
/** 
 * Duplicated occurrence of <code>d:Name</code> tag must result in an exception.
 * @throws Exception
 */
@Test public void validationOfDoublePropertyDifferentTagHierachyD_Namespace() throws Exception {
  String room="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  EdmEntitySet entitySet=MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("String_Node_Str");
  InputStream reqContent=createContentAsStream(room);
  XmlEntityConsumer xec=new XmlEntityConsumer();
  ODataEntry result=xec.readEntry(entitySet,reqContent,false);
  assertNotNull(result);
}
Program: 17936
Project: 17936
Buggy source:
@Override public boolean isAll(){
  return (isAll == null) || isAll;
}

Fixed version (ground truth):
@Override public boolean isAll(){
  return isAll.getBoolean();
}
Program: 17937
Project: 17937
Buggy source:
public void addProperty(final EdmProperty property){
  if (isAll == null) {
    isAll=false;
  }
  if (!isAll && !properties.contains(property)) {
    properties.add(property);
  }
}

Fixed version (ground truth):
public void addProperty(final EdmProperty property){
  if (isAll == AllKinds.IMPLICITLYTRUE) {
    isAll=AllKinds.FALSE;
  }
  if (isAll != AllKinds.EXPLICITLYTRUE && !properties.contains(property)) {
    properties.add(property);
  }
}
Program: 17938
Project: 17938
Buggy source:
public ExpandSelectTreeNode addChild(final EdmNavigationProperty navigationProperty,final ExpandSelectTreeNode childNode){
  if (isAll == null) {
    isAll=false;
  }
  if (links.containsKey(navigationProperty)) {
    ExpandSelectTreeNodeImpl existingNode=(ExpandSelectTreeNodeImpl)links.get(navigationProperty);
    if (existingNode != childNode && childNode != null) {
      if (existingNode.isAll() || childNode.isAll()) {
        existingNode.setAllExplicitly();
        for (        Map.Entry<EdmNavigationProperty,ExpandSelectTreeNode> entry : childNode.getLinks().entrySet()) {
          if (entry.getValue() != null) {
            existingNode.addChild(entry.getKey(),entry.getValue());
          }
        }
      }
 else {
        for (        EdmProperty property : childNode.getProperties()) {
          existingNode.addProperty(property);
        }
        for (        Map.Entry<EdmNavigationProperty,ExpandSelectTreeNode> entry : childNode.getLinks().entrySet()) {
          existingNode.addChild(entry.getKey(),entry.getValue());
        }
      }
    }
    return existingNode;
  }
  if (isAll && childNode == null) {
    return null;
  }
  links.put(navigationProperty,childNode);
  return childNode;
}

Fixed version (ground truth):
public ExpandSelectTreeNode addChild(final EdmNavigationProperty navigationProperty,final ExpandSelectTreeNode childNode){
  if (isAll == AllKinds.IMPLICITLYTRUE) {
    isAll=AllKinds.FALSE;
  }
  if (links.containsKey(navigationProperty)) {
    ExpandSelectTreeNodeImpl existingNode=(ExpandSelectTreeNodeImpl)links.get(navigationProperty);
    ExpandSelectTreeNodeImpl childNodeInternal=(ExpandSelectTreeNodeImpl)childNode;
    if (existingNode != childNode && childNode != null) {
      if (existingNode.isAllInternal() == AllKinds.EXPLICITLYTRUE || childNodeInternal.isAllInternal() == AllKinds.EXPLICITLYTRUE) {
        existingNode.setAllExplicitly();
        for (        Map.Entry<EdmNavigationProperty,ExpandSelectTreeNode> entry : childNode.getLinks().entrySet()) {
          if (entry.getValue() != null) {
            existingNode.addChild(entry.getKey(),entry.getValue());
          }
        }
      }
 else {
        for (        EdmProperty property : childNode.getProperties()) {
          existingNode.addProperty(property);
        }
        for (        Map.Entry<EdmNavigationProperty,ExpandSelectTreeNode> entry : childNode.getLinks().entrySet()) {
          existingNode.addChild(entry.getKey(),entry.getValue());
        }
      }
    }
    return existingNode;
  }
  if (isAll != AllKinds.FALSE && childNode == null) {
    return null;
  }
  links.put(navigationProperty,childNode);
  return childNode;
}
Program: 17939
Project: 17939
Buggy source:
public void setAllExplicitly(){
  isAll=true;
  properties.clear();
  Iterator<EdmNavigationProperty> iterator=links.keySet().iterator();
  while (iterator.hasNext()) {
    EdmNavigationProperty navProp=iterator.next();
    if (links.get(navProp) == null) {
      iterator.remove();
    }
  }
}

Fixed version (ground truth):
public void setAllExplicitly(){
  isAll=AllKinds.EXPLICITLYTRUE;
  properties.clear();
  Iterator<EdmNavigationProperty> iterator=links.keySet().iterator();
  while (iterator.hasNext()) {
    EdmNavigationProperty navProp=iterator.next();
    if (links.get(navProp) == null) {
      iterator.remove();
    }
  }
}
Program: 17940
Project: 17940
Buggy source:
private ContentType doContentNegotiationForFormat(final UriInfoImpl uriInfo) throws ODataException {
  ContentType formatContentType=mapFormat(uriInfo);
  formatContentType=ensureCharsetIsSet(formatContentType);
  final Class<? extends ODataProcessor> processorFeature=dispatcher.mapUriTypeToProcessorFeature(uriInfo);
  final List<ContentType> supportedContentTypes=getSupportedContentTypes(processorFeature);
  for (  final ContentType contentType : supportedContentTypes) {
    if (contentType.equals(formatContentType)) {
      return formatContentType;
    }
  }
  throw new ODataNotAcceptableException(ODataNotAcceptableException.NOT_SUPPORTED_CONTENT_TYPE.addContent(uriInfo.getFormat()));
}

Fixed version (ground truth):
private ContentType doContentNegotiationForFormat(final UriInfoImpl uriInfo) throws ODataException {
  validateFormatQuery(uriInfo);
  ContentType formatContentType=mapFormat(uriInfo);
  formatContentType=ensureCharsetIsSet(formatContentType);
  final Class<? extends ODataProcessor> processorFeature=dispatcher.mapUriTypeToProcessorFeature(uriInfo);
  final List<ContentType> supportedContentTypes=getSupportedContentTypes(processorFeature);
  for (  final ContentType contentType : supportedContentTypes) {
    if (contentType.equals(formatContentType)) {
      return formatContentType;
    }
  }
  throw new ODataNotAcceptableException(ODataNotAcceptableException.NOT_SUPPORTED_CONTENT_TYPE.addContent(uriInfo.getFormat()));
}
Program: 17941
Project: 17941
Buggy source:
private String createLineForJiraTable(Set<TestResult> results){
  final StringBuilder b=new StringBuilder(SEPARATOR);
  append(b,buildUriForJira(results));
  boolean acceptHeaderUnwritten=true;
  for (  final TestResult result : results) {
    if (acceptHeaderUnwritten) {
      append(b,result.getRequestHeader(HttpHeaders.ACCEPT));
      acceptHeaderUnwritten=false;
    }
    append(b,result.getResponseHeader(HttpHeaders.CONTENT_TYPE));
    append(b,result.getSomeValue("String_Node_Str"));
  }
  b.append("String_Node_Str");
  return b.toString();
}

Fixed version (ground truth):
private String createLineForJiraTable(Set<TestResult> results){
  final StringBuilder b=new StringBuilder(SEPARATOR);
  append(b,buildUriForJira(results));
  boolean acceptHeaderUnwritten=true;
  for (  final TestResult result : results) {
    if (acceptHeaderUnwritten) {
      append(b,result.getRequestHeader(HttpHeaders.ACCEPT));
      acceptHeaderUnwritten=false;
    }
    append(b,result.getResponseHeader(HttpHeaders.CONTENT_TYPE));
    append(b,result.getSomeValue(RESPONSE_STATUS_CODE));
  }
  b.append("String_Node_Str");
  return b.toString();
}
Program: 17942
Project: 17942
Buggy source:
public String getRequestHeader(String name){
  return reqHeaders.get(name);
}

Fixed version (ground truth):
public String getRequestHeader(String name){
  return reqHeaders.get(normalizeHeaderName(name));
}
Program: 17943
Project: 17943
Buggy source:
public void addResponseHeader(String name,String value){
  resHeaders.put(name,value);
}

Fixed version (ground truth):
public void addResponseHeader(String name,String value){
  resHeaders.put(normalizeHeaderName(name),value);
}
Program: 17944
Project: 17944
Buggy source:
public void addRequestHeader(String name,String value){
  reqHeaders.put(name,value);
}

Fixed version (ground truth):
public void addRequestHeader(String name,String value){
  reqHeaders.put(normalizeHeaderName(name),value);
}
Program: 17945
Project: 17945
Buggy source:
public String getResponseHeader(String name){
  return resHeaders.get(name);
}

Fixed version (ground truth):
public String getResponseHeader(String name){
  return resHeaders.get(normalizeHeaderName(name));
}