nus-yam/ex-repair huggingface dataset:
Program: 46387
Project: 46387
Buggy source:
private BufferedWriter newWriter() throws FileNotFoundException {
  FileOutputStream fos=new FileOutputStream(file,true);
  CharsetEncoder encoder=Charset.forName("String_Node_Str").newEncoder();
  return new BufferedWriter(new OutputStreamWriter(fos,encoder));
}

Fixed version (ground truth):
private PrintWriter newWriter() throws FileNotFoundException {
  FileOutputStream fos=new FileOutputStream(file,true);
  CharsetEncoder encoder=Charset.forName("String_Node_Str").newEncoder();
  return new PrintWriter(new BufferedWriter(new OutputStreamWriter(fos,encoder),Short.MAX_VALUE));
}
Program: 46388
Project: 46388
Buggy source:
@SuppressFBWarnings("String_Node_Str") private void rollover(){
  closeResource(bufferedWriter);
  bufferedWriter=null;
  file=null;
  fileLength=0;
  index++;
  File file=new File(format(fileName,index - maxRollingFileCount));
  file.delete();
}

Fixed version (ground truth):
@SuppressFBWarnings("String_Node_Str") private void rollover(){
  closeResource(printWriter);
  printWriter=null;
  file=null;
  index++;
  File file=new File(format(fileName,index - maxRollingFileCount));
  file.delete();
}
Program: 46389
Project: 46389
Buggy source:
public void write(DiagnosticsPlugin plugin){
  try {
    if (file == null) {
      file=new File(diagnostics.directory,format(fileName,index));
      bufferedWriter=newWriter();
      renderStaticPlugins();
    }
    renderPlugin(plugin);
    bufferedWriter.flush();
    if (fileLength >= maxRollingFileSizeBytes) {
      rollover();
    }
  }
 catch (  IOException e) {
    logger.warning("String_Node_Str" + file.getAbsolutePath(),e);
    file=null;
    closeResource(bufferedWriter);
    bufferedWriter=null;
  }
catch (  RuntimeException e) {
    logger.warning("String_Node_Str" + file,e);
  }
}

Fixed version (ground truth):
public void write(DiagnosticsPlugin plugin){
  try {
    if (file == null) {
      file=new File(diagnostics.directory,format(fileName,index));
      printWriter=newWriter();
      renderStaticPlugins();
    }
    renderPlugin(plugin);
    printWriter.flush();
    if (file.length() >= maxRollingFileSizeBytes) {
      rollover();
    }
  }
 catch (  IOException e) {
    logger.warning("String_Node_Str" + file.getAbsolutePath(),e);
    file=null;
    closeResource(printWriter);
    printWriter=null;
  }
catch (  RuntimeException e) {
    logger.warning("String_Node_Str" + file,e);
  }
}
Program: 46390
Project: 46390
Buggy source:
protected void appendDateTime(){
  date.setTime(System.currentTimeMillis());
  calendar.setTime(date);
  appendDate();
  sb.append(' ');
  appendTime();
}

Fixed version (ground truth):
protected void appendDateTime(){
  date.setTime(System.currentTimeMillis());
  calendar.setTime(date);
  appendDate();
  write(' ');
  appendTime();
}
Program: 46391
Project: 46391
Buggy source:
private void appendDate(){
  sb.append(calendar.get(DAY_OF_MONTH));
  sb.append('-');
  sb.append(calendar.get(MONTH));
  sb.append('-');
  sb.append(calendar.get(YEAR));
}

Fixed version (ground truth):
private void appendDate(){
  write(calendar.get(DAY_OF_MONTH));
  write('-');
  write(calendar.get(MONTH));
  write('-');
  write(calendar.get(YEAR));
}
Program: 46392
Project: 46392
Buggy source:
@SuppressWarnings("String_Node_Str") private void appendTime(){
  int hour=calendar.get(HOUR_OF_DAY);
  if (hour < 10) {
    sb.append('0');
  }
  sb.append(hour);
  sb.append(':');
  int minute=calendar.get(MINUTE);
  if (minute < 10) {
    sb.append('0');
  }
  sb.append(minute);
  sb.append(':');
  int second=calendar.get(SECOND);
  if (second < 10) {
    sb.append('0');
  }
  sb.append(second);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void appendTime(){
  int hour=calendar.get(HOUR_OF_DAY);
  if (hour < 10) {
    write('0');
  }
  write(hour);
  write(':');
  int minute=calendar.get(MINUTE);
  if (minute < 10) {
    write('0');
  }
  write(minute);
  write(':');
  int second=calendar.get(SECOND);
  if (second < 10) {
    write('0');
  }
  write(second);
}
Program: 46393
Project: 46393
Buggy source:
@SuppressWarnings("String_Node_Str") void writeLong(long value){
  if (value == Long.MIN_VALUE) {
    sb.append(STR_LONG_MIN_VALUE);
    return;
  }
  if (value < 0) {
    sb.append('-');
    value=-value;
  }
  int digitsWithoutComma=0;
  tmpSb.setLength(0);
  do {
    digitsWithoutComma++;
    if (digitsWithoutComma == 4) {
      tmpSb.append(',');
      digitsWithoutComma=1;
    }
    int mod=(int)(value % 10);
    tmpSb.append(DIGITS[mod]);
    value=value / 10;
  }
 while (value > 0);
  for (int k=tmpSb.length() - 1; k >= 0; k--) {
    char c=tmpSb.charAt(k);
    sb.append(c);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") void writeLong(long value){
  if (value == Long.MIN_VALUE) {
    write(STR_LONG_MIN_VALUE);
    return;
  }
  if (value < 0) {
    write('-');
    value=-value;
  }
  int digitsWithoutComma=0;
  tmpSb.setLength(0);
  do {
    digitsWithoutComma++;
    if (digitsWithoutComma == 4) {
      tmpSb.append(',');
      digitsWithoutComma=1;
    }
    int mod=(int)(value % 10);
    tmpSb.append(DIGITS[mod]);
    value=value / 10;
  }
 while (value > 0);
  for (int k=tmpSb.length() - 1; k >= 0; k--) {
    char c=tmpSb.charAt(k);
    write(c);
  }
}
Program: 46394
Project: 46394
Buggy source:
@Override public void writeKeyValueEntry(String key,boolean value){
  writeKeyValueHead(key);
  sb.append(value);
}

Fixed version (ground truth):
@Override public void writeKeyValueEntry(String key,boolean value){
  writeKeyValueHead(key);
  write(value);
}
Program: 46395
Project: 46395
Buggy source:
@Override public void endSection(){
  sb.append(']');
  sectionLevel--;
  if (sectionLevel == -1) {
    sb.append(LINE_SEPARATOR);
  }
}

Fixed version (ground truth):
@Override public void endSection(){
  write(']');
  sectionLevel--;
  if (sectionLevel == -1) {
    write(LINE_SEPARATOR);
  }
}
Program: 46396
Project: 46396
Buggy source:
@Override public void writeEntry(String s){
  sb.append(INDENTS[sectionLevel]);
  sb.append(s);
}

Fixed version (ground truth):
@Override public void writeEntry(String s){
  write(INDENTS[sectionLevel]);
  write(s);
}
Program: 46397
Project: 46397
Buggy source:
private void writeKeyValueHead(String key){
  sb.append(INDENTS[sectionLevel]);
  sb.append(key);
  sb.append('=');
}

Fixed version (ground truth):
private void writeKeyValueHead(String key){
  write(INDENTS[sectionLevel]);
  write(key);
  write('=');
}
Program: 46398
Project: 46398
Buggy source:
@Override public void startSection(String name){
  if (sectionLevel == -1) {
    appendDateTime();
    sb.append(' ');
  }
  if (sectionLevel >= 0) {
    sb.append(INDENTS[sectionLevel]);
  }
  sb.append(name);
  sb.append('[');
  sectionLevel++;
}

Fixed version (ground truth):
@Override public void startSection(String name){
  if (sectionLevel == -1) {
    appendDateTime();
    write(' ');
  }
  if (sectionLevel >= 0) {
    write(INDENTS[sectionLevel]);
  }
  write(name);
  write('[');
  sectionLevel++;
}
Program: 46399
Project: 46399
Buggy source:
@Override public void populate(LiveOperations liveOperations){
  for (  Queue<WaitingOperation> queue : mapWaitingOps.values()) {
    for (    WaitingOperation op : queue) {
      liveOperations.add(op.getCallerAddress(),op.getCallId());
    }
  }
}

Fixed version (ground truth):
@Override public void populate(LiveOperations liveOperations){
  for (  Queue<WaitingOperation> queue : mapWaitingOps.values()) {
    for (    WaitingOperation waitingOperation : queue) {
      Operation operation=waitingOperation.getOperation();
      liveOperations.add(operation.getCallerAddress(),operation.getCallId());
    }
  }
}
Program: 46400
Project: 46400
Buggy source:
@Override public void populate(LiveOperations liveOperations){
  for (  Queue<ParkedOperation> parkQueue : parkQueueMap.values()) {
    for (    ParkedOperation op : parkQueue) {
      liveOperations.add(op.getCallerAddress(),op.getCallId());
    }
  }
}

Fixed version (ground truth):
@Override public void populate(LiveOperations liveOperations){
  for (  Queue<ParkedOperation> parkQueue : parkQueueMap.values()) {
    for (    ParkedOperation parkedOperation : parkQueue) {
      Operation operation=parkedOperation.getOperation();
      liveOperations.add(operation.getCallerAddress(),operation.getCallId());
    }
  }
}
Program: 46401
Project: 46401
Buggy source:
@SuppressWarnings("String_Node_Str") public ExpirationManager(PartitionContainer[] partitionContainers,NodeEngine nodeEngine){
  this.nodeEngine=nodeEngine;
  this.partitionContainers=partitionContainers;
  this.thisAddress=nodeEngine.getThisAddress();
  this.partitionService=nodeEngine.getPartitionService();
  this.executionService=nodeEngine.getExecutionService();
  this.operationService=(InternalOperationService)nodeEngine.getOperationService();
  this.partitionCount=partitionService.getPartitionCount();
  this.taskPeriodSeconds=getInteger(SYS_PROP_EXPIRATION_TASK_PERIOD_SECONDS,DEFAULT_EXPIRATION_TASK_PERIOD_SECONDS);
  checkPositive(taskPeriodSeconds,"String_Node_Str");
  this.cleanupPercentage=getInteger(SYS_PROP_EXPIRATION_CLEANUP_PERCENTAGE,DEFAULT_EXPIRATION_CLEANUP_PERCENTAGE);
  checkTrue(cleanupPercentage > 0 && cleanupPercentage <= 100,"String_Node_Str");
  int defaultCleanupOpCount=calculateCleanupOperationCount(partitionCount,operationService.getPartitionThreadCount());
  this.cleanupOperationCount=getInteger(SYS_PROP_EXPIRATION_CLEANUP_OPERATION_COUNT,defaultCleanupOpCount);
  checkPositive(cleanupOperationCount,"String_Node_Str");
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @SuppressFBWarnings({"String_Node_Str"}) public ExpirationManager(PartitionContainer[] partitionContainers,NodeEngine nodeEngine){
  this.nodeEngine=nodeEngine;
  this.partitionContainers=partitionContainers;
  this.thisAddress=nodeEngine.getThisAddress();
  this.partitionService=nodeEngine.getPartitionService();
  this.executionService=nodeEngine.getExecutionService();
  this.operationService=(InternalOperationService)nodeEngine.getOperationService();
  this.partitionCount=partitionService.getPartitionCount();
  this.taskPeriodSeconds=getInteger(SYS_PROP_EXPIRATION_TASK_PERIOD_SECONDS,DEFAULT_EXPIRATION_TASK_PERIOD_SECONDS);
  checkPositive(taskPeriodSeconds,"String_Node_Str");
  this.cleanupPercentage=getInteger(SYS_PROP_EXPIRATION_CLEANUP_PERCENTAGE,DEFAULT_EXPIRATION_CLEANUP_PERCENTAGE);
  checkTrue(cleanupPercentage > 0 && cleanupPercentage <= 100,"String_Node_Str");
  int defaultCleanupOpCount=calculateCleanupOperationCount(partitionCount,operationService.getPartitionThreadCount());
  this.cleanupOperationCount=getInteger(SYS_PROP_EXPIRATION_CLEANUP_OPERATION_COUNT,defaultCleanupOpCount);
  checkPositive(cleanupOperationCount,"String_Node_Str");
}
Program: 46402
Project: 46402
Buggy source:
private int getInteger(String propertyName,int defaultValue){
  Config config=nodeEngine.getConfig();
  String property=config.getProperty(propertyName);
  return property == null ? defaultValue : valueOf(property);
}

Fixed version (ground truth):
private int getInteger(String propertyName,int defaultValue){
  Config config=nodeEngine.getConfig();
  String property=config.getProperty(propertyName);
  return property == null ? defaultValue : parseInt(property);
}
Program: 46403
Project: 46403
Buggy source:
private NearCacheConfig newNearCacheConfig(){
  return new NearCacheConfig();
}

Fixed version (ground truth):
protected NearCacheConfig newNearCacheConfig(){
  return new NearCacheConfig();
}
Program: 46404
Project: 46404
Buggy source:
/** 
 * There is a time-window in that an "is Near Cache evictable?" check may return   {@code false}, although the Near Cache size is bigger than the configured Near Cache max-size. This can happen because eviction process is offloaded to a different thread and there is no synchronization between the thread that puts the entry to the Near Cache and the thread which sweeps the entries from the Near Cache. This method continuously triggers the eviction to bring the Near Cache size under the configured max-size. Only needed for testing purposes.
 */
private void triggerNearCacheEviction(IMap<Integer,Integer> map){
  populateMap(map,1);
  pullEntriesToNearCache(map,1);
}

Fixed version (ground truth):
/** 
 * There is a time-window in that an "is Near Cache evictable?" check may return   {@code false}, although the Near Cache size is bigger than the configured Near Cache max-size. This can happen because eviction process is offloaded to a different thread and there is no synchronization between the thread that puts the entry to the Near Cache and the thread which sweeps the entries from the Near Cache. This method continuously triggers the eviction to bring the Near Cache size under the configured max-size. Only needed for testing purposes.
 */
protected void triggerNearCacheEviction(IMap<Integer,Integer> map){
  populateMap(map,1);
  pullEntriesToNearCache(map,1);
}
Program: 46405
Project: 46405
Buggy source:
private void pullEntriesToNearCache(IMap<Integer,Integer> map,int mapSize){
  for (int i=0; i < mapSize; i++) {
    map.get(i);
  }
}

Fixed version (ground truth):
protected void pullEntriesToNearCache(IMap<Integer,Integer> map,int mapSize){
  for (int i=0; i < mapSize; i++) {
    map.get(i);
  }
}
Program: 46406
Project: 46406
Buggy source:
private NearCacheConfig newNearCacheConfig(){
  return new NearCacheConfig();
}

Fixed version (ground truth):
protected NearCacheConfig newNearCacheConfig(){
  return new NearCacheConfig();
}
Program: 46407
Project: 46407
Buggy source:
private ClientConfig getClientConfig(String mapName){
  NearCacheConfig nearCacheConfig=getNearCacheConfig(mapName);
  ClientConfig clientConfig=new ClientConfig();
  clientConfig.addNearCacheConfig(nearCacheConfig);
  return clientConfig;
}

Fixed version (ground truth):
protected ClientConfig getClientConfig(String mapName){
  NearCacheConfig nearCacheConfig=getNearCacheConfig(mapName);
  ClientConfig clientConfig=new ClientConfig();
  clientConfig.addNearCacheConfig(nearCacheConfig);
  return clientConfig;
}
Program: 46408
Project: 46408
Buggy source:
private void populateNearCache(IMap<Integer,Integer> map,int size){
  for (int i=0; i < size; i++) {
    map.put(i,i);
  }
  for (int i=0; i < size; i++) {
    map.get(i);
  }
}

Fixed version (ground truth):
protected void populateNearCache(IMap<Integer,Integer> map,int size){
  for (int i=0; i < size; i++) {
    map.put(i,i);
  }
  for (int i=0; i < size; i++) {
    map.get(i);
  }
}
Program: 46409
Project: 46409
Buggy source:
private <K,V>IMap<K,V> getNearCachedMapFromClient(Config config,NearCacheConfig nearCacheConfig){
  String mapName=randomMapName();
  hazelcastFactory.newHazelcastInstance(config);
  nearCacheConfig.setName(mapName + "String_Node_Str");
  ClientConfig clientConfig=newClientConfig();
  clientConfig.addNearCacheConfig(nearCacheConfig);
  HazelcastInstance client=hazelcastFactory.newHazelcastClient(clientConfig);
  return client.getMap(mapName);
}

Fixed version (ground truth):
protected <K,V>IMap<K,V> getNearCachedMapFromClient(Config config,NearCacheConfig nearCacheConfig){
  String mapName=randomMapName();
  hazelcastFactory.newHazelcastInstance(config);
  nearCacheConfig.setName(mapName + "String_Node_Str");
  ClientConfig clientConfig=newClientConfig();
  clientConfig.addNearCacheConfig(nearCacheConfig);
  HazelcastInstance client=hazelcastFactory.newHazelcastClient(clientConfig);
  return client.getMap(mapName);
}
Program: 46410
Project: 46410
Buggy source:
private void assertThatOwnedEntryCountIsSmallerThan(IMap<Integer,Integer> clientMap,long expected){
  long ownedEntryCount=getOwnedEntryCount(clientMap);
  assertTrue(format("String_Node_Str",expected,ownedEntryCount),ownedEntryCount < expected);
}

Fixed version (ground truth):
protected void assertThatOwnedEntryCountIsSmallerThan(IMap<Integer,Integer> clientMap,long expected){
  long ownedEntryCount=getOwnedEntryCount(clientMap);
  assertTrue(format("String_Node_Str",expected,ownedEntryCount),ownedEntryCount < expected);
}
Program: 46411
Project: 46411
Buggy source:
private NearCacheConfig newNoInvalidationNearCacheConfig(){
  NearCacheConfig nearCacheConfig=newNearCacheConfig();
  nearCacheConfig.setInMemoryFormat(InMemoryFormat.OBJECT);
  nearCacheConfig.setInvalidateOnChange(false);
  return nearCacheConfig;
}

Fixed version (ground truth):
protected NearCacheConfig newNoInvalidationNearCacheConfig(){
  NearCacheConfig nearCacheConfig=newNearCacheConfig();
  nearCacheConfig.setInMemoryFormat(InMemoryFormat.OBJECT);
  nearCacheConfig.setInvalidateOnChange(false);
  return nearCacheConfig;
}
Program: 46412
Project: 46412
Buggy source:
private NearCacheConfig newInvalidationEnabledNearCacheConfig(){
  NearCacheConfig nearCacheConfig=newNearCacheConfig();
  nearCacheConfig.setInvalidateOnChange(true);
  return nearCacheConfig;
}

Fixed version (ground truth):
protected NearCacheConfig newInvalidationEnabledNearCacheConfig(){
  NearCacheConfig nearCacheConfig=newNearCacheConfig();
  nearCacheConfig.setInvalidateOnChange(true);
  return nearCacheConfig;
}
Program: 46413
Project: 46413
Buggy source:
private NearCacheConfig newInvalidationAndCacheLocalEntriesEnabledNearCacheConfig(String name){
  NearCacheConfig nearCacheConfig=newNearCacheConfig();
  nearCacheConfig.setInvalidateOnChange(true);
  nearCacheConfig.setCacheLocalEntries(true);
  nearCacheConfig.setName(name);
  return nearCacheConfig;
}

Fixed version (ground truth):
protected NearCacheConfig newInvalidationAndCacheLocalEntriesEnabledNearCacheConfig(String name){
  NearCacheConfig nearCacheConfig=newNearCacheConfig();
  nearCacheConfig.setInvalidateOnChange(true);
  nearCacheConfig.setCacheLocalEntries(true);
  nearCacheConfig.setName(name);
  return nearCacheConfig;
}
Program: 46414
Project: 46414
Buggy source:
private ClientConfig newClientConfig(){
  return new ClientConfig();
}

Fixed version (ground truth):
protected ClientConfig newClientConfig(){
  return new ClientConfig();
}
Program: 46415
Project: 46415
Buggy source:
private NearCacheConfig newTTLNearCacheConfig(){
  NearCacheConfig nearCacheConfig=newNearCacheConfig();
  nearCacheConfig.setInvalidateOnChange(false);
  nearCacheConfig.setTimeToLiveSeconds(MAX_TTL_SECONDS);
  return nearCacheConfig;
}

Fixed version (ground truth):
protected NearCacheConfig newTTLNearCacheConfig(){
  NearCacheConfig nearCacheConfig=newNearCacheConfig();
  nearCacheConfig.setInvalidateOnChange(false);
  nearCacheConfig.setTimeToLiveSeconds(MAX_TTL_SECONDS);
  return nearCacheConfig;
}
Program: 46416
Project: 46416
Buggy source:
private NearCacheConfig newMaxIdleSecondsNearCacheConfig(){
  NearCacheConfig nearCacheConfig=newNearCacheConfig();
  nearCacheConfig.setInvalidateOnChange(false);
  nearCacheConfig.setMaxIdleSeconds(MAX_IDLE_SECONDS);
  return nearCacheConfig;
}

Fixed version (ground truth):
protected NearCacheConfig newMaxIdleSecondsNearCacheConfig(){
  NearCacheConfig nearCacheConfig=newNearCacheConfig();
  nearCacheConfig.setInvalidateOnChange(false);
  nearCacheConfig.setMaxIdleSeconds(MAX_IDLE_SECONDS);
  return nearCacheConfig;
}
Program: 46417
Project: 46417
Buggy source:
private NearCacheConfig newLFUMaxSizeNearCacheConfig(){
  NearCacheConfig nearCacheConfig=newNearCacheConfig();
  nearCacheConfig.setInvalidateOnChange(true);
  nearCacheConfig.setMaxSize(MAX_CACHE_SIZE);
  nearCacheConfig.setEvictionPolicy("String_Node_Str");
  return nearCacheConfig;
}

Fixed version (ground truth):
protected NearCacheConfig newLFUMaxSizeNearCacheConfig(){
  NearCacheConfig nearCacheConfig=newNearCacheConfig();
  nearCacheConfig.setInvalidateOnChange(true);
  nearCacheConfig.setMaxSize(MAX_CACHE_SIZE);
  nearCacheConfig.setEvictionPolicy("String_Node_Str");
  return nearCacheConfig;
}
Program: 46418
Project: 46418
Buggy source:
private void assertThatOwnedEntryCountEquals(IMap<Integer,Integer> clientMap,long expected){
  long ownedEntryCount=getOwnedEntryCount(clientMap);
  assertEquals(expected,ownedEntryCount);
}

Fixed version (ground truth):
protected void assertThatOwnedEntryCountEquals(IMap<Integer,Integer> clientMap,long expected){
  long ownedEntryCount=getOwnedEntryCount(clientMap);
  assertEquals(expected,ownedEntryCount);
}
Program: 46419
Project: 46419
Buggy source:
private NearCacheConfig newMaxSizeNearCacheConfig(){
  NearCacheConfig nearCacheConfig=newNearCacheConfig();
  nearCacheConfig.setMaxSize(MAX_CACHE_SIZE);
  nearCacheConfig.setInvalidateOnChange(false);
  return nearCacheConfig;
}

Fixed version (ground truth):
protected NearCacheConfig newMaxSizeNearCacheConfig(){
  NearCacheConfig nearCacheConfig=newNearCacheConfig();
  nearCacheConfig.setMaxSize(MAX_CACHE_SIZE);
  nearCacheConfig.setInvalidateOnChange(false);
  return nearCacheConfig;
}
Program: 46420
Project: 46420
Buggy source:
private void assertNearCacheInvalidation_whenMaxSizeExceeded(NearCacheConfig config){
  final IMap<Integer,Integer> map=getNearCachedMapFromClient(config);
  populateNearCache(map,MAX_CACHE_SIZE);
  triggerEviction(map);
  assertTrueEventually(new AssertTask(){
    @Override public void run(){
      assertThatOwnedEntryCountIsSmallerThan(map,MAX_CACHE_SIZE);
    }
  }
);
}

Fixed version (ground truth):
protected void assertNearCacheInvalidation_whenMaxSizeExceeded(NearCacheConfig config){
  final IMap<Integer,Integer> map=getNearCachedMapFromClient(config);
  populateNearCache(map,MAX_CACHE_SIZE);
  triggerEviction(map);
  assertTrueEventually(new AssertTask(){
    @Override public void run(){
      assertThatOwnedEntryCountIsSmallerThan(map,MAX_CACHE_SIZE);
    }
  }
);
}
Program: 46421
Project: 46421
Buggy source:
private Config newConfig(){
  Config config=new Config();
  config.setProperty(MAP_INVALIDATION_MESSAGE_BATCH_ENABLED.getName(),String.valueOf(batchInvalidationEnabled));
  return config;
}

Fixed version (ground truth):
protected Config newConfig(){
  Config config=new Config();
  config.setProperty(MAP_INVALIDATION_MESSAGE_BATCH_ENABLED.getName(),String.valueOf(batchInvalidationEnabled));
  return config;
}
Program: 46422
Project: 46422
Buggy source:
private NearCacheConfig newNearCacheConfig(){
  return new NearCacheConfig();
}

Fixed version (ground truth):
protected NearCacheConfig newNearCacheConfig(){
  return new NearCacheConfig();
}
Program: 46423
Project: 46423
Buggy source:
private HazelcastInstance getClient(TestHazelcastFactory testHazelcastFactory,NearCacheConfig nearCacheConfig){
  ClientConfig clientConfig=newClientConfig();
  clientConfig.addNearCacheConfig(nearCacheConfig);
  return testHazelcastFactory.newHazelcastClient(clientConfig);
}

Fixed version (ground truth):
protected HazelcastInstance getClient(TestHazelcastFactory testHazelcastFactory,NearCacheConfig nearCacheConfig){
  ClientConfig clientConfig=newClientConfig();
  clientConfig.addNearCacheConfig(nearCacheConfig);
  return testHazelcastFactory.newHazelcastClient(clientConfig);
}
Program: 46424
Project: 46424
Buggy source:
private NearCacheConfig newNoneNearCacheConfig(){
  NearCacheConfig nearCacheConfig=newNearCacheConfig();
  nearCacheConfig.setInvalidateOnChange(true);
  nearCacheConfig.setMaxSize(MAX_CACHE_SIZE);
  nearCacheConfig.setEvictionPolicy("String_Node_Str");
  return nearCacheConfig;
}

Fixed version (ground truth):
protected NearCacheConfig newNoneNearCacheConfig(){
  NearCacheConfig nearCacheConfig=newNearCacheConfig();
  nearCacheConfig.setInvalidateOnChange(true);
  nearCacheConfig.setMaxSize(MAX_CACHE_SIZE);
  nearCacheConfig.setEvictionPolicy("String_Node_Str");
  return nearCacheConfig;
}
Program: 46425
Project: 46425
Buggy source:
private void triggerEviction(IMap<Integer,Integer> map){
  map.put(0,0);
}

Fixed version (ground truth):
protected void triggerEviction(IMap<Integer,Integer> map){
  map.put(0,0);
}
Program: 46426
Project: 46426
Buggy source:
private NearCacheConfig newLRUMaxSizeConfig(){
  NearCacheConfig nearCacheConfig=newNearCacheConfig();
  nearCacheConfig.setInvalidateOnChange(true);
  nearCacheConfig.setMaxSize(MAX_CACHE_SIZE);
  nearCacheConfig.setEvictionPolicy("String_Node_Str");
  return nearCacheConfig;
}

Fixed version (ground truth):
protected NearCacheConfig newLRUMaxSizeConfig(){
  NearCacheConfig nearCacheConfig=newNearCacheConfig();
  nearCacheConfig.setInvalidateOnChange(true);
  nearCacheConfig.setMaxSize(MAX_CACHE_SIZE);
  nearCacheConfig.setEvictionPolicy("String_Node_Str");
  return nearCacheConfig;
}
Program: 46427
Project: 46427
Buggy source:
private long getOwnedEntryCount(IMap<Integer,Integer> map){
  NearCacheStats stats=map.getLocalMapStats().getNearCacheStats();
  return stats.getOwnedEntryCount();
}

Fixed version (ground truth):
protected long getOwnedEntryCount(IMap<Integer,Integer> map){
  NearCacheStats stats=map.getLocalMapStats().getNearCacheStats();
  return stats.getOwnedEntryCount();
}
Program: 46428
Project: 46428
Buggy source:
private NearCacheConfig newRandomNearCacheConfig(){
  NearCacheConfig nearCacheConfig=newNearCacheConfig();
  nearCacheConfig.setInvalidateOnChange(true);
  nearCacheConfig.setMaxSize(MAX_CACHE_SIZE);
  nearCacheConfig.setEvictionPolicy("String_Node_Str");
  return nearCacheConfig;
}

Fixed version (ground truth):
protected NearCacheConfig newRandomNearCacheConfig(){
  NearCacheConfig nearCacheConfig=newNearCacheConfig();
  nearCacheConfig.setInvalidateOnChange(true);
  nearCacheConfig.setMaxSize(MAX_CACHE_SIZE);
  nearCacheConfig.setEvictionPolicy("String_Node_Str");
  return nearCacheConfig;
}
Program: 46429
Project: 46429
Buggy source:
private ClientConfig newClientConfig(String mapName){
  NearCacheConfig nearCacheConfig=new NearCacheConfig();
  nearCacheConfig.setInMemoryFormat(getNearCacheInMemoryFormat());
  nearCacheConfig.setName(mapName);
  nearCacheConfig.setInvalidateOnChange(true);
  nearCacheConfig.setCacheLocalEntries(true);
  ClientConfig clientConfig=new ClientConfig();
  clientConfig.addNearCacheConfig(nearCacheConfig);
  return clientConfig;
}

Fixed version (ground truth):
protected ClientConfig newClientConfig(String mapName){
  NearCacheConfig nearCacheConfig=new NearCacheConfig();
  nearCacheConfig.setInMemoryFormat(getNearCacheInMemoryFormat());
  nearCacheConfig.setName(mapName);
  nearCacheConfig.setInvalidateOnChange(true);
  nearCacheConfig.setCacheLocalEntries(true);
  ClientConfig clientConfig=new ClientConfig();
  clientConfig.addNearCacheConfig(nearCacheConfig);
  return clientConfig;
}
Program: 46430
Project: 46430
Buggy source:
public static NodeExtension create(Node node){
  try {
    ClassLoader classLoader=node.getConfigClassLoader();
    Iterator<Class<NodeExtension>> iter=ServiceLoader.classIterator(FACTORY_ID,classLoader);
    while (iter.hasNext()) {
      Class<NodeExtension> clazz=iter.next();
      if (!(clazz.equals(DefaultNodeExtension.class))) {
        if (clazz.getName().equals(DefaultNodeExtension.class.getName())) {
          node.nodeEngine.getLogger(NodeExtensionFactory.class).warning("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
        }
        Constructor<NodeExtension> constructor=clazz.getDeclaredConstructor(new Class[]{Node.class});
        return constructor.newInstance(node);
      }
    }
  }
 catch (  Exception e) {
    throw ExceptionUtil.rethrow(e);
  }
  return new DefaultNodeExtension(node);
}

Fixed version (ground truth):
public static NodeExtension create(Node node){
  try {
    ClassLoader classLoader=node.getConfigClassLoader();
    Iterator<Class<NodeExtension>> iter=ServiceLoader.classIterator(FACTORY_ID,classLoader);
    while (iter.hasNext()) {
      Class<NodeExtension> clazz=iter.next();
      if (!(clazz.equals(DefaultNodeExtension.class))) {
        if (clazz.getName().equals(DefaultNodeExtension.class.getName())) {
          Logger.getLogger(NodeExtensionFactory.class).warning("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
        }
        Constructor<NodeExtension> constructor=clazz.getDeclaredConstructor(new Class[]{Node.class});
        return constructor.newInstance(node);
      }
    }
  }
 catch (  Exception e) {
    throw ExceptionUtil.rethrow(e);
  }
  return new DefaultNodeExtension(node);
}
Program: 46431
Project: 46431
Buggy source:
public static NodeExtension create(Node node){
  try {
    ClassLoader classLoader=node.getConfigClassLoader();
    Iterator<Class<NodeExtension>> iter=ServiceLoader.classIterator(FACTORY_ID,classLoader);
    while (iter.hasNext()) {
      Class<NodeExtension> clazz=iter.next();
      if (!(clazz.equals(DefaultNodeExtension.class))) {
        if (clazz.getName().equals(DefaultNodeExtension.class.getName())) {
          node.nodeEngine.getLogger(NodeExtensionFactory.class).warning("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
        }
        Constructor<NodeExtension> constructor=clazz.getDeclaredConstructor(new Class[]{Node.class});
        return constructor.newInstance(node);
      }
    }
  }
 catch (  Exception e) {
    throw ExceptionUtil.rethrow(e);
  }
  return new DefaultNodeExtension(node);
}

Fixed version (ground truth):
public static NodeExtension create(Node node){
  try {
    ClassLoader classLoader=node.getConfigClassLoader();
    Iterator<Class<NodeExtension>> iter=ServiceLoader.classIterator(FACTORY_ID,classLoader);
    while (iter.hasNext()) {
      Class<NodeExtension> clazz=iter.next();
      if (!(clazz.equals(DefaultNodeExtension.class))) {
        if (clazz.getName().equals(DefaultNodeExtension.class.getName())) {
          Logger.getLogger(NodeExtensionFactory.class).warning("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
        }
        Constructor<NodeExtension> constructor=clazz.getDeclaredConstructor(new Class[]{Node.class});
        return constructor.newInstance(node);
      }
    }
  }
 catch (  Exception e) {
    throw ExceptionUtil.rethrow(e);
  }
  return new DefaultNodeExtension(node);
}
Program: 46432
Project: 46432
Buggy source:
private void initializeAndProcessMessage() throws Throwable {
  if (!node.joined()) {
    throw new HazelcastInstanceNotActiveException("String_Node_Str");
  }
  parameters=decodeClientMessage(clientMessage);
  Credentials credentials=endpoint.getCredentials();
  interceptBefore(credentials);
  checkPermissions(endpoint);
  processMessage();
  interceptAfter(credentials);
}

Fixed version (ground truth):
private void initializeAndProcessMessage() throws Throwable {
  if (!node.getNodeExtension().isStartCompleted()) {
    throw new HazelcastInstanceNotActiveException("String_Node_Str");
  }
  parameters=decodeClientMessage(clientMessage);
  Credentials credentials=endpoint.getCredentials();
  interceptBefore(credentials);
  checkPermissions(endpoint);
  processMessage();
  interceptAfter(credentials);
}
Program: 46433
Project: 46433
Buggy source:
private void initializeAndProcessMessage() throws Throwable {
  if (!node.joined()) {
    throw new HazelcastInstanceNotActiveException("String_Node_Str");
  }
  parameters=decodeClientMessage(clientMessage);
  Credentials credentials=endpoint.getCredentials();
  interceptBefore(credentials);
  checkPermissions(endpoint);
  processMessage();
  interceptAfter(credentials);
}

Fixed version (ground truth):
private void initializeAndProcessMessage() throws Throwable {
  if (!node.getNodeExtension().isStartCompleted()) {
    throw new HazelcastInstanceNotActiveException("String_Node_Str");
  }
  parameters=decodeClientMessage(clientMessage);
  Credentials credentials=endpoint.getCredentials();
  interceptBefore(credentials);
  checkPermissions(endpoint);
  processMessage();
  interceptAfter(credentials);
}
Program: 46434
Project: 46434
Buggy source:
private Map<Integer,List<Data>> getPartitionIdToKeysMap(){
  if (isEmpty(keySet)) {
    return Collections.emptyMap();
  }
  Map<Integer,List<Data>> partitionToKeys=new Int2ObjectHashMap<List<Data>>();
  for (  Data key : keySet) {
    int partitionId=nodeEngine.getPartitionService().getPartitionId(key);
    List<Data> keyList=partitionToKeys.get(partitionId);
    if (keyList == null) {
      keyList=new ArrayList<Data>();
      partitionToKeys.put(partitionId,keyList);
    }
    keyList.add(key);
  }
  return partitionToKeys;
}

Fixed version (ground truth):
private Map<Integer,List<Data>> getPartitionIdToKeysMap(Set<Data> keys,InternalPartitionService partitionService){
  if (isEmpty(keys)) {
    return Collections.emptyMap();
  }
  Map<Integer,List<Data>> partitionToKeys=new Int2ObjectHashMap<List<Data>>();
  for (  Data key : keys) {
    int partitionId=partitionService.getPartitionId(key);
    List<Data> keyList=partitionToKeys.get(partitionId);
    if (keyList == null) {
      keyList=new ArrayList<Data>();
      partitionToKeys.put(partitionId,keyList);
    }
    keyList.add(key);
  }
  return partitionToKeys;
}
Program: 46435
Project: 46435
Buggy source:
@Override public Operation createPartitionOperation(int partition){
  if (hasIndex) {
    List<Data> keys=partitionIdToKeys.get(partition);
    InflatableSet<Data> keySet=InflatableSet.newBuilder(keys).build();
    return new MultipleEntryWithPredicateOperation(name,keySet,entryProcessor,predicate);
  }
  return createOperation();
}

Fixed version (ground truth):
@Override public Operation createPartitionOperation(int partition){
  if (isNullOrEmpty(partitionIdToKeysMap)) {
    return new PartitionWideEntryWithPredicateOperation(name,entryProcessor,predicate);
  }
  List<Data> keyList=partitionIdToKeysMap.get(partition);
  InflatableSet<Data> keys=newBuilder(keyList).build();
  return new MultipleEntryWithPredicateOperation(name,keys,entryProcessor,predicate);
}
Program: 46436
Project: 46436
Buggy source:
/** 
 * Created operations by this factory will be run on these partitions. Return null to preserve  default behaviour.
 * @return null to preserve default behaviour or return all partition-ids for the operations of this factory.
 */
int[] getPartitions();

Fixed version (ground truth):
/** 
 * This method will be called on operation runner node. Created operations by this factory will be run on the partitions returned by this method. Returning null means operations will be run provided partitions by default.
 * @return null to preserve default behaviour or return relevant partition-ids for the operations of this factory.
 */
@SuppressFBWarnings("String_Node_Str") public int[] getPartitions(){
  return partitions;
}
Program: 46437
Project: 46437
Buggy source:
/** 
 * Create a partition-operation for the supplied partition-id
 * @param partition id of partition
 * @return new operation
 */
Operation createPartitionOperation(int partition);

Fixed version (ground truth):
/** 
 * This method can be called both caller and runner nodes. Creates a partition-operation for supplied partition-id
 * @param partition id of partition
 * @return created partition-operation
 */
public abstract Operation createPartitionOperation(int partition);
Program: 46438
Project: 46438
Buggy source:
private Object[] executePartitionAwareOperations(PartitionAwareOperationFactory partitionAwareFactory){
  partitionAwareFactory.init(getNodeEngine());
  NodeEngine nodeEngine=getNodeEngine();
  int[] operationFactoryPartitions=partitionAwareFactory.getPartitions();
  partitions=operationFactoryPartitions == null ? partitions : operationFactoryPartitions;
  Object[] responses=new Object[partitions.length];
  for (int i=0; i < partitions.length; i++) {
    ResponseQueue responseQueue=new ResponseQueue();
    responses[i]=responseQueue;
    int partition=partitions[i];
    Operation operation=partitionAwareFactory.createPartitionOperation(partition);
    operation.setNodeEngine(nodeEngine).setPartitionId(partition).setReplicaIndex(getReplicaIndex()).setOperationResponseHandler(responseQueue).setServiceName(getServiceName()).setService(getService()).setCallerUuid(extractCallerUuid());
    OperationAccessor.setCallerAddress(operation,getCallerAddress());
    nodeEngine.getOperationService().execute(operation);
  }
  return responses;
}

Fixed version (ground truth):
private Object[] executePartitionAwareOperations(PartitionAwareOperationFactory givenFactory){
  PartitionAwareOperationFactory factory=givenFactory.createFactoryOnRunner(getNodeEngine());
  NodeEngine nodeEngine=getNodeEngine();
  int[] operationFactoryPartitions=factory.getPartitions();
  partitions=operationFactoryPartitions == null ? partitions : operationFactoryPartitions;
  Object[] responses=new Object[partitions.length];
  for (int i=0; i < partitions.length; i++) {
    ResponseQueue responseQueue=new ResponseQueue();
    responses[i]=responseQueue;
    int partition=partitions[i];
    Operation operation=factory.createPartitionOperation(partition);
    operation.setNodeEngine(nodeEngine).setPartitionId(partition).setReplicaIndex(getReplicaIndex()).setOperationResponseHandler(responseQueue).setServiceName(getServiceName()).setService(getService()).setCallerUuid(extractCallerUuid());
    OperationAccessor.setCallerAddress(operation,getCallerAddress());
    nodeEngine.getOperationService().execute(operation);
  }
  return responses;
}
Program: 46439
Project: 46439
Buggy source:
public JoinRequest createJoinRequest(boolean withCredentials){
  final Credentials credentials=(withCredentials && securityContext != null) ? securityContext.getCredentialsFactory().newCredentials() : null;
  return new JoinRequest(Packet.VERSION,buildInfo.getBuildNumber(),address,localMember.getUuid(),localMember.isLiteMember(),createConfigCheck(),credentials,config.getMemberAttributeConfig().getAttributes());
}

Fixed version (ground truth):
public JoinRequest createJoinRequest(boolean withCredentials){
  final Credentials credentials=(withCredentials && securityContext != null) ? securityContext.getCredentialsFactory().newCredentials() : null;
  return new JoinRequest(Packet.VERSION,buildInfo.getBuildNumber(),address,localMember.getUuid(),localMember.isLiteMember(),createConfigCheck(),credentials,localMember.getAttributes());
}
Program: 46440
Project: 46440
Buggy source:
public JoinRequest createJoinRequest(boolean withCredentials){
  final Credentials credentials=(withCredentials && securityContext != null) ? securityContext.getCredentialsFactory().newCredentials() : null;
  return new JoinRequest(Packet.VERSION,buildInfo.getBuildNumber(),address,localMember.getUuid(),localMember.isLiteMember(),createConfigCheck(),credentials,config.getMemberAttributeConfig().getAttributes());
}

Fixed version (ground truth):
public JoinRequest createJoinRequest(boolean withCredentials){
  final Credentials credentials=(withCredentials && securityContext != null) ? securityContext.getCredentialsFactory().newCredentials() : null;
  return new JoinRequest(Packet.VERSION,buildInfo.getBuildNumber(),address,localMember.getUuid(),localMember.isLiteMember(),createConfigCheck(),credentials,localMember.getAttributes());
}
Program: 46441
Project: 46441
Buggy source:
private void initializeMulticastSocket(){
  try {
    int port=getOrDefault(MulticastProperties.PORT,DEFAULT_MULTICAST_PORT);
    PortValueValidator validator=new PortValueValidator();
    validator.validate(port);
    String group=getOrDefault(MulticastProperties.GROUP,DEFAULT_MULTICAST_GROUP);
    multicastSocket=new MulticastSocket(null);
    multicastSocket.bind(new InetSocketAddress(port));
    multicastSocket.setReuseAddress(true);
    multicastSocket.setTimeToLive(SOCKET_TIME_TO_LIVE);
    multicastSocket.setReceiveBufferSize(DATA_OUTPUT_BUFFER_SIZE);
    multicastSocket.setSendBufferSize(DATA_OUTPUT_BUFFER_SIZE);
    multicastSocket.setSoTimeout(SOCKET_TIMEOUT);
    multicastSocket.joinGroup(InetAddress.getByName(group));
    multicastDiscoverySender=new MulticastDiscoverySender(discoveryNode,multicastSocket,logger,group,port);
    multicastDiscoveryReceiver=new MulticastDiscoveryReceiver(multicastSocket,logger);
    if (discoveryNode != null) {
      isClient=false;
    }
  }
 catch (  Exception e) {
    logger.finest(e.getMessage());
  }
}

Fixed version (ground truth):
private void initializeMulticastSocket(){
  try {
    int port=getOrDefault(MulticastProperties.PORT,DEFAULT_MULTICAST_PORT);
    PortValueValidator validator=new PortValueValidator();
    validator.validate(port);
    String group=getOrDefault(MulticastProperties.GROUP,DEFAULT_MULTICAST_GROUP);
    multicastSocket=new MulticastSocket(null);
    multicastSocket.bind(new InetSocketAddress(port));
    multicastSocket.setReuseAddress(true);
    multicastSocket.setTimeToLive(SOCKET_TIME_TO_LIVE);
    multicastSocket.setReceiveBufferSize(DATA_OUTPUT_BUFFER_SIZE);
    multicastSocket.setSendBufferSize(DATA_OUTPUT_BUFFER_SIZE);
    multicastSocket.setSoTimeout(SOCKET_TIMEOUT);
    multicastSocket.joinGroup(InetAddress.getByName(group));
    multicastDiscoverySender=new MulticastDiscoverySender(discoveryNode,multicastSocket,logger,group,port);
    multicastDiscoveryReceiver=new MulticastDiscoveryReceiver(multicastSocket,logger);
    if (discoveryNode != null) {
      isClient=false;
    }
  }
 catch (  Exception e) {
    logger.finest(e.getMessage());
    rethrow(e);
  }
}
Program: 46442
Project: 46442
Buggy source:
@Override public Collection<PropertyDefinition> getConfigurationProperties(){
  return null;
}

Fixed version (ground truth):
@Override public Collection<PropertyDefinition> getConfigurationProperties(){
  return PROPERTY_DEFINITIONS;
}
Program: 46443
Project: 46443
Buggy source:
@Before public void setUp(){
  String xmlFileName="String_Node_Str";
  InputStream xmlResource=MulticastDiscoveryStrategy.class.getClassLoader().getResourceAsStream(xmlFileName);
  config=new XmlConfigBuilder(xmlResource).build();
  System.setProperty(TestEnvironment.HAZELCAST_TEST_USE_NETWORK,"String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  factory=createHazelcastInstanceFactory(2);
}

Fixed version (ground truth):
@Before public void setUp(){
  String xmlFileName="String_Node_Str";
  InputStream xmlResource=MulticastDiscoveryStrategy.class.getClassLoader().getResourceAsStream(xmlFileName);
  config=new XmlConfigBuilder(xmlResource).build();
  System.setProperty(TestEnvironment.HAZELCAST_TEST_USE_NETWORK,"String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
}
Program: 46444
Project: 46444
Buggy source:
private static String createFileName(float version){
  return version + "String_Node_Str";
}

Fixed version (ground truth):
private static String createFileName(String version){
  return version + "String_Node_Str";
}
Program: 46445
Project: 46445
Buggy source:
@BeforeClass public static void init() throws IOException {
  for (  float version : versions) {
    String fileName=createFileName(version);
    InputStream input=BinaryCompatibilityTest.class.getResourceAsStream("String_Node_Str" + fileName);
    DataInputStream inputStream=new DataInputStream(input);
    while (input.available() != 0) {
      String objectKey=inputStream.readUTF();
      int length=inputStream.readInt();
      byte[] bytes=new byte[length];
      inputStream.read(bytes);
      dataMap.put(objectKey,bytes);
    }
    inputStream.close();
  }
}

Fixed version (ground truth):
@BeforeClass public static void init() throws IOException {
  for (  String version : versions) {
    String fileName=createFileName(version);
    InputStream input=BinaryCompatibilityTest.class.getResourceAsStream("String_Node_Str" + fileName);
    DataInputStream inputStream=new DataInputStream(input);
    while (input.available() != 0) {
      String objectKey=inputStream.readUTF();
      int length=inputStream.readInt();
      byte[] bytes=new byte[length];
      inputStream.read(bytes);
      dataMap.put(objectKey,bytes);
    }
    inputStream.close();
  }
}
Program: 46446
Project: 46446
Buggy source:
@Parameterized.Parameters(name="String_Node_Str") public static Iterable<Object[]> parameters(){
  LinkedList<Object[]> parameters=new LinkedList<Object[]>();
  for (  Throwable throwable : throwables) {
    for (    float version : versions) {
      parameters.add(new Object[]{throwable,version});
    }
  }
  return parameters;
}

Fixed version (ground truth):
@Parameterized.Parameters(name="String_Node_Str") public static Iterable<Object[]> parameters(){
  LinkedList<Object[]> parameters=new LinkedList<Object[]>();
  for (  String version : versions) {
    for (    Throwable throwable : throwables.get(version)) {
      parameters.add(new Object[]{throwable,version});
    }
  }
  return parameters;
}
Program: 46447
Project: 46447
Buggy source:
private static String createFileName(){
  return VERSION + "String_Node_Str";
}

Fixed version (ground truth):
private static String createFileName(String version){
  return version + "String_Node_Str";
}
Program: 46448
Project: 46448
Buggy source:
private static String createObjectKey(Object object){
  return VERSION + "String_Node_Str" + object.getClass().getSimpleName();
}

Fixed version (ground truth):
private static String createObjectKey(Object object,String version){
  return version + "String_Node_Str" + object.getClass().getSimpleName();
}
Program: 46449
Project: 46449
Buggy source:
public static void main(String[] args) throws IOException {
  Throwable[] throwables=ReferenceObjects.throwables;
  String fileName=createFileName();
  OutputStream out=new FileOutputStream(fileName);
  DataOutputStream outputStream=new DataOutputStream(out);
  ClientExceptionFactory clientExceptionFactory=new ClientExceptionFactory(true);
  for (  Throwable throwable : throwables) {
    outputStream.writeUTF(createObjectKey(throwable));
    ClientMessage clientMessage=clientExceptionFactory.createExceptionMessage(throwable);
    outputStream.writeInt(clientMessage.getFrameLength());
    outputStream.write(clientMessage.buffer().byteArray(),0,clientMessage.getFrameLength());
  }
  outputStream.close();
}

Fixed version (ground truth):
public static void main(String[] args) throws IOException {
  Map<String,Throwable[]> allThrowables=ReferenceObjects.throwables;
  ClientExceptionFactory clientExceptionFactory=new ClientExceptionFactory(true);
  for (  String version : allThrowables.keySet()) {
    String fileName=createFileName(version);
    OutputStream out=new FileOutputStream(fileName);
    DataOutputStream outputStream=new DataOutputStream(out);
    Throwable[] throwables=allThrowables.get(version);
    for (    Throwable throwable : throwables) {
      outputStream.writeUTF(createObjectKey(throwable,version));
      ClientMessage clientMessage=clientExceptionFactory.createExceptionMessage(throwable);
      outputStream.writeInt(clientMessage.getFrameLength());
      outputStream.write(clientMessage.buffer().byteArray(),0,clientMessage.getFrameLength());
    }
    outputStream.close();
  }
}