nus-yam/ex-repair huggingface dataset:
Program: 15509
Project: 15509
Buggy source:
protected void fromResource(Resource resource,List<ModuleDefinition> holder) throws IOException {
  if (!resource.exists()) {
    return;
  }
  String filename=resource.getFile().getCanonicalFile().getName();
  boolean isDir=resource.getFile().isDirectory();
  if (!isDir && !filename.endsWith(ARCHIVE_AS_FILE_EXTENSION)) {
    return;
  }
  String name=isDir ? filename : filename.substring(0,filename.lastIndexOf(ARCHIVE_AS_FILE_EXTENSION));
  String canonicalPath=resource.getFile().getCanonicalPath();
  int lastSlash=canonicalPath.lastIndexOf('/');
  String typeAsString=canonicalPath.substring(canonicalPath.lastIndexOf('/',lastSlash - 1) + 1,lastSlash);
  ModuleType type=null;
  try {
    type=ModuleType.valueOf(typeAsString);
  }
 catch (  IllegalArgumentException e) {
    return;
  }
  ModuleDefinition found=ModuleDefinitions.simple(name,type,"String_Node_Str" + canonicalPath + (isDir ? "String_Node_Str" : "String_Node_Str"));
  if (holder.contains(found)) {
    SimpleModuleDefinition one=(SimpleModuleDefinition)found;
    SimpleModuleDefinition two=(SimpleModuleDefinition)holder.get(holder.indexOf(found));
    throw new IllegalStateException(String.format("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str",found.getType(),found.getName(),one.getLocation(),two.getLocation()));
  }
 else {
    holder.add(found);
  }
}

Fixed version (ground truth):
protected void fromResource(Resource resource,List<ModuleDefinition> holder) throws IOException {
  if (!resource.exists()) {
    return;
  }
  String filename=resource.getFile().getCanonicalFile().getName();
  boolean isDir=resource.getFile().isDirectory();
  if (!isDir && !filename.endsWith(ARCHIVE_AS_FILE_EXTENSION)) {
    return;
  }
  String name=isDir ? filename : filename.substring(0,filename.lastIndexOf(ARCHIVE_AS_FILE_EXTENSION));
  String canonicalPath=resource.getFile().getCanonicalPath();
  String fileSeparator=File.separator;
  int lastSlash=canonicalPath.lastIndexOf(fileSeparator);
  String typeAsString=canonicalPath.substring(canonicalPath.lastIndexOf(fileSeparator,lastSlash - 1) + 1,lastSlash);
  ModuleType type=null;
  try {
    type=ModuleType.valueOf(typeAsString);
  }
 catch (  IllegalArgumentException e) {
    return;
  }
  ModuleDefinition found=ModuleDefinitions.simple(name,type,"String_Node_Str" + canonicalPath + (isDir ? fileSeparator : "String_Node_Str"));
  if (holder.contains(found)) {
    SimpleModuleDefinition one=(SimpleModuleDefinition)found;
    SimpleModuleDefinition two=(SimpleModuleDefinition)holder.get(holder.indexOf(found));
    throw new IllegalStateException(String.format("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str",found.getType(),found.getName(),one.getLocation(),two.getLocation()));
  }
 else {
    holder.add(found);
  }
}
Program: 15510
Project: 15510
Buggy source:
@Test public void testPojoToJsonPrettyPrint(){
  String json="String_Node_Str";
  PojoToJsonMessageConverter messageConverter=new PojoToJsonMessageConverter();
  messageConverter.setPrettyPrint(true);
  Message<?> msg=(Message<?>)messageConverter.fromMessage(new GenericMessage<Foo>(new Foo()),String.class);
  assertEquals(json,msg.getPayload());
  assertEquals(MimeTypeUtils.APPLICATION_JSON,msg.getHeaders().get(MessageHeaders.CONTENT_TYPE));
}

Fixed version (ground truth):
@Test public void testPojoToJsonPrettyPrint(){
  String json=String.format("String_Node_Str");
  PojoToJsonMessageConverter messageConverter=new PojoToJsonMessageConverter();
  messageConverter.setPrettyPrint(true);
  Message<?> msg=(Message<?>)messageConverter.fromMessage(new GenericMessage<Foo>(new Foo()),String.class);
  assertEquals(json,msg.getPayload().toString().trim());
  assertEquals(MimeTypeUtils.APPLICATION_JSON,msg.getHeaders().get(MessageHeaders.CONTENT_TYPE));
}
Program: 15511
Project: 15511
Buggy source:
@Test @SuppressWarnings("String_Node_Str") public void testTupleToJsonPrettyPrint(){
  Tuple t=TupleBuilder.fromString("String_Node_Str");
  Message<?> msg=MessageBuilder.withPayload(t).build();
  TupleToJsonMessageConverter messageConverter=new TupleToJsonMessageConverter();
  messageConverter.setPrettyPrint(true);
  Message<String> result=(Message<String>)messageConverter.fromMessage(msg,String.class);
  assertTrue(result.getPayload(),result.getPayload().contains("String_Node_Str"));
  assertTrue(result.getPayload(),result.getPayload().contains("String_Node_Str"));
  assertEquals(MimeTypeUtils.APPLICATION_JSON,result.getHeaders().get(MessageHeaders.CONTENT_TYPE));
}

Fixed version (ground truth):
@Test @SuppressWarnings("String_Node_Str") public void testTupleToJsonPrettyPrint(){
  Tuple t=TupleBuilder.fromString("String_Node_Str");
  Message<?> msg=MessageBuilder.withPayload(t).build();
  TupleToJsonMessageConverter messageConverter=new TupleToJsonMessageConverter();
  messageConverter.setPrettyPrint(true);
  Message<String> result=(Message<String>)messageConverter.fromMessage(msg,String.class);
  assertTrue(result.getPayload(),result.getPayload().contains(String.format("String_Node_Str")));
  assertTrue(result.getPayload(),result.getPayload().contains("String_Node_Str"));
  assertEquals(MimeTypeUtils.APPLICATION_JSON,result.getHeaders().get(MessageHeaders.CONTENT_TYPE));
}
Program: 15512
Project: 15512
Buggy source:
@Override public void test(Message<?> message) throws MessagingException {
  File file=(File)message.getPayload();
  assertEquals(sourceDirName + "String_Node_Str" + "String_Node_Str",file.getAbsolutePath());
}

Fixed version (ground truth):
@Override public void test(Message<?> message) throws MessagingException {
  File file=(File)message.getPayload();
  assertEquals(sourceDirName + File.separator + "String_Node_Str",file.getAbsolutePath());
}
Program: 15513
Project: 15513
Buggy source:
@Test public void testFileReference() throws IOException {
  deployStream("String_Node_Str","String_Node_Str" + sourceDirName + "String_Node_Str");
  MessageTest test=new MessageTest(){
    @Override public void test(    Message<?> message) throws MessagingException {
      File file=(File)message.getPayload();
      assertEquals(sourceDirName + "String_Node_Str" + "String_Node_Str",file.getAbsolutePath());
    }
  }
;
  StreamTestSupport.getSinkInputChannel("String_Node_Str").subscribe(test);
  dropFile("String_Node_Str");
  test.waitForCompletion(1000);
  StreamTestSupport.getDeployedModule("String_Node_Str",0).stop();
  assertTrue(test.getMessageHandled());
}

Fixed version (ground truth):
@Test public void testFileReference() throws IOException {
  deployStream("String_Node_Str","String_Node_Str" + sourceDirName + "String_Node_Str");
  MessageTest test=new MessageTest(){
    @Override public void test(    Message<?> message) throws MessagingException {
      File file=(File)message.getPayload();
      assertEquals(sourceDirName + File.separator + "String_Node_Str",file.getAbsolutePath());
    }
  }
;
  StreamTestSupport.getSinkInputChannel("String_Node_Str").subscribe(test);
  dropFile("String_Node_Str");
  test.waitForCompletion(1000);
  StreamTestSupport.getDeployedModule("String_Node_Str",0).stop();
  assertTrue(test.getMessageHandled());
}
Program: 15514
Project: 15514
Buggy source:
@BeforeClass public static void setUp(){
  String currentDir=new File("String_Node_Str").getAbsolutePath();
  originalConfigLocation=System.getProperty("String_Node_Str");
  System.setProperty("String_Node_Str",currentDir + "String_Node_Str");
  application=new TestApplicationBootstrap().getSingleNodeApplication().run();
  context=application.pluginContext();
}

Fixed version (ground truth):
@BeforeClass public static void setUp(){
  originalConfigLocation=System.getProperty("String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  application=new TestApplicationBootstrap().getSingleNodeApplication().run();
  context=application.pluginContext();
}
Program: 15515
Project: 15515
Buggy source:
@Test public void testWritingDataset() throws Exception {
  ClassPathXmlApplicationContext context=new ClassPathXmlApplicationContext("String_Node_Str");
  MessageChannel channel=context.getBean("String_Node_Str",MessageChannel.class);
  channel.send(MessageBuilder.withPayload("String_Node_Str").build());
  channel.send(MessageBuilder.withPayload("String_Node_Str").build());
  DatasetOperations datasetOperations=context.getBean("String_Node_Str",DatasetOperations.class);
  String path=context.getBean("String_Node_Str",String.class);
  assertTrue("String_Node_Str",new File(path).exists());
  assertTrue("String_Node_Str",new File(path + "String_Node_Str" + "String_Node_Str"+ datasetOperations.getDatasetName(String.class)).exists());
  assertTrue("String_Node_Str",new File(path + "String_Node_Str" + "String_Node_Str"+ datasetOperations.getDatasetName(String.class)+ "String_Node_Str").exists());
  context.close();
}

Fixed version (ground truth):
@Test public void testWritingDataset() throws Exception {
  ClassPathXmlApplicationContext context=new ClassPathXmlApplicationContext("String_Node_Str");
  MessageChannel channel=context.getBean("String_Node_Str",MessageChannel.class);
  channel.send(MessageBuilder.withPayload("String_Node_Str").build());
  channel.send(MessageBuilder.withPayload("String_Node_Str").build());
  DatasetOperations datasetOperations=context.getBean("String_Node_Str",DatasetOperations.class);
  String path=context.getBean("String_Node_Str",String.class);
  assertTrue("String_Node_Str",new File(path).exists());
  String fileSeparator=File.separator;
  assertTrue("String_Node_Str",new File(path + "String_Node_Str" + "String_Node_Str"+ datasetOperations.getDatasetName(String.class)).exists());
  assertTrue("String_Node_Str",new File(path + "String_Node_Str" + "String_Node_Str"+ datasetOperations.getDatasetName(String.class)+ "String_Node_Str").exists());
  context.close();
}
Program: 15516
Project: 15516
Buggy source:
@Test public void testFieldValueCounterList() throws Exception {
  TailSource tailSource=newTailSource();
  tailTweets(tailSource);
  FieldValueCounterSink sink=metrics().newFieldValueCounterSink("String_Node_Str");
  stream().create(generateStreamName(),"String_Node_Str",tailSource,sink);
  assertThat(sink,eventually(exists()));
}

Fixed version (ground truth):
@Test public void testFieldValueCounterList() throws Exception {
  org.junit.Assume.assumeFalse(System.getProperty("String_Node_Str").toLowerCase().startsWith("String_Node_Str"));
  TailSource tailSource=newTailSource();
  tailTweets(tailSource);
  FieldValueCounterSink sink=metrics().newFieldValueCounterSink("String_Node_Str");
  stream().create(generateStreamName(),"String_Node_Str",tailSource,sink);
  assertThat(sink,eventually(exists()));
}
Program: 15517
Project: 15517
Buggy source:
@Test public void testFieldValueCounterDisplay() throws Exception {
  TreeMap<String,Double> fvcMap=new TreeMap<String,Double>();
  fvcMap.put("String_Node_Str",1d);
  fvcMap.put("String_Node_Str",2d);
  TailSource tailSource=newTailSource();
  tailTweets(tailSource);
  FieldValueCounterSink sink=metrics().newFieldValueCounterSink("String_Node_Str");
  stream().create(generateStreamName(),"String_Node_Str",tailSource,sink);
  Table t=sink.constructFVCDisplay(fvcMap);
  assertThat(sink,eventually(hasValue(t)));
}

Fixed version (ground truth):
@Test public void testFieldValueCounterDisplay() throws Exception {
  org.junit.Assume.assumeFalse(System.getProperty("String_Node_Str").toLowerCase().startsWith("String_Node_Str"));
  TreeMap<String,Double> fvcMap=new TreeMap<String,Double>();
  fvcMap.put("String_Node_Str",1d);
  fvcMap.put("String_Node_Str",2d);
  TailSource tailSource=newTailSource();
  tailTweets(tailSource);
  FieldValueCounterSink sink=metrics().newFieldValueCounterSink("String_Node_Str");
  stream().create(generateStreamName(),"String_Node_Str",tailSource,sink);
  Table t=sink.constructFVCDisplay(fvcMap);
  assertThat(sink,eventually(hasValue(t)));
}
Program: 15518
Project: 15518
Buggy source:
/** 
 * Verify the stream is listed in stream list.
 * @param streamName the name of the stream
 * @param definition definition of the stream
 */
public void verifyExists(String streamName,String definition,boolean deployed){
  CommandResult cr=getShell().executeCommand("String_Node_Str");
  assertTrue("String_Node_Str" + cr.toString(),cr.isSuccess());
  Table t=(Table)cr.getResult();
  assertTrue(t.getRows().contains(new TableRow().addValue(1,streamName).addValue(2,definition).addValue(3,deployed ? "String_Node_Str" : "String_Node_Str")));
}

Fixed version (ground truth):
/** 
 * Verify the stream is listed in stream list.
 * @param streamName the name of the stream
 * @param definition definition of the stream
 */
public void verifyExists(String streamName,String definition,boolean deployed){
  CommandResult cr=getShell().executeCommand("String_Node_Str");
  assertTrue("String_Node_Str" + cr.toString(),cr.isSuccess());
  Table t=(Table)cr.getResult();
  assertTrue(t.getRows().contains(new TableRow().addValue(1,streamName).addValue(2,definition.replace("String_Node_Str","String_Node_Str")).addValue(3,deployed ? "String_Node_Str" : "String_Node_Str")));
}
Program: 15519
Project: 15519
Buggy source:
public HttpSource postFromFile(File file){
  String command=String.format("String_Node_Str",port,file.getAbsolutePath());
  if (contentType != null) {
    command+=String.format("String_Node_Str",contentType);
  }
  CommandResult result=shell.executeCommand(command);
  Assert.isTrue(result.isSuccess());
  return this;
}

Fixed version (ground truth):
public HttpSource postFromFile(File file){
  String command=String.format("String_Node_Str",port,FixtureUtils.handleShellEscapeProcessing(file.getAbsolutePath()));
  if (contentType != null) {
    command+=String.format("String_Node_Str",contentType);
  }
  CommandResult result=shell.executeCommand(command);
  Assert.isTrue(result.isSuccess());
  return this;
}
Program: 15520
Project: 15520
Buggy source:
@Override protected String toDSL(){
  String fileName=file.getName();
  return String.format("String_Node_Str",file.getParent(),fileName.substring(0,fileName.lastIndexOf("String_Node_Str")),"String_Node_Str",charset,binary,"String_Node_Str");
}

Fixed version (ground truth):
@Override protected String toDSL(){
  String fileName=file.getName();
  return String.format("String_Node_Str",FixtureUtils.handleShellEscapeProcessing(file.getParent()),fileName.substring(0,fileName.lastIndexOf("String_Node_Str")),"String_Node_Str",charset,binary,"String_Node_Str");
}
Program: 15521
Project: 15521
Buggy source:
@Override protected String toDSL(){
  return String.format("String_Node_Str",file.getParent());
}

Fixed version (ground truth):
@Override protected String toDSL(){
  return String.format("String_Node_Str",FixtureUtils.handleShellEscapeProcessing(file.getParent()));
}
Program: 15522
Project: 15522
Buggy source:
@Override public String toDSL(){
  return String.format("String_Node_Str",file.getAbsolutePath());
}

Fixed version (ground truth):
@Override public String toDSL(){
  return String.format("String_Node_Str",FixtureUtils.handleShellEscapeProcessing(file.getAbsolutePath()));
}
Program: 15523
Project: 15523
Buggy source:
private Object deserializePayload(byte[] bytes,MimeType contentType){
  Class<?> targetType=null;
  try {
    if (contentType.equals(TEXT_PLAIN)) {
      return new String(bytes,"String_Node_Str");
    }
    targetType=Class.forName(contentType.getParameter("String_Node_Str"));
    return codec.deserialize(bytes,targetType);
  }
 catch (  ClassNotFoundException e) {
    throw new SerializationException("String_Node_Str" + targetType + "String_Node_Str",e);
  }
catch (  IOException e) {
    throw new SerializationException("String_Node_Str" + targetType + "String_Node_Str",e);
  }
}

Fixed version (ground truth):
private Object deserializePayload(byte[] bytes,MimeType contentType){
  Class<?> targetType=null;
  try {
    if (contentType.equals(TEXT_PLAIN)) {
      return new String(bytes,"String_Node_Str");
    }
    String className=JavaClassMimeTypeConversion.classNameFromMimeType(contentType);
    targetType=Class.forName(className);
    return codec.deserialize(bytes,targetType);
  }
 catch (  ClassNotFoundException e) {
    throw new SerializationException("String_Node_Str" + targetType + "String_Node_Str",e);
  }
catch (  IOException e) {
    throw new SerializationException("String_Node_Str" + targetType + "String_Node_Str",e);
  }
}
Program: 15524
Project: 15524
Buggy source:
@Test public void testBytesPassThru(){
  byte[] payload="String_Node_Str".getBytes();
  Message<byte[]> message=MessageBuilder.withPayload(payload).build();
  Message<?> converted=messageBus.serializePayloadIfNecessary(message,MediaType.APPLICATION_OCTET_STREAM);
  assertSame(payload,converted.getPayload());
  assertEquals(MediaType.APPLICATION_OCTET_STREAM,contentTypeResolver.resolve(converted.getHeaders()));
  Message<?> reconstructed=messageBus.deserializePayloadIfNecessary(converted);
  payload=(byte[])reconstructed.getPayload();
  assertSame(converted.getPayload(),payload);
  assertNull(reconstructed.getHeaders().get(MessageBusSupport.ORIGINAL_CONTENT_TYPE_HEADER));
}

Fixed version (ground truth):
@Test public void testBytesPassThru(){
  byte[] payload="String_Node_Str".getBytes();
  Message<byte[]> message=MessageBuilder.withPayload(payload).build();
  Message<?> converted=messageBus.serializePayloadIfNecessary(message,MimeTypeUtils.APPLICATION_OCTET_STREAM);
  assertSame(payload,converted.getPayload());
  assertEquals(MimeTypeUtils.APPLICATION_OCTET_STREAM,contentTypeResolver.resolve(converted.getHeaders()));
  Message<?> reconstructed=messageBus.deserializePayloadIfNecessary(converted);
  payload=(byte[])reconstructed.getPayload();
  assertSame(converted.getPayload(),payload);
  assertNull(reconstructed.getHeaders().get(MessageBusSupport.ORIGINAL_CONTENT_TYPE_HEADER));
}
Program: 15525
Project: 15525
Buggy source:
@Test public void testTupleSerialization(){
  Tuple payload=TupleBuilder.tuple().of("String_Node_Str","String_Node_Str");
  Message<?> converted=messageBus.serializePayloadIfNecessary(new GenericMessage<Tuple>(payload),MediaType.APPLICATION_OCTET_STREAM);
  MimeType mimeType=contentTypeResolver.resolve(converted.getHeaders());
  assertEquals("String_Node_Str",mimeType.getType());
  assertEquals("String_Node_Str",mimeType.getSubtype());
  assertEquals(DefaultTuple.class.getName(),mimeType.getParameter("String_Node_Str"));
  Message<?> reconstructed=messageBus.deserializePayloadIfNecessary(converted);
  assertEquals("String_Node_Str",((Tuple)reconstructed.getPayload()).getString("String_Node_Str"));
  assertNull(reconstructed.getHeaders().get(MessageHeaders.CONTENT_TYPE));
}

Fixed version (ground truth):
@Test public void testTupleSerialization(){
  Tuple payload=TupleBuilder.tuple().of("String_Node_Str","String_Node_Str");
  Message<?> converted=messageBus.serializePayloadIfNecessary(new GenericMessage<Tuple>(payload),MimeTypeUtils.APPLICATION_OCTET_STREAM);
  MimeType mimeType=contentTypeResolver.resolve(converted.getHeaders());
  assertEquals("String_Node_Str",mimeType.getType());
  assertEquals("String_Node_Str",mimeType.getSubtype());
  assertEquals(DefaultTuple.class.getName(),mimeType.getParameter("String_Node_Str"));
  Message<?> reconstructed=messageBus.deserializePayloadIfNecessary(converted);
  assertEquals("String_Node_Str",((Tuple)reconstructed.getPayload()).getString("String_Node_Str"));
  assertNull(reconstructed.getHeaders().get(MessageHeaders.CONTENT_TYPE));
}
Program: 15526
Project: 15526
Buggy source:
@Test public void testContentTypePreserved() throws IOException {
  Message<String> inbound=MessageBuilder.withPayload("String_Node_Str").copyHeaders(Collections.singletonMap(MessageHeaders.CONTENT_TYPE,MediaType.APPLICATION_JSON)).build();
  Message<?> converted=messageBus.serializePayloadIfNecessary(inbound,MediaType.APPLICATION_OCTET_STREAM);
  assertEquals(MediaType.TEXT_PLAIN,contentTypeResolver.resolve(converted.getHeaders()));
  assertEquals(MediaType.APPLICATION_JSON,converted.getHeaders().get(MessageBusSupport.ORIGINAL_CONTENT_TYPE_HEADER));
  Message<?> reconstructed=messageBus.deserializePayloadIfNecessary(converted);
  assertEquals("String_Node_Str",reconstructed.getPayload());
  assertEquals(MediaType.APPLICATION_JSON,reconstructed.getHeaders().get(MessageHeaders.CONTENT_TYPE));
}

Fixed version (ground truth):
@Test public void testContentTypePreserved() throws IOException {
  Message<String> inbound=MessageBuilder.withPayload("String_Node_Str").copyHeaders(Collections.singletonMap(MessageHeaders.CONTENT_TYPE,MimeTypeUtils.APPLICATION_JSON)).build();
  Message<?> converted=messageBus.serializePayloadIfNecessary(inbound,MimeTypeUtils.APPLICATION_OCTET_STREAM);
  assertEquals(MimeTypeUtils.TEXT_PLAIN,contentTypeResolver.resolve(converted.getHeaders()));
  assertEquals(MimeTypeUtils.APPLICATION_JSON,converted.getHeaders().get(MessageBusSupport.ORIGINAL_CONTENT_TYPE_HEADER));
  Message<?> reconstructed=messageBus.deserializePayloadIfNecessary(converted);
  assertEquals("String_Node_Str",reconstructed.getPayload());
  assertEquals(MimeTypeUtils.APPLICATION_JSON,reconstructed.getHeaders().get(MessageHeaders.CONTENT_TYPE));
}
Program: 15527
Project: 15527
Buggy source:
@Test public void testString() throws IOException {
  Message<?> converted=messageBus.serializePayloadIfNecessary(new GenericMessage<String>("String_Node_Str"),MediaType.APPLICATION_OCTET_STREAM);
  assertEquals(MediaType.TEXT_PLAIN,contentTypeResolver.resolve(converted.getHeaders()));
  Message<?> reconstructed=messageBus.deserializePayloadIfNecessary(converted);
  assertEquals("String_Node_Str",reconstructed.getPayload());
  assertNull(reconstructed.getHeaders().get(MessageHeaders.CONTENT_TYPE));
}

Fixed version (ground truth):
@Test public void testString() throws IOException {
  Message<?> converted=messageBus.serializePayloadIfNecessary(new GenericMessage<String>("String_Node_Str"),MimeTypeUtils.APPLICATION_OCTET_STREAM);
  assertEquals(MimeTypeUtils.TEXT_PLAIN,contentTypeResolver.resolve(converted.getHeaders()));
  Message<?> reconstructed=messageBus.deserializePayloadIfNecessary(converted);
  assertEquals("String_Node_Str",reconstructed.getPayload());
  assertNull(reconstructed.getHeaders().get(MessageHeaders.CONTENT_TYPE));
}
Program: 15528
Project: 15528
Buggy source:
@Test public void testBytesPassThruContentType(){
  byte[] payload="String_Node_Str".getBytes();
  Message<byte[]> message=MessageBuilder.withPayload(payload).setHeader(MessageHeaders.CONTENT_TYPE,MediaType.APPLICATION_OCTET_STREAM_VALUE).build();
  Message<?> converted=messageBus.serializePayloadIfNecessary(message,MediaType.APPLICATION_OCTET_STREAM);
  assertSame(payload,converted.getPayload());
  assertEquals(MediaType.APPLICATION_OCTET_STREAM,contentTypeResolver.resolve(converted.getHeaders()));
  Message<?> reconstructed=messageBus.deserializePayloadIfNecessary(converted);
  payload=(byte[])reconstructed.getPayload();
  assertSame(converted.getPayload(),payload);
  assertEquals(MediaType.APPLICATION_OCTET_STREAM_VALUE,reconstructed.getHeaders().get(MessageHeaders.CONTENT_TYPE));
  assertNull(reconstructed.getHeaders().get(MessageBusSupport.ORIGINAL_CONTENT_TYPE_HEADER));
}

Fixed version (ground truth):
@Test public void testBytesPassThruContentType(){
  byte[] payload="String_Node_Str".getBytes();
  Message<byte[]> message=MessageBuilder.withPayload(payload).setHeader(MessageHeaders.CONTENT_TYPE,MimeTypeUtils.APPLICATION_OCTET_STREAM_VALUE).build();
  Message<?> converted=messageBus.serializePayloadIfNecessary(message,MimeTypeUtils.APPLICATION_OCTET_STREAM);
  assertSame(payload,converted.getPayload());
  assertEquals(MimeTypeUtils.APPLICATION_OCTET_STREAM,contentTypeResolver.resolve(converted.getHeaders()));
  Message<?> reconstructed=messageBus.deserializePayloadIfNecessary(converted);
  payload=(byte[])reconstructed.getPayload();
  assertSame(converted.getPayload(),payload);
  assertEquals(MimeTypeUtils.APPLICATION_OCTET_STREAM_VALUE,reconstructed.getHeaders().get(MessageHeaders.CONTENT_TYPE));
  assertNull(reconstructed.getHeaders().get(MessageBusSupport.ORIGINAL_CONTENT_TYPE_HEADER));
}
Program: 15529
Project: 15529
Buggy source:
@Test public void testPojoSerialization(){
  Message<?> converted=messageBus.serializePayloadIfNecessary(new GenericMessage<Foo>(new Foo("String_Node_Str")),MediaType.APPLICATION_OCTET_STREAM);
  MimeType mimeType=contentTypeResolver.resolve(converted.getHeaders());
  assertEquals("String_Node_Str",mimeType.getType());
  assertEquals("String_Node_Str",mimeType.getSubtype());
  assertEquals(Foo.class.getName(),mimeType.getParameter("String_Node_Str"));
  Message<?> reconstructed=messageBus.deserializePayloadIfNecessary(converted);
  assertEquals("String_Node_Str",((Foo)reconstructed.getPayload()).getBar());
  assertNull(reconstructed.getHeaders().get(MessageHeaders.CONTENT_TYPE));
}

Fixed version (ground truth):
@Test public void testPojoSerialization(){
  Message<?> converted=messageBus.serializePayloadIfNecessary(new GenericMessage<Foo>(new Foo("String_Node_Str")),MimeTypeUtils.APPLICATION_OCTET_STREAM);
  MimeType mimeType=contentTypeResolver.resolve(converted.getHeaders());
  assertEquals("String_Node_Str",mimeType.getType());
  assertEquals("String_Node_Str",mimeType.getSubtype());
  assertEquals(Foo.class.getName(),mimeType.getParameter("String_Node_Str"));
  Message<?> reconstructed=messageBus.deserializePayloadIfNecessary(converted);
  assertEquals("String_Node_Str",((Foo)reconstructed.getPayload()).getBar());
  assertNull(reconstructed.getHeaders().get(MessageHeaders.CONTENT_TYPE));
}
Program: 15530
Project: 15530
Buggy source:
/** 
 * Constructs a SyslogUdpSource that receives syslog events via udp.
 * @return an instance of SyslogUdpSource.
 */
public SyslogUdpSource syslogUdpSource(){
  return SyslogUdpSource.withDefaults();
}

Fixed version (ground truth):
/** 
 * Constructs a SyslogUdpSource that receives syslog events via udp.
 * @param host the ip of the machine where simulated syslog traffic will be sent.
 * @return an instance of SyslogUdpSource.
 */
public SyslogUdpSource syslogUdpSource(String host){
  return SyslogUdpSource.withDefaults(host);
}
Program: 15531
Project: 15531
Buggy source:
/** 
 * Constructs a SyslogTcpSource that receives syslog events via tcp.
 * @return an instance of SyslogTcpSource.
 */
public SyslogTcpSource syslogTcpSource(){
  return SyslogTcpSource.withDefaults();
}

Fixed version (ground truth):
/** 
 * Constructs a SyslogTcpSource that receives syslog events via tcp.
 * @param host the ip of the machine where simulated syslog traffic will be sent.
 * @return an instance of SyslogTcpSource.
 */
public SyslogTcpSource syslogTcpSource(String host){
  return SyslogTcpSource.withDefaults(host);
}
Program: 15532
Project: 15532
Buggy source:
/** 
 * Verifies that the Syslog TCP Source captures the correct data.
 */
@Test public void testSyslogTcp(){
  String data=UUID.randomUUID().toString();
  SyslogTcpSource syslogTcp=sources.syslogTcpSource().host(getContainerForStream().getHost());
  stream(syslogTcp + XD_DELIMETER + "String_Node_Str");
  waitForXD();
  syslogTcp.sendBytes((data + "String_Node_Str").getBytes());
  assertReceived(1);
  assertContains(data);
}

Fixed version (ground truth):
/** 
 * Verifies that the Syslog TCP Source captures the correct data.
 */
@Test public void testSyslogTcp(){
  String data=UUID.randomUUID().toString();
  SyslogTcpSource syslogTcp=sources.syslogTcpSource(getContainerForStream().getHost());
  stream(syslogTcp + XD_DELIMETER + "String_Node_Str");
  waitForXD();
  syslogTcp.sendBytes((data + "String_Node_Str").getBytes());
  assertReceived(1);
  assertContains(data);
}
Program: 15533
Project: 15533
Buggy source:
/** 
 * Verifies that the Syslog UDP Source captures the correct data.
 */
@Test public void testSyslogUdp(){
  String data=UUID.randomUUID().toString();
  SyslogUdpSource syslogUdp=sources.syslogUdpSource().host(getContainerForStream().getHost());
  stream(syslogUdp + XD_DELIMETER + "String_Node_Str");
  waitForXD();
  syslogUdp.sendBytes((data + "String_Node_Str").getBytes());
  assertReceived(1);
  this.assertContains(data);
}

Fixed version (ground truth):
/** 
 * Verifies that the Syslog UDP Source captures the correct data.
 */
@Test public void testSyslogUdp(){
  String data=UUID.randomUUID().toString();
  SyslogUdpSource syslogUdp=sources.syslogUdpSource(getContainerForStream().getHost());
  stream(syslogUdp + XD_DELIMETER + "String_Node_Str");
  waitForXD();
  syslogUdp.sendBytes((data + "String_Node_Str").getBytes());
  assertReceived(1);
  this.assertContains(data);
}
Program: 15534
Project: 15534
Buggy source:
/** 
 * Returns a SyslogTcpSource fixture instance that is initialized with default port and the host param.
 * @param host The host that tcp will be sent.
 * @return a SyslogTcpSource instance
 */
public static SyslogTcpSource withDefaults(String host){
  Assert.hasText(host,"String_Node_Str");
  return new SyslogTcpSource(host,DEFAULT_PORT);
}

Fixed version (ground truth):
/** 
 * Returns a SyslogTcpSource fixture instance that is initialized with default port and the  provided host parameter
 * @param host The host that tcp data will be sent.
 * @return a SyslogTcpSource instance
 */
public static SyslogTcpSource withDefaults(String host){
  Assert.hasText(host,"String_Node_Str");
  return new SyslogTcpSource(host,DEFAULT_PORT);
}
Program: 15535
Project: 15535
Buggy source:
@Override @RequestMapping(value="String_Node_Str",produces="String_Node_Str") public ModelAndView errorHtml(HttpServletRequest request){
  Map<String,Object> map=extract(new ServletRequestAttributes(request),false,false);
  int status=(int)map.get("String_Node_Str");
switch (status) {
case 404:
    return new ModelAndView(new RedirectView("String_Node_Str"));
}
return super.errorHtml(request);
}

Fixed version (ground truth):
@Override @RequestMapping(value="String_Node_Str",produces="String_Node_Str") public ModelAndView errorHtml(HttpServletRequest request){
  Map<String,Object> map=extract(new ServletRequestAttributes(request),false,false);
  int status=(Integer)map.get("String_Node_Str");
switch (status) {
case 404:
    return new ModelAndView(new RedirectView("String_Node_Str"));
}
return super.errorHtml(request);
}
Program: 15536
Project: 15536
Buggy source:
/** 
 * Create an instance of   {@link ModuleDescriptor} for a given job name.This helper method is intended for use in  {@link ContainerMatcher#match(ModuleDescriptor,ContainerRepository)}when deploying jobs. This is intended to be temporary; future revisions of Jobs will include ModuleDescriptors.
 * @param jobName job name
 * @return a ModuleDescriptor for the given job
 */
public static ModuleDescriptor createJobModuleDescriptor(String jobName){
  return new ModuleDescriptor(new ModuleDefinition(jobName,ModuleType.job),jobName,jobName,0,null,1);
}

Fixed version (ground truth):
/** 
 * Create an instance of   {@link ModuleDescriptor} for a given job name.This helper method is intended for use in  {@link ContainerMatcher#match(ModuleDescriptor,ContainerRepository)}when deploying jobs. This is intended to be temporary; future revisions of Jobs will include ModuleDescriptors.
 * @param jobName job name
 * @return a ModuleDescriptor for the given job
 */
public static ModuleDescriptor createJobModuleDescriptor(String jobName){
  return new ModuleDescriptor(new ModuleDefinition(jobName,ModuleType.job),jobName,jobName,0,null);
}
Program: 15537
Project: 15537
Buggy source:
private final boolean waitForStreamOp(StreamDefinition definition,boolean isDeploy){
  final int MAX_TRIES=40;
  int tries=1;
  boolean done=false;
  while (!done && tries <= MAX_TRIES) {
    done=true;
    int i=definition.getModuleDefinitions().size();
    for (    ModuleDefinition module : definition.getModuleDefinitions()) {
      Module deployedModule=getModule(definition.getName(),module.getName(),--i);
      done=(isDeploy) ? deployedModule != null : deployedModule == null;
      if (!done) {
        break;
      }
    }
    if (!done) {
      try {
        Thread.sleep(100);
        tries++;
      }
 catch (      InterruptedException e) {
        Thread.currentThread().interrupt();
      }
    }
  }
  return done;
}

Fixed version (ground truth):
private final boolean waitForStreamOp(StreamDefinition definition,boolean isDeploy){
  final int MAX_TRIES=40;
  int tries=1;
  boolean done=false;
  while (!done && tries <= MAX_TRIES) {
    done=true;
    int i=definition.getModuleDefinitions().size();
    for (    ModuleDefinition module : definition.getModuleDefinitions()) {
      Module deployedModule=getModule(definition.getName(),module.getName(),--i);
      done=(isDeploy) ? deployedModule != null : deployedModule == null;
      if (!done) {
        break;
      }
    }
    if (!done) {
      try {
        Thread.sleep(100);
        tries++;
      }
 catch (      InterruptedException e) {
        Thread.currentThread().interrupt();
        break;
      }
    }
  }
  return done;
}
Program: 15540
Project: 15540
Buggy source:
/** 
 * Handle the deletion of a job deployment.
 * @param client curator client
 * @param data   job deployment request data
 */
private void onChildRemoved(CuratorFramework client,ChildData data) throws Exception {
  String jobName=Paths.stripPath(data.getPath());
  byte[] bytes=client.getData().forPath(Paths.build(Paths.JOBS,jobName));
  Map<String,String> map=mapBytesUtility.toMap(bytes);
  JobDefinition jobDefinition=new JobDefinition(jobName,map.get("String_Node_Str"));
  LOG.info("String_Node_Str",jobDefinition);
  undeployJob(client,jobDefinition);
}

Fixed version (ground truth):
/** 
 * Handle the deletion of a job deployment.
 * @param client curator client
 * @param data   job deployment request data
 */
private void onChildRemoved(CuratorFramework client,ChildData data) throws Exception {
  String jobName=Paths.stripPath(data.getPath());
  LOG.info("String_Node_Str",jobName);
  try {
    byte[] bytes=client.getData().forPath(Paths.build(Paths.JOBS,jobName));
    Map<String,String> map=mapBytesUtility.toMap(bytes);
    JobDefinition jobDefinition=new JobDefinition(jobName,map.get("String_Node_Str"));
    undeployJob(client,jobDefinition);
  }
 catch (  KeeperException.NoNodeException e) {
    LOG.debug("String_Node_Str",jobName);
  }
}
Program: 15541
Project: 15541
Buggy source:
/** 
 * Handle the deletion of a stream deployment.
 * @param client curator client
 * @param data   stream deployment request data
 */
private void onChildRemoved(CuratorFramework client,ChildData data) throws Exception {
  String streamName=Paths.stripPath(data.getPath());
  LOG.info("String_Node_Str",streamName);
  byte[] streamDefinition=client.getData().forPath(new StreamsPath().setStreamName(streamName).build());
  Stream stream=streamFactory.createStream(streamName,mapBytesUtility.toMap(streamDefinition));
  List<String> paths=new ArrayList<String>();
  paths.add(new StreamsPath().setStreamName(streamName).setModuleType(Module.Type.SOURCE.toString()).build());
  for (  ModuleDescriptor descriptor : stream.getProcessors()) {
    paths.add(new StreamsPath().setStreamName(streamName).setModuleType(Module.Type.PROCESSOR.toString()).setModuleLabel(descriptor.getLabel()).build());
  }
  paths.add(new StreamsPath().setStreamName(streamName).setModuleType(Module.Type.PROCESSOR.toString()).build());
  paths.add(new StreamsPath().setStreamName(streamName).setModuleType(Module.Type.SINK.toString()).build());
  for (  String path : paths) {
    try {
      client.delete().deletingChildrenIfNeeded().forPath(path);
    }
 catch (    KeeperException.NoNodeException e) {
      LOG.trace("String_Node_Str",path);
    }
  }
}

Fixed version (ground truth):
/** 
 * Handle the deletion of a stream deployment.
 * @param client curator client
 * @param data   stream deployment request data
 */
private void onChildRemoved(CuratorFramework client,ChildData data) throws Exception {
  String streamName=Paths.stripPath(data.getPath());
  LOG.info("String_Node_Str",streamName);
  Stream stream;
  try {
    byte[] streamDefinition=client.getData().forPath(new StreamsPath().setStreamName(streamName).build());
    stream=streamFactory.createStream(streamName,mapBytesUtility.toMap(streamDefinition));
  }
 catch (  KeeperException.NoNodeException e) {
    LOG.debug("String_Node_Str",streamName);
    return;
  }
  List<String> paths=new ArrayList<String>();
  paths.add(new StreamsPath().setStreamName(streamName).setModuleType(Module.Type.SOURCE.toString()).build());
  for (  ModuleDescriptor descriptor : stream.getProcessors()) {
    paths.add(new StreamsPath().setStreamName(streamName).setModuleType(Module.Type.PROCESSOR.toString()).setModuleLabel(descriptor.getLabel()).build());
  }
  paths.add(new StreamsPath().setStreamName(streamName).setModuleType(Module.Type.PROCESSOR.toString()).build());
  paths.add(new StreamsPath().setStreamName(streamName).setModuleType(Module.Type.SINK.toString()).build());
  for (  String path : paths) {
    try {
      client.delete().deletingChildrenIfNeeded().forPath(path);
    }
 catch (    KeeperException.NoNodeException e) {
      LOG.trace("String_Node_Str",path);
    }
  }
}
Program: 15542
Project: 15542
Buggy source:
/** 
 * Convert a byte array containing a JSON string to a map of key/value pairs.
 * @param bytes byte array containing the key/value pair strings
 * @return a new map instance containing the key/value pairs
 */
public Map<String,String> toMap(byte[] bytes){
  if (bytes == null || bytes.length == 0) {
    return Collections.emptyMap();
  }
  try {
    return reader.readValue(bytes);
  }
 catch (  JsonProcessingException e) {
    throw new RuntimeException(e);
  }
catch (  IOException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
/** 
 * Convert a byte array containing a JSON string to a map of key/value pairs.
 * @param bytes byte array containing the key/value pair strings
 * @return a new map instance containing the key/value pairs
 */
public Map<String,String> toMap(byte[] bytes){
  if (bytes == null || bytes.length == 0) {
    return Collections.emptyMap();
  }
  try {
    return reader.readValue(bytes);
  }
 catch (  Exception e) {
    String contents;
    try {
      contents=new String(bytes,"String_Node_Str");
    }
 catch (    UnsupportedEncodingException uue) {
      contents="String_Node_Str" + uue;
    }
    throw new RuntimeException("String_Node_Str" + contents,e);
  }
}
Program: 15543
Project: 15543
Buggy source:
@Test public void moduleChannelsRegisteredWithMessageBus(){
  StreamDefinition sd=new StreamDefinition("String_Node_Str","String_Node_Str");
  int originalBindings=getMessageBusBindings().size();
  integrationSupport.createAndDeployStream(sd);
  int newBindings=getMessageBusBindings().size() - originalBindings;
  assertEquals(3,newBindings);
  integrationSupport.undeployAndDestroyStream(sd);
  assertEquals(originalBindings,getMessageBusBindings().size());
}

Fixed version (ground truth):
@Test public void moduleChannelsRegisteredWithMessageBus(){
  StreamDefinition sd=new StreamDefinition("String_Node_Str","String_Node_Str");
  int originalBindings=getMessageBusBindings().size();
  assertTrue("String_Node_Str",integrationSupport.createAndDeployStream(sd));
  int newBindings=getMessageBusBindings().size() - originalBindings;
  assertEquals(3,newBindings);
  integrationSupport.undeployAndDestroyStream(sd);
  assertEquals(originalBindings,getMessageBusBindings().size());
}
Program: 15544
Project: 15544
Buggy source:
@Override public XDContainer launch(ContainerOptions options){
  try {
    String id=this.generateId();
    XDContainer container=new XDContainer(id);
    container.setApplicationContext(deployerContext);
    container.start();
    this.logContainerInfo(logger,container);
    container.addListener(new ShutdownListener(container));
    this.eventPublisher.publishEvent(new ContainerStartedEvent(container));
    return container;
  }
 catch (  Exception e) {
    logger.fatal(e.getClass().getName() + "String_Node_Str" + e.getMessage());
    this.logErrorInfo(e);
    System.exit(1);
  }
  return null;
}

Fixed version (ground truth):
@Override public XDContainer launch(ContainerOptions options){
  try {
    String id=this.generateId();
    XDContainer container=new XDContainer(id);
    container.setApplicationContext(deployerContext);
    container.start();
    this.logContainerInfo(logger,container);
    container.addListener(new ShutdownListener(container));
    this.eventPublisher.publishEvent(new ContainerStartedEvent(container));
    return container;
  }
 catch (  Exception e) {
    logger.fatal(e.getClass().getName() + "String_Node_Str" + e.getMessage());
    this.logErrorInfo(e);
    throw new XDContainerLaunchException(e.getMessage(),e);
  }
}
Program: 15545
Project: 15545
Buggy source:
/** 
 * The main entry point to create the AdminServer.
 * @param args command line arguments
 */
public static void main(String[] args){
  launchSingleNodeServer(parseCommandLineOptions(args));
}

Fixed version (ground truth):
/** 
 * The main entry point to create the AdminServer.
 * @param args command line arguments
 */
public static void main(String[] args){
  try {
    launchSingleNodeServer(parseCommandLineOptions(args));
  }
 catch (  Exception e) {
    System.err.println(e.getMessage());
    System.exit(1);
  }
}
Program: 15546
Project: 15546
Buggy source:
@Test public void testDefault(){
  SingleNodeMain.main(new String[]{});
}

Fixed version (ground truth):
@Test public void testDefault(){
  SingleNodeMain.parseOptions(new String[]{});
}
Program: 15547
Project: 15547
Buggy source:
private void verifyPayloadConversion(final Object expectedValue,final LocalChannelRegistry registry,Collection<MediaType> acceptedMediaTypes){
  DirectChannel myChannel=new DirectChannel();
  registry.inbound("String_Node_Str",myChannel,acceptedMediaTypes,false);
  DirectChannel input=registry.lookupSharedChannel("String_Node_Str",DirectChannel.class);
  assertNotNull(input);
  final AtomicBoolean msgSent=new AtomicBoolean(false);
  myChannel.subscribe(new MessageHandler(){
    @Override public void handleMessage(    Message<?> message) throws MessagingException {
      assertEquals(expectedValue,message.getPayload());
      msgSent.set(true);
    }
  }
);
  Message<Foo> msg=MessageBuilder.withPayload(new Foo()).setHeader(MessageHeaders.CONTENT_TYPE,MediaType.ALL_VALUE).build();
  input.send(msg);
  assertTrue(msgSent.get());
}

Fixed version (ground truth):
private void verifyPayloadConversion(final Object expectedValue,final LocalChannelRegistry registry,Collection<MediaType> acceptedMediaTypes){
  DirectChannel myChannel=new DirectChannel();
  registry.inbound("String_Node_Str",myChannel,acceptedMediaTypes,false);
  DirectChannel input=registry.getBean("String_Node_Str",DirectChannel.class);
  assertNotNull(input);
  final AtomicBoolean msgSent=new AtomicBoolean(false);
  myChannel.subscribe(new MessageHandler(){
    @Override public void handleMessage(    Message<?> message) throws MessagingException {
      assertEquals(expectedValue,message.getPayload());
      msgSent.set(true);
    }
  }
);
  Message<Foo> msg=MessageBuilder.withPayload(new Foo()).setHeader(MessageHeaders.CONTENT_TYPE,MediaType.ALL_VALUE).build();
  input.send(msg);
  assertTrue(msgSent.get());
}
Program: 15548
Project: 15548
Buggy source:
private void jButtonDownloadActionPerformed(ActionEvent evt){
  new Thread(new Runnable(){
    @Override public void run(){
      String btnText=jButtonDownload.getText();
      jButtonDownload.setText("String_Node_Str");
      jButtonDownload.setEnabled(false);
      if (!UpdateManager.downloadLatestAppVersion()) {
        JOptionPane.showMessageDialog(null,translation.getString(Translation.SEC_WCHECKFORUPDATES,"String_Node_Str") + "String_Node_Str" + translation.getString(Translation.SEC_WCHECKFORUPDATES,"String_Node_Str"),translation.getString(Translation.SEC_WCHECKFORUPDATES,"String_Node_Str"),JOptionPane.INFORMATION_MESSAGE);
        UpdateManager.extBrowserGetLatestVersion();
      }
 else {
        JOptionPane.showMessageDialog(null,translation.getString(Translation.SEC_WCHECKFORUPDATES,"String_Node_Str"),translation.getString(Translation.SEC_WCHECKFORUPDATES,"String_Node_Str"),JOptionPane.INFORMATION_MESSAGE);
      }
      jButtonDownload.setText(btnText);
      jButtonDownload.setEnabled(true);
    }
  }
).start();
}

Fixed version (ground truth):
private void jButtonDownloadActionPerformed(ActionEvent evt){
  UpdateManager.extBrowserGetLatestVersion();
}
Program: 15549
Project: 15549
Buggy source:
@Override public void run(){
  String btnText=jButtonDownload.getText();
  jButtonDownload.setText("String_Node_Str");
  jButtonDownload.setEnabled(false);
  if (!UpdateManager.downloadLatestAppVersion()) {
    JOptionPane.showMessageDialog(null,translation.getString(Translation.SEC_WCHECKFORUPDATES,"String_Node_Str") + "String_Node_Str" + translation.getString(Translation.SEC_WCHECKFORUPDATES,"String_Node_Str"),translation.getString(Translation.SEC_WCHECKFORUPDATES,"String_Node_Str"),JOptionPane.INFORMATION_MESSAGE);
    UpdateManager.extBrowserGetLatestVersion();
  }
 else {
    JOptionPane.showMessageDialog(null,translation.getString(Translation.SEC_WCHECKFORUPDATES,"String_Node_Str"),translation.getString(Translation.SEC_WCHECKFORUPDATES,"String_Node_Str"),JOptionPane.INFORMATION_MESSAGE);
  }
  jButtonDownload.setText(btnText);
  jButtonDownload.setEnabled(true);
}

Fixed version (ground truth):
@Override public void run(){
  String latestVersion=UpdateManager.getLatestVersion();
  StringBuilder message=new StringBuilder(256);
  message.append("String_Node_Str").append(translation.getString(Translation.SEC_WCHECKFORUPDATES,"String_Node_Str").replace("String_Node_Str",Version.VERSION)).append("String_Node_Str").append(translation.getString(Translation.SEC_WCHECKFORUPDATES,"String_Node_Str").replace("String_Node_Str",UpdateManager.normalizeVersionStr(latestVersion)));
  if (latestVersion.equalsIgnoreCase(translation.getString(Translation.SEC_WCHECKFORUPDATES,"String_Node_Str"))) {
    message.append("String_Node_Str");
    jButtonDownload.setVisible(false);
  }
 else {
    message.append("String_Node_Str");
    if (UpdateManager.IsUpToDate(latestVersion)) {
      message.append(translation.getString(Translation.SEC_WCHECKFORUPDATES,"String_Node_Str"));
      jButtonDownload.setVisible(false);
    }
 else {
      message.append(translation.getString(Translation.SEC_WCHECKFORUPDATES,"String_Node_Str"));
      jButtonDownload.setVisible(true);
    }
    message.append("String_Node_Str");
  }
  jLabelMessage.setText(message.toString());
}
Program: 15550
Project: 15550
Buggy source:
private void jButtonReloadRedistListActionPerformed(ActionEvent evt){
  searchRedistPackagesOnDisk();
  jButtonReloadRedistList.setEnabled(true);
  CLOSING_APP=false;
}

Fixed version (ground truth):
private void jButtonReloadRedistListActionPerformed(ActionEvent evt){
  searchRedistPackagesOnDisk(jButtonReloadRedistList);
  CLOSING_APP=false;
}
Program: 15552
Project: 15552
Buggy source:
static public CsvPreference getFormat(BufferedReader reader) throws IOException {
  reader.mark(10 * 1024);
  CsvPreference[] formats={CsvPreference.EXCEL_PREFERENCE,CsvPreference.EXCEL_NORTH_EUROPE_PREFERENCE,CsvPreference.TAB_PREFERENCE};
  for (  CsvPreference format : formats) {
    try {
      if (checkFormat(reader,format)) {
        return format;
      }
    }
  finally {
      reader.reset();
    }
  }
  throw new IOException("String_Node_Str");
}

Fixed version (ground truth):
static public CsvPreference getFormat(BufferedReader reader) throws IOException {
  reader.mark(10 * 1024);
  CsvPreference[] templates={CsvPreference.EXCEL_PREFERENCE,CsvPreference.EXCEL_NORTH_EUROPE_PREFERENCE,CsvPreference.TAB_PREFERENCE};
  for (  CsvPreference template : templates) {
    CsvPreference format=createFormat(template);
    try {
      if (checkFormat(reader,format)) {
        return format;
      }
    }
  finally {
      reader.reset();
    }
  }
  throw new IOException("String_Node_Str");
}