nus-yam/ex-repair huggingface dataset:
Program: 48838
Project: 48838
Buggy source:
public void readData(ObjectDataInput in) throws IOException {
  available=in.readInt();
  partitionId=in.readInt();
  backupCount=in.readInt();
  asyncBackupCount=in.readInt();
  int size=in.readInt();
  attachMap=new HashMap<String,Integer>(size);
  for (int i=0; i < size; i++) {
    String caller=in.readUTF();
    Integer val=in.readInt();
    attachMap.put(caller,val);
  }
}

Fixed version (ground truth):
public void readData(ObjectDataInput in) throws IOException {
  initialized=in.readBoolean();
  available=in.readInt();
  partitionId=in.readInt();
  backupCount=in.readInt();
  asyncBackupCount=in.readInt();
  int size=in.readInt();
  attachMap=new HashMap<String,Integer>(size);
  for (int i=0; i < size; i++) {
    String caller=in.readUTF();
    Integer val=in.readInt();
    attachMap.put(caller,val);
  }
}
Program: 48839
Project: 48839
Buggy source:
public void writeData(ObjectDataOutput out) throws IOException {
  out.writeInt(available);
  out.writeInt(partitionId);
  out.writeInt(backupCount);
  out.writeInt(asyncBackupCount);
  out.writeInt(attachMap.size());
  for (  Map.Entry<String,Integer> entry : attachMap.entrySet()) {
    out.writeUTF(entry.getKey());
    out.writeInt(entry.getValue());
  }
}

Fixed version (ground truth):
public void writeData(ObjectDataOutput out) throws IOException {
  out.writeBoolean(initialized);
  out.writeInt(available);
  out.writeInt(partitionId);
  out.writeInt(backupCount);
  out.writeInt(asyncBackupCount);
  out.writeInt(attachMap.size());
  for (  Map.Entry<String,Integer> entry : attachMap.entrySet()) {
    out.writeUTF(entry.getKey());
    out.writeInt(entry.getValue());
  }
}
Program: 48840
Project: 48840
Buggy source:
@Test public void testSemaphoreWithFailuresAndJoin(){
  final Config config=new Config();
  final TestHazelcastInstanceFactory factory=createHazelcastInstanceFactory(3);
  final HazelcastInstance instance1=factory.newHazelcastInstance(config);
  final HazelcastInstance instance2=factory.newHazelcastInstance(config);
  final ISemaphore semaphore=instance1.getSemaphore("String_Node_Str");
  final CountDownLatch countDownLatch=new CountDownLatch(1);
  Assert.assertTrue(semaphore.init(0));
  final Thread thread=new Thread(){
    public void run(){
      for (int i=0; i < 2; i++) {
        try {
          semaphore.acquire();
        }
 catch (        InterruptedException e) {
          e.printStackTrace();
        }
      }
      countDownLatch.countDown();
    }
  }
;
  thread.start();
  instance2.getLifecycleService().shutdown();
  semaphore.release();
  HazelcastInstance instance3=factory.newHazelcastInstance(config);
  ISemaphore semaphore1=instance3.getSemaphore("String_Node_Str");
  semaphore1.release();
  try {
    Assert.assertTrue(countDownLatch.await(15,TimeUnit.SECONDS));
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
 finally {
    thread.interrupt();
  }
}

Fixed version (ground truth):
@Test public void testSemaphoreWithFailuresAndJoin(){
  final Config config=new Config();
  final TestHazelcastInstanceFactory factory=createHazelcastInstanceFactory(3);
  final HazelcastInstance instance1=factory.newHazelcastInstance(config);
  final HazelcastInstance instance2=factory.newHazelcastInstance(config);
  final ISemaphore semaphore=instance1.getSemaphore("String_Node_Str");
  final CountDownLatch countDownLatch=new CountDownLatch(1);
  assertTrue(semaphore.init(0));
  final Thread thread=new Thread(){
    public void run(){
      for (int i=0; i < 2; i++) {
        try {
          semaphore.acquire();
        }
 catch (        InterruptedException e) {
          e.printStackTrace();
        }
      }
      countDownLatch.countDown();
    }
  }
;
  thread.start();
  instance2.getLifecycleService().shutdown();
  semaphore.release();
  HazelcastInstance instance3=factory.newHazelcastInstance(config);
  ISemaphore semaphore1=instance3.getSemaphore("String_Node_Str");
  semaphore1.release();
  try {
    assertTrue(countDownLatch.await(15,TimeUnit.SECONDS));
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
 finally {
    thread.interrupt();
  }
}
Program: 48841
Project: 48841
Buggy source:
@Test public void testMutex(){
  final int k=5;
  final Config config=new Config();
  TestHazelcastInstanceFactory factory=createHazelcastInstanceFactory(k);
  final HazelcastInstance[] instances=factory.newInstances(config);
  final CountDownLatch latch=new CountDownLatch(k);
  final int loopCount=1000;
class Counter {
    int count=0;
    void inc(){
      count++;
    }
    int get(){
      return count;
    }
  }
  final Counter counter=new Counter();
  Assert.assertTrue(instances[0].getSemaphore("String_Node_Str").init(1));
  for (int i=0; i < k; i++) {
    final ISemaphore semaphore=instances[i].getSemaphore("String_Node_Str");
    new Thread(){
      public void run(){
        for (int j=0; j < loopCount; j++) {
          try {
            semaphore.acquire();
          }
 catch (          InterruptedException e) {
            System.err.println("String_Node_Str" + e.getMessage());
            return;
          }
          try {
            sleep((int)(Math.random() * 3));
            counter.inc();
          }
 catch (          InterruptedException e) {
            return;
          }
 finally {
            semaphore.release();
          }
        }
        latch.countDown();
      }
    }
.start();
  }
  try {
    Assert.assertTrue(latch.await(60,TimeUnit.SECONDS));
    Assert.assertEquals(loopCount * k,counter.get());
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
    Assert.fail(e.getMessage());
  }
}

Fixed version (ground truth):
@Test public void testMutex(){
  final int k=5;
  final Config config=new Config();
  TestHazelcastInstanceFactory factory=createHazelcastInstanceFactory(k);
  final HazelcastInstance[] instances=factory.newInstances(config);
  final CountDownLatch latch=new CountDownLatch(k);
  final int loopCount=1000;
class Counter {
    int count=0;
    void inc(){
      count++;
    }
    int get(){
      return count;
    }
  }
  final Counter counter=new Counter();
  assertTrue(instances[0].getSemaphore("String_Node_Str").init(1));
  for (int i=0; i < k; i++) {
    final ISemaphore semaphore=instances[i].getSemaphore("String_Node_Str");
    new Thread(){
      public void run(){
        for (int j=0; j < loopCount; j++) {
          try {
            semaphore.acquire();
          }
 catch (          InterruptedException e) {
            System.err.println("String_Node_Str" + e.getMessage());
            return;
          }
          try {
            sleep((int)(Math.random() * 3));
            counter.inc();
          }
 catch (          InterruptedException e) {
            return;
          }
 finally {
            semaphore.release();
          }
        }
        latch.countDown();
      }
    }
.start();
  }
  try {
    assertTrue(latch.await(60,TimeUnit.SECONDS));
    Assert.assertEquals(loopCount * k,counter.get());
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
    Assert.fail(e.getMessage());
  }
}
Program: 48843
Project: 48843
Buggy source:
public boolean init(int permitCount){
  if (available != 0) {
    return false;
  }
  available=permitCount;
  return true;
}

Fixed version (ground truth):
public boolean init(int permitCount){
  if (initialized || available != 0) {
    return false;
  }
  available=permitCount;
  initialized=true;
  return true;
}
Program: 48844
Project: 48844
Buggy source:
@Test public void testSemaphoreWithFailuresAndJoin(){
  final Config config=new Config();
  final TestHazelcastInstanceFactory factory=createHazelcastInstanceFactory(3);
  final HazelcastInstance instance1=factory.newHazelcastInstance(config);
  final HazelcastInstance instance2=factory.newHazelcastInstance(config);
  final ISemaphore semaphore=instance1.getSemaphore("String_Node_Str");
  final CountDownLatch countDownLatch=new CountDownLatch(1);
  Assert.assertTrue(semaphore.init(0));
  final Thread thread=new Thread(){
    public void run(){
      for (int i=0; i < 2; i++) {
        try {
          semaphore.acquire();
        }
 catch (        InterruptedException e) {
          e.printStackTrace();
        }
      }
      countDownLatch.countDown();
    }
  }
;
  thread.start();
  instance2.getLifecycleService().shutdown();
  semaphore.release();
  HazelcastInstance instance3=factory.newHazelcastInstance(config);
  ISemaphore semaphore1=instance3.getSemaphore("String_Node_Str");
  semaphore1.release();
  try {
    Assert.assertTrue(countDownLatch.await(15,TimeUnit.SECONDS));
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
 finally {
    thread.interrupt();
  }
}

Fixed version (ground truth):
@Test public void testSemaphoreWithFailuresAndJoin(){
  final Config config=new Config();
  final TestHazelcastInstanceFactory factory=createHazelcastInstanceFactory(3);
  final HazelcastInstance instance1=factory.newHazelcastInstance(config);
  final HazelcastInstance instance2=factory.newHazelcastInstance(config);
  final ISemaphore semaphore=instance1.getSemaphore("String_Node_Str");
  final CountDownLatch countDownLatch=new CountDownLatch(1);
  assertTrue(semaphore.init(0));
  final Thread thread=new Thread(){
    public void run(){
      for (int i=0; i < 2; i++) {
        try {
          semaphore.acquire();
        }
 catch (        InterruptedException e) {
          e.printStackTrace();
        }
      }
      countDownLatch.countDown();
    }
  }
;
  thread.start();
  instance2.getLifecycleService().shutdown();
  semaphore.release();
  HazelcastInstance instance3=factory.newHazelcastInstance(config);
  ISemaphore semaphore1=instance3.getSemaphore("String_Node_Str");
  semaphore1.release();
  try {
    assertTrue(countDownLatch.await(15,TimeUnit.SECONDS));
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
 finally {
    thread.interrupt();
  }
}
Program: 48845
Project: 48845
Buggy source:
@Test public void testMutex(){
  final int k=5;
  final Config config=new Config();
  TestHazelcastInstanceFactory factory=createHazelcastInstanceFactory(k);
  final HazelcastInstance[] instances=factory.newInstances(config);
  final CountDownLatch latch=new CountDownLatch(k);
  final int loopCount=1000;
class Counter {
    int count=0;
    void inc(){
      count++;
    }
    int get(){
      return count;
    }
  }
  final Counter counter=new Counter();
  Assert.assertTrue(instances[0].getSemaphore("String_Node_Str").init(1));
  for (int i=0; i < k; i++) {
    final ISemaphore semaphore=instances[i].getSemaphore("String_Node_Str");
    new Thread(){
      public void run(){
        for (int j=0; j < loopCount; j++) {
          try {
            semaphore.acquire();
          }
 catch (          InterruptedException e) {
            System.err.println("String_Node_Str" + e.getMessage());
            return;
          }
          try {
            sleep((int)(Math.random() * 3));
            counter.inc();
          }
 catch (          InterruptedException e) {
            return;
          }
 finally {
            semaphore.release();
          }
        }
        latch.countDown();
      }
    }
.start();
  }
  try {
    Assert.assertTrue(latch.await(60,TimeUnit.SECONDS));
    Assert.assertEquals(loopCount * k,counter.get());
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
    Assert.fail(e.getMessage());
  }
}

Fixed version (ground truth):
@Test public void testMutex(){
  final int k=5;
  final Config config=new Config();
  TestHazelcastInstanceFactory factory=createHazelcastInstanceFactory(k);
  final HazelcastInstance[] instances=factory.newInstances(config);
  final CountDownLatch latch=new CountDownLatch(k);
  final int loopCount=1000;
class Counter {
    int count=0;
    void inc(){
      count++;
    }
    int get(){
      return count;
    }
  }
  final Counter counter=new Counter();
  assertTrue(instances[0].getSemaphore("String_Node_Str").init(1));
  for (int i=0; i < k; i++) {
    final ISemaphore semaphore=instances[i].getSemaphore("String_Node_Str");
    new Thread(){
      public void run(){
        for (int j=0; j < loopCount; j++) {
          try {
            semaphore.acquire();
          }
 catch (          InterruptedException e) {
            System.err.println("String_Node_Str" + e.getMessage());
            return;
          }
          try {
            sleep((int)(Math.random() * 3));
            counter.inc();
          }
 catch (          InterruptedException e) {
            return;
          }
 finally {
            semaphore.release();
          }
        }
        latch.countDown();
      }
    }
.start();
  }
  try {
    assertTrue(latch.await(60,TimeUnit.SECONDS));
    Assert.assertEquals(loopCount * k,counter.get());
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
    Assert.fail(e.getMessage());
  }
}
Program: 48847
Project: 48847
Buggy source:
@Override public void run(){
  recordStore.unlock(dataKey,getCallerUuid(),getThreadId());
  Record record=recordStore.getRecord(dataKey);
  if (record == null || version == record.getVersion()) {
    shouldBackup=recordStore.remove(dataKey) != null;
  }
}

Fixed version (ground truth):
@Override public void run(){
  recordStore.unlock(dataKey,getCallerUuid(),getThreadId());
  Record record=recordStore.getRecord(dataKey);
  if (record == null || version == record.getVersion()) {
    dataOldValue=getNodeEngine().toData(recordStore.remove(dataKey));
    successful=dataOldValue != null;
  }
}
Program: 48848
Project: 48848
Buggy source:
@Override public boolean shouldBackup(){
  return shouldBackup;
}

Fixed version (ground truth):
@Override public boolean shouldBackup(){
  return successful;
}
Program: 48849
Project: 48849
Buggy source:
public boolean init(int permitCount){
  if (available != 0) {
    return false;
  }
  available=permitCount;
  return true;
}

Fixed version (ground truth):
public boolean init(int permitCount){
  if (initialized || available != 0) {
    return false;
  }
  available=permitCount;
  initialized=true;
  return true;
}
Program: 48850
Project: 48850
Buggy source:
@Test public void testSemaphoreWithFailuresAndJoin(){
  final Config config=new Config();
  final TestHazelcastInstanceFactory factory=createHazelcastInstanceFactory(3);
  final HazelcastInstance instance1=factory.newHazelcastInstance(config);
  final HazelcastInstance instance2=factory.newHazelcastInstance(config);
  final ISemaphore semaphore=instance1.getSemaphore("String_Node_Str");
  final CountDownLatch countDownLatch=new CountDownLatch(1);
  Assert.assertTrue(semaphore.init(0));
  final Thread thread=new Thread(){
    public void run(){
      for (int i=0; i < 2; i++) {
        try {
          semaphore.acquire();
        }
 catch (        InterruptedException e) {
          e.printStackTrace();
        }
      }
      countDownLatch.countDown();
    }
  }
;
  thread.start();
  instance2.getLifecycleService().shutdown();
  semaphore.release();
  HazelcastInstance instance3=factory.newHazelcastInstance(config);
  ISemaphore semaphore1=instance3.getSemaphore("String_Node_Str");
  semaphore1.release();
  try {
    Assert.assertTrue(countDownLatch.await(15,TimeUnit.SECONDS));
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
 finally {
    thread.interrupt();
  }
}

Fixed version (ground truth):
@Test public void testSemaphoreWithFailuresAndJoin(){
  final Config config=new Config();
  final TestHazelcastInstanceFactory factory=createHazelcastInstanceFactory(3);
  final HazelcastInstance instance1=factory.newHazelcastInstance(config);
  final HazelcastInstance instance2=factory.newHazelcastInstance(config);
  final ISemaphore semaphore=instance1.getSemaphore("String_Node_Str");
  final CountDownLatch countDownLatch=new CountDownLatch(1);
  assertTrue(semaphore.init(0));
  final Thread thread=new Thread(){
    public void run(){
      for (int i=0; i < 2; i++) {
        try {
          semaphore.acquire();
        }
 catch (        InterruptedException e) {
          e.printStackTrace();
        }
      }
      countDownLatch.countDown();
    }
  }
;
  thread.start();
  instance2.getLifecycleService().shutdown();
  semaphore.release();
  HazelcastInstance instance3=factory.newHazelcastInstance(config);
  ISemaphore semaphore1=instance3.getSemaphore("String_Node_Str");
  semaphore1.release();
  try {
    assertTrue(countDownLatch.await(15,TimeUnit.SECONDS));
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
 finally {
    thread.interrupt();
  }
}
Program: 48851
Project: 48851
Buggy source:
@Test public void testMutex(){
  final int k=5;
  final Config config=new Config();
  TestHazelcastInstanceFactory factory=createHazelcastInstanceFactory(k);
  final HazelcastInstance[] instances=factory.newInstances(config);
  final CountDownLatch latch=new CountDownLatch(k);
  final int loopCount=1000;
class Counter {
    int count=0;
    void inc(){
      count++;
    }
    int get(){
      return count;
    }
  }
  final Counter counter=new Counter();
  Assert.assertTrue(instances[0].getSemaphore("String_Node_Str").init(1));
  for (int i=0; i < k; i++) {
    final ISemaphore semaphore=instances[i].getSemaphore("String_Node_Str");
    new Thread(){
      public void run(){
        for (int j=0; j < loopCount; j++) {
          try {
            semaphore.acquire();
          }
 catch (          InterruptedException e) {
            System.err.println("String_Node_Str" + e.getMessage());
            return;
          }
          try {
            sleep((int)(Math.random() * 3));
            counter.inc();
          }
 catch (          InterruptedException e) {
            return;
          }
 finally {
            semaphore.release();
          }
        }
        latch.countDown();
      }
    }
.start();
  }
  try {
    Assert.assertTrue(latch.await(60,TimeUnit.SECONDS));
    Assert.assertEquals(loopCount * k,counter.get());
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
    Assert.fail(e.getMessage());
  }
}

Fixed version (ground truth):
@Test public void testMutex(){
  final int k=5;
  final Config config=new Config();
  TestHazelcastInstanceFactory factory=createHazelcastInstanceFactory(k);
  final HazelcastInstance[] instances=factory.newInstances(config);
  final CountDownLatch latch=new CountDownLatch(k);
  final int loopCount=1000;
class Counter {
    int count=0;
    void inc(){
      count++;
    }
    int get(){
      return count;
    }
  }
  final Counter counter=new Counter();
  assertTrue(instances[0].getSemaphore("String_Node_Str").init(1));
  for (int i=0; i < k; i++) {
    final ISemaphore semaphore=instances[i].getSemaphore("String_Node_Str");
    new Thread(){
      public void run(){
        for (int j=0; j < loopCount; j++) {
          try {
            semaphore.acquire();
          }
 catch (          InterruptedException e) {
            System.err.println("String_Node_Str" + e.getMessage());
            return;
          }
          try {
            sleep((int)(Math.random() * 3));
            counter.inc();
          }
 catch (          InterruptedException e) {
            return;
          }
 finally {
            semaphore.release();
          }
        }
        latch.countDown();
      }
    }
.start();
  }
  try {
    assertTrue(latch.await(60,TimeUnit.SECONDS));
    Assert.assertEquals(loopCount * k,counter.get());
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
    Assert.fail(e.getMessage());
  }
}
Program: 48853
Project: 48853
Buggy source:
@Override public void run(){
  recordStore.unlock(dataKey,getCallerUuid(),getThreadId());
  Record record=recordStore.getRecord(dataKey);
  if (record == null || version == record.getVersion()) {
    shouldBackup=recordStore.remove(dataKey) != null;
  }
}

Fixed version (ground truth):
@Override public void run(){
  recordStore.unlock(dataKey,getCallerUuid(),getThreadId());
  Record record=recordStore.getRecord(dataKey);
  if (record == null || version == record.getVersion()) {
    dataOldValue=getNodeEngine().toData(recordStore.remove(dataKey));
    successful=dataOldValue != null;
  }
}
Program: 48854
Project: 48854
Buggy source:
@Override public boolean shouldBackup(){
  return shouldBackup;
}

Fixed version (ground truth):
@Override public boolean shouldBackup(){
  return successful;
}
Program: 48855
Project: 48855
Buggy source:
public Map.Entry<Data,Data> getMapEntryData(Data dataKey){
  checkIfLoaded();
  Record record=records.get(dataKey);
  Data data=record != null ? mapService.toData(record.getValue()) : null;
  return new AbstractMap.SimpleImmutableEntry<Data,Data>(dataKey,data);
}

Fixed version (ground truth):
public Map.Entry<Data,Data> getMapEntryData(Data dataKey){
  checkIfLoaded();
  Record record=records.get(dataKey);
  Object value;
  if (record == null) {
    if (mapContainer.getStore() != null) {
      value=mapContainer.getStore().load(mapService.toObject(dataKey));
      if (value != null) {
        record=mapService.createRecord(name,dataKey,value,-1);
        records.put(dataKey,record);
        saveIndex(record);
        updateSizeEstimator(calculateRecordSize(record));
      }
    }
  }
 else {
    accessRecord(record);
  }
  Data data=record != null ? mapService.toData(record.getValue()) : null;
  return new AbstractMap.SimpleImmutableEntry<Data,Data>(dataKey,data);
}
Program: 48856
Project: 48856
Buggy source:
@Override public String toString(){
  final StringBuilder sb=new StringBuilder("String_Node_Str");
  sb.append("String_Node_Str").append(index);
  sb.append("String_Node_Str").append(fieldName).append('\'');
  sb.append("String_Node_Str").append(type);
  sb.append("String_Node_Str").append(classId);
  sb.append("String_Node_Str").append(factoryId).append('\'');
  sb.append('}');
  return sb.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  final StringBuilder sb=new StringBuilder("String_Node_Str");
  sb.append("String_Node_Str").append(index);
  sb.append("String_Node_Str").append(fieldName).append('\'');
  sb.append("String_Node_Str").append(type);
  sb.append("String_Node_Str").append(classId);
  sb.append("String_Node_Str").append(factoryId);
  sb.append('}');
  return sb.toString();
}
Program: 48857
Project: 48857
Buggy source:
public Portable read(ObjectDataInput in) throws IOException {
  if (!(in instanceof BufferObjectDataInput)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (!(in instanceof PortableContextAwareInputStream)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final PortableContextAwareInputStream ctxIn=(PortableContextAwareInputStream)in;
  final int factoryId=ctxIn.getFactoryId();
  final int dataClassId=ctxIn.getClassId();
  final int dataVersion=ctxIn.getVersion();
  final PortableFactory portableFactory=factories.get(factoryId);
  if (portableFactory == null) {
    throw new HazelcastSerializationException("String_Node_Str" + factoryId);
  }
  final Portable portable=portableFactory.create(dataClassId);
  if (portable == null) {
    throw new HazelcastSerializationException("String_Node_Str" + dataClassId);
  }
  final DefaultPortableReader reader;
  final ClassDefinition cd;
  final BufferObjectDataInput bufferedIn=(BufferObjectDataInput)in;
  if (context.getVersion() == dataVersion) {
    cd=context.lookup(factoryId,dataClassId);
    reader=new DefaultPortableReader(this,bufferedIn,cd);
  }
 else {
    cd=context.lookup(factoryId,dataClassId,dataVersion);
    reader=new MorphingPortableReader(this,bufferedIn,cd);
  }
  portable.readPortable(reader);
  reader.end();
  return portable;
}

Fixed version (ground truth):
public Portable read(ObjectDataInput in) throws IOException {
  if (!(in instanceof BufferObjectDataInput)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (!(in instanceof PortableContextAwareInputStream)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final PortableContextAwareInputStream ctxIn=(PortableContextAwareInputStream)in;
  final int factoryId=ctxIn.getFactoryId();
  final int dataClassId=ctxIn.getClassId();
  final int dataVersion=ctxIn.getVersion();
  final PortableFactory portableFactory=factories.get(factoryId);
  if (portableFactory == null) {
    throw new HazelcastSerializationException("String_Node_Str" + factoryId);
  }
  final Portable portable=portableFactory.create(dataClassId);
  if (portable == null) {
    throw new HazelcastSerializationException("String_Node_Str" + dataClassId);
  }
  final DefaultPortableReader reader;
  final ClassDefinition cd;
  final BufferObjectDataInput bufferedIn=(BufferObjectDataInput)in;
  if (context.getVersion() == dataVersion) {
    cd=context.lookup(factoryId,dataClassId);
    if (cd == null) {
      throw new HazelcastSerializationException("String_Node_Str" + "String_Node_Str" + factoryId + "String_Node_Str"+ dataClassId+ "String_Node_Str"+ dataVersion);
    }
    reader=new DefaultPortableReader(this,bufferedIn,cd);
  }
 else {
    cd=context.lookup(factoryId,dataClassId,dataVersion);
    if (cd == null) {
      throw new HazelcastSerializationException("String_Node_Str" + "String_Node_Str" + factoryId + "String_Node_Str"+ dataClassId+ "String_Node_Str"+ dataVersion);
    }
    reader=new MorphingPortableReader(this,bufferedIn,cd);
  }
  portable.readPortable(reader);
  reader.end();
  return portable;
}
Program: 48858
Project: 48858
Buggy source:
ClassDefinition registerClassDefinition(ClassDefinition cd){
  if (cd == null)   return null;
  final ClassDefinitionImpl cdImpl=(ClassDefinitionImpl)cd;
  if (cdImpl.getVersion() < 0) {
    cdImpl.version=getVersion();
  }
  if (cdImpl.getBinary() == null) {
    final BufferObjectDataOutput out=serializationService.pop();
    try {
      cdImpl.writeData(out);
      final byte[] binary=out.toByteArray();
      out.clear();
      compress(binary,out);
      cdImpl.setBinary(out.toByteArray());
    }
 catch (    IOException e) {
      throw new HazelcastSerializationException(e);
    }
 finally {
      serializationService.push(out);
    }
  }
  final long versionedClassId=combineToLong(cdImpl.getClassId(),cdImpl.getVersion());
  final ClassDefinitionImpl currentClassDef=versionedDefinitions.putIfAbsent(versionedClassId,cdImpl);
  if (currentClassDef == null) {
    registerNestedDefinitions(cdImpl);
    return cd;
  }
  return currentClassDef;
}

Fixed version (ground truth):
ClassDefinition registerClassDefinition(ClassDefinition cd){
  if (cd == null)   return null;
  final ClassDefinitionImpl cdImpl=(ClassDefinitionImpl)cd;
  if (cdImpl.getVersion() < 0) {
    cdImpl.version=getVersion();
  }
  if (cdImpl.getBinary() == null) {
    final BufferObjectDataOutput out=serializationService.pop();
    try {
      cdImpl.writeData(out);
      final byte[] binary=out.toByteArray();
      out.clear();
      compress(binary,out);
      cdImpl.setBinary(out.toByteArray());
    }
 catch (    IOException e) {
      throw new HazelcastSerializationException(e);
    }
 finally {
      serializationService.push(out);
    }
  }
  final long versionedClassId=combineToLong(cdImpl.getClassId(),cdImpl.getVersion());
  registerNestedDefinitions(cdImpl);
  final ClassDefinitionImpl currentCd=versionedDefinitions.putIfAbsent(versionedClassId,cdImpl);
  return currentCd == null ? cdImpl : currentCd;
}
Program: 48859
Project: 48859
Buggy source:
ClassDefinition createClassDefinition(byte[] compressedBinary) throws IOException {
  if (compressedBinary == null || compressedBinary.length == 0) {
    throw new IOException("String_Node_Str");
  }
  final BufferObjectDataOutput out=serializationService.pop();
  final byte[] binary;
  try {
    decompress(compressedBinary,out);
    binary=out.toByteArray();
  }
  finally {
    serializationService.push(out);
  }
  final ClassDefinitionImpl cd=new ClassDefinitionImpl();
  cd.readData(serializationService.createObjectDataInput(binary));
  cd.setBinary(compressedBinary);
  final ClassDefinitionImpl currentCD=versionedDefinitions.putIfAbsent(combineToLong(cd.classId,getVersion()),cd);
  if (currentCD == null) {
    registerNestedDefinitions(cd);
    return cd;
  }
 else {
    return currentCD;
  }
}

Fixed version (ground truth):
ClassDefinition createClassDefinition(byte[] compressedBinary) throws IOException {
  if (compressedBinary == null || compressedBinary.length == 0) {
    throw new IOException("String_Node_Str");
  }
  final BufferObjectDataOutput out=serializationService.pop();
  final byte[] binary;
  try {
    decompress(compressedBinary,out);
    binary=out.toByteArray();
  }
  finally {
    serializationService.push(out);
  }
  final ClassDefinitionImpl cd=new ClassDefinitionImpl();
  cd.readData(serializationService.createObjectDataInput(binary));
  cd.setBinary(compressedBinary);
  registerNestedDefinitions(cd);
  final ClassDefinitionImpl currentCd=versionedDefinitions.putIfAbsent(combineToLong(cd.classId,getVersion()),cd);
  return currentCd == null ? cd : currentCd;
}
Program: 48860
Project: 48860
Buggy source:
@Override public String toString(){
  final StringBuilder sb=new StringBuilder("String_Node_Str");
  sb.append("String_Node_Str").append(index);
  sb.append("String_Node_Str").append(fieldName).append('\'');
  sb.append("String_Node_Str").append(type);
  sb.append("String_Node_Str").append(classId);
  sb.append("String_Node_Str").append(factoryId).append('\'');
  sb.append('}');
  return sb.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  final StringBuilder sb=new StringBuilder("String_Node_Str");
  sb.append("String_Node_Str").append(index);
  sb.append("String_Node_Str").append(fieldName).append('\'');
  sb.append("String_Node_Str").append(type);
  sb.append("String_Node_Str").append(classId);
  sb.append("String_Node_Str").append(factoryId);
  sb.append('}');
  return sb.toString();
}
Program: 48861
Project: 48861
Buggy source:
public Portable read(ObjectDataInput in) throws IOException {
  if (!(in instanceof BufferObjectDataInput)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (!(in instanceof PortableContextAwareInputStream)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final PortableContextAwareInputStream ctxIn=(PortableContextAwareInputStream)in;
  final int factoryId=ctxIn.getFactoryId();
  final int dataClassId=ctxIn.getClassId();
  final int dataVersion=ctxIn.getVersion();
  final PortableFactory portableFactory=factories.get(factoryId);
  if (portableFactory == null) {
    throw new HazelcastSerializationException("String_Node_Str" + factoryId);
  }
  final Portable portable=portableFactory.create(dataClassId);
  if (portable == null) {
    throw new HazelcastSerializationException("String_Node_Str" + dataClassId);
  }
  final DefaultPortableReader reader;
  final ClassDefinition cd;
  final BufferObjectDataInput bufferedIn=(BufferObjectDataInput)in;
  if (context.getVersion() == dataVersion) {
    cd=context.lookup(factoryId,dataClassId);
    reader=new DefaultPortableReader(this,bufferedIn,cd);
  }
 else {
    cd=context.lookup(factoryId,dataClassId,dataVersion);
    reader=new MorphingPortableReader(this,bufferedIn,cd);
  }
  portable.readPortable(reader);
  reader.end();
  return portable;
}

Fixed version (ground truth):
public Portable read(ObjectDataInput in) throws IOException {
  if (!(in instanceof BufferObjectDataInput)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (!(in instanceof PortableContextAwareInputStream)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final PortableContextAwareInputStream ctxIn=(PortableContextAwareInputStream)in;
  final int factoryId=ctxIn.getFactoryId();
  final int dataClassId=ctxIn.getClassId();
  final int dataVersion=ctxIn.getVersion();
  final PortableFactory portableFactory=factories.get(factoryId);
  if (portableFactory == null) {
    throw new HazelcastSerializationException("String_Node_Str" + factoryId);
  }
  final Portable portable=portableFactory.create(dataClassId);
  if (portable == null) {
    throw new HazelcastSerializationException("String_Node_Str" + dataClassId);
  }
  final DefaultPortableReader reader;
  final ClassDefinition cd;
  final BufferObjectDataInput bufferedIn=(BufferObjectDataInput)in;
  if (context.getVersion() == dataVersion) {
    cd=context.lookup(factoryId,dataClassId);
    if (cd == null) {
      throw new HazelcastSerializationException("String_Node_Str" + "String_Node_Str" + factoryId + "String_Node_Str"+ dataClassId+ "String_Node_Str"+ dataVersion);
    }
    reader=new DefaultPortableReader(this,bufferedIn,cd);
  }
 else {
    cd=context.lookup(factoryId,dataClassId,dataVersion);
    if (cd == null) {
      throw new HazelcastSerializationException("String_Node_Str" + "String_Node_Str" + factoryId + "String_Node_Str"+ dataClassId+ "String_Node_Str"+ dataVersion);
    }
    reader=new MorphingPortableReader(this,bufferedIn,cd);
  }
  portable.readPortable(reader);
  reader.end();
  return portable;
}
Program: 48862
Project: 48862
Buggy source:
ClassDefinition registerClassDefinition(ClassDefinition cd){
  if (cd == null)   return null;
  final ClassDefinitionImpl cdImpl=(ClassDefinitionImpl)cd;
  if (cdImpl.getVersion() < 0) {
    cdImpl.version=getVersion();
  }
  if (cdImpl.getBinary() == null) {
    final BufferObjectDataOutput out=serializationService.pop();
    try {
      cdImpl.writeData(out);
      final byte[] binary=out.toByteArray();
      out.clear();
      compress(binary,out);
      cdImpl.setBinary(out.toByteArray());
    }
 catch (    IOException e) {
      throw new HazelcastSerializationException(e);
    }
 finally {
      serializationService.push(out);
    }
  }
  final long versionedClassId=combineToLong(cdImpl.getClassId(),cdImpl.getVersion());
  final ClassDefinitionImpl currentClassDef=versionedDefinitions.putIfAbsent(versionedClassId,cdImpl);
  if (currentClassDef == null) {
    registerNestedDefinitions(cdImpl);
    return cd;
  }
  return currentClassDef;
}

Fixed version (ground truth):
ClassDefinition registerClassDefinition(ClassDefinition cd){
  if (cd == null)   return null;
  final ClassDefinitionImpl cdImpl=(ClassDefinitionImpl)cd;
  if (cdImpl.getVersion() < 0) {
    cdImpl.version=getVersion();
  }
  if (cdImpl.getBinary() == null) {
    final BufferObjectDataOutput out=serializationService.pop();
    try {
      cdImpl.writeData(out);
      final byte[] binary=out.toByteArray();
      out.clear();
      compress(binary,out);
      cdImpl.setBinary(out.toByteArray());
    }
 catch (    IOException e) {
      throw new HazelcastSerializationException(e);
    }
 finally {
      serializationService.push(out);
    }
  }
  final long versionedClassId=combineToLong(cdImpl.getClassId(),cdImpl.getVersion());
  registerNestedDefinitions(cdImpl);
  final ClassDefinitionImpl currentCd=versionedDefinitions.putIfAbsent(versionedClassId,cdImpl);
  return currentCd == null ? cdImpl : currentCd;
}
Program: 48863
Project: 48863
Buggy source:
ClassDefinition createClassDefinition(byte[] compressedBinary) throws IOException {
  if (compressedBinary == null || compressedBinary.length == 0) {
    throw new IOException("String_Node_Str");
  }
  final BufferObjectDataOutput out=serializationService.pop();
  final byte[] binary;
  try {
    decompress(compressedBinary,out);
    binary=out.toByteArray();
  }
  finally {
    serializationService.push(out);
  }
  final ClassDefinitionImpl cd=new ClassDefinitionImpl();
  cd.readData(serializationService.createObjectDataInput(binary));
  cd.setBinary(compressedBinary);
  final ClassDefinitionImpl currentCD=versionedDefinitions.putIfAbsent(combineToLong(cd.classId,getVersion()),cd);
  if (currentCD == null) {
    registerNestedDefinitions(cd);
    return cd;
  }
 else {
    return currentCD;
  }
}

Fixed version (ground truth):
ClassDefinition createClassDefinition(byte[] compressedBinary) throws IOException {
  if (compressedBinary == null || compressedBinary.length == 0) {
    throw new IOException("String_Node_Str");
  }
  final BufferObjectDataOutput out=serializationService.pop();
  final byte[] binary;
  try {
    decompress(compressedBinary,out);
    binary=out.toByteArray();
  }
  finally {
    serializationService.push(out);
  }
  final ClassDefinitionImpl cd=new ClassDefinitionImpl();
  cd.readData(serializationService.createObjectDataInput(binary));
  cd.setBinary(compressedBinary);
  registerNestedDefinitions(cd);
  final ClassDefinitionImpl currentCd=versionedDefinitions.putIfAbsent(combineToLong(cd.classId,getVersion()),cd);
  return currentCd == null ? cd : currentCd;
}
Program: 48864
Project: 48864
Buggy source:
public Map.Entry<Data,Data> getMapEntryData(Data dataKey){
  checkIfLoaded();
  Record record=records.get(dataKey);
  Data data=record != null ? mapService.toData(record.getValue()) : null;
  return new AbstractMap.SimpleImmutableEntry<Data,Data>(dataKey,data);
}

Fixed version (ground truth):
public Map.Entry<Data,Data> getMapEntryData(Data dataKey){
  checkIfLoaded();
  Record record=records.get(dataKey);
  Object value;
  if (record == null) {
    if (mapContainer.getStore() != null) {
      value=mapContainer.getStore().load(mapService.toObject(dataKey));
      if (value != null) {
        record=mapService.createRecord(name,dataKey,value,-1);
        records.put(dataKey,record);
        saveIndex(record);
        updateSizeEstimator(calculateRecordSize(record));
      }
    }
  }
 else {
    accessRecord(record);
  }
  Data data=record != null ? mapService.toData(record.getValue()) : null;
  return new AbstractMap.SimpleImmutableEntry<Data,Data>(dataKey,data);
}
Program: 48865
Project: 48865
Buggy source:
public EntryObject key(){
  if (qb.attribute == null) {
    qb.attribute=KEY_ATTRIBUTE_NAME;
  }
 else   if (!qb.attribute.startsWith(KEY_ATTRIBUTE_NAME)) {
    qb.attribute=KEY_ATTRIBUTE_NAME + "String_Node_Str" + qb.attribute;
  }
  return this;
}

Fixed version (ground truth):
public EntryObject key(){
  qb.attribute=KEY_ATTRIBUTE_NAME;
  return this;
}
Program: 48866
Project: 48866
Buggy source:
public EntryObject key(){
  if (qb.attribute == null) {
    qb.attribute=KEY_ATTRIBUTE_NAME;
  }
 else   if (!qb.attribute.startsWith(KEY_ATTRIBUTE_NAME)) {
    qb.attribute=KEY_ATTRIBUTE_NAME + "String_Node_Str" + qb.attribute;
  }
  return this;
}

Fixed version (ground truth):
public EntryObject key(){
  qb.attribute=KEY_ATTRIBUTE_NAME;
  return this;
}
Program: 48867
Project: 48867
Buggy source:
public void run() throws Exception {
  for (  Operation op : opList) {
    op.setNodeEngine(getNodeEngine()).setServiceName(getServiceName()).setPartitionId(getPartitionId());
    op.beforeRun();
    op.run();
    op.afterRun();
    boolean response=(Boolean)op.getResponse();
  }
}

Fixed version (ground truth):
public void run() throws Exception {
  for (  Operation op : opList) {
    op.setNodeEngine(getNodeEngine()).setServiceName(getServiceName()).setPartitionId(getPartitionId());
    op.beforeRun();
    op.run();
  }
  getOrCreateContainer().unlock(dataKey,getCallerUuid(),threadId);
}
Program: 48868
Project: 48868
Buggy source:
public Operation getBackupOperation(){
  return new TxnCommitBackupOperation(name,dataKey,opList,getCallerUuid(),threadId);
}

Fixed version (ground truth):
public Operation getBackupOperation(){
  return new TxnCommitBackupOperation(name,dataKey,backupOpList,getCallerUuid(),threadId);
}
Program: 48869
Project: 48869
Buggy source:
public void run() throws Exception {
  MultiMapWrapper wrapper=getCollectionWrapper();
  if (wrapper == null || wrapper.getVersion() != version) {
    notify=false;
    return;
  }
  wrapper.incrementAndGetVersion();
  for (  Operation op : opList) {
    op.setNodeEngine(getNodeEngine()).setServiceName(getServiceName()).setPartitionId(getPartitionId());
    op.beforeRun();
    op.run();
    op.afterRun();
  }
  getOrCreateContainer().unlock(dataKey,getCallerUuid(),threadId);
}

Fixed version (ground truth):
public void run() throws Exception {
  MultiMapWrapper wrapper=getCollectionWrapper();
  if (wrapper == null || wrapper.getVersion() != version) {
    notify=false;
    return;
  }
  wrapper.incrementAndGetVersion();
  backupOpList=new ArrayList<Operation>();
  for (  Operation op : opList) {
    op.setNodeEngine(getNodeEngine()).setServiceName(getServiceName()).setPartitionId(getPartitionId());
    op.beforeRun();
    op.run();
    op.afterRun();
    if (Boolean.TRUE.equals(op.getResponse())) {
      backupOpList.add(op);
    }
  }
  getOrCreateContainer().unlock(dataKey,getCallerUuid(),threadId);
}
Program: 48870
Project: 48870
Buggy source:
public void entryAdded(EntryEvent event){
  latch2Add.countDown();
}

Fixed version (ground truth):
@Override public void entryAdded(EntryEvent<Integer,Deal> arg0){
  _gateAdd.countDown();
}
Program: 48871
Project: 48871
Buggy source:
public void entryRemoved(EntryEvent event){
  latch2Remove.countDown();
}

Fixed version (ground truth):
@Override public void entryRemoved(EntryEvent<Integer,Deal> arg0){
  _gateRemove.countDown();
}
Program: 48872
Project: 48872
Buggy source:
public void entryUpdated(EntryEvent event){
}

Fixed version (ground truth):
@Override public void entryUpdated(EntryEvent<Integer,Deal> arg0){
  _gateUpdate.countDown();
}
Program: 48873
Project: 48873
Buggy source:
public void entryEvicted(EntryEvent<String,String> event){
  latch.countDown();
}

Fixed version (ground truth):
@Override public void entryEvicted(EntryEvent<Integer,Deal> arg0){
  _gateEvict.countDown();
}
Program: 48874
Project: 48874
Buggy source:
public void writePortable(PortableWriter writer) throws IOException {
  writer.writeUTF("String_Node_Str",name);
  writer.writeBoolean("String_Node_Str",includeValue);
  final boolean hasKey=key != null;
  writer.writeBoolean("String_Node_Str",hasKey);
  if (predicate == null) {
    writer.writeBoolean("String_Node_Str",false);
  }
 else {
    writer.writeBoolean("String_Node_Str",true);
    writer.writePortable("String_Node_Str",(Portable)predicate);
  }
  if (hasKey) {
    final ObjectDataOutput out=writer.getRawDataOutput();
    key.writeData(out);
  }
}

Fixed version (ground truth):
public void writePortable(PortableWriter writer) throws IOException {
  writer.writeUTF("String_Node_Str",name);
  writer.writeBoolean("String_Node_Str",includeValue);
  final boolean hasKey=key != null;
  writer.writeBoolean("String_Node_Str",hasKey);
  if (predicate == null) {
    writer.writeBoolean("String_Node_Str",false);
    if (hasKey) {
      final ObjectDataOutput out=writer.getRawDataOutput();
      key.writeData(out);
    }
  }
 else {
    writer.writeBoolean("String_Node_Str",true);
    final ObjectDataOutput out=writer.getRawDataOutput();
    out.writeObject(predicate);
    if (hasKey) {
      key.writeData(out);
    }
  }
}
Program: 48875
Project: 48875
Buggy source:
public void readPortable(PortableReader reader) throws IOException {
  name=reader.readUTF("String_Node_Str");
  includeValue=reader.readBoolean("String_Node_Str");
  boolean hasKey=reader.readBoolean("String_Node_Str");
  if (reader.readBoolean("String_Node_Str")) {
    predicate=(Predicate)reader.readPortable("String_Node_Str");
  }
  if (hasKey) {
    final ObjectDataInput in=reader.getRawDataInput();
    key=new Data();
    key.readData(in);
  }
}

Fixed version (ground truth):
public void readPortable(PortableReader reader) throws IOException {
  name=reader.readUTF("String_Node_Str");
  includeValue=reader.readBoolean("String_Node_Str");
  boolean hasKey=reader.readBoolean("String_Node_Str");
  if (reader.readBoolean("String_Node_Str")) {
    final ObjectDataInput in=reader.getRawDataInput();
    predicate=in.readObject();
    if (hasKey) {
      key=in.readObject();
    }
  }
 else   if (hasKey) {
    final ObjectDataInput in=reader.getRawDataInput();
    key=in.readObject();
  }
}
Program: 48876
Project: 48876
Buggy source:
public void run() throws Exception {
  for (  Operation op : opList) {
    op.setNodeEngine(getNodeEngine()).setServiceName(getServiceName()).setPartitionId(getPartitionId());
    op.beforeRun();
    op.run();
    op.afterRun();
    boolean response=(Boolean)op.getResponse();
  }
}

Fixed version (ground truth):
public void run() throws Exception {
  for (  Operation op : opList) {
    op.setNodeEngine(getNodeEngine()).setServiceName(getServiceName()).setPartitionId(getPartitionId());
    op.beforeRun();
    op.run();
  }
  getOrCreateContainer().unlock(dataKey,getCallerUuid(),threadId);
}
Program: 48877
Project: 48877
Buggy source:
public Operation getBackupOperation(){
  return new TxnCommitBackupOperation(name,dataKey,opList,getCallerUuid(),threadId);
}

Fixed version (ground truth):
public Operation getBackupOperation(){
  return new TxnCommitBackupOperation(name,dataKey,backupOpList,getCallerUuid(),threadId);
}
Program: 48878
Project: 48878
Buggy source:
public void run() throws Exception {
  MultiMapWrapper wrapper=getCollectionWrapper();
  if (wrapper == null || wrapper.getVersion() != version) {
    notify=false;
    return;
  }
  wrapper.incrementAndGetVersion();
  for (  Operation op : opList) {
    op.setNodeEngine(getNodeEngine()).setServiceName(getServiceName()).setPartitionId(getPartitionId());
    op.beforeRun();
    op.run();
    op.afterRun();
  }
  getOrCreateContainer().unlock(dataKey,getCallerUuid(),threadId);
}

Fixed version (ground truth):
public void run() throws Exception {
  MultiMapWrapper wrapper=getCollectionWrapper();
  if (wrapper == null || wrapper.getVersion() != version) {
    notify=false;
    return;
  }
  wrapper.incrementAndGetVersion();
  backupOpList=new ArrayList<Operation>();
  for (  Operation op : opList) {
    op.setNodeEngine(getNodeEngine()).setServiceName(getServiceName()).setPartitionId(getPartitionId());
    op.beforeRun();
    op.run();
    op.afterRun();
    if (Boolean.TRUE.equals(op.getResponse())) {
      backupOpList.add(op);
    }
  }
  getOrCreateContainer().unlock(dataKey,getCallerUuid(),threadId);
}
Program: 48879
Project: 48879
Buggy source:
public void entryAdded(EntryEvent event){
  latch2Add.countDown();
}

Fixed version (ground truth):
@Override public void entryAdded(EntryEvent<Integer,Deal> arg0){
  _gateAdd.countDown();
}
Program: 48880
Project: 48880
Buggy source:
public void entryRemoved(EntryEvent event){
  latch2Remove.countDown();
}

Fixed version (ground truth):
@Override public void entryRemoved(EntryEvent<Integer,Deal> arg0){
  _gateRemove.countDown();
}
Program: 48881
Project: 48881
Buggy source:
public void entryUpdated(EntryEvent event){
}

Fixed version (ground truth):
@Override public void entryUpdated(EntryEvent<Integer,Deal> arg0){
  _gateUpdate.countDown();
}
Program: 48882
Project: 48882
Buggy source:
public void entryEvicted(EntryEvent<String,String> event){
  latch.countDown();
}

Fixed version (ground truth):
@Override public void entryEvicted(EntryEvent<Integer,Deal> arg0){
  _gateEvict.countDown();
}
Program: 48883
Project: 48883
Buggy source:
public void writePortable(PortableWriter writer) throws IOException {
  writer.writeUTF("String_Node_Str",name);
  writer.writeBoolean("String_Node_Str",includeValue);
  final boolean hasKey=key != null;
  writer.writeBoolean("String_Node_Str",hasKey);
  if (predicate == null) {
    writer.writeBoolean("String_Node_Str",false);
  }
 else {
    writer.writeBoolean("String_Node_Str",true);
    writer.writePortable("String_Node_Str",(Portable)predicate);
  }
  if (hasKey) {
    final ObjectDataOutput out=writer.getRawDataOutput();
    key.writeData(out);
  }
}

Fixed version (ground truth):
public void writePortable(PortableWriter writer) throws IOException {
  writer.writeUTF("String_Node_Str",name);
  writer.writeBoolean("String_Node_Str",includeValue);
  final boolean hasKey=key != null;
  writer.writeBoolean("String_Node_Str",hasKey);
  if (predicate == null) {
    writer.writeBoolean("String_Node_Str",false);
    if (hasKey) {
      final ObjectDataOutput out=writer.getRawDataOutput();
      key.writeData(out);
    }
  }
 else {
    writer.writeBoolean("String_Node_Str",true);
    final ObjectDataOutput out=writer.getRawDataOutput();
    out.writeObject(predicate);
    if (hasKey) {
      key.writeData(out);
    }
  }
}