nus-yam/ex-repair huggingface dataset:
Program: 49644
Project: 49644
Buggy source:
@Test public void testMapRemoveWithWriteBehindMapStore(){
  Config c=new Config();
  TestMapStore mapStore=new TestMapStore();
  mapStore.setLoadAllKeys(false);
  for (int i=1; i < 5; i++) {
    mapStore.store(i,"String_Node_Str" + i);
  }
  c.getMapConfig("String_Node_Str").setMapStoreConfig(new MapStoreConfig().setEnabled(true).setWriteDelaySeconds(100).setImplementation(mapStore));
  HazelcastInstance hz=Hazelcast.newHazelcastInstance(c);
  Map map=hz.getMap("String_Node_Str");
  assertEquals("String_Node_Str",map.get(1));
  assertEquals("String_Node_Str",map.remove(1));
  assertNull(map.get(1));
  assertEquals("String_Node_Str",map.get(2));
  assertEquals("String_Node_Str",map.remove(2));
  assertFalse(map.containsKey(2));
  assertEquals("String_Node_Str",map.get(3));
  assertEquals("String_Node_Str",map.remove(3));
  assertNull(map.put(3,"String_Node_Str"));
  assertEquals("String_Node_Str",map.get(4));
  assertEquals("String_Node_Str",map.remove(4));
  assertNull(map.remove(4));
}

Fixed version (ground truth):
@Test public void testMapRemoveWithWriteBehindMapStore(){
  Config c=new Config();
  TestMapStore mapStore=new TestMapStore();
  mapStore.setLoadAllKeys(false);
  for (int i=1; i < 6; i++) {
    mapStore.store(i,"String_Node_Str" + i);
  }
  c.getMapConfig("String_Node_Str").setMapStoreConfig(new MapStoreConfig().setEnabled(true).setWriteDelaySeconds(100).setImplementation(mapStore));
  HazelcastInstance hz=Hazelcast.newHazelcastInstance(c);
  IMap map=hz.getMap("String_Node_Str");
  assertEquals("String_Node_Str",map.get(1));
  assertEquals("String_Node_Str",map.remove(1));
  assertNull(map.get(1));
  assertEquals("String_Node_Str",map.get(2));
  assertEquals("String_Node_Str",map.remove(2));
  assertFalse(map.containsKey(2));
  assertEquals("String_Node_Str",map.get(3));
  assertEquals("String_Node_Str",map.remove(3));
  assertNull(map.put(3,"String_Node_Str"));
  assertEquals("String_Node_Str",map.get(4));
  assertEquals("String_Node_Str",map.remove(4));
  assertNull(map.remove(4));
  assertEquals("String_Node_Str",map.get(5));
  assertEquals("String_Node_Str",map.remove(5));
  assertNull(map.putIfAbsent(5,"String_Node_Str"));
}
Program: 49645
Project: 49645
Buggy source:
public Collection<MemberGroup> createMemberGroups(Collection<MemberImpl> members){
  Map<String,MemberGroup> groups=new HashMap<String,MemberGroup>();
  for (  MemberImpl member : members) {
    if (!member.isLiteMember()) {
      Address address=member.getAddress();
      MemberGroup group=groups.get(address.getHost());
      if (group == null) {
        group=new DefaultMemberGroup();
        groups.put(address.getHost(),group);
      }
      group.addMember(member);
    }
  }
  return groups.values();
}

Fixed version (ground truth):
public Collection<MemberGroup> createMemberGroups(Collection<MemberImpl> members){
  final Collection<MemberGroup> groups=createHostAwareMemberGroups(members);
  if (groups.size() == 1 && members.size() >= 2) {
    MemberGroup group1=groups.iterator().next();
    MemberGroup group2=new DefaultMemberGroup();
    final int sizePerGroup=group1.size() / 2;
    Iterator<MemberImpl> iter=group1.iterator();
    while (group2.size() < sizePerGroup && iter.hasNext()) {
      group2.addMember(iter.next());
      iter.remove();
    }
    groups.add(group2);
  }
  return groups;
}
Program: 49646
Project: 49646
Buggy source:
public PartitionStateGeneratorImpl(MemberGroupFactory nodeGroupFactory){
  super();
  this.memberGroupFactory=nodeGroupFactory;
}

Fixed version (ground truth):
public PartitionStateGeneratorImpl(MemberGroupFactory memberGroupFactory){
  super();
  this.memberGroupFactory=memberGroupFactory;
}
Program: 49647
Project: 49647
Buggy source:
public void remove(){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
public void remove(){
  if (end) {
    member=null;
  }
}
Program: 49648
Project: 49648
Buggy source:
public void finalizeJoin(){
  Set<Member> members=node.getClusterImpl().getMembers();
  List<AsyncRemotelyBooleanCallable> calls=new ArrayList<AsyncRemotelyBooleanCallable>();
  for (  Member m : members) {
    MemberImpl member=(MemberImpl)m;
    if (!member.localMember() && !member.isSuperClient()) {
      AsyncRemotelyBooleanCallable rrp=new AsyncRemotelyBooleanCallable();
      rrp.executeProcess(member.getAddress(),new FinalizeJoin());
      calls.add(rrp);
    }
  }
  for (  AsyncRemotelyBooleanCallable call : calls) {
    call.getResultAsBoolean();
  }
}

Fixed version (ground truth):
public void finalizeJoin(){
  Set<Member> members=node.getClusterImpl().getMembers();
  List<AsyncRemotelyBooleanCallable> calls=new ArrayList<AsyncRemotelyBooleanCallable>();
  for (  Member m : members) {
    MemberImpl member=(MemberImpl)m;
    if (!member.localMember() && !member.isLiteMember()) {
      AsyncRemotelyBooleanCallable rrp=new AsyncRemotelyBooleanCallable();
      rrp.executeProcess(member.getAddress(),new FinalizeJoin());
      calls.add(rrp);
    }
  }
  for (  AsyncRemotelyBooleanCallable call : calls) {
    call.getResultAsBoolean();
  }
}
Program: 49649
Project: 49649
Buggy source:
/** 
 * @see #isLiteMember()
 * @deprecated as of 2.0
 */
public boolean isSuperClient(){
  return liteMember;
}

Fixed version (ground truth):
/** 
 * @see #isLiteMember()
 * @deprecated as of 2.0
 */
@Deprecated public boolean isSuperClient(){
  return liteMember;
}
Program: 49650
Project: 49650
Buggy source:
/** 
 * @see #setLiteMember(boolean)
 * @deprecated as of 2.0
 */
public Config setSuperClient(boolean liteMember){
  this.liteMember=liteMember;
  return this;
}

Fixed version (ground truth):
/** 
 * @see #setLiteMember(boolean)
 * @deprecated as of 2.0
 */
@Deprecated public Config setSuperClient(boolean liteMember){
  this.liteMember=liteMember;
  return this;
}
Program: 49652
Project: 49652
Buggy source:
protected MemberImpl getNextMemberAfter(final List<MemberImpl> lsMembers,final Address address,final boolean skipSuperClient,final int distance){
  final int size=lsMembers.size();
  if (size <= 1)   return null;
  int indexOfMember=-1;
  for (int i=0; i < size; i++) {
    final MemberImpl member=lsMembers.get(i);
    if (member.getAddress().equals(address)) {
      indexOfMember=i;
    }
  }
  if (indexOfMember == -1)   return null;
  int foundDistance=0;
  for (int i=indexOfMember; i < size + indexOfMember; i++) {
    final MemberImpl member=lsMembers.get((1 + i) % size);
    if (!(skipSuperClient && member.isSuperClient())) {
      foundDistance++;
    }
    if (foundDistance == distance) {
      return member;
    }
  }
  return null;
}

Fixed version (ground truth):
protected MemberImpl getNextMemberAfter(final List<MemberImpl> lsMembers,final Address address,final boolean skipSuperClient,final int distance){
  final int size=lsMembers.size();
  if (size <= 1)   return null;
  int indexOfMember=-1;
  for (int i=0; i < size; i++) {
    final MemberImpl member=lsMembers.get(i);
    if (member.getAddress().equals(address)) {
      indexOfMember=i;
    }
  }
  if (indexOfMember == -1)   return null;
  int foundDistance=0;
  for (int i=indexOfMember; i < size + indexOfMember; i++) {
    final MemberImpl member=lsMembers.get((1 + i) % size);
    if (!(skipSuperClient && member.isLiteMember())) {
      foundDistance++;
    }
    if (foundDistance == distance) {
      return member;
    }
  }
  return null;
}
Program: 49653
Project: 49653
Buggy source:
public boolean isSuperClient(){
  return (nodeType == NodeType.LITE_MEMBER);
}

Fixed version (ground truth):
@Deprecated public boolean isSuperClient(){
  return isLiteMember();
}
Program: 49654
Project: 49654
Buggy source:
@JMXAttribute("String_Node_Str") @JMXDescription("String_Node_Str") public boolean isSuperClient(){
  return getManagedObject().isSuperClient();
}

Fixed version (ground truth):
@JMXAttribute("String_Node_Str") @JMXDescription("String_Node_Str") public boolean isSuperClient(){
  return getManagedObject().isLiteMember();
}
Program: 49655
Project: 49655
Buggy source:
public PredicateBuilder or(Predicate predicate){
  int index=lsPredicates.size() - 2;
  Predicate first=lsPredicates.remove(index);
  Predicate second=lsPredicates.remove(index);
  lsPredicates.add(Predicates.or(first,second));
  return this;
}

Fixed version (ground truth):
public PredicateBuilder or(Predicate predicate){
  if (predicate != PredicateBuilder.this) {
    throw new RuntimeException("String_Node_Str" + PredicateBuilder.class.getSimpleName() + "String_Node_Str"+ ((predicate == null) ? "String_Node_Str" : predicate.getClass().getSimpleName()));
  }
  int index=lsPredicates.size() - 2;
  Predicate first=lsPredicates.remove(index);
  Predicate second=lsPredicates.remove(index);
  lsPredicates.add(Predicates.or(first,second));
  return this;
}
Program: 49656
Project: 49656
Buggy source:
public PredicateBuilder and(Predicate predicate){
  int index=lsPredicates.size() - 2;
  Predicate first=lsPredicates.remove(index);
  Predicate second=lsPredicates.remove(index);
  lsPredicates.add(Predicates.and(first,second));
  return this;
}

Fixed version (ground truth):
public PredicateBuilder and(Predicate predicate){
  if (predicate != PredicateBuilder.this) {
    throw new RuntimeException("String_Node_Str" + PredicateBuilder.class.getSimpleName() + "String_Node_Str"+ ((predicate == null) ? "String_Node_Str" : predicate.getClass().getSimpleName()));
  }
  int index=lsPredicates.size() - 2;
  Predicate first=lsPredicates.remove(index);
  Predicate second=lsPredicates.remove(index);
  lsPredicates.add(Predicates.and(first,second));
  return this;
}
Program: 49657
Project: 49657
Buggy source:
@Override public String toString(){
  final StringBuffer sb=new StringBuffer();
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  sb.append(lsPredicates.get(0));
  sb.append("String_Node_Str");
  return sb.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  final StringBuffer sb=new StringBuffer();
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  sb.append(lsPredicates.size() == 0 ? "String_Node_Str" : lsPredicates.get(0));
  sb.append("String_Node_Str");
  return sb.toString();
}
Program: 49659
Project: 49659
Buggy source:
public void finalizeJoin(){
  Set<Member> members=node.getClusterImpl().getMembers();
  List<AsyncRemotelyBooleanCallable> calls=new ArrayList<AsyncRemotelyBooleanCallable>();
  for (  Member m : members) {
    MemberImpl member=(MemberImpl)m;
    if (!member.localMember() && !member.isSuperClient()) {
      AsyncRemotelyBooleanCallable rrp=new AsyncRemotelyBooleanCallable();
      rrp.executeProcess(member.getAddress(),new FinalizeJoin());
      calls.add(rrp);
    }
  }
  for (  AsyncRemotelyBooleanCallable call : calls) {
    call.getResultAsBoolean();
  }
}

Fixed version (ground truth):
public void finalizeJoin(){
  Set<Member> members=node.getClusterImpl().getMembers();
  List<AsyncRemotelyBooleanCallable> calls=new ArrayList<AsyncRemotelyBooleanCallable>();
  for (  Member m : members) {
    MemberImpl member=(MemberImpl)m;
    if (!member.localMember() && !member.isLiteMember()) {
      AsyncRemotelyBooleanCallable rrp=new AsyncRemotelyBooleanCallable();
      rrp.executeProcess(member.getAddress(),new FinalizeJoin());
      calls.add(rrp);
    }
  }
  for (  AsyncRemotelyBooleanCallable call : calls) {
    call.getResultAsBoolean();
  }
}
Program: 49660
Project: 49660
Buggy source:
/** 
 * @see #isLiteMember()
 * @deprecated as of 2.0
 */
public boolean isSuperClient(){
  return liteMember;
}

Fixed version (ground truth):
/** 
 * @see #isLiteMember()
 * @deprecated as of 2.0
 */
@Deprecated public boolean isSuperClient(){
  return liteMember;
}
Program: 49661
Project: 49661
Buggy source:
/** 
 * @see #setLiteMember(boolean)
 * @deprecated as of 2.0
 */
public Config setSuperClient(boolean liteMember){
  this.liteMember=liteMember;
  return this;
}

Fixed version (ground truth):
/** 
 * @see #setLiteMember(boolean)
 * @deprecated as of 2.0
 */
@Deprecated public Config setSuperClient(boolean liteMember){
  this.liteMember=liteMember;
  return this;
}
Program: 49663
Project: 49663
Buggy source:
protected MemberImpl getNextMemberAfter(final List<MemberImpl> lsMembers,final Address address,final boolean skipSuperClient,final int distance){
  final int size=lsMembers.size();
  if (size <= 1)   return null;
  int indexOfMember=-1;
  for (int i=0; i < size; i++) {
    final MemberImpl member=lsMembers.get(i);
    if (member.getAddress().equals(address)) {
      indexOfMember=i;
    }
  }
  if (indexOfMember == -1)   return null;
  int foundDistance=0;
  for (int i=indexOfMember; i < size + indexOfMember; i++) {
    final MemberImpl member=lsMembers.get((1 + i) % size);
    if (!(skipSuperClient && member.isSuperClient())) {
      foundDistance++;
    }
    if (foundDistance == distance) {
      return member;
    }
  }
  return null;
}

Fixed version (ground truth):
protected MemberImpl getNextMemberAfter(final List<MemberImpl> lsMembers,final Address address,final boolean skipSuperClient,final int distance){
  final int size=lsMembers.size();
  if (size <= 1)   return null;
  int indexOfMember=-1;
  for (int i=0; i < size; i++) {
    final MemberImpl member=lsMembers.get(i);
    if (member.getAddress().equals(address)) {
      indexOfMember=i;
    }
  }
  if (indexOfMember == -1)   return null;
  int foundDistance=0;
  for (int i=indexOfMember; i < size + indexOfMember; i++) {
    final MemberImpl member=lsMembers.get((1 + i) % size);
    if (!(skipSuperClient && member.isLiteMember())) {
      foundDistance++;
    }
    if (foundDistance == distance) {
      return member;
    }
  }
  return null;
}
Program: 49664
Project: 49664
Buggy source:
public boolean isSuperClient(){
  return (nodeType == NodeType.LITE_MEMBER);
}

Fixed version (ground truth):
@Deprecated public boolean isSuperClient(){
  return isLiteMember();
}
Program: 49665
Project: 49665
Buggy source:
@JMXAttribute("String_Node_Str") @JMXDescription("String_Node_Str") public boolean isSuperClient(){
  return getManagedObject().isSuperClient();
}

Fixed version (ground truth):
@JMXAttribute("String_Node_Str") @JMXDescription("String_Node_Str") public boolean isSuperClient(){
  return getManagedObject().isLiteMember();
}
Program: 49666
Project: 49666
Buggy source:
private synchronized void start(){
  final boolean jmxProperty=instance.node.groupProperties.ENABLE_JMX.getBoolean();
  if (!jmxProperty) {
    return;
  }
  logger.log(Level.INFO,"String_Node_Str");
  if (showDetails()) {
    if (statCollectors == null) {
      statCollectors=new ScheduledThreadPoolExecutor(2,new ExecutorThreadFactory(null,"String_Node_Str",null));
    }
  }
  started=true;
}

Fixed version (ground truth):
private void start(){
synchronized (LOCK) {
    final boolean jmxProperty=instance.node.groupProperties.ENABLE_JMX.getBoolean();
    if (!jmxProperty) {
      return;
    }
    logger.log(Level.INFO,"String_Node_Str");
    if (showDetails()) {
      if (statCollectors == null) {
        statCollectors=new ScheduledThreadPoolExecutor(2,new ExecutorThreadFactory(null,"String_Node_Str",null));
      }
    }
    started=true;
  }
}
Program: 49667
Project: 49667
Buggy source:
/** 
 * Unregister a cluster instance.
 */
public synchronized void unregister(){
  if (!started) {
    return;
  }
  MBeanServer mbs=mBeanServer();
  Set<ObjectName> entries;
  try {
    entries=mbs.queryNames(ObjectNameSpec.getClusterNameFilter(this.name),null);
    for (    ObjectName name : entries) {
      if (mbs.isRegistered(name)) {
        mbs.unregisterMBean(name);
      }
    }
  }
 catch (  Exception e) {
    logger.log(Level.FINEST,"String_Node_Str",e);
  }
  counter.decrementAndGet();
}

Fixed version (ground truth):
/** 
 * Unregister a cluster instance.
 */
public void unregister(){
synchronized (LOCK) {
    if (!started) {
      return;
    }
    MBeanServer mbs=mBeanServer();
    Set<ObjectName> entries;
    try {
      entries=mbs.queryNames(ObjectNameSpec.getClusterNameFilter(this.name),null);
      for (      ObjectName name : entries) {
        if (mbs.isRegistered(name)) {
          mbs.unregisterMBean(name);
        }
      }
    }
 catch (    Exception e) {
      logger.log(Level.FINEST,"String_Node_Str",e);
    }
    counter.decrementAndGet();
  }
}
Program: 49668
Project: 49668
Buggy source:
/** 
 * Create a new collector or return null if statistics are not enabled
 * @return statisticsCollector
 */
@SuppressWarnings("String_Node_Str") public static StatisticsCollector newStatisticsCollector(){
  if (statCollectors != null) {
    long interval=1L;
    ScheduledCollector collector=new ScheduledCollector(interval);
    ScheduledFuture future=statCollectors.scheduleWithFixedDelay(collector,interval,interval,TimeUnit.SECONDS);
    collector.setScheduledFuture(future);
    return collector;
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Create a new collector or return null if statistics are not enabled
 * @return statisticsCollector
 */
@SuppressWarnings("String_Node_Str") public static StatisticsCollector newStatisticsCollector(){
synchronized (LOCK) {
    if (statCollectors != null) {
      long interval=1L;
      ScheduledCollector collector=new ScheduledCollector(interval);
      ScheduledFuture future=statCollectors.scheduleWithFixedDelay(collector,interval,interval,TimeUnit.SECONDS);
      collector.setScheduledFuture(future);
      return collector;
    }
 else {
      return null;
    }
  }
}
Program: 49669
Project: 49669
Buggy source:
public ManagementService(FactoryImpl instance){
  this.instance=instance;
  this.logger=instance.node.getLogger(ManagementService.class.getName());
}

Fixed version (ground truth):
public ManagementService(FactoryImpl instance){
  this.instance=instance;
  this.logger=instance.node.getLogger(ManagementService.class.getName());
  this.showDetails=instance.node.groupProperties.ENABLE_JMX_DETAILED.getBoolean();
}
Program: 49670
Project: 49670
Buggy source:
/** 
 * Stop the management service
 */
public synchronized static void shutdown(){
  if (counter.get() > 0) {
    return;
  }
  MBeanServer mbs=mBeanServer();
  Set<ObjectName> entries;
  try {
    entries=mbs.queryNames(new ObjectName(ObjectNameSpec.NAME_DOMAIN + "String_Node_Str"),null);
    for (    ObjectName name : entries) {
      if (mbs.isRegistered(name)) {
        mbs.unregisterMBean(name);
      }
    }
  }
 catch (  Exception e) {
    Logger.getLogger("String_Node_Str").log(Level.FINEST,"String_Node_Str",e);
  }
  if (statCollectors != null) {
    statCollectors.shutdownNow();
    statCollectors=null;
  }
}

Fixed version (ground truth):
/** 
 * Stop the management service
 */
public static void shutdown(){
synchronized (LOCK) {
    if (counter.get() > 0) {
      return;
    }
    MBeanServer mbs=mBeanServer();
    Set<ObjectName> entries;
    try {
      entries=mbs.queryNames(new ObjectName(ObjectNameSpec.NAME_DOMAIN + "String_Node_Str"),null);
      for (      ObjectName name : entries) {
        if (mbs.isRegistered(name)) {
          mbs.unregisterMBean(name);
        }
      }
    }
 catch (    Exception e) {
      Logger.getLogger("String_Node_Str").log(Level.FINEST,"String_Node_Str",e);
    }
    if (statCollectors != null) {
      statCollectors.shutdownNow();
      statCollectors=null;
    }
  }
}
Program: 49671
Project: 49671
Buggy source:
/** 
 * Return if the instrumentation must manage objects and statistics at detailed level. For forward compatibility, return always true.
 */
final boolean showDetails(){
  return instance.node.groupProperties.ENABLE_JMX_DETAILED.getBoolean();
}

Fixed version (ground truth):
/** 
 * Return if the instrumentation must manage objects and statistics at detailed level. For forward compatibility, return always true.
 */
final boolean showDetails(){
  return showDetails;
}
Program: 49672
Project: 49672
Buggy source:
/** 
 * Register all the MBeans.
 */
public synchronized void register(){
  if (!started) {
    start();
  }
  if (!started) {
    return;
  }
  MBeanServer mbs=mBeanServer();
  try {
    nameLookup();
    ClusterMBean clusterMBean=new ClusterMBean(this,this.name);
    mbs.registerMBean(clusterMBean,clusterMBean.getObjectName());
    DataMBean dataMBean=new DataMBean(this);
    dataMBean.setParentName(clusterMBean.getRootName());
    mbs.registerMBean(dataMBean,dataMBean.getObjectName());
  }
 catch (  Exception e) {
    logger.log(Level.WARNING,"String_Node_Str",e);
    return;
  }
  counter.incrementAndGet();
}

Fixed version (ground truth):
/** 
 * Register all the MBeans.
 */
public void register(){
synchronized (LOCK) {
    if (!started) {
      start();
    }
    if (!started) {
      return;
    }
    MBeanServer mbs=mBeanServer();
    try {
      nameLookup();
      ClusterMBean clusterMBean=new ClusterMBean(this,this.name);
      mbs.registerMBean(clusterMBean,clusterMBean.getObjectName());
      DataMBean dataMBean=new DataMBean(this);
      dataMBean.setParentName(clusterMBean.getRootName());
      mbs.registerMBean(dataMBean,dataMBean.getObjectName());
    }
 catch (    Exception e) {
      logger.log(Level.WARNING,"String_Node_Str",e);
      return;
    }
    counter.incrementAndGet();
  }
}
Program: 49674
Project: 49674
Buggy source:
void clusterIsDown(Connection oldConnection){
  if (!running) {
    interruptWaitingCalls();
    return;
  }
  client.getConnectionManager().destroyConnection(oldConnection);
  if (reconnection.compareAndSet(false,true)) {
    client.runAsyncAndWait(new Runnable(){
      public void run(){
        try {
          final Connection lookForAliveConnection=client.getConnectionManager().lookForLiveConnection();
          if (lookForAliveConnection == null) {
            logger.log(Level.WARNING,"String_Node_Str" + reconnection);
            if (reconnection.get()) {
              interruptWaitingCalls();
            }
          }
 else {
            if (running) {
              enQueue(RECONNECT_CALL);
            }
          }
        }
 catch (        IOException e) {
          logger.log(Level.WARNING,Thread.currentThread().getName() + "String_Node_Str" + e.getMessage(),e);
        }
 finally {
          reconnection.compareAndSet(true,false);
        }
      }
    }
);
  }
}

Fixed version (ground truth):
void clusterIsDown(Connection oldConnection){
  if (!running) {
    interruptWaitingCalls();
    return;
  }
  client.getConnectionManager().destroyConnection(oldConnection);
  if (reconnection.compareAndSet(false,true)) {
    client.runAsyncAndWait(new Runnable(){
      public void run(){
        try {
          final Connection lookForAliveConnection=client.getConnectionManager().lookForLiveConnection();
          if (lookForAliveConnection == null) {
            logger.log(Level.WARNING,"String_Node_Str");
            if (reconnection.get()) {
              logger.log(Level.WARNING,"String_Node_Str" + reconnection.get() + "String_Node_Str");
              interruptWaitingCalls();
              client.getLifecycleService().shutdown();
            }
          }
 else {
            if (running) {
              enQueue(RECONNECT_CALL);
            }
          }
        }
 catch (        IOException e) {
          logger.log(Level.WARNING,Thread.currentThread().getName() + "String_Node_Str" + e.getMessage(),e);
        }
 finally {
          reconnection.compareAndSet(true,false);
        }
      }
    }
);
  }
}
Program: 49675
Project: 49675
Buggy source:
public void run(){
  try {
    final Connection lookForAliveConnection=client.getConnectionManager().lookForLiveConnection();
    if (lookForAliveConnection == null) {
      logger.log(Level.WARNING,"String_Node_Str" + reconnection);
      if (reconnection.get()) {
        interruptWaitingCalls();
      }
    }
 else {
      if (running) {
        enQueue(RECONNECT_CALL);
      }
    }
  }
 catch (  IOException e) {
    logger.log(Level.WARNING,Thread.currentThread().getName() + "String_Node_Str" + e.getMessage(),e);
  }
 finally {
    reconnection.compareAndSet(true,false);
  }
}

Fixed version (ground truth):
public void run(){
  try {
    final Connection lookForAliveConnection=client.getConnectionManager().lookForLiveConnection();
    if (lookForAliveConnection == null) {
      logger.log(Level.WARNING,"String_Node_Str");
      if (reconnection.get()) {
        logger.log(Level.WARNING,"String_Node_Str" + reconnection.get() + "String_Node_Str");
        interruptWaitingCalls();
        client.getLifecycleService().shutdown();
      }
    }
 else {
      if (running) {
        enQueue(RECONNECT_CALL);
      }
    }
  }
 catch (  IOException e) {
    logger.log(Level.WARNING,Thread.currentThread().getName() + "String_Node_Str" + e.getMessage(),e);
  }
 finally {
    reconnection.compareAndSet(true,false);
  }
}
Program: 49676
Project: 49676
Buggy source:
public String getPassword(){
  return new String(password);
}

Fixed version (ground truth):
public String getPassword(){
  return password == null ? "String_Node_Str" : new String(password);
}
Program: 49677
Project: 49677
Buggy source:
public void own(DataRecordEntry dataRecordEntry){
  Record record=storeDataRecordEntry(dataRecordEntry);
  if (record != null) {
    if (record.getValueData() != null) {
      updateIndexes(record);
    }
    Map<Address,Boolean> keyListeners=dataRecordEntry.getListeners();
    if (keyListeners != null) {
      record.setMapListeners(keyListeners);
    }
  }
}

Fixed version (ground truth):
public void own(DataRecordEntry dataRecordEntry){
  Record record=storeDataRecordEntry(dataRecordEntry);
  if (record != null) {
    if (record.valueCount() > 0) {
      updateIndexes(record);
    }
    Map<Address,Boolean> keyListeners=dataRecordEntry.getListeners();
    if (keyListeners != null) {
      record.setMapListeners(keyListeners);
    }
  }
}
Program: 49679
Project: 49679
Buggy source:
public Boolean call() throws Exception {
  if (to.equals(from)) {
    getLogger().log(Level.FINEST,"String_Node_Str" + toString());
    return Boolean.TRUE;
  }
  if (from == null) {
    getLogger().log(Level.FINEST,"String_Node_Str" + toString());
  }
  Node node=((FactoryImpl)hazelcast).node;
  PartitionManager pm=node.concurrentMapManager.getPartitionManager();
  try {
    Member target=pm.getMember(to);
    if (target == null) {
      getLogger().log(Level.WARNING,"String_Node_Str" + toString());
      return Boolean.FALSE;
    }
    CostAwareRecordList costAwareRecordList=pm.getActivePartitionRecords(partitionId,replicaIndex,to,diffOnly);
    DistributedTask task=new DistributedTask(new MigrationTask(partitionId,costAwareRecordList,replicaIndex,from),target);
    Future future=node.factory.getExecutorService().submit(task);
    return (Boolean)future.get(400,TimeUnit.SECONDS);
  }
 catch (  Throwable e) {
    Level level=Level.WARNING;
    if (e instanceof ExecutionException) {
      e=e.getCause();
    }
    if (e instanceof MemberLeftException || e instanceof IllegalStateException) {
      level=Level.FINEST;
    }
    getLogger().log(level,e.getMessage(),e);
  }
  return Boolean.FALSE;
}

Fixed version (ground truth):
public Boolean call() throws Exception {
  if (to.equals(from)) {
    getLogger().log(Level.FINEST,"String_Node_Str" + toString());
    return Boolean.TRUE;
  }
  if (from == null) {
    getLogger().log(Level.FINEST,"String_Node_Str" + toString());
  }
  final Node node=((FactoryImpl)hazelcast).node;
  PartitionManager pm=node.concurrentMapManager.getPartitionManager();
  try {
    Member target=pm.getMember(to);
    if (target == null) {
      getLogger().log(Level.WARNING,"String_Node_Str" + toString());
      return Boolean.FALSE;
    }
    final CostAwareRecordList costAwareRecordList=pm.getActivePartitionRecords(partitionId,replicaIndex,to,diffOnly);
    DistributedTask task=new DistributedTask(new MigrationTask(partitionId,costAwareRecordList,replicaIndex,from),target);
    Future future=node.factory.getExecutorService().submit(task);
    Boolean result=(Boolean)future.get(400,TimeUnit.SECONDS);
    if (result) {
      if (replicaIndex == 0) {
        node.concurrentMapManager.enqueueAndWait(new Processable(){
          public void process(){
            for (            Record record : costAwareRecordList.getRecords()) {
              CMap cmap=node.concurrentMapManager.getMap(record.getName());
              if (cmap != null) {
                cmap.getMapIndexService().remove(record);
              }
            }
          }
        }
,100);
      }
    }
    return result;
  }
 catch (  Throwable e) {
    Level level=Level.WARNING;
    if (e instanceof ExecutionException) {
      e=e.getCause();
    }
    if (e instanceof MemberLeftException || e instanceof IllegalStateException) {
      level=Level.FINEST;
    }
    getLogger().log(level,e.getMessage(),e);
  }
  return Boolean.FALSE;
}
Program: 49682
Project: 49682
Buggy source:
@Test(timeout=60000) public void testMultiMapRecovery() throws Exception {
  HazelcastInstance h=Hazelcast.newHazelcastInstance(new Config());
  MultiMap mm=h.getMultiMap("String_Node_Str");
  Collection<String> expectedValues=new HashSet<String>();
  expectedValues.add("String_Node_Str");
  expectedValues.add("String_Node_Str");
  mm.put("String_Node_Str","String_Node_Str");
  mm.put("String_Node_Str","String_Node_Str");
  assertEquals(2,mm.size());
  assertEquals(1,mm.keySet().size());
  Collection values=mm.get("String_Node_Str");
  for (  Object value : values) {
    assertTrue(expectedValues.contains(value));
  }
  HazelcastInstance h2=Hazelcast.newHazelcastInstance(new Config());
  assertEquals(2,mm.size());
  assertEquals(1,mm.keySet().size());
  values=mm.get("String_Node_Str");
  for (  Object value : values) {
    assertTrue(expectedValues.contains(value));
  }
  MultiMap mm2=h2.getMultiMap("String_Node_Str");
  assertEquals(2,mm2.size());
  assertEquals(1,mm2.keySet().size());
  values=mm2.get("String_Node_Str");
  for (  Object value : values) {
    assertTrue(expectedValues.contains(value));
  }
  h.getLifecycleService().shutdown();
  assertEquals(2,mm2.size());
  assertEquals(1,mm2.keySet().size());
  values=mm2.get("String_Node_Str");
  for (  Object value : values) {
    assertTrue(expectedValues.contains(value));
  }
}

Fixed version (ground truth):
@Test(timeout=60000) public void testMultiMapRecovery() throws Exception {
  HazelcastInstance h=Hazelcast.newHazelcastInstance(new Config());
  MultiMap mm=h.getMultiMap("String_Node_Str");
  Collection<String> expectedValues=new HashSet<String>();
  expectedValues.add("String_Node_Str");
  expectedValues.add("String_Node_Str");
  mm.put("String_Node_Str","String_Node_Str");
  mm.put("String_Node_Str","String_Node_Str");
  assertEquals(2,mm.size());
  assertEquals(1,mm.keySet().size());
  Collection values=mm.get("String_Node_Str");
  for (  Object value : values) {
    assertTrue(expectedValues.contains(value));
  }
  HazelcastInstance h2=Hazelcast.newHazelcastInstance(new Config());
  MultiMap mm2=h2.getMultiMap("String_Node_Str");
  Thread.sleep(1000);
  getCMapForMultiMap(h,"String_Node_Str").startCleanup(true);
  getCMapForMultiMap(h2,"String_Node_Str").startCleanup(true);
  assertEquals(2,mm.size());
  assertEquals(1,mm.keySet().size());
  values=mm.get("String_Node_Str");
  for (  Object value : values) {
    assertTrue(expectedValues.contains(value));
  }
  assertEquals(2,mm2.size());
  assertEquals(1,mm2.keySet().size());
  values=mm2.get("String_Node_Str");
  for (  Object value : values) {
    assertTrue(expectedValues.contains(value));
  }
  h.getLifecycleService().shutdown();
  values=mm2.get("String_Node_Str");
  for (  Object value : values) {
    assertTrue(expectedValues.contains(value));
  }
  assertEquals(2,mm2.size());
  assertEquals(1,mm2.keySet().size());
}
Program: 49683
Project: 49683
Buggy source:
@Test(timeout=60000) public void testMapRecovery() throws Exception {
  HazelcastInstance h=Hazelcast.newHazelcastInstance(new Config());
  IMap mm=h.getMap("String_Node_Str");
  mm.put("String_Node_Str","String_Node_Str");
  assertEquals(1,mm.size());
  assertEquals(1,mm.keySet().size());
  HazelcastInstance h2=Hazelcast.newHazelcastInstance(new Config());
  assertEquals(1,mm.size());
  assertEquals(1,mm.keySet().size());
  IMap mm2=h2.getMap("String_Node_Str");
  assertEquals(1,mm2.size());
  assertEquals(1,mm2.keySet().size());
  h.getLifecycleService().shutdown();
  assertEquals(1,mm2.size());
  assertEquals(1,mm2.keySet().size());
}

Fixed version (ground truth):
@Test(timeout=60000) public void testMapRecovery() throws Exception {
  HazelcastInstance h1=Hazelcast.newHazelcastInstance(new Config());
  IMap map1=h1.getMap("String_Node_Str");
  map1.put("String_Node_Str","String_Node_Str");
  assertEquals(1,map1.size());
  assertEquals(1,map1.keySet().size());
  CMap cmap1=getCMap(h1,"String_Node_Str");
  assertEquals(1,cmap1.mapRecords.size());
  assertEquals(1,cmap1.getMapIndexService().getOwnedRecords().size());
  HazelcastInstance h2=Hazelcast.newHazelcastInstance(new Config());
  IMap map2=h2.getMap("String_Node_Str");
  CMap cmap2=getCMap(h2,"String_Node_Str");
  assertEquals(1,cmap1.mapRecords.size());
  assertEquals(1,cmap2.mapRecords.size());
  assertEquals(1,cmap1.getMapIndexService().getOwnedRecords().size() + cmap2.getMapIndexService().getOwnedRecords().size());
  assertEquals(1,map1.size());
  assertEquals(1,map1.keySet().size());
  assertEquals(1,map2.size());
  assertEquals(1,map2.keySet().size());
  h1.getLifecycleService().shutdown();
  assertEquals(1,map2.size());
  assertEquals(1,map2.keySet().size());
  assertEquals(1,cmap2.mapRecords.size());
  assertEquals(1,cmap2.getMapIndexService().getOwnedRecords().size());
}
Program: 49684
Project: 49684
Buggy source:
public DeleteCommandProcessor(TextCommandService textCommandService){
  super(textCommandService);
  logger=textCommandService.getNode().getLogger(this.getClass().getName());
}

Fixed version (ground truth):
public DeleteCommandProcessor(TextCommandService textCommandService){
  super(textCommandService);
}
Program: 49685
Project: 49685
Buggy source:
public void handle(DeleteCommand command){
  String key=null;
  try {
    key=URLDecoder.decode(command.getKey(),"String_Node_Str");
  }
 catch (  UnsupportedEncodingException e) {
    logger.log(Level.WARNING,e.getMessage(),e);
  }
  String mapName="String_Node_Str";
  int index=key.indexOf(':');
  if (index != -1) {
    mapName=key.substring(0,index);
    key=key.substring(index + 1);
  }
  command.setResponse(DELETED);
  if (command.shouldReply()) {
    textCommandService.sendResponse(command);
  }
  textCommandService.incrementDeleteCount();
  textCommandService.delete(mapName,key);
}

Fixed version (ground truth):
public void handle(DeleteCommand command){
  String key;
  try {
    key=URLDecoder.decode(command.getKey(),"String_Node_Str");
  }
 catch (  UnsupportedEncodingException e) {
    throw new RuntimeException(format("String_Node_Str",command.getKey()));
  }
  String mapName="String_Node_Str";
  int index=key.indexOf(':');
  if (index != -1) {
    mapName=key.substring(0,index);
    key=key.substring(index + 1);
  }
  command.setResponse(DELETED);
  if (command.shouldReply()) {
    textCommandService.sendResponse(command);
  }
  textCommandService.incrementDeleteCount();
  textCommandService.delete(mapName,key);
}
Program: 49686
Project: 49686
Buggy source:
public Long extractLongValue(Object value){
  Object extractedValue=expression.getValue(value);
  if (extractedValue == null) {
    return Long.MIN_VALUE;
  }
 else {
    if (!checkedStrength) {
      if (extractedValue instanceof Boolean || extractedValue instanceof Number) {
        strong=true;
      }
      checkedStrength=true;
    }
    return getLongValueByType(extractedValue);
  }
}

Fixed version (ground truth):
public Long extractLongValue(Object value){
  Object extractedValue=expression.getValue(value);
  setIndexType(extractedValue);
  if (extractedValue == null) {
    return Long.MIN_VALUE;
  }
 else {
    returnType=getIndexType(extractedValue.getClass());
    if (!checkedStrength) {
      if (extractedValue instanceof Boolean || extractedValue instanceof Number) {
        strong=true;
      }
      checkedStrength=true;
    }
    return getLongValueByType(extractedValue);
  }
}
Program: 49687
Project: 49687
Buggy source:
public byte getIndexType(Class klass){
  if (klass == String.class) {
    return TYPE_STRING;
  }
 else   if (klass == int.class || klass == Integer.class) {
    return TYPE_INT;
  }
 else   if (klass == long.class || klass == Long.class) {
    return TYPE_LONG;
  }
 else   if (klass == boolean.class || klass == Boolean.class) {
    return TYPE_BOOLEAN;
  }
 else   if (klass == double.class || klass == Double.class) {
    return TYPE_DOUBLE;
  }
 else   if (klass == float.class || klass == Float.class) {
    return TYPE_FLOAT;
  }
 else   if (klass == byte.class || klass == Byte.class) {
    return TYPE_BYTE;
  }
 else   if (klass == char.class || klass == Character.class) {
    return TYPE_CLASS;
  }
 else {
    return TYPE_UNKNOWN;
  }
}

Fixed version (ground truth):
public static byte getIndexType(Class klass){
  if (klass == String.class) {
    return TYPE_STRING;
  }
 else   if (klass == int.class || klass == Integer.class) {
    return TYPE_INT;
  }
 else   if (klass == long.class || klass == Long.class) {
    return TYPE_LONG;
  }
 else   if (klass == boolean.class || klass == Boolean.class) {
    return TYPE_BOOLEAN;
  }
 else   if (klass == double.class || klass == Double.class) {
    return TYPE_DOUBLE;
  }
 else   if (klass == float.class || klass == Float.class) {
    return TYPE_FLOAT;
  }
 else   if (klass == byte.class || klass == Byte.class) {
    return TYPE_BYTE;
  }
 else   if (klass == char.class || klass == Character.class) {
    return TYPE_CLASS;
  }
 else {
    return TYPE_UNKNOWN;
  }
}
Program: 49689
Project: 49689
Buggy source:
void markAsDirty(Record record){
  if (!record.isDirty()) {
    record.setDirty(true);
    if (writeDelayMillis > 0) {
      record.setWriteTime(System.currentTimeMillis() + writeDelayMillis);
    }
  }
}

Fixed version (ground truth):
void markAsDirty(Record record){
  if (!record.isDirty()) {
    dirty=true;
    record.setDirty(true);
    if (writeDelayMillis > 0) {
      record.setWriteTime(System.currentTimeMillis() + writeDelayMillis);
    }
  }
}
Program: 49695
Project: 49695
Buggy source:
/** 
 * @param config
 * @return
 */
public static HazelcastClient newHazelcastClient(ClientConfig config){
  return new HazelcastClient(config);
}

Fixed version (ground truth):
/** 
 * @param config
 * @return
 */
public static HazelcastClient newHazelcastClient(ClientConfig config){
  if (config == null)   config=new ClientConfig();
  return new HazelcastClient(config);
}
Program: 49696
Project: 49696
Buggy source:
public void connectionRemoved(Connection connection){
  LifecycleServiceImpl lifecycleService=(LifecycleServiceImpl)node.factory.getLifecycleService();
  if (connection.equals(this.conn) && !lifecycleService.paused.get()) {
    destroyEndpointThreads();
    rollbackTransactions();
    removeEntryListeners();
    removeEntryListenersWithKey();
    removeMessageListeners();
    cancelRunningOperations();
    releaseAttachedSemaphorePermits();
    node.clusterManager.sendProcessableToAll(new ClientService.CountDownLatchLeave(conn.getEndPoint()),true);
  }
}

Fixed version (ground truth):
public void connectionRemoved(Connection connection){
  LifecycleServiceImpl lifecycleService=(LifecycleServiceImpl)node.factory.getLifecycleService();
  if (connection.equals(this.conn) && !lifecycleService.paused.get()) {
    destroyEndpointThreads();
    rollbackTransactions();
    removeEntryListeners();
    removeEntryListenersWithKey();
    removeMessageListeners();
    cancelRunningOperations();
    releaseAttachedSemaphorePermits();
    node.clusterManager.sendProcessableToAll(new ClientHandlerService.CountDownLatchLeave(conn.getEndPoint()),true);
    node.clientService.remove(this);
  }
}
Program: 49697
Project: 49697
Buggy source:
public void authenticated(){
  this.authenticated=true;
}

Fixed version (ground truth):
public void authenticated(){
  this.authenticated=true;
  node.clientService.add(this);
}
Program: 49698
Project: 49698
Buggy source:
public boolean pause(){
  Callable<Boolean> callable=new Callable<Boolean>(){
    public Boolean call(){
synchronized (lifecycleLock) {
        if (paused.get()) {
          fireLifecycleEvent(PAUSING);
        }
 else {
          return false;
        }
        paused.set(false);
        fireLifecycleEvent(PAUSED);
        return true;
      }
    }
  }
;
  return hazelcastClient.callAsyncAndWait(callable);
}

Fixed version (ground truth):
public boolean pause(){
  Callable<Boolean> callable=new Callable<Boolean>(){
    public Boolean call(){
synchronized (lifecycleLock) {
        if (!paused.get()) {
          fireLifecycleEvent(PAUSING);
        }
 else {
          return false;
        }
        paused.set(true);
        fireLifecycleEvent(PAUSED);
        return true;
      }
    }
  }
;
  return hazelcastClient.callAsyncAndWait(callable);
}
Program: 49699
Project: 49699
Buggy source:
Record getOwnedRecord(Data key){
  PartitionServiceImpl partitionService=concurrentMapManager.partitionServiceImpl;
  PartitionServiceImpl.PartitionProxy partition=partitionService.getPartition(concurrentMapManager.getPartitionId(key));
  Member ownerNow=partition.getOwner();
  if (ownerNow != null && !concurrentMapManager.isMigrating(partition.getPartitionId()) && ownerNow.localMember()) {
    return getRecord(key);
  }
  return null;
}

Fixed version (ground truth):
Record getOwnedRecord(Data key){
  PartitionServiceImpl partitionService=concurrentMapManager.partitionServiceImpl;
  PartitionServiceImpl.PartitionProxy partition=partitionService.getPartition(concurrentMapManager.getPartitionId(key));
  Member ownerNow=partition.getOwner();
  if (ownerNow != null && !concurrentMapManager.partitionManager.isOwnedPartitionMigrating(partition.getPartitionId()) && ownerNow.localMember()) {
    return getRecord(key);
  }
  return null;
}
Program: 49701
Project: 49701
Buggy source:
public boolean containsKey(String name,Object key){
  this.keyObject=key;
  this.nearCache=mapCaches.get(name);
  Data dataKey=toData(key);
  if (nearCache != null) {
    if (nearCache.containsKey(key)) {
      return true;
    }
 else     if (nearCache.getMaxSize() == Integer.MAX_VALUE) {
      return false;
    }
  }
  final CMap cMap=maps.get(name);
  if (cMap != null) {
    Record record=cMap.getOwnedRecord(dataKey);
    if (record != null && record.isActive() && record.isValid() && record.hasValueData()) {
      if (cMap.readBackupData) {
        return true;
      }
 else {
        PartitionServiceImpl.PartitionProxy partition=partitionServiceImpl.getPartition(record.getBlockId());
        if (partition != null && !isMigrating(partition.getPartitionId()) && partition.getOwner() != null && partition.getOwner().localMember()) {
          return true;
        }
      }
    }
  }
  return booleanCall(CONCURRENT_MAP_CONTAINS_KEY,name,dataKey,null,0,-1);
}

Fixed version (ground truth):
public boolean containsKey(String name,Object key){
  this.keyObject=key;
  this.nearCache=mapCaches.get(name);
  Data dataKey=toData(key);
  if (nearCache != null) {
    if (nearCache.containsKey(key)) {
      return true;
    }
 else     if (nearCache.getMaxSize() == Integer.MAX_VALUE) {
      return false;
    }
  }
  final CMap cMap=maps.get(name);
  if (cMap != null) {
    Record record=cMap.getOwnedRecord(dataKey);
    if (record != null && record.isActive() && record.isValid() && record.hasValueData()) {
      if (cMap.readBackupData) {
        return true;
      }
 else {
        PartitionServiceImpl.PartitionProxy partition=partitionServiceImpl.getPartition(record.getBlockId());
        if (partition != null && !partitionManager.isOwnedPartitionMigrating(partition.getPartitionId()) && partition.getOwner() != null && partition.getOwner().localMember()) {
          return true;
        }
      }
    }
  }
  return booleanCall(CONCURRENT_MAP_CONTAINS_KEY,name,dataKey,null,0,-1);
}
Program: 49702
Project: 49702
Buggy source:
public boolean isMigrating(int partitionId){
  return partitionManager.isMigrating(partitionId);
}

Fixed version (ground truth):
@Override public boolean isMigrating(Request req){
  final Data key=req.key;
  if (key == null)   return false;
  return partitionManager.isOwnedPartitionMigrating(getPartitionId(key));
}
Program: 49704
Project: 49704
Buggy source:
protected void beforeExecute(Thread t,Runnable r){
  ThreadContext threadContext=ThreadContext.get();
  threadContext.setCurrentFactory(node.factory);
  CallContext callContext=mapThreadCallContexts.get(t);
  if (callContext == null) {
    callContext=new CallContext(threadContext.createNewThreadId(),false);
    mapThreadCallContexts.put(t,callContext);
  }
  threadContext.setCallContext(callContext);
}

Fixed version (ground truth):
protected void beforeExecute(Thread t,Runnable r){
  threadPoolBeforeExecute(t,r);
}
Program: 49705
Project: 49705
Buggy source:
private boolean connectAndSendJoinRequest(Address masterAddress){
  if (masterAddress == null || masterAddress.equals(node.address)) {
    throw new IllegalArgumentException();
  }
  Connection conn=node.connectionManager.getOrConnect(masterAddress);
  logger.log(Level.FINEST,"String_Node_Str" + conn);
  if (conn != null) {
    return node.clusterManager.sendJoinRequest(masterAddress);
  }
  return false;
}

Fixed version (ground truth):
private boolean connectAndSendJoinRequest(Address masterAddress){
  if (masterAddress == null || masterAddress.equals(node.address)) {
    throw new IllegalArgumentException();
  }
  Connection conn=node.connectionManager.getOrConnect(masterAddress);
  logger.log(Level.FINEST,"String_Node_Str" + conn);
  if (conn != null) {
    return node.clusterManager.sendJoinRequest(masterAddress,true);
  }
  return false;
}
Program: 49707
Project: 49707
Buggy source:
public ClientSerializer(){
  super(new DataSerializer(){
    @Override protected Class loadClass(    final String className) throws ClassNotFoundException {
      String name=className;
      if (className.equals("String_Node_Str")) {
        name="String_Node_Str";
      }
      return super.loadClass(name);
    }
    protected String toClassName(    final Class clazz) throws ClassNotFoundException {
      final String className=super.toClassName(clazz);
      if (!className.startsWith("String_Node_Str")) {
        return className;
      }
      return "String_Node_Str" + className.substring("String_Node_Str".length());
    }
  }
,new DefaultSerializer());
}

Fixed version (ground truth):
public ClientSerializer(){
  super(new DataSerializer(){
    @Override protected Class loadClass(    final String className) throws ClassNotFoundException {
      String name=className;
      if (className.equals("String_Node_Str")) {
        name="String_Node_Str";
      }
 else       if (className.equals("String_Node_Str")) {
        name="String_Node_Str";
      }
      return super.loadClass(name);
    }
    protected String toClassName(    final Class clazz) throws ClassNotFoundException {
      final String className=super.toClassName(clazz);
      if (!className.startsWith("String_Node_Str")) {
        return className;
      }
      return "String_Node_Str" + className.substring("String_Node_Str".length());
    }
  }
,new DefaultSerializer());
}
Program: 49708
Project: 49708
Buggy source:
@Override protected Class loadClass(final String className) throws ClassNotFoundException {
  String name=className;
  if (className.equals("String_Node_Str")) {
    name="String_Node_Str";
  }
  return super.loadClass(name);
}

Fixed version (ground truth):
@Override protected Class loadClass(final String className) throws ClassNotFoundException {
  String name=className;
  if (className.equals("String_Node_Str")) {
    name="String_Node_Str";
  }
 else   if (className.equals("String_Node_Str")) {
    name="String_Node_Str";
  }
  return super.loadClass(name);
}