nus-yam/ex-repair huggingface dataset:
Program: 49249
Project: 49249
Buggy source:
public ClientConfig build(){
  logger.log(Level.INFO,"String_Node_Str" + (resource != null ? "String_Node_Str" + resource : "String_Node_Str") + "String_Node_Str");
  if (props.containsKey(GROUP_NAME)) {
    config.getGroupConfig().setName(props.getProperty(GROUP_NAME));
  }
  if (props.containsKey(GROUP_PASS)) {
    config.getGroupConfig().setPassword(props.getProperty(GROUP_PASS));
  }
  if (props.containsKey(CONNECTION_TIMEOUT)) {
    config.setConnectionTimeout(Integer.parseInt(props.getProperty(CONNECTION_TIMEOUT)));
  }
  if (props.containsKey(CONNECTION_ATTEMPT_LIMIT)) {
    config.setConnectionAttemptLimit(Integer.parseInt(props.getProperty(CONNECTION_ATTEMPT_LIMIT)));
  }
  if (props.containsKey(RECONNECTION_TIMEOUT)) {
    config.setAttemptPeriod(Integer.parseInt(props.getProperty(RECONNECTION_TIMEOUT)));
  }
  if (props.containsKey(ADDRESSES)) {
    final String addressesProp=props.getProperty(ADDRESSES);
    if (addressesProp != null) {
      final String[] addresses=addressesProp.split("String_Node_Str");
      for (      String address : addresses) {
        address=address.trim();
        if (address.length() > 0) {
          config.addAddress(address);
        }
      }
    }
  }
  return config;
}

Fixed version (ground truth):
public ClientConfig build(){
  logger.log(Level.INFO,"String_Node_Str" + (resource != null ? "String_Node_Str" + resource : "String_Node_Str") + "String_Node_Str");
  if (props.containsKey(GROUP_NAME)) {
    config.getGroupConfig().setName(props.getProperty(GROUP_NAME));
  }
  if (props.containsKey(GROUP_PASS)) {
    config.getGroupConfig().setPassword(props.getProperty(GROUP_PASS));
  }
  if (props.containsKey(CONNECTION_TIMEOUT)) {
    config.setConnectionTimeout(Integer.parseInt(props.getProperty(CONNECTION_TIMEOUT)));
  }
  if (props.containsKey(CONNECTION_ATTEMPT_LIMIT)) {
    config.setConnectionAttemptLimit(Integer.parseInt(props.getProperty(CONNECTION_ATTEMPT_LIMIT)));
  }
  if (props.containsKey(CONNECTION_ATTEMPT_PERIOD)) {
    config.setConnectionAttemptPeriod(Integer.parseInt(props.getProperty(CONNECTION_ATTEMPT_PERIOD)));
  }
  if (props.containsKey(ADDRESSES)) {
    final String addressesProp=props.getProperty(ADDRESSES);
    if (addressesProp != null) {
      final String[] addresses=addressesProp.split("String_Node_Str");
      for (      String address : addresses) {
        address=address.trim();
        if (address.length() > 0) {
          config.addAddress(address);
        }
      }
    }
  }
  return config;
}
Program: 49250
Project: 49250
Buggy source:
private Connection getConnection(Address address) throws IOException {
  if (!client.getLifecycleService().isRunning()) {
    throw new HazelcastInstanceNotActiveException();
  }
  Connection connection=null;
  int retryCount=RETRY_COUNT;
  while (connection == null && retryCount > 0) {
    if (address == null) {
      connection=client.getConnectionManager().getConnection(address);
    }
 else {
      connection=client.getConnectionManager().getRandomConnection();
    }
    if (connection == null) {
      retryCount--;
      try {
        Thread.sleep(RETRY_WAIT_TIME);
      }
 catch (      InterruptedException e) {
        e.printStackTrace();
      }
    }
  }
  if (connection == null) {
    throw new HazelcastException("String_Node_Str");
  }
  return connection;
}

Fixed version (ground truth):
private Connection getConnection(Address address) throws IOException {
  if (!client.getLifecycleService().isRunning()) {
    throw new HazelcastInstanceNotActiveException();
  }
  Connection connection=null;
  int retryCount=RETRY_COUNT;
  while (connection == null && retryCount > 0) {
    if (address != null) {
      connection=client.getConnectionManager().getConnection(address);
    }
 else {
      connection=client.getConnectionManager().getRandomConnection();
    }
    if (connection == null) {
      retryCount--;
      try {
        Thread.sleep(RETRY_WAIT_TIME);
      }
 catch (      InterruptedException e) {
        e.printStackTrace();
      }
    }
  }
  if (connection == null) {
    throw new HazelcastException("String_Node_Str");
  }
  return connection;
}
Program: 49251
Project: 49251
Buggy source:
private Connection connectToOne(final Collection<InetSocketAddress> socketAddresses) throws Exception {
  final int connectionAttemptLimit=getClientConfig().getConnectionAttemptLimit();
  final ManagerAuthenticator authenticator=new ManagerAuthenticator();
  int attempt=0;
  while (true) {
    final long nextTry=Clock.currentTimeMillis() + getClientConfig().getAttemptPeriod();
    for (    InetSocketAddress isa : socketAddresses) {
      try {
        Address address=new Address(isa);
        return getConnectionManager().firstConnection(address,authenticator);
      }
 catch (      IOException ignored) {
      }
    }
    if (attempt++ >= connectionAttemptLimit) {
      break;
    }
    final long remainingTime=nextTry - Clock.currentTimeMillis();
    System.err.println(String.format("String_Node_Str" + "String_Node_Str",Math.max(0,remainingTime),attempt,connectionAttemptLimit));
    if (remainingTime > 0) {
      try {
        Thread.sleep(remainingTime);
      }
 catch (      InterruptedException e) {
        break;
      }
    }
  }
  throw new IllegalStateException("String_Node_Str");
}

Fixed version (ground truth):
private Connection connectToOne(final Collection<InetSocketAddress> socketAddresses) throws Exception {
  final int connectionAttemptLimit=getClientConfig().getConnectionAttemptLimit();
  final ManagerAuthenticator authenticator=new ManagerAuthenticator();
  int attempt=0;
  while (true) {
    final long nextTry=Clock.currentTimeMillis() + getClientConfig().getConnectionAttemptPeriod();
    for (    InetSocketAddress isa : socketAddresses) {
      try {
        Address address=new Address(isa);
        return getConnectionManager().firstConnection(address,authenticator);
      }
 catch (      IOException ignored) {
      }
    }
    if (attempt++ >= connectionAttemptLimit) {
      break;
    }
    final long remainingTime=nextTry - Clock.currentTimeMillis();
    System.err.println(String.format("String_Node_Str" + "String_Node_Str",Math.max(0,remainingTime),attempt,connectionAttemptLimit));
    if (remainingTime > 0) {
      try {
        Thread.sleep(remainingTime);
      }
 catch (      InterruptedException e) {
        break;
      }
    }
  }
  throw new IllegalStateException("String_Node_Str");
}
Program: 49252
Project: 49252
Buggy source:
@Test public void testClient(){
  assertNotNull(client);
  assertNotNull(client2);
  ClientConfig config=client.getClientConfig();
  assertEquals(3,config.getConnectionAttemptLimit());
  assertEquals(1000,config.getConnectionTimeout());
  assertEquals(3000,config.getAttemptPeriod());
  ClientConfig config2=client2.getClientConfig();
  assertEquals(credentials,config2.getCredentials());
  client.getMap("String_Node_Str").put("String_Node_Str","String_Node_Str");
  client2.getMap("String_Node_Str").put("String_Node_Str","String_Node_Str");
  final IMap<Object,Object> map=instance.getMap("String_Node_Str");
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testClient(){
  assertNotNull(client);
  assertNotNull(client2);
  ClientConfig config=client.getClientConfig();
  assertEquals(3,config.getConnectionAttemptLimit());
  assertEquals(1000,config.getConnectionTimeout());
  assertEquals(3000,config.getConnectionAttemptPeriod());
  ClientConfig config2=client2.getClientConfig();
  assertEquals(credentials,config2.getCredentials());
  client.getMap("String_Node_Str").put("String_Node_Str","String_Node_Str");
  client2.getMap("String_Node_Str").put("String_Node_Str","String_Node_Str");
  final IMap<Object,Object> map=instance.getMap("String_Node_Str");
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
}
Program: 49253
Project: 49253
Buggy source:
@Test public void testTxnOwnerDies() throws TransactionException {
  Config config=new Config();
  StaticNodeFactory factory=new StaticNodeFactory(3);
  final HazelcastInstance h1=factory.newHazelcastInstance(config);
  HazelcastInstance h2=factory.newHazelcastInstance(config);
  HazelcastInstance h3=factory.newHazelcastInstance(config);
  final IMap map1=h1.getMap("String_Node_Str");
  final int size=50;
  Runnable runnable=new Runnable(){
    public void run(){
      try {
        boolean b=h1.executeTransaction(new TransactionalTask<Boolean>(){
          public Boolean execute(          TransactionalTaskContext context) throws TransactionException {
            final TransactionalMap<Object,Object> txMap=context.getMap("String_Node_Str");
            for (int i=0; i < size; i++) {
              txMap.put(i,i);
              try {
                Thread.sleep(100);
                System.out.println("String_Node_Str" + i);
              }
 catch (              InterruptedException e) {
                e.printStackTrace();
              }
            }
            return true;
          }
        }
);
        fail();
      }
 catch (      TransactionException e) {
      }
    }
  }
;
  try {
    Thread thread=new Thread(runnable);
    thread.start();
    Thread.sleep(200);
    h1.getLifecycleService().shutdown();
    thread.join();
    final IMap map2=h2.getMap("String_Node_Str");
    for (int i=0; i < size; i++) {
      assertNull(map2.get(i));
    }
  }
 catch (  InterruptedException e) {
  }
}

Fixed version (ground truth):
@Test public void testTxnOwnerDies() throws TransactionException {
  Config config=new Config();
  final TestHazelcastInstanceFactory factory=createHazelcastInstanceFactory(3);
  final HazelcastInstance h1=factory.newHazelcastInstance(config);
  final HazelcastInstance h2=factory.newHazelcastInstance(config);
  final HazelcastInstance h3=factory.newHazelcastInstance(config);
  final IMap map1=h1.getMap("String_Node_Str");
  final int size=50;
  Runnable runnable=new Runnable(){
    public void run(){
      try {
        boolean b=h1.executeTransaction(new TransactionalTask<Boolean>(){
          public Boolean execute(          TransactionalTaskContext context) throws TransactionException {
            final TransactionalMap<Object,Object> txMap=context.getMap("String_Node_Str");
            for (int i=0; i < size; i++) {
              txMap.put(i,i);
              try {
                Thread.sleep(100);
                System.out.println("String_Node_Str" + i);
              }
 catch (              InterruptedException e) {
                e.printStackTrace();
              }
            }
            return true;
          }
        }
);
        fail();
      }
 catch (      TransactionException e) {
      }
    }
  }
;
  try {
    Thread thread=new Thread(runnable);
    thread.start();
    Thread.sleep(200);
    h1.getLifecycleService().shutdown();
    thread.join();
    final IMap map2=h2.getMap("String_Node_Str");
    for (int i=0; i < size; i++) {
      assertNull(map2.get(i));
    }
  }
 catch (  InterruptedException e) {
  }
}
Program: 49254
Project: 49254
Buggy source:
@Test public void testTxnCommit() throws TransactionException {
  Config config=new Config();
  StaticNodeFactory factory=new StaticNodeFactory(2);
  HazelcastInstance h1=factory.newHazelcastInstance(config);
  HazelcastInstance h2=factory.newHazelcastInstance(config);
  final IMap map2=h2.getMap("String_Node_Str");
  boolean b=h1.executeTransaction(new TransactionalTask<Boolean>(){
    public Boolean execute(    TransactionalTaskContext context) throws TransactionException {
      final TransactionalMap<Object,Object> txMap=context.getMap("String_Node_Str");
      txMap.put("String_Node_Str","String_Node_Str");
      assertEquals("String_Node_Str",txMap.put("String_Node_Str","String_Node_Str"));
      assertEquals("String_Node_Str",txMap.get("String_Node_Str"));
      assertEquals(true,txMap.containsKey("String_Node_Str"));
      assertNull(map2.get("String_Node_Str"));
      assertNull(map2.get("String_Node_Str"));
      return true;
    }
  }
);
  assertTrue(b);
  IMap map1=h1.getMap("String_Node_Str");
  assertEquals("String_Node_Str",map1.get("String_Node_Str"));
  assertEquals("String_Node_Str",map2.get("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testTxnCommit() throws TransactionException {
  Config config=new Config();
  final TestHazelcastInstanceFactory factory=createHazelcastInstanceFactory(2);
  final HazelcastInstance h1=factory.newHazelcastInstance(config);
  final HazelcastInstance h2=factory.newHazelcastInstance(config);
  final IMap map2=h2.getMap("String_Node_Str");
  boolean b=h1.executeTransaction(new TransactionalTask<Boolean>(){
    public Boolean execute(    TransactionalTaskContext context) throws TransactionException {
      final TransactionalMap<Object,Object> txMap=context.getMap("String_Node_Str");
      txMap.put("String_Node_Str","String_Node_Str");
      assertEquals("String_Node_Str",txMap.put("String_Node_Str","String_Node_Str"));
      assertEquals("String_Node_Str",txMap.get("String_Node_Str"));
      assertEquals(true,txMap.containsKey("String_Node_Str"));
      assertNull(map2.get("String_Node_Str"));
      assertNull(map2.get("String_Node_Str"));
      return true;
    }
  }
);
  assertTrue(b);
  IMap map1=h1.getMap("String_Node_Str");
  assertEquals("String_Node_Str",map1.get("String_Node_Str"));
  assertEquals("String_Node_Str",map2.get("String_Node_Str"));
}
Program: 49256
Project: 49256
Buggy source:
@Test public void testCommitOrder() throws TransactionException {
  Config config=new Config();
  StaticNodeFactory factory=new StaticNodeFactory(4);
  HazelcastInstance h1=factory.newHazelcastInstance(config);
  HazelcastInstance h2=factory.newHazelcastInstance(config);
  HazelcastInstance h3=factory.newHazelcastInstance(config);
  HazelcastInstance h4=factory.newHazelcastInstance(config);
  boolean b=h1.executeTransaction(new TransactionalTask<Boolean>(){
    public Boolean execute(    TransactionalTaskContext context) throws TransactionException {
      final TransactionalMap<Object,Object> txMap=context.getMap("String_Node_Str");
      txMap.put("String_Node_Str","String_Node_Str");
      assertEquals("String_Node_Str",txMap.put("String_Node_Str","String_Node_Str"));
      assertEquals("String_Node_Str",txMap.put("String_Node_Str","String_Node_Str"));
      assertEquals("String_Node_Str",txMap.put("String_Node_Str","String_Node_Str"));
      assertEquals("String_Node_Str",txMap.put("String_Node_Str","String_Node_Str"));
      assertEquals("String_Node_Str",txMap.put("String_Node_Str","String_Node_Str"));
      return true;
    }
  }
);
  assertEquals("String_Node_Str",h4.getMap("String_Node_Str").get("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testCommitOrder() throws TransactionException {
  Config config=new Config();
  final TestHazelcastInstanceFactory factory=createHazelcastInstanceFactory(4);
  final HazelcastInstance h1=factory.newHazelcastInstance(config);
  final HazelcastInstance h2=factory.newHazelcastInstance(config);
  final HazelcastInstance h3=factory.newHazelcastInstance(config);
  final HazelcastInstance h4=factory.newHazelcastInstance(config);
  boolean b=h1.executeTransaction(new TransactionalTask<Boolean>(){
    public Boolean execute(    TransactionalTaskContext context) throws TransactionException {
      final TransactionalMap<Object,Object> txMap=context.getMap("String_Node_Str");
      txMap.put("String_Node_Str","String_Node_Str");
      assertEquals("String_Node_Str",txMap.put("String_Node_Str","String_Node_Str"));
      assertEquals("String_Node_Str",txMap.put("String_Node_Str","String_Node_Str"));
      assertEquals("String_Node_Str",txMap.put("String_Node_Str","String_Node_Str"));
      assertEquals("String_Node_Str",txMap.put("String_Node_Str","String_Node_Str"));
      assertEquals("String_Node_Str",txMap.put("String_Node_Str","String_Node_Str"));
      return true;
    }
  }
);
  assertEquals("String_Node_Str",h4.getMap("String_Node_Str").get("String_Node_Str"));
}
Program: 49259
Project: 49259
Buggy source:
@Test public void testTxnSet() throws TransactionException {
  Config config=new Config();
  StaticNodeFactory factory=new StaticNodeFactory(2);
  HazelcastInstance h1=factory.newHazelcastInstance(config);
  HazelcastInstance h2=factory.newHazelcastInstance(config);
  final IMap map2=h2.getMap("String_Node_Str");
  boolean b=h1.executeTransaction(new TransactionalTask<Boolean>(){
    public Boolean execute(    TransactionalTaskContext context) throws TransactionException {
      final TransactionalMap<Object,Object> txMap=context.getMap("String_Node_Str");
      txMap.set("String_Node_Str","String_Node_Str");
      txMap.set("String_Node_Str","String_Node_Str");
      assertEquals("String_Node_Str",txMap.get("String_Node_Str"));
      assertNull(map2.get("String_Node_Str"));
      assertNull(map2.get("String_Node_Str"));
      return true;
    }
  }
);
  assertTrue(b);
  IMap map1=h1.getMap("String_Node_Str");
  assertEquals("String_Node_Str",map1.get("String_Node_Str"));
  assertEquals("String_Node_Str",map2.get("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testTxnSet() throws TransactionException {
  Config config=new Config();
  final TestHazelcastInstanceFactory factory=createHazelcastInstanceFactory(2);
  final HazelcastInstance h1=factory.newHazelcastInstance(config);
  final HazelcastInstance h2=factory.newHazelcastInstance(config);
  final IMap map2=h2.getMap("String_Node_Str");
  boolean b=h1.executeTransaction(new TransactionalTask<Boolean>(){
    public Boolean execute(    TransactionalTaskContext context) throws TransactionException {
      final TransactionalMap<Object,Object> txMap=context.getMap("String_Node_Str");
      txMap.set("String_Node_Str","String_Node_Str");
      txMap.set("String_Node_Str","String_Node_Str");
      assertEquals("String_Node_Str",txMap.get("String_Node_Str"));
      assertNull(map2.get("String_Node_Str"));
      assertNull(map2.get("String_Node_Str"));
      return true;
    }
  }
);
  assertTrue(b);
  IMap map1=h1.getMap("String_Node_Str");
  assertEquals("String_Node_Str",map1.get("String_Node_Str"));
  assertEquals("String_Node_Str",map2.get("String_Node_Str"));
}
Program: 49260
Project: 49260
Buggy source:
@Test public void testTxnReplace2() throws TransactionException {
  Config config=new Config();
  StaticNodeFactory factory=new StaticNodeFactory(2);
  HazelcastInstance h1=factory.newHazelcastInstance(config);
  HazelcastInstance h2=factory.newHazelcastInstance(config);
  final IMap map2=h2.getMap("String_Node_Str");
  map2.put("String_Node_Str","String_Node_Str");
  boolean b=h1.executeTransaction(new TransactionalTask<Boolean>(){
    public Boolean execute(    TransactionalTaskContext context) throws TransactionException {
      final TransactionalMap<Object,Object> txMap=context.getMap("String_Node_Str");
      assertEquals("String_Node_Str",txMap.replace("String_Node_Str","String_Node_Str"));
      assertEquals("String_Node_Str",txMap.get("String_Node_Str"));
      assertNull(map2.get("String_Node_Str"));
      return true;
    }
  }
);
  assertTrue(b);
  IMap map1=h1.getMap("String_Node_Str");
  assertEquals("String_Node_Str",map1.get("String_Node_Str"));
  assertEquals("String_Node_Str",map2.get("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testTxnReplace2() throws TransactionException {
  Config config=new Config();
  final TestHazelcastInstanceFactory factory=createHazelcastInstanceFactory(2);
  final HazelcastInstance h1=factory.newHazelcastInstance(config);
  final HazelcastInstance h2=factory.newHazelcastInstance(config);
  final IMap map2=h2.getMap("String_Node_Str");
  map2.put("String_Node_Str","String_Node_Str");
  boolean b=h1.executeTransaction(new TransactionalTask<Boolean>(){
    public Boolean execute(    TransactionalTaskContext context) throws TransactionException {
      final TransactionalMap<Object,Object> txMap=context.getMap("String_Node_Str");
      assertEquals("String_Node_Str",txMap.replace("String_Node_Str","String_Node_Str"));
      assertEquals("String_Node_Str",txMap.get("String_Node_Str"));
      assertNull(map2.get("String_Node_Str"));
      return true;
    }
  }
);
  assertTrue(b);
  IMap map1=h1.getMap("String_Node_Str");
  assertEquals("String_Node_Str",map1.get("String_Node_Str"));
  assertEquals("String_Node_Str",map2.get("String_Node_Str"));
}
Program: 49262
Project: 49262
Buggy source:
@Test public void testTxnBackupDies() throws TransactionException {
  Config config=new Config();
  StaticNodeFactory factory=new StaticNodeFactory(2);
  final HazelcastInstance h1=factory.newHazelcastInstance(config);
  final HazelcastInstance h2=factory.newHazelcastInstance(config);
  final IMap map1=h1.getMap("String_Node_Str");
  final int size=50;
  final CountDownLatch latch=new CountDownLatch(size + 1);
  Runnable runnable=new Runnable(){
    public void run(){
      try {
        boolean b=h1.executeTransaction(new TransactionOptions().setDurability(1),new TransactionalTask<Boolean>(){
          public Boolean execute(          TransactionalTaskContext context) throws TransactionException {
            final TransactionalMap<Object,Object> txMap=context.getMap("String_Node_Str");
            for (int i=0; i < size; i++) {
              txMap.put(i,i);
              try {
                Thread.sleep(100);
              }
 catch (              InterruptedException e) {
              }
              latch.countDown();
            }
            return true;
          }
        }
);
        fail();
      }
 catch (      Exception e) {
      }
      latch.countDown();
    }
  }
;
  new Thread(runnable).start();
  try {
    Thread.sleep(1000);
    h2.getLifecycleService().shutdown();
    latch.await();
    for (int i=0; i < size; i++) {
      assertNull(map1.get(i));
    }
  }
 catch (  InterruptedException e) {
  }
}

Fixed version (ground truth):
@Test public void testTxnBackupDies() throws TransactionException {
  Config config=new Config();
  final TestHazelcastInstanceFactory factory=createHazelcastInstanceFactory(2);
  final HazelcastInstance h1=factory.newHazelcastInstance(config);
  final HazelcastInstance h2=factory.newHazelcastInstance(config);
  final IMap map1=h1.getMap("String_Node_Str");
  final int size=50;
  final CountDownLatch latch=new CountDownLatch(size + 1);
  Runnable runnable=new Runnable(){
    public void run(){
      try {
        boolean b=h1.executeTransaction(new TransactionOptions().setDurability(1),new TransactionalTask<Boolean>(){
          public Boolean execute(          TransactionalTaskContext context) throws TransactionException {
            final TransactionalMap<Object,Object> txMap=context.getMap("String_Node_Str");
            for (int i=0; i < size; i++) {
              txMap.put(i,i);
              try {
                Thread.sleep(100);
              }
 catch (              InterruptedException e) {
              }
              latch.countDown();
            }
            return true;
          }
        }
);
        fail();
      }
 catch (      Exception e) {
      }
      latch.countDown();
    }
  }
;
  new Thread(runnable).start();
  try {
    Thread.sleep(1000);
    h2.getLifecycleService().shutdown();
    latch.await();
    for (int i=0; i < size; i++) {
      assertNull(map1.get(i));
    }
  }
 catch (  InterruptedException e) {
  }
}
Program: 49263
Project: 49263
Buggy source:
@Test public void testTxnPutIfAbsent() throws TransactionException {
  Config config=new Config();
  StaticNodeFactory factory=new StaticNodeFactory(2);
  HazelcastInstance h1=factory.newHazelcastInstance(config);
  HazelcastInstance h2=factory.newHazelcastInstance(config);
  final IMap map2=h2.getMap("String_Node_Str");
  boolean b=h1.executeTransaction(new TransactionalTask<Boolean>(){
    public Boolean execute(    TransactionalTaskContext context) throws TransactionException {
      final TransactionalMap<Object,Object> txMap=context.getMap("String_Node_Str");
      txMap.putIfAbsent("String_Node_Str","String_Node_Str");
      assertEquals("String_Node_Str",txMap.putIfAbsent("String_Node_Str","String_Node_Str"));
      assertEquals("String_Node_Str",txMap.get("String_Node_Str"));
      assertNull(map2.get("String_Node_Str"));
      assertNull(map2.get("String_Node_Str"));
      return true;
    }
  }
);
  assertTrue(b);
  IMap map1=h1.getMap("String_Node_Str");
  assertEquals("String_Node_Str",map1.get("String_Node_Str"));
  assertEquals("String_Node_Str",map2.get("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testTxnPutIfAbsent() throws TransactionException {
  Config config=new Config();
  final TestHazelcastInstanceFactory factory=createHazelcastInstanceFactory(2);
  final HazelcastInstance h1=factory.newHazelcastInstance(config);
  final HazelcastInstance h2=factory.newHazelcastInstance(config);
  final IMap map2=h2.getMap("String_Node_Str");
  boolean b=h1.executeTransaction(new TransactionalTask<Boolean>(){
    public Boolean execute(    TransactionalTaskContext context) throws TransactionException {
      final TransactionalMap<Object,Object> txMap=context.getMap("String_Node_Str");
      txMap.putIfAbsent("String_Node_Str","String_Node_Str");
      assertEquals("String_Node_Str",txMap.putIfAbsent("String_Node_Str","String_Node_Str"));
      assertEquals("String_Node_Str",txMap.get("String_Node_Str"));
      assertNull(map2.get("String_Node_Str"));
      assertNull(map2.get("String_Node_Str"));
      return true;
    }
  }
);
  assertTrue(b);
  IMap map1=h1.getMap("String_Node_Str");
  assertEquals("String_Node_Str",map1.get("String_Node_Str"));
  assertEquals("String_Node_Str",map2.get("String_Node_Str"));
}
Program: 49264
Project: 49264
Buggy source:
@Test public void testTxnReplace() throws TransactionException {
  Config config=new Config();
  StaticNodeFactory factory=new StaticNodeFactory(2);
  HazelcastInstance h1=factory.newHazelcastInstance(config);
  HazelcastInstance h2=factory.newHazelcastInstance(config);
  final IMap map2=h2.getMap("String_Node_Str");
  boolean b=h1.executeTransaction(new TransactionOptions().setTimeout(1,TimeUnit.SECONDS),new TransactionalTask<Boolean>(){
    public Boolean execute(    TransactionalTaskContext context) throws TransactionException {
      final TransactionalMap<Object,Object> txMap=context.getMap("String_Node_Str");
      assertNull(txMap.replace("String_Node_Str","String_Node_Str"));
      txMap.put("String_Node_Str","String_Node_Str");
      assertEquals("String_Node_Str",txMap.replace("String_Node_Str","String_Node_Str"));
      assertEquals("String_Node_Str",txMap.get("String_Node_Str"));
      assertNull(map2.get("String_Node_Str"));
      assertNull(map2.get("String_Node_Str"));
      return true;
    }
  }
);
  assertTrue(b);
  IMap map1=h1.getMap("String_Node_Str");
  assertEquals("String_Node_Str",map1.get("String_Node_Str"));
  assertEquals("String_Node_Str",map2.get("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testTxnReplace() throws TransactionException {
  Config config=new Config();
  final TestHazelcastInstanceFactory factory=createHazelcastInstanceFactory(2);
  final HazelcastInstance h1=factory.newHazelcastInstance(config);
  final HazelcastInstance h2=factory.newHazelcastInstance(config);
  final IMap map2=h2.getMap("String_Node_Str");
  boolean b=h1.executeTransaction(new TransactionOptions().setTimeout(1,TimeUnit.SECONDS),new TransactionalTask<Boolean>(){
    public Boolean execute(    TransactionalTaskContext context) throws TransactionException {
      final TransactionalMap<Object,Object> txMap=context.getMap("String_Node_Str");
      assertNull(txMap.replace("String_Node_Str","String_Node_Str"));
      txMap.put("String_Node_Str","String_Node_Str");
      assertEquals("String_Node_Str",txMap.replace("String_Node_Str","String_Node_Str"));
      assertEquals("String_Node_Str",txMap.get("String_Node_Str"));
      assertNull(map2.get("String_Node_Str"));
      assertNull(map2.get("String_Node_Str"));
      return true;
    }
  }
);
  assertTrue(b);
  IMap map1=h1.getMap("String_Node_Str");
  assertEquals("String_Node_Str",map1.get("String_Node_Str"));
  assertEquals("String_Node_Str",map2.get("String_Node_Str"));
}
Program: 49265
Project: 49265
Buggy source:
public final int getAsyncBackupCount(){
  return getLockStore().getAsyncBackupCount();
}

Fixed version (ground truth):
public final int getAsyncBackupCount(){
  final LockStoreImpl lockStore=getLockStore();
  return !asyncBackup ? lockStore.getAsyncBackupCount() : lockStore.getBackupCount() + lockStore.getAsyncBackupCount();
}
Program: 49266
Project: 49266
Buggy source:
public final int getSyncBackupCount(){
  return getLockStore().getBackupCount();
}

Fixed version (ground truth):
public final int getSyncBackupCount(){
  return !asyncBackup ? getLockStore().getBackupCount() : 0;
}
Program: 49267
Project: 49267
Buggy source:
private void releaseLocksOf(final String uuid){
  for (  LockStoreContainer container : containers) {
    for (    LockStoreImpl lockStore : container.getLockStores()) {
      Map<Data,DistributedLock> locks=lockStore.getLocks();
      for (      Map.Entry<Data,DistributedLock> entry : locks.entrySet()) {
        final Data key=entry.getKey();
        final DistributedLock lock=entry.getValue();
        if (uuid.equals(lock.getOwner()) && !lock.isTransactional()) {
          UnlockOperation op=new UnlockOperation(lockStore.getNamespace(),key,-1,true);
          op.setNodeEngine(nodeEngine);
          op.setServiceName(SERVICE_NAME);
          op.setService(LockService.this);
          op.setResponseHandler(ResponseHandlerFactory.createEmptyResponseHandler());
          op.setPartitionId(container.getPartitionId());
          nodeEngine.getOperationService().executeOperation(op);
        }
      }
    }
  }
}

Fixed version (ground truth):
private void releaseLocksOf(final String uuid){
  for (  LockStoreContainer container : containers) {
    for (    LockStoreImpl lockStore : container.getLockStores()) {
      Map<Data,DistributedLock> locks=lockStore.getLocks();
      for (      Map.Entry<Data,DistributedLock> entry : locks.entrySet()) {
        final Data key=entry.getKey();
        final DistributedLock lock=entry.getValue();
        if (uuid.equals(lock.getOwner()) && !lock.isTransactional()) {
          UnlockOperation op=new UnlockOperation(lockStore.getNamespace(),key,-1,true);
          op.setAsyncBackup(true);
          op.setNodeEngine(nodeEngine);
          op.setServiceName(SERVICE_NAME);
          op.setService(LockService.this);
          op.setResponseHandler(ResponseHandlerFactory.createEmptyResponseHandler());
          op.setPartitionId(container.getPartitionId());
          nodeEngine.getOperationService().executeOperation(op);
        }
      }
    }
  }
}
Program: 49268
Project: 49268
Buggy source:
public boolean containsKey(Data dataKey){
  Record record=records.get(dataKey);
  if (record == null) {
    if (mapContainer.getStore() != null) {
      Object value=mapContainer.getStore().load(mapService.toObject(dataKey));
      if (value != null) {
        record=mapService.createRecord(name,dataKey,value,-1);
        records.put(dataKey,record);
      }
      if (value == null) {
        record=mapService.createRecord(name,dataKey,null,100);
        records.put(dataKey,record);
      }
    }
  }
  return record != null;
}

Fixed version (ground truth):
public boolean containsKey(Data dataKey){
  Record record=records.get(dataKey);
  if (record == null) {
    if (mapContainer.getStore() != null) {
      Object value=mapContainer.getStore().load(mapService.toObject(dataKey));
      if (value != null) {
        record=mapService.createRecord(name,dataKey,value,-1);
        records.put(dataKey,record);
      }
    }
  }
  return record != null && record.getValue() != null;
}
Program: 49269
Project: 49269
Buggy source:
public boolean replaceIfSameInternal(Data key,Object oldValue,Data newValue){
  VersionedValue versionedValue=lockAndGet(key,tx.getTimeoutMillis());
  if (versionedValue == null) {
    throw new ConcurrentModificationException("String_Node_Str" + ThreadUtil.getThreadId());
  }
  if (!getService().compare(name,oldValue,versionedValue.value))   return false;
  tx.addTransactionLog(new MapTransactionLog(name,key,new TxnSetOperation(name,key,newValue,-1,versionedValue.version),versionedValue.version));
  return true;
}

Fixed version (ground truth):
public boolean replaceIfSameInternal(Data key,Object oldValue,Data newValue){
  VersionedValue versionedValue=lockAndGet(key,tx.getTimeoutMillis());
  if (versionedValue == null) {
    throw new TransactionException("String_Node_Str" + ThreadUtil.getThreadId());
  }
  if (!getService().compare(name,oldValue,versionedValue.value))   return false;
  tx.addTransactionLog(new MapTransactionLog(name,key,new TxnSetOperation(name,key,newValue,-1,versionedValue.version),versionedValue.version));
  return true;
}
Program: 49270
Project: 49270
Buggy source:
public boolean removeIfSameInternal(Data key,Object value){
  VersionedValue versionedValue=lockAndGet(key,tx.getTimeoutMillis());
  if (versionedValue == null) {
    throw new ConcurrentModificationException("String_Node_Str" + ThreadUtil.getThreadId());
  }
  if (!getService().compare(name,versionedValue.value,value)) {
    return false;
  }
  tx.addTransactionLog(new MapTransactionLog(name,key,new TxnDeleteOperation(name,key,versionedValue.version),versionedValue.version));
  return true;
}

Fixed version (ground truth):
public boolean removeIfSameInternal(Data key,Object value){
  VersionedValue versionedValue=lockAndGet(key,tx.getTimeoutMillis());
  if (versionedValue == null) {
    throw new TransactionException("String_Node_Str" + ThreadUtil.getThreadId());
  }
  if (!getService().compare(name,versionedValue.value,value)) {
    return false;
  }
  tx.addTransactionLog(new MapTransactionLog(name,key,new TxnDeleteOperation(name,key,versionedValue.version),versionedValue.version));
  return true;
}
Program: 49271
Project: 49271
Buggy source:
public void setInternal(Data key,Data value){
  VersionedValue versionedValue=lockAndGet(key,tx.getTimeoutMillis());
  if (versionedValue == null) {
    throw new ConcurrentModificationException("String_Node_Str" + ThreadUtil.getThreadId());
  }
  tx.addTransactionLog(new MapTransactionLog(name,key,new TxnSetOperation(name,key,value,-1,versionedValue.version),versionedValue.version));
}

Fixed version (ground truth):
public void setInternal(Data key,Data value){
  VersionedValue versionedValue=lockAndGet(key,tx.getTimeoutMillis());
  if (versionedValue == null) {
    throw new TransactionException("String_Node_Str" + ThreadUtil.getThreadId());
  }
  tx.addTransactionLog(new MapTransactionLog(name,key,new TxnSetOperation(name,key,value,-1,versionedValue.version),versionedValue.version));
}
Program: 49272
Project: 49272
Buggy source:
public Data replaceInternal(Data key,Data value){
  VersionedValue versionedValue=lockAndGet(key,tx.getTimeoutMillis());
  if (versionedValue == null) {
    throw new ConcurrentModificationException("String_Node_Str" + ThreadUtil.getThreadId());
  }
  if (versionedValue.value == null)   return null;
  tx.addTransactionLog(new MapTransactionLog(name,key,new TxnSetOperation(name,key,value,-1,versionedValue.version),versionedValue.version));
  return versionedValue.value;
}

Fixed version (ground truth):
public Data replaceInternal(Data key,Data value){
  VersionedValue versionedValue=lockAndGet(key,tx.getTimeoutMillis());
  if (versionedValue == null) {
    throw new TransactionException("String_Node_Str" + ThreadUtil.getThreadId());
  }
  if (versionedValue.value == null)   return null;
  tx.addTransactionLog(new MapTransactionLog(name,key,new TxnSetOperation(name,key,value,-1,versionedValue.version),versionedValue.version));
  return versionedValue.value;
}
Program: 49273
Project: 49273
Buggy source:
public Data putInternal(Data key,Data value){
  VersionedValue versionedValue=lockAndGet(key,tx.getTimeoutMillis());
  if (versionedValue == null) {
    throw new ConcurrentModificationException("String_Node_Str" + ThreadUtil.getThreadId());
  }
  tx.addTransactionLog(new MapTransactionLog(name,key,new TxnSetOperation(name,key,value,-1,versionedValue.version),versionedValue.version));
  return versionedValue.value;
}

Fixed version (ground truth):
public Data putInternal(Data key,Data value){
  VersionedValue versionedValue=lockAndGet(key,tx.getTimeoutMillis());
  if (versionedValue == null) {
    throw new TransactionException("String_Node_Str" + ThreadUtil.getThreadId());
  }
  tx.addTransactionLog(new MapTransactionLog(name,key,new TxnSetOperation(name,key,value,-1,versionedValue.version),versionedValue.version));
  return versionedValue.value;
}
Program: 49274
Project: 49274
Buggy source:
public Data removeInternal(Data key){
  VersionedValue versionedValue=lockAndGet(key,tx.getTimeoutMillis());
  if (versionedValue == null) {
    throw new ConcurrentModificationException("String_Node_Str" + ThreadUtil.getThreadId());
  }
  tx.addTransactionLog(new MapTransactionLog(name,key,new TxnDeleteOperation(name,key,versionedValue.version),versionedValue.version));
  return versionedValue.value;
}

Fixed version (ground truth):
public Data removeInternal(Data key){
  VersionedValue versionedValue=lockAndGet(key,tx.getTimeoutMillis());
  if (versionedValue == null) {
    throw new TransactionException("String_Node_Str" + ThreadUtil.getThreadId());
  }
  tx.addTransactionLog(new MapTransactionLog(name,key,new TxnDeleteOperation(name,key,versionedValue.version),versionedValue.version));
  return versionedValue.value;
}
Program: 49275
Project: 49275
Buggy source:
public Data putIfAbsentInternal(Data key,Data value){
  VersionedValue versionedValue=lockAndGet(key,tx.getTimeoutMillis());
  if (versionedValue == null) {
    throw new ConcurrentModificationException("String_Node_Str" + ThreadUtil.getThreadId());
  }
  if (versionedValue.value != null)   return versionedValue.value;
  tx.addTransactionLog(new MapTransactionLog(name,key,new TxnSetOperation(name,key,value,-1,versionedValue.version),versionedValue.version));
  return versionedValue.value;
}

Fixed version (ground truth):
public Data putIfAbsentInternal(Data key,Data value){
  VersionedValue versionedValue=lockAndGet(key,tx.getTimeoutMillis());
  if (versionedValue == null) {
    throw new TransactionException("String_Node_Str" + ThreadUtil.getThreadId());
  }
  if (versionedValue.value != null)   return versionedValue.value;
  tx.addTransactionLog(new MapTransactionLog(name,key,new TxnSetOperation(name,key,value,-1,versionedValue.version),versionedValue.version));
  return versionedValue.value;
}
Program: 49276
Project: 49276
Buggy source:
Backup(Operation backupOp,Address originalCaller,long[] replicaVersions,boolean sync){
  this.backupOp=backupOp;
  this.originalCaller=originalCaller;
  this.sync=sync;
  this.replicaVersions=replicaVersions;
  if (sync && originalCaller == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
}

Fixed version (ground truth):
Backup(Operation backupOp,Address originalCaller,long[] replicaVersions,boolean sync){
  this.backupOp=backupOp;
  this.originalCaller=originalCaller;
  this.sync=sync;
  this.replicaVersions=replicaVersions;
  if (sync && originalCaller == null) {
    throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str" + backupOp);
  }
}
Program: 49277
Project: 49277
Buggy source:
@Test public void testLock() throws Exception {
  Config config=new Config();
  final String name="String_Node_Str";
  config.getMultiMapConfig(name).setValueCollectionType(MultiMapConfig.ValueCollectionType.LIST);
  final int insCount=4;
  final HazelcastInstance[] instances=StaticNodeFactory.newInstances(config,insCount);
  final CountDownLatch latch=new CountDownLatch(1);
  new Thread(){
    public void run(){
      instances[0].getMultiMap(name).lock("String_Node_Str");
      latch.countDown();
      try {
        Thread.sleep(5 * 1000);
      }
 catch (      InterruptedException e) {
        e.printStackTrace();
      }
      instances[0].getMultiMap(name).unlock("String_Node_Str");
    }
  }
.start();
  assertTrue(latch.await(10,TimeUnit.SECONDS));
  assertFalse(getMultiMap(instances,name).tryLock("String_Node_Str"));
  assertTrue(instances[0].getMultiMap(name).tryLock("String_Node_Str",20,TimeUnit.SECONDS));
  new Thread(){
    public void run(){
      try {
        Thread.sleep(3000);
      }
 catch (      InterruptedException e) {
        e.printStackTrace();
      }
      instances[0].getLifecycleService().shutdown();
    }
  }
.start();
  assertTrue(instances[1].getMultiMap(name).tryLock("String_Node_Str",20,TimeUnit.SECONDS));
}

Fixed version (ground truth):
@Test public void testLock() throws Exception {
  Config config=new Config();
  final String name="String_Node_Str";
  config.getMultiMapConfig(name).setValueCollectionType(MultiMapConfig.ValueCollectionType.LIST);
  final int insCount=4;
  final HazelcastInstance[] instances=StaticNodeFactory.newInstances(config,insCount);
  final CountDownLatch latch=new CountDownLatch(1);
  final CountDownLatch latch2=new CountDownLatch(1);
  new Thread(){
    public void run(){
      instances[0].getMultiMap(name).lock("String_Node_Str");
      latch.countDown();
      try {
        latch2.await(10,TimeUnit.SECONDS);
        instances[0].getMultiMap(name).unlock("String_Node_Str");
      }
 catch (      InterruptedException e) {
        e.printStackTrace();
      }
    }
  }
.start();
  assertTrue(latch.await(10,TimeUnit.SECONDS));
  assertFalse(getMultiMap(instances,name).tryLock("String_Node_Str"));
  latch2.countDown();
  assertTrue(instances[0].getMultiMap(name).tryLock("String_Node_Str",20,TimeUnit.SECONDS));
  new Thread(){
    public void run(){
      try {
        Thread.sleep(3000);
      }
 catch (      InterruptedException e) {
        e.printStackTrace();
      }
      instances[0].getLifecycleService().shutdown();
    }
  }
.start();
  assertTrue(instances[1].getMultiMap(name).tryLock("String_Node_Str",20,TimeUnit.SECONDS));
}
Program: 49279
Project: 49279
Buggy source:
@Test(timeout=100000) public void testLockEviction() throws Exception {
  final StaticNodeFactory nodeFactory=new StaticNodeFactory(2);
  final Config config=new Config();
  final AtomicInteger integer=new AtomicInteger(0);
  final HazelcastInstance lockOwner=nodeFactory.newHazelcastInstance(config);
  final HazelcastInstance instance1=nodeFactory.newHazelcastInstance(config);
  final String name="String_Node_Str";
  final ILock lock=lockOwner.getLock(name);
  lock.lock(1,TimeUnit.SECONDS);
  Assert.assertEquals(true,lock.isLocked());
  Thread t=new Thread(new Runnable(){
    public void run(){
      final ILock lock=instance1.getLock(name);
      lock.lock();
      integer.incrementAndGet();
    }
  }
);
  t.start();
  Assert.assertEquals(0,integer.get());
  Thread.sleep(2000);
  Assert.assertEquals(1,integer.get());
}

Fixed version (ground truth):
@Test(timeout=100000) public void testLockEviction() throws Exception {
  final StaticNodeFactory nodeFactory=new StaticNodeFactory(2);
  final Config config=new Config();
  final AtomicInteger integer=new AtomicInteger(0);
  final HazelcastInstance lockOwner=nodeFactory.newHazelcastInstance(config);
  final HazelcastInstance instance1=nodeFactory.newHazelcastInstance(config);
  final String name="String_Node_Str";
  final ILock lock=lockOwner.getLock(name);
  lock.lock(1,TimeUnit.SECONDS);
  Assert.assertTrue(lock.isLocked());
  final CountDownLatch latch=new CountDownLatch(1);
  Thread t=new Thread(new Runnable(){
    public void run(){
      final ILock lock=instance1.getLock(name);
      lock.lock();
      latch.countDown();
    }
  }
);
  t.start();
  Assert.assertTrue(latch.await(3,TimeUnit.SECONDS));
}
Program: 49280
Project: 49280
Buggy source:
@Test(timeout=100000) public void testKeyOwnerDies() throws Exception {
  final StaticNodeFactory nodeFactory=new StaticNodeFactory(3);
  final Config config=new Config();
  final HazelcastInstance keyOwner=nodeFactory.newHazelcastInstance(config);
  final HazelcastInstance instance1=nodeFactory.newHazelcastInstance(config);
  final HazelcastInstance instance2=nodeFactory.newHazelcastInstance(config);
  int k=0;
  final AtomicInteger atomicInteger=new AtomicInteger(0);
  while (!keyOwner.getCluster().getLocalMember().equals(instance1.getPartitionService().getPartition(++k).getOwner()))   ;
  final int key=k;
  final ILock lock1=instance1.getLock(key);
  lock1.lock();
  Thread t=new Thread(new Runnable(){
    public void run(){
      final ILock lock=instance2.getLock(key);
      lock.lock();
      atomicInteger.incrementAndGet();
    }
  }
);
  t.start();
  keyOwner.getLifecycleService().shutdown();
  Assert.assertEquals(true,lock1.isLocked());
  Assert.assertEquals(true,lock1.tryLock());
  lock1.unlock();
  lock1.unlock();
  Thread.sleep(1000);
  Assert.assertEquals(1,atomicInteger.get());
  lock1.forceUnlock();
}

Fixed version (ground truth):
@Test(timeout=100000) public void testKeyOwnerDies() throws Exception {
  final StaticNodeFactory nodeFactory=new StaticNodeFactory(3);
  final Config config=new Config();
  final HazelcastInstance keyOwner=nodeFactory.newHazelcastInstance(config);
  final HazelcastInstance instance1=nodeFactory.newHazelcastInstance(config);
  final HazelcastInstance instance2=nodeFactory.newHazelcastInstance(config);
  int k=0;
  final Member localMember=keyOwner.getCluster().getLocalMember();
  while (!localMember.equals(instance1.getPartitionService().getPartition(++k).getOwner())) {
    Thread.sleep(1);
  }
  final int key=k;
  final ILock lock1=instance1.getLock(key);
  lock1.lock();
  final CountDownLatch latch=new CountDownLatch(1);
  new Thread(new Runnable(){
    public void run(){
      final ILock lock=instance2.getLock(key);
      lock.lock();
      latch.countDown();
    }
  }
).start();
  keyOwner.getLifecycleService().shutdown();
  Assert.assertTrue(lock1.isLocked());
  Assert.assertTrue(lock1.tryLock());
  lock1.unlock();
  lock1.unlock();
  Assert.assertTrue(latch.await(5,TimeUnit.SECONDS));
}
Program: 49282
Project: 49282
Buggy source:
IPartitionService getPartitionService();

Fixed version (ground truth):
PartitionService getPartitionService();
Program: 49283
Project: 49283
Buggy source:
public IPartitionService getPartitionService(){
  return nodeEngine.getPartitionService();
}

Fixed version (ground truth):
public PartitionService getPartitionService(){
  return nodeEngine.getPartitionService();
}
Program: 49285
Project: 49285
Buggy source:
public ClassDefinitionBuilder addByteArrayField(String fieldName){
  check();
  cd.add(new FieldDefinitionImpl(index++,fieldName,FieldType.BYTE_ARRAY));
  return this;
}

Fixed version (ground truth):
public ClassDefinitionBuilder addByteArrayField(String fieldName){
  check();
  fieldDefinitions.add(new FieldDefinitionImpl(index++,fieldName,FieldType.BYTE_ARRAY));
  return this;
}
Program: 49286
Project: 49286
Buggy source:
public ClassDefinitionBuilder addPortableField(String fieldName,int factoryId,int classId){
  check();
  if (classId == Data.NO_CLASS_ID) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  cd.add(new FieldDefinitionImpl(index++,fieldName,FieldType.PORTABLE,factoryId,classId));
  return this;
}

Fixed version (ground truth):
public ClassDefinitionBuilder addPortableField(String fieldName,ClassDefinition def){
  check();
  if (def.getClassId() == Data.NO_CLASS_ID) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  fieldDefinitions.add(new FieldDefinitionImpl(index++,fieldName,FieldType.PORTABLE,def.getFactoryId(),def.getClassId()));
  nestedClassDefinitions.add(def);
  return this;
}
Program: 49287
Project: 49287
Buggy source:
public ClassDefinitionBuilder addPortableArrayField(String fieldName,int factoryId,int classId){
  check();
  if (classId == Data.NO_CLASS_ID) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  cd.add(new FieldDefinitionImpl(index++,fieldName,FieldType.PORTABLE_ARRAY,factoryId,classId));
  return this;
}

Fixed version (ground truth):
public ClassDefinitionBuilder addPortableArrayField(String fieldName,ClassDefinition def){
  check();
  if (def.getClassId() == Data.NO_CLASS_ID) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  fieldDefinitions.add(new FieldDefinitionImpl(index++,fieldName,FieldType.PORTABLE_ARRAY,def.getFactoryId(),def.getClassId()));
  nestedClassDefinitions.add(def);
  return this;
}