nus-yam/ex-repair huggingface dataset:
Program: 48346
Project: 48346
Buggy source:
public TextCommand parser(SocketTextReader socketTextReader,String cmd,int space){
  StringTokenizer st=new StringTokenizer(cmd);
  st.nextToken();
  String key=null;
  int valueLen=0;
  int flag=0;
  int expiration=0;
  boolean noReply=false;
  if (st.hasMoreTokens()) {
    key=st.nextToken();
  }
 else {
    return new ErrorCommand(ERROR_CLIENT);
  }
  if (st.hasMoreTokens()) {
    flag=Integer.valueOf(st.nextToken());
  }
 else {
    return new ErrorCommand(ERROR_CLIENT);
  }
  if (st.hasMoreTokens()) {
    expiration=Integer.parseInt(st.nextToken());
  }
 else {
    return new ErrorCommand(ERROR_CLIENT);
  }
  if (st.hasMoreTokens()) {
    valueLen=Integer.parseInt(st.nextToken());
  }
 else {
    return new ErrorCommand(ERROR_CLIENT);
  }
  if (st.hasMoreTokens()) {
    noReply="String_Node_Str".equals(st.nextToken());
  }
  return new SetCommand(type,key,flag,expiration,valueLen,noReply);
}

Fixed version (ground truth):
public TextCommand parser(SocketTextReader socketTextReader,String cmd,int space){
  StringTokenizer st=new StringTokenizer(cmd);
  st.nextToken();
  String key=null;
  int valueLen=0;
  int flag=0;
  int expiration=0;
  boolean noReply=false;
  if (st.hasMoreTokens()) {
    key=st.nextToken();
  }
 else {
    return new ErrorCommand(ERROR_CLIENT);
  }
  if (st.hasMoreTokens()) {
    flag=Integer.parseInt(st.nextToken());
  }
 else {
    return new ErrorCommand(ERROR_CLIENT);
  }
  if (st.hasMoreTokens()) {
    expiration=Integer.parseInt(st.nextToken());
  }
 else {
    return new ErrorCommand(ERROR_CLIENT);
  }
  if (st.hasMoreTokens()) {
    valueLen=Integer.parseInt(st.nextToken());
  }
 else {
    return new ErrorCommand(ERROR_CLIENT);
  }
  if (st.hasMoreTokens()) {
    noReply="String_Node_Str".equals(st.nextToken());
  }
  return new SetCommand(type,key,flag,expiration,valueLen,noReply);
}
Program: 48347
Project: 48347
Buggy source:
/** 
 * Starts the test
 * @param args the number of threads to start
 */
public static void main(String[] args){
  int nThreads=(args.length == 0) ? 10 : new Integer(args[0]);
  final AllTest allTest=new AllTest(nThreads);
  allTest.start();
  Executors.newSingleThreadExecutor().execute(new Runnable(){
    public void run(){
      while (true) {
        try {
          Thread.sleep(STATS_SECONDS * ONE_SECOND);
          System.out.println("String_Node_Str" + allTest.hazelcast.getCluster().getMembers().size());
          allTest.mapStats();
          allTest.qStats();
          allTest.topicStats();
        }
 catch (        InterruptedException ignored) {
          return;
        }
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Starts the test
 * @param args the number of threads to start
 */
public static void main(String[] args){
  int nThreads=(args.length == 0) ? 10 : Integer.parseInt(args[0]);
  final AllTest allTest=new AllTest(nThreads);
  allTest.start();
  Executors.newSingleThreadExecutor().execute(new Runnable(){
    public void run(){
      while (true) {
        try {
          Thread.sleep(STATS_SECONDS * ONE_SECOND);
          System.out.println("String_Node_Str" + allTest.hazelcast.getCluster().getMembers().size());
          allTest.mapStats();
          allTest.qStats();
          allTest.topicStats();
        }
 catch (        InterruptedException ignored) {
          return;
        }
      }
    }
  }
);
}
Program: 48348
Project: 48348
Buggy source:
@SuppressWarnings("String_Node_Str") protected void handleLock(String[] args){
  String lockStr=args[0];
  String key=args[1];
  Lock lock=hazelcast.getLock(key);
  if (lockStr.equalsIgnoreCase("String_Node_Str")) {
    lock.lock();
    println("String_Node_Str");
  }
 else   if (lockStr.equalsIgnoreCase("String_Node_Str")) {
    lock.unlock();
    println("String_Node_Str");
  }
 else   if (lockStr.equalsIgnoreCase("String_Node_Str")) {
    String timeout=args.length > 2 ? args[2] : null;
    if (timeout == null) {
      println(lock.tryLock());
    }
 else {
      long time=Long.valueOf(timeout);
      try {
        println(lock.tryLock(time,TimeUnit.SECONDS));
      }
 catch (      InterruptedException e) {
        e.printStackTrace();
      }
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") protected void handleLock(String[] args){
  String lockStr=args[0];
  String key=args[1];
  Lock lock=hazelcast.getLock(key);
  if (lockStr.equalsIgnoreCase("String_Node_Str")) {
    lock.lock();
    println("String_Node_Str");
  }
 else   if (lockStr.equalsIgnoreCase("String_Node_Str")) {
    lock.unlock();
    println("String_Node_Str");
  }
 else   if (lockStr.equalsIgnoreCase("String_Node_Str")) {
    String timeout=args.length > 2 ? args[2] : null;
    if (timeout == null) {
      println(lock.tryLock());
    }
 else {
      long time=Long.parseLong(timeout);
      try {
        println(lock.tryLock(time,TimeUnit.SECONDS));
      }
 catch (      InterruptedException e) {
        e.printStackTrace();
      }
    }
  }
}
Program: 48349
Project: 48349
Buggy source:
protected void handleQOffer(String[] args){
  long timeout=0;
  if (args.length > 2) {
    timeout=Long.valueOf(args[2]);
  }
  try {
    boolean offered=getQueue().offer(args[1],timeout,TimeUnit.SECONDS);
    println(offered);
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
protected void handleQOffer(String[] args){
  long timeout=0;
  if (args.length > 2) {
    timeout=Long.parseLong(args[2]);
  }
  try {
    boolean offered=getQueue().offer(args[1],timeout,TimeUnit.SECONDS);
    println(offered);
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
}
Program: 48350
Project: 48350
Buggy source:
protected void handleMultiMapTryLock(String[] args){
  String key=args[1];
  long time=(args.length > 2) ? Long.valueOf(args[2]) : 0;
  boolean locked;
  if (time == 0) {
    locked=getMultiMap().tryLock(key);
  }
 else {
    try {
      locked=getMultiMap().tryLock(key,time,TimeUnit.SECONDS);
    }
 catch (    InterruptedException e) {
      locked=false;
    }
  }
  println(locked);
}

Fixed version (ground truth):
protected void handleMultiMapTryLock(String[] args){
  String key=args[1];
  long time=(args.length > 2) ? Long.parseLong(args[2]) : 0;
  boolean locked;
  if (time == 0) {
    locked=getMultiMap().tryLock(key);
  }
 else {
    try {
      locked=getMultiMap().tryLock(key,time,TimeUnit.SECONDS);
    }
 catch (    InterruptedException e) {
      locked=false;
    }
  }
  println(locked);
}
Program: 48351
Project: 48351
Buggy source:
private void handleAtomicNumberSet(String[] args){
  long v=0;
  if (args.length > 1) {
    v=Long.valueOf(args[1]);
  }
  getAtomicNumber().set(v);
  println(getAtomicNumber().get());
}

Fixed version (ground truth):
private void handleAtomicNumberSet(String[] args){
  long v=0;
  if (args.length > 1) {
    v=Long.parseLong(args[1]);
  }
  getAtomicNumber().set(v);
  println(getAtomicNumber().get());
}
Program: 48352
Project: 48352
Buggy source:
protected void handleMapTryLock(String[] args){
  String key=args[1];
  long time=(args.length > 2) ? Long.valueOf(args[2]) : 0;
  boolean locked;
  if (time == 0) {
    locked=getMap().tryLock(key);
  }
 else {
    try {
      locked=getMap().tryLock(key,time,TimeUnit.SECONDS);
    }
 catch (    InterruptedException e) {
      locked=false;
    }
  }
  println(locked);
}

Fixed version (ground truth):
protected void handleMapTryLock(String[] args){
  String key=args[1];
  long time=(args.length > 2) ? Long.parseLong(args[2]) : 0;
  boolean locked;
  if (time == 0) {
    locked=getMap().tryLock(key);
  }
 else {
    try {
      locked=getMap().tryLock(key,time,TimeUnit.SECONDS);
    }
 catch (    InterruptedException e) {
      locked=false;
    }
  }
  println(locked);
}
Program: 48353
Project: 48353
Buggy source:
protected void handleQPoll(String[] args){
  long timeout=0;
  if (args.length > 1) {
    timeout=Long.valueOf(args[1]);
  }
  try {
    println(getQueue().poll(timeout,TimeUnit.SECONDS));
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
protected void handleQPoll(String[] args){
  long timeout=0;
  if (args.length > 1) {
    timeout=Long.parseLong(args[1]);
  }
  try {
    println(getQueue().poll(timeout,TimeUnit.SECONDS));
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
}
Program: 48354
Project: 48354
Buggy source:
@Test @Category(ProblematicTest.class) public void concurrent_TryLock_WithTimeOutTest() throws InterruptedException {
  concurrent_LockTest(true);
}

Fixed version (ground truth):
@Test public void concurrent_TryLock_WithTimeOutTest() throws InterruptedException {
  concurrent_LockTest(true);
}
Program: 48355
Project: 48355
Buggy source:
@Test @Category(ProblematicTest.class) public void concurrent_MapTryLockTimeOutTest() throws InterruptedException {
  concurrent_MapTryLock(true);
}

Fixed version (ground truth):
@Test public void concurrent_MapTryLockTimeOutTest() throws InterruptedException {
  concurrent_MapTryLock(true);
}
Program: 48356
Project: 48356
Buggy source:
@Test @Category(ProblematicTest.class) public void concurrent_trySemaphoreWithTimeOutTest(){
  concurrent_trySemaphoreTest(true);
}

Fixed version (ground truth):
@Test public void concurrent_trySemaphoreWithTimeOutTest(){
  concurrent_trySemaphoreTest(true);
}
Program: 48357
Project: 48357
Buggy source:
public void updateManagementCenterUrl(String newUrl){
  if (newUrl == null) {
    return;
  }
  managementCenterUrl=newUrl;
  if (newUrl.equals(managementCenterUrl)) {
    return;
  }
  if (!isRunning()) {
    start();
  }
  urlChanged=true;
  logger.info("String_Node_Str" + "String_Node_Str" + managementCenterUrl);
}

Fixed version (ground truth):
public void updateManagementCenterUrl(String newUrl){
  if (newUrl == null) {
    return;
  }
  if (newUrl.equals(managementCenterUrl)) {
    return;
  }
  managementCenterUrl=newUrl;
  if (!isRunning()) {
    start();
  }
  urlChanged=true;
  logger.info("String_Node_Str" + "String_Node_Str" + managementCenterUrl);
}
Program: 48358
Project: 48358
Buggy source:
public void applyRecordInfo(Record record,String mapName,RecordInfo replicationInfo){
  record.setStatistics(replicationInfo.getStatistics());
  if (replicationInfo.getIdleDelayMillis() >= 0) {
    scheduleIdleEviction(mapName,record.getKey(),replicationInfo.getIdleDelayMillis());
  }
  if (replicationInfo.getTtlDelayMillis() >= 0) {
    scheduleTtlEviction(mapName,record,replicationInfo.getTtlDelayMillis());
  }
  if (replicationInfo.getMapStoreWriteDelayMillis() >= 0) {
    scheduleMapStoreWrite(mapName,record.getKey(),record.getValue(),replicationInfo.getMapStoreWriteDelayMillis());
  }
  if (replicationInfo.getMapStoreDeleteDelayMillis() >= 0) {
    scheduleMapStoreDelete(mapName,record.getKey(),replicationInfo.getMapStoreDeleteDelayMillis());
  }
}

Fixed version (ground truth):
public void applyRecordInfo(Record record,String mapName,RecordInfo replicationInfo){
  record.setStatistics(replicationInfo.getStatistics());
  record.setVersion(replicationInfo.getVersion());
  if (replicationInfo.getIdleDelayMillis() >= 0) {
    scheduleIdleEviction(mapName,record.getKey(),replicationInfo.getIdleDelayMillis());
  }
  if (replicationInfo.getTtlDelayMillis() >= 0) {
    scheduleTtlEviction(mapName,record,replicationInfo.getTtlDelayMillis());
  }
  if (replicationInfo.getMapStoreWriteDelayMillis() >= 0) {
    scheduleMapStoreWrite(mapName,record.getKey(),record.getValue(),replicationInfo.getMapStoreWriteDelayMillis());
  }
  if (replicationInfo.getMapStoreDeleteDelayMillis() >= 0) {
    scheduleMapStoreDelete(mapName,record.getKey(),replicationInfo.getMapStoreDeleteDelayMillis());
  }
}
Program: 48359
Project: 48359
Buggy source:
public RecordInfo createRecordInfo(MapContainer mapContainer,Record record,Data key){
  int backupDelay=getNodeEngine().getGroupProperties().MAP_REPLICA_WAIT_SECONDS_FOR_SCHEDULED_TASKS.getInteger() * 1000;
  ScheduledEntry idleScheduledEntry=mapContainer.getIdleEvictionScheduler() == null ? null : mapContainer.getIdleEvictionScheduler().get(record.getKey());
  long idleDelay=idleScheduledEntry == null ? -1 : backupDelay + findDelayMillis(idleScheduledEntry);
  ScheduledEntry ttlScheduledEntry=mapContainer.getTtlEvictionScheduler() == null ? null : mapContainer.getTtlEvictionScheduler().get(key);
  long ttlDelay=ttlScheduledEntry == null ? -1 : backupDelay + findDelayMillis(ttlScheduledEntry);
  final RecordInfo recordInfo=new RecordInfo(record.getStatistics(),idleDelay,ttlDelay);
  setDelays(recordInfo,backupDelay,mapContainer,key);
  return recordInfo;
}

Fixed version (ground truth):
public RecordInfo createRecordInfo(MapContainer mapContainer,Record record,Data key){
  final int backupDelay=getNodeEngine().getGroupProperties().MAP_REPLICA_WAIT_SECONDS_FOR_SCHEDULED_TASKS.getInteger() * 1000;
  return constructRecordInfo(mapContainer,record,key,backupDelay);
}
Program: 48360
Project: 48360
Buggy source:
public RecordReplicationInfo createRecordReplicationInfo(MapContainer mapContainer,Record record,Data key){
  ScheduledEntry idleScheduledEntry=mapContainer.getIdleEvictionScheduler() == null ? null : mapContainer.getIdleEvictionScheduler().get(key);
  long idleDelay=idleScheduledEntry == null ? -1 : replicaWaitSecondsForScheduledTasks + findDelayMillis(idleScheduledEntry);
  ScheduledEntry ttlScheduledEntry=mapContainer.getTtlEvictionScheduler() == null ? null : mapContainer.getTtlEvictionScheduler().get(key);
  long ttlDelay=ttlScheduledEntry == null ? -1 : replicaWaitSecondsForScheduledTasks + findDelayMillis(ttlScheduledEntry);
  final RecordReplicationInfo recordReplicationInfo=new RecordReplicationInfo(record.getKey(),toData(record.getValue()),record.getStatistics(),idleDelay,ttlDelay);
  setDelays(recordReplicationInfo,replicaWaitSecondsForScheduledTasks,mapContainer,key);
  return recordReplicationInfo;
}

Fixed version (ground truth):
public RecordReplicationInfo createRecordReplicationInfo(MapContainer mapContainer,Record record,Data key){
  final RecordInfo info=constructRecordInfo(mapContainer,record,key,replicaWaitSecondsForScheduledTasks);
  final RecordReplicationInfo replicationInfo=new RecordReplicationInfo(record.getKey(),toData(record.getValue()),info);
  return replicationInfo;
}
Program: 48361
Project: 48361
Buggy source:
private void setDelays(RecordInfo recordInfo,int extraDelay,MapContainer mapContainer,Data key){
  long deleteDelay=-1;
  long writeDelay=-1;
  if (mapContainer.getMapStoreScheduler() != null) {
    final ScheduledEntry scheduledEntry=mapContainer.getMapStoreScheduler().get(key);
    if (scheduledEntry != null) {
      if (scheduledEntry.getValue() == null) {
        deleteDelay=extraDelay + findDelayMillis(scheduledEntry);
      }
 else {
        writeDelay=extraDelay + findDelayMillis(scheduledEntry);
      }
    }
  }
  recordInfo.setMapStoreDeleteDelayMillis(deleteDelay);
  recordInfo.setMapStoreWriteDelayMillis(writeDelay);
}

Fixed version (ground truth):
private void setDelays(MapContainer mapContainer,RecordInfo info,Data key,int extraDelay){
  long deleteDelay=-1;
  long writeDelay=-1;
  long idleDelay;
  long ttlDelay;
  if (mapContainer.getMapStoreScheduler() != null) {
    final ScheduledEntry scheduledEntry=mapContainer.getMapStoreScheduler().get(key);
    if (scheduledEntry != null) {
      if (scheduledEntry.getValue() == null) {
        deleteDelay=extraDelay + findDelayMillis(scheduledEntry);
      }
 else {
        writeDelay=extraDelay + findDelayMillis(scheduledEntry);
      }
    }
  }
  idleDelay=getDelay(mapContainer.getIdleEvictionScheduler(),key,extraDelay);
  ttlDelay=getDelay(mapContainer.getTtlEvictionScheduler(),key,extraDelay);
  info.setMapStoreDeleteDelayMillis(deleteDelay);
  info.setMapStoreWriteDelayMillis(writeDelay);
  info.setIdleDelayMillis(idleDelay);
  info.setTtlDelayMillis(ttlDelay);
}
Program: 48362
Project: 48362
Buggy source:
@Override public void readData(ObjectDataInput in) throws IOException {
  boolean statsEnabled=in.readBoolean();
  if (statsEnabled) {
    statistics=new RecordStatistics();
    statistics.readData(in);
  }
  idleDelayMillis=in.readLong();
  ttlDelayMillis=in.readLong();
  mapStoreWriteDelayMillis=in.readLong();
  mapStoreDeleteDelayMillis=in.readLong();
}

Fixed version (ground truth):
@Override public void readData(ObjectDataInput in) throws IOException {
  boolean statsEnabled=in.readBoolean();
  if (statsEnabled) {
    statistics=new RecordStatistics();
    statistics.readData(in);
  }
  idleDelayMillis=in.readLong();
  ttlDelayMillis=in.readLong();
  mapStoreWriteDelayMillis=in.readLong();
  mapStoreDeleteDelayMillis=in.readLong();
  version=in.readLong();
}
Program: 48363
Project: 48363
Buggy source:
public RecordInfo(RecordStatistics statistics,long idleDelayMillis,long ttlDelayMillis){
  this(statistics,idleDelayMillis,ttlDelayMillis,-1,-1);
}

Fixed version (ground truth):
public RecordInfo(RecordInfo recordInfo){
  this.statistics=recordInfo.statistics;
  this.idleDelayMillis=recordInfo.idleDelayMillis;
  this.ttlDelayMillis=recordInfo.ttlDelayMillis;
  this.mapStoreWriteDelayMillis=recordInfo.mapStoreWriteDelayMillis;
  this.mapStoreDeleteDelayMillis=recordInfo.mapStoreDeleteDelayMillis;
  this.version=recordInfo.version;
}
Program: 48364
Project: 48364
Buggy source:
@Override public void writeData(ObjectDataOutput out) throws IOException {
  if (statistics != null) {
    out.writeBoolean(true);
    statistics.writeData(out);
  }
 else {
    out.writeBoolean(false);
  }
  out.writeLong(idleDelayMillis);
  out.writeLong(ttlDelayMillis);
  out.writeLong(mapStoreWriteDelayMillis);
  out.writeLong(mapStoreDeleteDelayMillis);
}

Fixed version (ground truth):
@Override public void writeData(ObjectDataOutput out) throws IOException {
  if (statistics != null) {
    out.writeBoolean(true);
    statistics.writeData(out);
  }
 else {
    out.writeBoolean(false);
  }
  out.writeLong(idleDelayMillis);
  out.writeLong(ttlDelayMillis);
  out.writeLong(mapStoreWriteDelayMillis);
  out.writeLong(mapStoreDeleteDelayMillis);
  out.writeLong(version);
}
Program: 48365
Project: 48365
Buggy source:
@Override public String toString(){
  return "String_Node_Str" + "String_Node_Str" + statistics + "String_Node_Str"+ idleDelayMillis+ "String_Node_Str"+ ttlDelayMillis+ "String_Node_Str"+ mapStoreWriteDelayMillis+ "String_Node_Str"+ mapStoreDeleteDelayMillis+ '}';
}

Fixed version (ground truth):
@Override public String toString(){
  return "String_Node_Str" + "String_Node_Str" + statistics + "String_Node_Str"+ idleDelayMillis+ "String_Node_Str"+ ttlDelayMillis+ "String_Node_Str"+ mapStoreWriteDelayMillis+ "String_Node_Str"+ mapStoreDeleteDelayMillis+ "String_Node_Str"+ version+ '}';
}
Program: 48366
Project: 48366
Buggy source:
private void flush(Data key){
  checkIfLoaded();
  EntryTaskScheduler writeScheduler=mapContainer.getMapStoreWriteScheduler();
  Set<Data> keys=new HashSet<Data>(1);
  keys.add(key);
  if (writeScheduler != null) {
    Set<Data> processedKeys=writeScheduler.flush(keys);
    for (    Data pkey : processedKeys) {
      records.get(pkey).onStore();
    }
  }
  EntryTaskScheduler deleteScheduler=mapContainer.getMapStoreDeleteScheduler();
  if (deleteScheduler != null) {
    if (toBeRemovedKeys.contains(key)) {
      deleteScheduler.flush(keys);
      toBeRemovedKeys.remove(key);
    }
  }
}

Fixed version (ground truth):
private void flush(Data key){
  checkIfLoaded();
  EntryTaskScheduler writeScheduler=mapContainer.getMapStoreScheduler();
  Set<Data> keys=new HashSet<Data>(1);
  keys.add(key);
  if (writeScheduler != null) {
    Set<Data> processedKeys=writeScheduler.flush(keys);
    for (    Data pkey : processedKeys) {
      records.get(pkey).onStore();
    }
  }
  EntryTaskScheduler deleteScheduler=mapContainer.getMapStoreScheduler();
  if (deleteScheduler != null) {
    if (toBeRemovedKeys.contains(key)) {
      deleteScheduler.flush(keys);
      toBeRemovedKeys.remove(key);
    }
  }
}
Program: 48368
Project: 48368
Buggy source:
public void scheduleMapStoreDelete(String mapName,Data key,long delay){
  getMapContainer(mapName).getMapStoreDeleteScheduler().schedule(delay,key,null);
}

Fixed version (ground truth):
public void scheduleMapStoreDelete(String mapName,Data key,long delay){
  getMapContainer(mapName).getMapStoreScheduler().schedule(delay,key,null);
}
Program: 48369
Project: 48369
Buggy source:
public RecordInfo createRecordInfo(MapContainer mapContainer,Record record,Data key){
  int backupDelay=getNodeEngine().getGroupProperties().MAP_REPLICA_WAIT_SECONDS_FOR_SCHEDULED_TASKS.getInteger() * 1000;
  ScheduledEntry idleScheduledEntry=mapContainer.getIdleEvictionScheduler() == null ? null : mapContainer.getIdleEvictionScheduler().get(record.getKey());
  long idleDelay=idleScheduledEntry == null ? -1 : backupDelay + findDelayMillis(idleScheduledEntry);
  ScheduledEntry ttlScheduledEntry=mapContainer.getTtlEvictionScheduler() == null ? null : mapContainer.getTtlEvictionScheduler().get(key);
  long ttlDelay=ttlScheduledEntry == null ? -1 : backupDelay + findDelayMillis(ttlScheduledEntry);
  ScheduledEntry writeScheduledEntry=mapContainer.getMapStoreWriteScheduler() == null ? null : mapContainer.getMapStoreWriteScheduler().get(key);
  long writeDelay=writeScheduledEntry == null ? -1 : backupDelay + findDelayMillis(writeScheduledEntry);
  ScheduledEntry deleteScheduledEntry=mapContainer.getMapStoreDeleteScheduler() == null ? null : mapContainer.getMapStoreDeleteScheduler().get(key);
  long deleteDelay=deleteScheduledEntry == null ? -1 : backupDelay + findDelayMillis(deleteScheduledEntry);
  return new RecordInfo(record.getStatistics(),idleDelay,ttlDelay,writeDelay,deleteDelay);
}

Fixed version (ground truth):
public RecordInfo createRecordInfo(MapContainer mapContainer,Record record,Data key){
  int backupDelay=getNodeEngine().getGroupProperties().MAP_REPLICA_WAIT_SECONDS_FOR_SCHEDULED_TASKS.getInteger() * 1000;
  ScheduledEntry idleScheduledEntry=mapContainer.getIdleEvictionScheduler() == null ? null : mapContainer.getIdleEvictionScheduler().get(record.getKey());
  long idleDelay=idleScheduledEntry == null ? -1 : backupDelay + findDelayMillis(idleScheduledEntry);
  ScheduledEntry ttlScheduledEntry=mapContainer.getTtlEvictionScheduler() == null ? null : mapContainer.getTtlEvictionScheduler().get(key);
  long ttlDelay=ttlScheduledEntry == null ? -1 : backupDelay + findDelayMillis(ttlScheduledEntry);
  final RecordInfo recordInfo=new RecordInfo(record.getStatistics(),idleDelay,ttlDelay);
  setDelays(recordInfo,backupDelay,mapContainer,key);
  return recordInfo;
}
Program: 48370
Project: 48370
Buggy source:
public RecordReplicationInfo createRecordReplicationInfo(MapContainer mapContainer,Record record,Data key){
  ScheduledEntry idleScheduledEntry=mapContainer.getIdleEvictionScheduler() == null ? null : mapContainer.getIdleEvictionScheduler().get(key);
  long idleDelay=idleScheduledEntry == null ? -1 : replicaWaitSecondsForScheduledTasks + findDelayMillis(idleScheduledEntry);
  ScheduledEntry ttlScheduledEntry=mapContainer.getTtlEvictionScheduler() == null ? null : mapContainer.getTtlEvictionScheduler().get(key);
  long ttlDelay=ttlScheduledEntry == null ? -1 : replicaWaitSecondsForScheduledTasks + findDelayMillis(ttlScheduledEntry);
  ScheduledEntry writeScheduledEntry=mapContainer.getMapStoreWriteScheduler() == null ? null : mapContainer.getMapStoreWriteScheduler().get(key);
  long writeDelay=writeScheduledEntry == null ? -1 : replicaWaitSecondsForScheduledTasks + findDelayMillis(writeScheduledEntry);
  ScheduledEntry deleteScheduledEntry=mapContainer.getMapStoreDeleteScheduler() == null ? null : mapContainer.getMapStoreDeleteScheduler().get(key);
  long deleteDelay=deleteScheduledEntry == null ? -1 : replicaWaitSecondsForScheduledTasks + findDelayMillis(deleteScheduledEntry);
  return new RecordReplicationInfo(record.getKey(),toData(record.getValue()),record.getStatistics(),idleDelay,ttlDelay,writeDelay,deleteDelay);
}

Fixed version (ground truth):
public RecordReplicationInfo createRecordReplicationInfo(MapContainer mapContainer,Record record,Data key){
  ScheduledEntry idleScheduledEntry=mapContainer.getIdleEvictionScheduler() == null ? null : mapContainer.getIdleEvictionScheduler().get(key);
  long idleDelay=idleScheduledEntry == null ? -1 : replicaWaitSecondsForScheduledTasks + findDelayMillis(idleScheduledEntry);
  ScheduledEntry ttlScheduledEntry=mapContainer.getTtlEvictionScheduler() == null ? null : mapContainer.getTtlEvictionScheduler().get(key);
  long ttlDelay=ttlScheduledEntry == null ? -1 : replicaWaitSecondsForScheduledTasks + findDelayMillis(ttlScheduledEntry);
  final RecordReplicationInfo recordReplicationInfo=new RecordReplicationInfo(record.getKey(),toData(record.getValue()),record.getStatistics(),idleDelay,ttlDelay);
  setDelays(recordReplicationInfo,replicaWaitSecondsForScheduledTasks,mapContainer,key);
  return recordReplicationInfo;
}
Program: 48371
Project: 48371
Buggy source:
public void scheduleMapStoreWrite(String mapName,Data key,Object value,long delay){
  getMapContainer(mapName).getMapStoreWriteScheduler().schedule(delay,key,value);
}

Fixed version (ground truth):
public void scheduleMapStoreWrite(String mapName,Data key,Object value,long delay){
  getMapContainer(mapName).getMapStoreScheduler().schedule(delay,key,value);
}
Program: 48373
Project: 48373
Buggy source:
public RecordInfo(RecordStatistics statistics,long idleDelayMillis,long ttlDelayMillis,long mapStoreWriteDelayMillis,long mapStoreDeleteDelayMillis){
  this.statistics=statistics;
  this.idleDelayMillis=idleDelayMillis;
  this.ttlDelayMillis=ttlDelayMillis;
  this.mapStoreWriteDelayMillis=mapStoreWriteDelayMillis;
  this.mapStoreDeleteDelayMillis=mapStoreDeleteDelayMillis;
}

Fixed version (ground truth):
public RecordInfo(RecordStatistics statistics,long idleDelayMillis,long ttlDelayMillis){
  this(statistics,idleDelayMillis,ttlDelayMillis,-1,-1);
}
Program: 48374
Project: 48374
Buggy source:
@Override public <ValueOut>ReducingJob<EntryKey,Key,ValueOut> combiner(CombinerFactory<Key,Value,ValueOut> combinerFactory){
  ValidationUtil.isNotNull(combinerFactory,"String_Node_Str");
  if (AbstractJob.this.combinerFactory != null) {
    throw new IllegalStateException("String_Node_Str");
  }
  AbstractJob.this.combinerFactory=AbstractJob.this.combinerFactory;
  return new ReducingJobImpl<EntryKey,Key,ValueOut>();
}

Fixed version (ground truth):
@Override public <ValueOut>ReducingJob<EntryKey,Key,ValueOut> combiner(CombinerFactory<Key,Value,ValueOut> combinerFactory){
  ValidationUtil.isNotNull(combinerFactory,"String_Node_Str");
  if (AbstractJob.this.combinerFactory != null) {
    throw new IllegalStateException("String_Node_Str");
  }
  AbstractJob.this.combinerFactory=combinerFactory;
  return new ReducingJobImpl<EntryKey,Key,ValueOut>();
}
Program: 48375
Project: 48375
Buggy source:
@Override public void reduce(Integer value){
  sum+=value;
}

Fixed version (ground truth):
@Override public void reduce(Long value){
  sum+=value;
}
Program: 48376
Project: 48376
Buggy source:
@Override public Reducer<String,Integer,Integer> newReducer(String key){
  return new TestReducer();
}

Fixed version (ground truth):
@Override public Reducer<String,Long,Long> newReducer(String key){
  return new TestIntermediateReducer();
}
Program: 48377
Project: 48377
Buggy source:
@Override public Integer finalizeReduce(){
  return sum;
}

Fixed version (ground truth):
@Override public Long finalizeReduce(){
  return sum;
}
Program: 48378
Project: 48378
Buggy source:
@Override public Combiner<String,Integer,Integer> newCombiner(String key){
  return new TestCombiner();
}

Fixed version (ground truth):
@Override public Combiner<String,Integer,Long> newCombiner(String key){
  return new TestIntermediateCombiner();
}
Program: 48379
Project: 48379
Buggy source:
@Override public Integer finalizeChunk(){
  int v=sum;
  sum=0;
  return v;
}

Fixed version (ground truth):
@Override public Long finalizeChunk(){
  int v=sum;
  sum=0;
  return Long.valueOf(v);
}
Program: 48380
Project: 48380
Buggy source:
@Override protected void readInternal(ObjectDataInput in) throws IOException {
  super.readInternal(in);
  operationCallId=in.readLong();
}

Fixed version (ground truth):
@Override protected void readInternal(ObjectDataInput in) throws IOException {
  super.readInternal(in);
  serviceName=in.readUTF();
  identifier=in.readObject();
}
Program: 48381
Project: 48381
Buggy source:
@Override protected void writeInternal(ObjectDataOutput out) throws IOException {
  super.writeInternal(out);
  out.writeLong(operationCallId);
}

Fixed version (ground truth):
@Override protected void writeInternal(ObjectDataOutput out) throws IOException {
  super.writeInternal(out);
  out.writeUTF(serviceName);
  out.writeObject(identifier);
}
Program: 48382
Project: 48382
Buggy source:
private boolean isOperationExecuting(Address target){
  Boolean executing=Boolean.FALSE;
  try {
    final BasicInvocation inv=new BasicTargetInvocation(nodeEngine,serviceName,new IsStillExecuting(op.getCallId()),target,0,0,5000,null,null,true);
    Future f=inv.invoke();
    logger.warning("String_Node_Str" + toString());
    executing=(Boolean)nodeEngine.toObject(f.get(5000,TimeUnit.MILLISECONDS));
  }
 catch (  Exception e) {
    logger.warning("String_Node_Str" + toString(),e);
  }
  logger.warning("String_Node_Str" + executing + "String_Node_Str"+ toString());
  return executing;
}

Fixed version (ground truth):
private boolean isOperationExecuting(Address target){
  Boolean executing=Boolean.FALSE;
  try {
    Operation isStillExecuting;
    if (op instanceof TraceableOperation) {
      TraceableOperation traceable=(TraceableOperation)op;
      isStillExecuting=new TraceableIsStillExecuting(serviceName,traceable.getTraceIdentifier());
    }
 else {
      isStillExecuting=new IsStillExecuting(op.getCallId());
    }
    final BasicInvocation inv=new BasicTargetInvocation(nodeEngine,serviceName,isStillExecuting,target,0,0,5000,null,null,true);
    Future f=inv.invoke();
    logger.warning("String_Node_Str" + toString());
    executing=(Boolean)nodeEngine.toObject(f.get(5000,TimeUnit.MILLISECONDS));
  }
 catch (  Exception e) {
    logger.warning("String_Node_Str" + toString(),e);
  }
  logger.warning("String_Node_Str" + executing + "String_Node_Str"+ toString());
  return executing;
}
Program: 48383
Project: 48383
Buggy source:
@PrivateApi boolean isOperationExecuting(Address callerAddress,String callerUuid,long operationCallId){
  return executingCalls.containsKey(new RemoteCallKey(callerAddress,callerUuid,operationCallId));
}

Fixed version (ground truth):
@PrivateApi boolean isOperationExecuting(Address callerAddress,String callerUuid,String serviceName,Object identifier){
  Object service=nodeEngine.getService(serviceName);
  if (service == null) {
    logger.severe("String_Node_Str" + serviceName);
    return false;
  }
  if (service instanceof ExecutionTracingService) {
    return ((ExecutionTracingService)service).isOperationExecuting(callerAddress,callerUuid,identifier);
  }
  logger.severe("String_Node_Str" + service);
  return false;
}
Program: 48384
Project: 48384
Buggy source:
@Test public void testExecutorServiceStats() throws InterruptedException, ExecutionException {
  final IExecutorService executorService=createSingleNodeExecutorService("String_Node_Str");
  final int k=10;
  final CountDownLatch latch=new CountDownLatch(k);
  final int executionTime=200;
  for (int i=0; i < k; i++) {
    executorService.execute(new Runnable(){
      public void run(){
        try {
          Thread.sleep(executionTime);
        }
 catch (        InterruptedException e) {
          e.printStackTrace();
        }
        latch.countDown();
      }
    }
);
  }
  latch.await(2,TimeUnit.MINUTES);
  final Future<Boolean> f=executorService.submit(new CancellationAwareTask(10000));
  Thread.sleep(1000);
  f.cancel(true);
  try {
    f.get();
  }
 catch (  CancellationException e) {
  }
  final LocalExecutorStats stats=executorService.getLocalExecutorStats();
  assertEquals(k + 1,stats.getStartedTaskCount());
  assertEquals(k,stats.getCompletedTaskCount());
  assertEquals(0,stats.getPendingTaskCount());
  assertEquals(1,stats.getCancelledTaskCount());
}

Fixed version (ground truth):
@Test public void testExecutorServiceStats() throws InterruptedException, ExecutionException {
  final IExecutorService executorService=createSingleNodeExecutorService("String_Node_Str");
  final int k=10;
  final CountDownLatch latch=new CountDownLatch(k);
  final int executionTime=200;
  for (int i=0; i < k; i++) {
    executorService.execute(new Runnable(){
      public void run(){
        try {
          Thread.sleep(executionTime);
        }
 catch (        InterruptedException e) {
          e.printStackTrace();
        }
        latch.countDown();
      }
    }
);
  }
  latch.await(2,TimeUnit.MINUTES);
  final Future<Boolean> f=executorService.submit(new SleepingTask(10000));
  Thread.sleep(1000);
  f.cancel(true);
  try {
    f.get();
  }
 catch (  CancellationException e) {
  }
  final LocalExecutorStats stats=executorService.getLocalExecutorStats();
  assertEquals(k + 1,stats.getStartedTaskCount());
  assertEquals(k,stats.getCompletedTaskCount());
  assertEquals(0,stats.getPendingTaskCount());
  assertEquals(1,stats.getCancelledTaskCount());
}
Program: 48385
Project: 48385
Buggy source:
@Test public void testCancellationAwareTask2(){
  Callable task1=new CancellationAwareTask(5000);
  ExecutorService executor=createSingleNodeExecutorService("String_Node_Str",1);
  executor.submit(task1);
  Callable task2=new BasicTestTask();
  Future future=executor.submit(task2);
  assertFalse(future.isDone());
  assertTrue(future.cancel(true));
  assertTrue(future.isCancelled());
  assertTrue(future.isDone());
  try {
    future.get();
    fail("String_Node_Str");
  }
 catch (  CancellationException expected) {
  }
catch (  Exception e) {
    fail("String_Node_Str" + e);
  }
}

Fixed version (ground truth):
@Test public void testCancellationAwareTask2(){
  Callable task1=new SleepingTask(5000);
  ExecutorService executor=createSingleNodeExecutorService("String_Node_Str",1);
  executor.submit(task1);
  Callable task2=new BasicTestTask();
  Future future=executor.submit(task2);
  assertFalse(future.isDone());
  assertTrue(future.cancel(true));
  assertTrue(future.isCancelled());
  assertTrue(future.isDone());
  try {
    future.get();
    fail("String_Node_Str");
  }
 catch (  CancellationException expected) {
  }
catch (  Exception e) {
    fail("String_Node_Str" + e);
  }
}
Program: 48386
Project: 48386
Buggy source:
@Test public void testInvokeAllTimeoutCancelled() throws Exception {
  ExecutorService executor=createSingleNodeExecutorService("String_Node_Str");
  assertFalse(executor.isShutdown());
  ArrayList<Callable<Boolean>> tasks=new ArrayList<Callable<Boolean>>();
  tasks.add(new CancellationAwareTask(0));
  List<Future<Boolean>> futures=executor.invokeAll(tasks,5,TimeUnit.SECONDS);
  assertEquals(futures.size(),1);
  assertEquals(futures.get(0).get(),Boolean.TRUE);
  tasks.clear();
  for (int i=0; i < COUNT; i++) {
    tasks.add(new CancellationAwareTask(i < 2 ? 0 : 20000));
  }
  futures=executor.invokeAll(tasks,5,TimeUnit.SECONDS);
  assertEquals(futures.size(),COUNT);
  for (int i=0; i < COUNT; i++) {
    if (i < 2) {
      assertEquals(futures.get(i).get(),Boolean.TRUE);
    }
 else {
      boolean excepted=false;
      try {
        futures.get(i).get();
      }
 catch (      CancellationException e) {
        excepted=true;
      }
      assertTrue(excepted);
    }
  }
}

Fixed version (ground truth):
@Test public void testInvokeAllTimeoutCancelled() throws Exception {
  ExecutorService executor=createSingleNodeExecutorService("String_Node_Str");
  assertFalse(executor.isShutdown());
  ArrayList<Callable<Boolean>> tasks=new ArrayList<Callable<Boolean>>();
  tasks.add(new SleepingTask(0));
  List<Future<Boolean>> futures=executor.invokeAll(tasks,5,TimeUnit.SECONDS);
  assertEquals(futures.size(),1);
  assertEquals(futures.get(0).get(),Boolean.TRUE);
  tasks.clear();
  for (int i=0; i < COUNT; i++) {
    tasks.add(new SleepingTask(i < 2 ? 0 : 20000));
  }
  futures=executor.invokeAll(tasks,5,TimeUnit.SECONDS);
  assertEquals(futures.size(),COUNT);
  for (int i=0; i < COUNT; i++) {
    if (i < 2) {
      assertEquals(futures.get(i).get(),Boolean.TRUE);
    }
 else {
      boolean excepted=false;
      try {
        futures.get(i).get();
      }
 catch (      CancellationException e) {
        excepted=true;
      }
      assertTrue(excepted);
    }
  }
}
Program: 48387
Project: 48387
Buggy source:
@Test public void testCancellationAwareTask() throws ExecutionException, InterruptedException {
  CancellationAwareTask task=new CancellationAwareTask(5000);
  ExecutorService executor=createSingleNodeExecutorService("String_Node_Str");
  Future future=executor.submit(task);
  try {
    future.get(2,TimeUnit.SECONDS);
    fail("String_Node_Str");
  }
 catch (  TimeoutException expected) {
  }
  assertFalse(future.isDone());
  assertTrue(future.cancel(true));
  assertTrue(future.isCancelled());
  assertTrue(future.isDone());
  try {
    future.get();
    fail("String_Node_Str");
  }
 catch (  CancellationException expected) {
  }
catch (  Exception e) {
    fail("String_Node_Str" + e);
  }
}

Fixed version (ground truth):
@Test public void testCancellationAwareTask() throws ExecutionException, InterruptedException {
  SleepingTask task=new SleepingTask(5000);
  ExecutorService executor=createSingleNodeExecutorService("String_Node_Str");
  Future future=executor.submit(task);
  try {
    future.get(2,TimeUnit.SECONDS);
    fail("String_Node_Str");
  }
 catch (  TimeoutException expected) {
  }
  assertFalse(future.isDone());
  assertTrue(future.cancel(true));
  assertTrue(future.isCancelled());
  assertTrue(future.isDone());
  try {
    future.get();
    fail("String_Node_Str");
  }
 catch (  CancellationException expected) {
  }
catch (  Exception e) {
    fail("String_Node_Str" + e);
  }
}
Program: 48388
Project: 48388
Buggy source:
private Address getMemberAddress(Member member){
  MemberImpl m=getContext().getClusterService().getMember(member.getUuid());
  if (m == null) {
    throw new HazelcastException("String_Node_Str" + m + "String_Node_Str");
  }
  return m.getAddress();
}

Fixed version (ground truth):
private Address getMemberAddress(Member member){
  MemberImpl m=getContext().getClusterService().getMember(member.getUuid());
  if (m == null) {
    throw new HazelcastException(member + "String_Node_Str");
  }
  return m.getAddress();
}
Program: 48389
Project: 48389
Buggy source:
private long getCallTimeout(long callTimeout){
  if (callTimeout > 0) {
    return callTimeout;
  }
  BasicOperationService operationService=(BasicOperationService)nodeEngine.operationService;
  final long defaultCallTimeout=operationService.getDefaultCallTimeout();
  if (op instanceof WaitSupport) {
    final long waitTimeoutMillis=((WaitSupport)op).getWaitTimeoutMillis();
    if (waitTimeoutMillis > 0 && waitTimeoutMillis < Long.MAX_VALUE) {
      return waitTimeoutMillis + (defaultCallTimeout > PLUS_TIMEOUT ? PLUS_TIMEOUT : defaultCallTimeout);
    }
  }
  return defaultCallTimeout;
}

Fixed version (ground truth):
private long getCallTimeout(long callTimeout){
  if (callTimeout > 0) {
    return callTimeout;
  }
  BasicOperationService operationService=(BasicOperationService)nodeEngine.operationService;
  final long defaultCallTimeout=operationService.getDefaultCallTimeout();
  if (op instanceof WaitSupport) {
    final long waitTimeoutMillis=((WaitSupport)op).getWaitTimeoutMillis();
    if (waitTimeoutMillis > 0 && waitTimeoutMillis < Long.MAX_VALUE) {
      final long max=Math.max(waitTimeoutMillis,MIN_TIMEOUT);
      return Math.min(max,defaultCallTimeout);
    }
  }
  return defaultCallTimeout;
}
Program: 48390
Project: 48390
Buggy source:
@Test(timeout=60000) @Category(ProblematicTest.class) public void testLockInterruption() throws InterruptedException {
  Config config=new Config();
  config.setProperty(GroupProperties.PROP_OPERATION_CALL_TIMEOUT_MILLIS,"String_Node_Str");
  final HazelcastInstance hz=createHazelcastInstance(config);
  final Lock lock=hz.getLock("String_Node_Str");
  final CountDownLatch latch=new CountDownLatch(1);
  Thread t=new Thread(new Runnable(){
    public void run(){
      try {
        lock.tryLock(60,TimeUnit.SECONDS);
      }
 catch (      InterruptedException ignored) {
        latch.countDown();
      }
    }
  }
);
  lock.lock();
  t.start();
  Thread.sleep(2000);
  t.interrupt();
  assertTrue("String_Node_Str",latch.await(30,TimeUnit.SECONDS));
  lock.unlock();
  assertTrue("String_Node_Str",lock.tryLock());
}

Fixed version (ground truth):
@Test(timeout=60000) public void testLockInterruption() throws InterruptedException {
  Config config=new Config();
  config.setProperty(GroupProperties.PROP_OPERATION_CALL_TIMEOUT_MILLIS,"String_Node_Str");
  final HazelcastInstance hz=createHazelcastInstance(config);
  final Lock lock=hz.getLock("String_Node_Str");
  final CountDownLatch latch=new CountDownLatch(1);
  Thread t=new Thread(new Runnable(){
    public void run(){
      try {
        lock.tryLock(60,TimeUnit.SECONDS);
      }
 catch (      InterruptedException ignored) {
        latch.countDown();
      }
    }
  }
);
  lock.lock();
  t.start();
  Thread.sleep(2000);
  t.interrupt();
  assertTrue("String_Node_Str",latch.await(30,TimeUnit.SECONDS));
  lock.unlock();
  assertTrue("String_Node_Str",lock.tryLock());
}
Program: 48391
Project: 48391
Buggy source:
private long getCallTimeout(long callTimeout){
  if (callTimeout > 0) {
    return callTimeout;
  }
  final long defaultCallTimeout=nodeEngine.operationService.getDefaultCallTimeout();
  if (op instanceof WaitSupport) {
    final long waitTimeoutMillis=((WaitSupport)op).getWaitTimeoutMillis();
    if (waitTimeoutMillis > 0 && waitTimeoutMillis < Long.MAX_VALUE) {
      return waitTimeoutMillis + (defaultCallTimeout > PLUS_TIMEOUT ? PLUS_TIMEOUT : defaultCallTimeout);
    }
  }
  return defaultCallTimeout;
}

Fixed version (ground truth):
private long getCallTimeout(long callTimeout){
  if (callTimeout > 0) {
    return callTimeout;
  }
  final long defaultCallTimeout=nodeEngine.operationService.getDefaultCallTimeout();
  if (op instanceof WaitSupport) {
    final long waitTimeoutMillis=((WaitSupport)op).getWaitTimeoutMillis();
    if (waitTimeoutMillis > 0 && waitTimeoutMillis < Long.MAX_VALUE) {
      final long max=Math.max(waitTimeoutMillis,MIN_TIMEOUT);
      return Math.min(max,defaultCallTimeout);
    }
  }
  return defaultCallTimeout;
}
Program: 48392
Project: 48392
Buggy source:
@Test @Ignore public void testLockInterruption() throws InterruptedException {
  Config config=new Config();
  config.setProperty(GroupProperties.PROP_OPERATION_CALL_TIMEOUT_MILLIS,"String_Node_Str");
  final TestHazelcastInstanceFactory nodeFactory=createHazelcastInstanceFactory(1);
  final HazelcastInstance hz=nodeFactory.newHazelcastInstance(config);
  final Lock lock=hz.getLock("String_Node_Str");
  final CountDownLatch latch=new CountDownLatch(1);
  Thread t=new Thread(new Runnable(){
    public void run(){
      try {
        lock.tryLock(60,TimeUnit.SECONDS);
      }
 catch (      InterruptedException ignored) {
        latch.countDown();
      }
    }
  }
);
  lock.lock();
  t.start();
  Thread.sleep(2000);
  t.interrupt();
  assertTrue("String_Node_Str",latch.await(30,TimeUnit.SECONDS));
  lock.unlock();
  assertTrue("String_Node_Str",lock.tryLock());
}

Fixed version (ground truth):
@Test public void testLockInterruption() throws InterruptedException {
  Config config=new Config();
  config.setProperty(GroupProperties.PROP_OPERATION_CALL_TIMEOUT_MILLIS,"String_Node_Str");
  final TestHazelcastInstanceFactory nodeFactory=createHazelcastInstanceFactory(1);
  final HazelcastInstance hz=nodeFactory.newHazelcastInstance(config);
  final Lock lock=hz.getLock("String_Node_Str");
  final CountDownLatch latch=new CountDownLatch(1);
  Thread t=new Thread(new Runnable(){
    public void run(){
      try {
        lock.tryLock(60,TimeUnit.SECONDS);
      }
 catch (      InterruptedException ignored) {
        latch.countDown();
      }
    }
  }
);
  lock.lock();
  t.start();
  Thread.sleep(2000);
  t.interrupt();
  assertTrue("String_Node_Str",latch.await(30,TimeUnit.SECONDS));
  lock.unlock();
  assertTrue("String_Node_Str",lock.tryLock());
}
Program: 48393
Project: 48393
Buggy source:
private long getCallTimeout(long callTimeout){
  if (callTimeout > 0) {
    return callTimeout;
  }
  final long defaultCallTimeout=nodeEngine.operationService.getDefaultCallTimeout();
  if (op instanceof WaitSupport) {
    final long waitTimeoutMillis=((WaitSupport)op).getWaitTimeoutMillis();
    if (waitTimeoutMillis > 0 && waitTimeoutMillis < Long.MAX_VALUE) {
      final long max=Math.max(waitTimeoutMillis,MIN_TIMEOUT);
      return Math.min(max,defaultCallTimeout);
    }
  }
  return defaultCallTimeout;
}

Fixed version (ground truth):
private long getCallTimeout(long callTimeout){
  if (callTimeout > 0) {
    return callTimeout;
  }
  final long defaultCallTimeout=nodeEngine.operationService.getDefaultCallTimeout();
  if (op instanceof WaitSupport) {
    final long waitTimeoutMillis=((WaitSupport)op).getWaitTimeoutMillis();
    if (waitTimeoutMillis > 0 && waitTimeoutMillis < Long.MAX_VALUE) {
      return waitTimeoutMillis + (defaultCallTimeout > PLUS_TIMEOUT ? PLUS_TIMEOUT : defaultCallTimeout);
    }
  }
  return defaultCallTimeout;
}
Program: 48394
Project: 48394
Buggy source:
@Test public void testLockInterruption() throws InterruptedException {
  Config config=new Config();
  config.setProperty(GroupProperties.PROP_OPERATION_CALL_TIMEOUT_MILLIS,"String_Node_Str");
  final TestHazelcastInstanceFactory nodeFactory=createHazelcastInstanceFactory(1);
  final HazelcastInstance hz=nodeFactory.newHazelcastInstance(config);
  final Lock lock=hz.getLock("String_Node_Str");
  final CountDownLatch latch=new CountDownLatch(1);
  Thread t=new Thread(new Runnable(){
    public void run(){
      try {
        lock.tryLock(60,TimeUnit.SECONDS);
      }
 catch (      InterruptedException ignored) {
        latch.countDown();
      }
    }
  }
);
  lock.lock();
  t.start();
  Thread.sleep(2000);
  t.interrupt();
  assertTrue("String_Node_Str",latch.await(30,TimeUnit.SECONDS));
  lock.unlock();
  assertTrue("String_Node_Str",lock.tryLock());
}

Fixed version (ground truth):
@Test @Ignore public void testLockInterruption() throws InterruptedException {
  Config config=new Config();
  config.setProperty(GroupProperties.PROP_OPERATION_CALL_TIMEOUT_MILLIS,"String_Node_Str");
  final TestHazelcastInstanceFactory nodeFactory=createHazelcastInstanceFactory(1);
  final HazelcastInstance hz=nodeFactory.newHazelcastInstance(config);
  final Lock lock=hz.getLock("String_Node_Str");
  final CountDownLatch latch=new CountDownLatch(1);
  Thread t=new Thread(new Runnable(){
    public void run(){
      try {
        lock.tryLock(60,TimeUnit.SECONDS);
      }
 catch (      InterruptedException ignored) {
        latch.countDown();
      }
    }
  }
);
  lock.lock();
  t.start();
  Thread.sleep(2000);
  t.interrupt();
  assertTrue("String_Node_Str",latch.await(30,TimeUnit.SECONDS));
  lock.unlock();
  assertTrue("String_Node_Str",lock.tryLock());
}
Program: 48395
Project: 48395
Buggy source:
public Object getAttribute(final String name){
  IMap<String,Object> clusterMap=getClusterMap();
  if (deferredWrite) {
    LocalCacheEntry cacheEntry=localCache.get(name);
    if (cacheEntry == null || cacheEntry.reload) {
      Object value=clusterMap.get(buildAttributeName(name));
      if (value == null) {
        cacheEntry=NULL_ENTRY;
      }
 else {
        cacheEntry=new LocalCacheEntry();
        cacheEntry.value=value;
        cacheEntry.reload=false;
      }
      localCache.put(name,NULL_ENTRY);
    }
    return cacheEntry != NULL_ENTRY ? cacheEntry.value : null;
  }
  return clusterMap.get(buildAttributeName(name));
}

Fixed version (ground truth):
public Object getAttribute(final String name){
  IMap<String,Object> clusterMap=getClusterMap();
  if (deferredWrite) {
    LocalCacheEntry cacheEntry=localCache.get(name);
    if (cacheEntry == null || cacheEntry.reload) {
      Object value=clusterMap.get(buildAttributeName(name));
      if (value == null) {
        cacheEntry=NULL_ENTRY;
      }
 else {
        cacheEntry=new LocalCacheEntry();
        cacheEntry.value=value;
        cacheEntry.reload=false;
      }
      localCache.put(name,cacheEntry);
    }
    return cacheEntry != NULL_ENTRY ? cacheEntry.value : null;
  }
  return clusterMap.get(buildAttributeName(name));
}