nus-yam/ex-repair huggingface dataset:
Program: 49582
Project: 49582
Buggy source:
public void onMessage(Object msg){
  if (msg != null && msg instanceof JoinInfo) {
    JoinInfo joinInfo=(JoinInfo)msg;
    if (node.address != null && !node.address.equals(joinInfo.address)) {
      boolean validJoinRequest;
      try {
        validJoinRequest=node.validateJoinRequest(joinInfo);
      }
 catch (      Exception e) {
        validJoinRequest=false;
      }
      if (validJoinRequest) {
        if (node.isMaster() && node.isActive() && node.joined()) {
          if (joinInfo.isRequest()) {
            node.multicastService.send(joinInfo.copy(false,node.address,node.getClusterImpl().getMembers().size()));
          }
        }
 else {
          if (!node.joined() && !joinInfo.isRequest()) {
            if (node.masterAddress == null) {
              final String masterHost=joinInfo.address.getHost();
              if (trustedInterfaces.isEmpty() || AddressPicker.matchAddress(masterHost,trustedInterfaces)) {
                node.masterAddress=new Address(joinInfo.address);
              }
            }
          }
 else           if (joinInfo.isRequest()) {
            Joiner joiner=node.getJoiner();
            if (joiner instanceof MulticastJoiner) {
              MulticastJoiner mjoiner=(MulticastJoiner)joiner;
              mjoiner.onReceivedJoinInfo(joinInfo);
            }
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
public void onMessage(Object msg){
  if (msg != null && msg instanceof JoinInfo) {
    JoinInfo joinInfo=(JoinInfo)msg;
    if (node.address != null && !node.address.equals(joinInfo.address)) {
      boolean validJoinRequest;
      try {
        validJoinRequest=node.validateJoinRequest(joinInfo);
      }
 catch (      Exception e) {
        validJoinRequest=false;
      }
      if (validJoinRequest) {
        if (node.isMaster() && node.isActive() && node.joined()) {
          if (joinInfo.isRequest()) {
            node.multicastService.send(joinInfo.copy(false,node.address,node.getClusterImpl().getMembers().size()));
          }
        }
 else {
          if (!node.joined() && !joinInfo.isRequest()) {
            if (node.masterAddress == null) {
              final String masterHost=joinInfo.address.getHost();
              if (trustedInterfaces.isEmpty() || AddressUtil.matchAnyInterface(masterHost,trustedInterfaces)) {
                node.masterAddress=new Address(joinInfo.address);
              }
            }
          }
 else           if (joinInfo.isRequest()) {
            Joiner joiner=node.getJoiner();
            if (joiner instanceof MulticastJoiner) {
              MulticastJoiner mjoiner=(MulticastJoiner)joiner;
              mjoiner.onReceivedJoinInfo(joinInfo);
            }
          }
        }
      }
    }
  }
}
Program: 49583
Project: 49583
Buggy source:
private Address getAddressFor(String host){
  try {
    final AddressHolder addressHolder=AddressUtil.getAddressHolder(host,config.getPort());
    if (AddressUtil.isIpAddress(addressHolder.address)) {
      return new Address(addressHolder.address,addressHolder.port);
    }
 else {
      final InetAddress[] allAddresses=InetAddress.getAllByName(addressHolder.address);
      final Interfaces interfaces=config.getNetworkConfig().getInterfaces();
      for (      final InetAddress inetAddress : allAddresses) {
        boolean matchingAddress=true;
        if (interfaces.isEnabled()) {
          matchingAddress=AddressPicker.matchAddress(inetAddress.getHostAddress(),interfaces.getInterfaces());
        }
        if (matchingAddress) {
          return new Address(inetAddress,addressHolder.port);
        }
      }
    }
  }
 catch (  final Exception e) {
    logger.log(Level.WARNING,e.getMessage(),e);
  }
  return null;
}

Fixed version (ground truth):
private Address getAddressFor(String host){
  try {
    final AddressHolder addressHolder=AddressUtil.getAddressHolder(host,config.getPort());
    if (AddressUtil.isIpAddress(addressHolder.address)) {
      return new Address(addressHolder.address,addressHolder.port);
    }
 else {
      final InetAddress[] allAddresses=InetAddress.getAllByName(addressHolder.address);
      final Interfaces interfaces=config.getNetworkConfig().getInterfaces();
      for (      final InetAddress inetAddress : allAddresses) {
        boolean matchingAddress=true;
        if (interfaces.isEnabled()) {
          matchingAddress=AddressUtil.matchAnyInterface(inetAddress.getHostAddress(),interfaces.getInterfaces());
        }
        if (matchingAddress) {
          return new Address(inetAddress,addressHolder.port);
        }
      }
    }
  }
 catch (  final Exception e) {
    logger.log(Level.WARNING,e.getMessage(),e);
  }
  return null;
}
Program: 49585
Project: 49585
Buggy source:
public Collection<MemberGroup> createMemberGroups(Collection<MemberImpl> members){
  final Map<Integer,MemberGroup> memberGroups=new HashMap<Integer,MemberGroup>();
  for (  MemberImpl member : members) {
    if (member.isLiteMember()) {
      continue;
    }
    for (    Entry<Integer,MemberGroupConfig> groupConfigEntry : memberGroupConfigMap.entrySet()) {
      if (AddressPicker.matchAddress(member.getAddress().getHost(),groupConfigEntry.getValue().getInterfaces())) {
        MemberGroup group=memberGroups.get(groupConfigEntry.getKey());
        if (group == null) {
          group=new DefaultMemberGroup();
          memberGroups.put(groupConfigEntry.getKey(),group);
        }
        group.addMember(member);
        break;
      }
    }
  }
  return memberGroups.values();
}

Fixed version (ground truth):
public Collection<MemberGroup> createMemberGroups(Collection<MemberImpl> members){
  final Map<Integer,MemberGroup> memberGroups=new HashMap<Integer,MemberGroup>();
  for (  MemberImpl member : members) {
    if (member.isLiteMember()) {
      continue;
    }
    for (    Entry<Integer,MemberGroupConfig> groupConfigEntry : memberGroupConfigMap.entrySet()) {
      if (AddressUtil.matchAnyInterface(member.getAddress().getHost(),groupConfigEntry.getValue().getInterfaces())) {
        MemberGroup group=memberGroups.get(groupConfigEntry.getKey());
        if (group == null) {
          group=new DefaultMemberGroup();
          memberGroups.put(groupConfigEntry.getKey(),group);
        }
        group.addMember(member);
        break;
      }
    }
  }
  return memberGroups.values();
}
Program: 49586
Project: 49586
Buggy source:
private InetAddress pickInetAddress(final Collection<String> interfaces) throws SocketException {
  final Enumeration<NetworkInterface> networkInterfaces=NetworkInterface.getNetworkInterfaces();
  final boolean preferIPv4Stack=preferIPv4Stack();
  while (networkInterfaces.hasMoreElements()) {
    final NetworkInterface ni=networkInterfaces.nextElement();
    final Enumeration<InetAddress> e=ni.getInetAddresses();
    while (e.hasMoreElements()) {
      final InetAddress inetAddress=e.nextElement();
      if (preferIPv4Stack && inetAddress instanceof Inet6Address) {
        continue;
      }
      if (interfaces != null && !interfaces.isEmpty()) {
        final String address=inetAddress.getHostAddress();
        if (matchAddress(address,interfaces)) {
          return inetAddress;
        }
      }
 else       if (!inetAddress.isLoopbackAddress()) {
        return inetAddress;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
private InetAddress pickInetAddress(final Collection<String> interfaces) throws SocketException {
  final Enumeration<NetworkInterface> networkInterfaces=NetworkInterface.getNetworkInterfaces();
  final boolean preferIPv4Stack=preferIPv4Stack();
  while (networkInterfaces.hasMoreElements()) {
    final NetworkInterface ni=networkInterfaces.nextElement();
    final Enumeration<InetAddress> e=ni.getInetAddresses();
    while (e.hasMoreElements()) {
      final InetAddress inetAddress=e.nextElement();
      if (preferIPv4Stack && inetAddress instanceof Inet6Address) {
        continue;
      }
      if (interfaces != null && !interfaces.isEmpty()) {
        final String address=inetAddress.getHostAddress();
        if (AddressUtil.matchAnyInterface(address,interfaces)) {
          return inetAddress;
        }
      }
 else       if (!inetAddress.isLoopbackAddress()) {
        return inetAddress;
      }
    }
  }
  return null;
}
Program: 49588
Project: 49588
Buggy source:
public AddressPicker(Node node,ServerSocketChannel serverSocketChannel){
  this.node=node;
  this.logger=Logger.getLogger(AddressPicker.class.getName());
  this.serverSocketChannel=serverSocketChannel;
}

Fixed version (ground truth):
public AddressPicker(Node node){
  this.node=node;
  this.logger=Logger.getLogger(AddressPicker.class.getName());
}
Program: 49590
Project: 49590
Buggy source:
public void onMessage(Object msg){
  if (msg != null && msg instanceof JoinInfo) {
    JoinInfo joinInfo=(JoinInfo)msg;
    if (node.address != null && !node.address.equals(joinInfo.address)) {
      boolean validJoinRequest;
      try {
        validJoinRequest=node.validateJoinRequest(joinInfo);
      }
 catch (      Exception e) {
        validJoinRequest=false;
      }
      if (validJoinRequest) {
        if (node.isMaster() && node.isActive() && node.joined()) {
          if (joinInfo.isRequest()) {
            node.multicastService.send(joinInfo.copy(false,node.address,node.getClusterImpl().getMembers().size()));
          }
        }
 else {
          if (!node.joined() && !joinInfo.isRequest()) {
            if (node.masterAddress == null) {
              final String masterHost=joinInfo.address.getHost();
              if (trustedInterfaces.isEmpty() || AddressPicker.matchAddress(masterHost,trustedInterfaces)) {
                node.masterAddress=new Address(joinInfo.address);
              }
            }
          }
 else           if (joinInfo.isRequest()) {
            Joiner joiner=node.getJoiner();
            if (joiner instanceof MulticastJoiner) {
              MulticastJoiner mjoiner=(MulticastJoiner)joiner;
              mjoiner.onReceivedJoinInfo(joinInfo);
            }
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
public void onMessage(Object msg){
  if (msg != null && msg instanceof JoinInfo) {
    JoinInfo joinInfo=(JoinInfo)msg;
    if (node.address != null && !node.address.equals(joinInfo.address)) {
      boolean validJoinRequest;
      try {
        validJoinRequest=node.validateJoinRequest(joinInfo);
      }
 catch (      Exception e) {
        validJoinRequest=false;
      }
      if (validJoinRequest) {
        if (node.isMaster() && node.isActive() && node.joined()) {
          if (joinInfo.isRequest()) {
            node.multicastService.send(joinInfo.copy(false,node.address,node.getClusterImpl().getMembers().size()));
          }
        }
 else {
          if (!node.joined() && !joinInfo.isRequest()) {
            if (node.masterAddress == null) {
              final String masterHost=joinInfo.address.getHost();
              if (trustedInterfaces.isEmpty() || AddressUtil.matchAnyInterface(masterHost,trustedInterfaces)) {
                node.masterAddress=new Address(joinInfo.address);
              }
            }
          }
 else           if (joinInfo.isRequest()) {
            Joiner joiner=node.getJoiner();
            if (joiner instanceof MulticastJoiner) {
              MulticastJoiner mjoiner=(MulticastJoiner)joiner;
              mjoiner.onReceivedJoinInfo(joinInfo);
            }
          }
        }
      }
    }
  }
}
Program: 49591
Project: 49591
Buggy source:
private Address getAddressFor(String host){
  try {
    final AddressHolder addressHolder=AddressUtil.getAddressHolder(host,config.getPort());
    if (AddressUtil.isIpAddress(addressHolder.address)) {
      return new Address(addressHolder.address,addressHolder.port);
    }
 else {
      final InetAddress[] allAddresses=InetAddress.getAllByName(addressHolder.address);
      final Interfaces interfaces=config.getNetworkConfig().getInterfaces();
      for (      final InetAddress inetAddress : allAddresses) {
        boolean matchingAddress=true;
        if (interfaces.isEnabled()) {
          matchingAddress=AddressPicker.matchAddress(inetAddress.getHostAddress(),interfaces.getInterfaces());
        }
        if (matchingAddress) {
          return new Address(inetAddress,addressHolder.port);
        }
      }
    }
  }
 catch (  final Exception e) {
    logger.log(Level.WARNING,e.getMessage(),e);
  }
  return null;
}

Fixed version (ground truth):
private Address getAddressFor(String host){
  try {
    final AddressHolder addressHolder=AddressUtil.getAddressHolder(host,config.getPort());
    if (AddressUtil.isIpAddress(addressHolder.address)) {
      return new Address(addressHolder.address,addressHolder.port);
    }
 else {
      final InetAddress[] allAddresses=InetAddress.getAllByName(addressHolder.address);
      final Interfaces interfaces=config.getNetworkConfig().getInterfaces();
      for (      final InetAddress inetAddress : allAddresses) {
        boolean matchingAddress=true;
        if (interfaces.isEnabled()) {
          matchingAddress=AddressUtil.matchAnyInterface(inetAddress.getHostAddress(),interfaces.getInterfaces());
        }
        if (matchingAddress) {
          return new Address(inetAddress,addressHolder.port);
        }
      }
    }
  }
 catch (  final Exception e) {
    logger.log(Level.WARNING,e.getMessage(),e);
  }
  return null;
}
Program: 49593
Project: 49593
Buggy source:
public Collection<MemberGroup> createMemberGroups(Collection<MemberImpl> members){
  final Map<Integer,MemberGroup> memberGroups=new HashMap<Integer,MemberGroup>();
  for (  MemberImpl member : members) {
    if (member.isLiteMember()) {
      continue;
    }
    for (    Entry<Integer,MemberGroupConfig> groupConfigEntry : memberGroupConfigMap.entrySet()) {
      if (AddressPicker.matchAddress(member.getAddress().getHost(),groupConfigEntry.getValue().getInterfaces())) {
        MemberGroup group=memberGroups.get(groupConfigEntry.getKey());
        if (group == null) {
          group=new DefaultMemberGroup();
          memberGroups.put(groupConfigEntry.getKey(),group);
        }
        group.addMember(member);
        break;
      }
    }
  }
  return memberGroups.values();
}

Fixed version (ground truth):
public Collection<MemberGroup> createMemberGroups(Collection<MemberImpl> members){
  final Map<Integer,MemberGroup> memberGroups=new HashMap<Integer,MemberGroup>();
  for (  MemberImpl member : members) {
    if (member.isLiteMember()) {
      continue;
    }
    for (    Entry<Integer,MemberGroupConfig> groupConfigEntry : memberGroupConfigMap.entrySet()) {
      if (AddressUtil.matchAnyInterface(member.getAddress().getHost(),groupConfigEntry.getValue().getInterfaces())) {
        MemberGroup group=memberGroups.get(groupConfigEntry.getKey());
        if (group == null) {
          group=new DefaultMemberGroup();
          memberGroups.put(groupConfigEntry.getKey(),group);
        }
        group.addMember(member);
        break;
      }
    }
  }
  return memberGroups.values();
}
Program: 49595
Project: 49595
Buggy source:
private ManagedList parseListeners(Node node,String listenerBeanName,Class listenerConfigClass){
  ManagedList listeners=new ManagedList();
  final String implementationAttr="String_Node_Str";
  for (  Node listenerNode : new IterableNodeList(node.getChildNodes(),Node.ELEMENT_NODE)) {
    final BeanDefinitionBuilder listenerConfBuilder=createBeanBuilder(listenerConfigClass);
    fillAttributeValues(listenerNode,listenerConfBuilder,implementationAttr);
    Node implementationNode=null;
    if ((implementationNode=listenerNode.getAttributes().getNamedItem(implementationAttr)) != null) {
      listenerConfBuilder.addPropertyReference(implementationAttr,getValue(implementationNode));
    }
    listeners.add(listenerConfBuilder.getBeanDefinition());
  }
  return listeners;
}

Fixed version (ground truth):
private ManagedList parseListeners(Node node,Class listenerConfigClass){
  ManagedList listeners=new ManagedList();
  final String implementationAttr="String_Node_Str";
  for (  Node listenerNode : new IterableNodeList(node.getChildNodes(),Node.ELEMENT_NODE)) {
    final BeanDefinitionBuilder listenerConfBuilder=createBeanBuilder(listenerConfigClass);
    fillAttributeValues(listenerNode,listenerConfBuilder,implementationAttr);
    Node implementationNode=null;
    if ((implementationNode=listenerNode.getAttributes().getNamedItem(implementationAttr)) != null) {
      listenerConfBuilder.addPropertyReference(implementationAttr,getValue(implementationNode));
    }
    listeners.add(listenerConfBuilder.getBeanDefinition());
  }
  return listeners;
}
Program: 49597
Project: 49597
Buggy source:
public void handleQueue(Node node){
  BeanDefinitionBuilder queueConfigBuilder=createBeanBuilder(QueueConfig.class);
  final Node attName=node.getAttributes().getNamedItem("String_Node_Str");
  final String name=getValue(attName);
  fillAttributeValues(node,queueConfigBuilder);
  for (  org.w3c.dom.Node childNode : new IterableNodeList(node.getChildNodes(),Node.ELEMENT_NODE)) {
    if ("String_Node_Str".equals(cleanNodeName(childNode))) {
      ManagedList listeners=parseListeners(childNode,"String_Node_Str",ItemListenerConfig.class);
      queueConfigBuilder.addPropertyValue("String_Node_Str",listeners);
    }
  }
  queueManagedMap.put(name,queueConfigBuilder.getBeanDefinition());
}

Fixed version (ground truth):
public void handleQueue(Node node){
  BeanDefinitionBuilder queueConfigBuilder=createBeanBuilder(QueueConfig.class);
  final Node attName=node.getAttributes().getNamedItem("String_Node_Str");
  final String name=getValue(attName);
  fillAttributeValues(node,queueConfigBuilder);
  for (  org.w3c.dom.Node childNode : new IterableNodeList(node.getChildNodes(),Node.ELEMENT_NODE)) {
    if ("String_Node_Str".equals(cleanNodeName(childNode))) {
      ManagedList listeners=parseListeners(childNode,ItemListenerConfig.class);
      queueConfigBuilder.addPropertyValue("String_Node_Str",listeners);
    }
  }
  queueManagedMap.put(name,queueConfigBuilder.getBeanDefinition());
}
Program: 49598
Project: 49598
Buggy source:
public void handleTopic(Node node){
  BeanDefinitionBuilder topicConfigBuilder=createBeanBuilder(TopicConfig.class);
  final Node attName=node.getAttributes().getNamedItem("String_Node_Str");
  final String name=getValue(attName);
  fillAttributeValues(node,topicConfigBuilder);
  for (  org.w3c.dom.Node childNode : new IterableNodeList(node.getChildNodes(),Node.ELEMENT_NODE)) {
    if ("String_Node_Str".equals(cleanNodeName(childNode))) {
      ManagedList listeners=parseListeners(childNode,"String_Node_Str",ListenerConfig.class);
      topicConfigBuilder.addPropertyValue("String_Node_Str",listeners);
    }
  }
  topicManagedMap.put(name,topicConfigBuilder.getBeanDefinition());
}

Fixed version (ground truth):
public void handleTopic(Node node){
  BeanDefinitionBuilder topicConfigBuilder=createBeanBuilder(TopicConfig.class);
  final Node attName=node.getAttributes().getNamedItem("String_Node_Str");
  final String name=getValue(attName);
  fillAttributeValues(node,topicConfigBuilder);
  for (  org.w3c.dom.Node childNode : new IterableNodeList(node.getChildNodes(),Node.ELEMENT_NODE)) {
    if ("String_Node_Str".equals(cleanNodeName(childNode))) {
      ManagedList listeners=parseListeners(childNode,ListenerConfig.class);
      topicConfigBuilder.addPropertyValue("String_Node_Str",listeners);
    }
  }
  topicManagedMap.put(name,topicConfigBuilder.getBeanDefinition());
}
Program: 49599
Project: 49599
Buggy source:
public void handleMultiMap(Node node){
  BeanDefinitionBuilder multiMapConfigBuilder=createBeanBuilder(MultiMapConfig.class);
  final Node attName=node.getAttributes().getNamedItem("String_Node_Str");
  final String name=getValue(attName);
  fillAttributeValues(node,multiMapConfigBuilder);
  for (  org.w3c.dom.Node childNode : new IterableNodeList(node.getChildNodes(),Node.ELEMENT_NODE)) {
    if ("String_Node_Str".equals(cleanNodeName(childNode))) {
      ManagedList listeners=parseListeners(childNode,"String_Node_Str",EntryListenerConfig.class);
      multiMapConfigBuilder.addPropertyValue("String_Node_Str",listeners);
    }
  }
  multiMapManagedMap.put(name,multiMapConfigBuilder.getBeanDefinition());
}

Fixed version (ground truth):
public void handleMultiMap(Node node){
  BeanDefinitionBuilder multiMapConfigBuilder=createBeanBuilder(MultiMapConfig.class);
  final Node attName=node.getAttributes().getNamedItem("String_Node_Str");
  final String name=getValue(attName);
  fillAttributeValues(node,multiMapConfigBuilder);
  for (  org.w3c.dom.Node childNode : new IterableNodeList(node.getChildNodes(),Node.ELEMENT_NODE)) {
    if ("String_Node_Str".equals(cleanNodeName(childNode))) {
      ManagedList listeners=parseListeners(childNode,EntryListenerConfig.class);
      multiMapConfigBuilder.addPropertyValue("String_Node_Str",listeners);
    }
  }
  multiMapManagedMap.put(name,multiMapConfigBuilder.getBeanDefinition());
}
Program: 49601
Project: 49601
Buggy source:
private void initializeListeners(){
  final TopicConfig topicConfig=node.config.findMatchingTopicConfig(name);
  for (  ListenerConfig lc : topicConfig.getMessageListenerConfigs()) {
    try {
      node.listenerManager.createAndAddListenerItem(name,lc,InstanceType.TOPIC);
      for (      MemberImpl member : node.clusterManager.getMembers()) {
        addListener(member.getAddress(),true);
      }
    }
 catch (    Exception e) {
      logger.log(Level.SEVERE,e.getMessage(),e);
    }
  }
}

Fixed version (ground truth):
private void initializeListeners(){
  for (  ListenerConfig lc : topicConfig.getMessageListenerConfigs()) {
    try {
      node.listenerManager.createAndAddListenerItem(name,lc,InstanceType.TOPIC);
      for (      MemberImpl member : node.clusterManager.getMembers()) {
        addListener(member.getAddress(),true);
      }
    }
 catch (    Exception e) {
      logger.log(Level.SEVERE,e.getMessage(),e);
    }
  }
}
Program: 49602
Project: 49602
Buggy source:
public TopicInstance(final TopicManager topicManager,final String name){
  if (topicManager == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (name == null) {
    throw new NullPointerException("String_Node_Str");
  }
  this.topicManager=topicManager;
  this.name=name;
  initializeListeners();
}

Fixed version (ground truth):
public TopicInstance(final TopicManager topicManager,final String name){
  if (topicManager == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (name == null) {
    throw new NullPointerException("String_Node_Str");
  }
  this.topicManager=topicManager;
  this.name=name;
  String shortName=name.substring(Prefix.TOPIC.length());
  topicConfig=node.config.findMatchingTopicConfig(shortName);
  initializeListeners();
}
Program: 49603
Project: 49603
Buggy source:
public void run(){
  assertFalse(lock.tryLock());
  unlockLatch.countDown();
  try {
    assertTrue(lock.tryLock(10,TimeUnit.SECONDS));
  }
 catch (  InterruptedException e) {
    throw new RuntimeException(e);
  }
  latch.countDown();
}

Fixed version (ground truth):
public void run(){
  assertTrue(lock.isLocked());
  try {
    while (lock.isLocked()) {
      Thread.sleep(100);
    }
  }
 catch (  InterruptedException e) {
    throw new RuntimeException(e);
  }
  latch.countDown();
}
Program: 49604
Project: 49604
Buggy source:
public void run(){
  if (!map.tryLock("String_Node_Str",100,TimeUnit.MILLISECONDS)) {
    latch.countDown();
  }
  if (!map.tryLock("String_Node_Str")) {
    latch.countDown();
  }
  if (map.tryLock("String_Node_Str")) {
    latch.countDown();
  }
}

Fixed version (ground truth):
public void run(){
  assertTrue(map.isLocked("String_Node_Str"));
  try {
    while (map.isLocked("String_Node_Str")) {
      Thread.sleep(100);
    }
  }
 catch (  InterruptedException e) {
    throw new RuntimeException(e);
  }
  latch.countDown();
}
Program: 49609
Project: 49609
Buggy source:
public void assertAwait(int seconds) throws Exception {
  assertTrue(latchStore.await(seconds,TimeUnit.SECONDS));
  assertTrue(latchStoreAll.await(seconds,TimeUnit.SECONDS));
  assertTrue(latchDelete.await(seconds,TimeUnit.SECONDS));
  assertTrue(latchDeleteAll.await(seconds,TimeUnit.SECONDS));
  assertTrue(latchLoad.await(seconds,TimeUnit.SECONDS));
  assertTrue(latchLoadAll.await(seconds,TimeUnit.SECONDS));
}

Fixed version (ground truth):
public void assertAwait(int seconds) throws InterruptedException {
  assertTrue("String_Node_Str" + latchStore.getCount(),latchStore.await(seconds,TimeUnit.SECONDS));
  assertTrue("String_Node_Str" + latchStoreAll.getCount(),latchStoreAll.await(seconds,TimeUnit.SECONDS));
  assertTrue("String_Node_Str" + latchDelete.getCount(),latchDelete.await(seconds,TimeUnit.SECONDS));
  assertTrue("String_Node_Str" + latchDeleteAll.getCount(),latchDeleteAll.await(seconds,TimeUnit.SECONDS));
  assertTrue("String_Node_Str" + latchLoad.getCount(),latchLoad.await(seconds,TimeUnit.SECONDS));
  assertTrue("String_Node_Str" + latchLoadAll.getCount(),latchLoadAll.await(seconds,TimeUnit.SECONDS));
}
Program: 49611
Project: 49611
Buggy source:
public void assertAwait(int seconds) throws Exception {
  assertTrue(latchStore.await(seconds,TimeUnit.SECONDS));
  assertTrue(latchStoreAll.await(seconds,TimeUnit.SECONDS));
  assertTrue(latchDelete.await(seconds,TimeUnit.SECONDS));
  assertTrue(latchDeleteAll.await(seconds,TimeUnit.SECONDS));
  assertTrue(latchLoad.await(seconds,TimeUnit.SECONDS));
  assertTrue(latchLoadAll.await(seconds,TimeUnit.SECONDS));
}

Fixed version (ground truth):
public void assertAwait(int seconds) throws InterruptedException {
  assertTrue("String_Node_Str" + latchStore.getCount(),latchStore.await(seconds,TimeUnit.SECONDS));
  assertTrue("String_Node_Str" + latchStoreAll.getCount(),latchStoreAll.await(seconds,TimeUnit.SECONDS));
  assertTrue("String_Node_Str" + latchDelete.getCount(),latchDelete.await(seconds,TimeUnit.SECONDS));
  assertTrue("String_Node_Str" + latchDeleteAll.getCount(),latchDeleteAll.await(seconds,TimeUnit.SECONDS));
  assertTrue("String_Node_Str" + latchLoad.getCount(),latchLoad.await(seconds,TimeUnit.SECONDS));
  assertTrue("String_Node_Str" + latchLoadAll.getCount(),latchLoadAll.await(seconds,TimeUnit.SECONDS));
}
Program: 49612
Project: 49612
Buggy source:
public void syncForDead(MemberImpl deadMember){
  Address deadAddress=deadMember.getAddress();
  Address thisAddress=concurrentMapManager.getThisAddress();
  if (deadAddress == null || deadAddress.equals(thisAddress)) {
    return;
  }
  if (!hasStorageMember()) {
    reset();
  }
  concurrentMapManager.partitionServiceImpl.reset();
  checkMigratingPartitionForDead(deadAddress);
  int[] indexesOfDead=new int[partitions.length];
  for (  PartitionInfo partition : partitions) {
    indexesOfDead[partition.getPartitionId()]=partition.getReplicaIndexOf(deadAddress);
  }
  if (!deadMember.isLiteMember()) {
    clearTaskQueues();
    for (    PartitionInfo partition : partitions) {
      while (partition.onDeadAddress(deadAddress))       ;
    }
  }
  fixCMapsForDead(deadAddress,indexesOfDead);
  fixReplicasAndPartitionsForDead(deadMember,indexesOfDead);
}

Fixed version (ground truth):
public void syncForDead(MemberImpl deadMember){
  Address deadAddress=deadMember.getAddress();
  Address thisAddress=concurrentMapManager.getThisAddress();
  if (deadAddress == null || deadAddress.equals(thisAddress)) {
    return;
  }
  if (!hasStorageMember()) {
    reset();
  }
  final boolean migrationStatus=migrationActive.getAndSet(false);
  concurrentMapManager.partitionServiceImpl.reset();
  checkMigratingPartitionForDead(deadAddress);
  int[] indexesOfDead=new int[partitions.length];
  for (  PartitionInfo partition : partitions) {
    indexesOfDead[partition.getPartitionId()]=partition.getReplicaIndexOf(deadAddress);
  }
  if (!deadMember.isLiteMember()) {
    clearTaskQueues();
    for (    PartitionInfo partition : partitions) {
      while (partition.onDeadAddress(deadAddress))       ;
    }
  }
  fixCMapsForDead(deadAddress,indexesOfDead);
  fixReplicasAndPartitionsForDead(deadMember,indexesOfDead);
  final Node node=concurrentMapManager.node;
  final long waitBeforeMigrationActivate=node.groupProperties.CONNECTION_MONITOR_INTERVAL.getLong() * node.groupProperties.CONNECTION_MONITOR_MAX_FAULTS.getInteger() * 10;
  node.executorManager.getScheduledExecutorService().schedule(new Runnable(){
    public void run(){
      migrationActive.compareAndSet(false,migrationStatus);
    }
  }
,waitBeforeMigrationActivate,TimeUnit.MILLISECONDS);
}
Program: 49613
Project: 49613
Buggy source:
private void sendClusterRuntimeState(){
  if (!concurrentMapManager.isMaster() || !concurrentMapManager.isActive() || !concurrentMapManager.node.joined()) {
    return;
  }
  if (!initialized)   return;
  long clusterTime=concurrentMapManager.node.getClusterImpl().getClusterTime();
  List<MemberImpl> lsMembers=concurrentMapManager.lsMembers;
  ArrayList<MemberInfo> memberInfos=new ArrayList<MemberInfo>(lsMembers.size());
  for (  MemberImpl member : lsMembers) {
    memberInfos.add(new MemberInfo(member.getAddress(),member.getNodeType(),member.getUuid()));
  }
  ClusterRuntimeState crs=new ClusterRuntimeState(memberInfos,partitions,clusterTime,version.get());
  concurrentMapManager.sendProcessableToAll(crs,false);
}

Fixed version (ground truth):
private void sendClusterRuntimeState(){
  if (!concurrentMapManager.isMaster() || !concurrentMapManager.isActive() || !concurrentMapManager.node.joined()) {
    return;
  }
  if (!migrationActive.get()) {
    return;
  }
  if (!initialized)   return;
  long clusterTime=concurrentMapManager.node.getClusterImpl().getClusterTime();
  List<MemberImpl> lsMembers=concurrentMapManager.lsMembers;
  ArrayList<MemberInfo> memberInfos=new ArrayList<MemberInfo>(lsMembers.size());
  for (  MemberImpl member : lsMembers) {
    memberInfos.add(new MemberInfo(member.getAddress(),member.getNodeType(),member.getUuid()));
  }
  ClusterRuntimeState crs=new ClusterRuntimeState(memberInfos,partitions,clusterTime,version.get());
  concurrentMapManager.sendProcessableToAll(crs,false);
}
Program: 49614
Project: 49614
Buggy source:
public boolean inactivateMigration(){
  migrationActive.getAndSet(false);
  while (migratingPartition != null) {
    try {
      Thread.sleep(250);
    }
 catch (    InterruptedException e) {
      return true;
    }
  }
  return true;
}

Fixed version (ground truth):
public boolean inactivateMigration(){
  migrationActive.compareAndSet(true,false);
  while (migratingPartition != null) {
    try {
      Thread.sleep(250);
    }
 catch (    InterruptedException e) {
      return true;
    }
  }
  return true;
}
Program: 49615
Project: 49615
Buggy source:
public boolean activateMigration(){
  return migrationActive.getAndSet(true);
}

Fixed version (ground truth):
public boolean activateMigration(){
  return migrationActive.compareAndSet(false,true);
}
Program: 49617
Project: 49617
Buggy source:
public void setAddresses(List<String> addresses){
  addressList.clear();
  for (  String address : addresses) {
    addressList.addAll(parse(address));
  }
}

Fixed version (ground truth):
public void setAddresses(List<String> addresses){
  addressList.clear();
  for (  String address : addresses) {
    addressList.addAll(AddressHelper.getSocketAddresses(address));
  }
}
Program: 49618
Project: 49618
Buggy source:
public ClientConfig addAddress(String... addresses){
  for (  String address : addresses) {
    this.addressList.addAll(parse(address));
  }
  return this;
}

Fixed version (ground truth):
public ClientConfig addAddress(String... addresses){
  for (  String address : addresses) {
    this.addressList.addAll(AddressHelper.getSocketAddresses(address));
  }
  return this;
}
Program: 49619
Project: 49619
Buggy source:
public synchronized void memberRemoved(MembershipEvent membershipEvent){
  this.clusterMembers.remove(membershipEvent.getMember().getInetSocketAddress());
}

Fixed version (ground truth):
public void memberRemoved(MembershipEvent membershipEvent){
  InetSocketAddress address=membershipEvent.getMember().getInetSocketAddress();
  Collection<InetSocketAddress> addresses=AddressHelper.getPossibleSocketAddresses(address.getAddress(),address.getPort());
  clusterMembers.removeAll(addresses);
}
Program: 49620
Project: 49620
Buggy source:
public synchronized void updateMembers(){
  Set<Member> members=client.getCluster().getMembers();
  clusterMembers.clear();
  for (  Member member : members) {
    clusterMembers.add(member.getInetSocketAddress());
  }
}

Fixed version (ground truth):
public void updateMembers(){
  Set<Member> members=client.getCluster().getMembers();
  clusterMembers.clear();
  for (  Member member : members) {
    InetSocketAddress address=member.getInetSocketAddress();
    Collection<InetSocketAddress> addresses=AddressHelper.getPossibleSocketAddresses(address.getAddress(),address.getPort());
    clusterMembers.addAll(addresses);
  }
}
Program: 49621
Project: 49621
Buggy source:
public synchronized void memberAdded(MembershipEvent membershipEvent){
  if (!this.clusterMembers.contains(membershipEvent.getMember().getInetSocketAddress())) {
    this.clusterMembers.add(membershipEvent.getMember().getInetSocketAddress());
  }
}

Fixed version (ground truth):
public void memberAdded(MembershipEvent membershipEvent){
  InetSocketAddress address=membershipEvent.getMember().getInetSocketAddress();
  Collection<InetSocketAddress> addresses=AddressHelper.getPossibleSocketAddresses(address.getAddress(),address.getPort());
  clusterMembers.addAll(addresses);
}
Program: 49622
Project: 49622
Buggy source:
public void destroyConnection(final Connection connection){
  boolean lost=false;
synchronized (this) {
    if (currentConnection != null && connection != null && currentConnection.getVersion() == connection.getVersion()) {
      logger.log(Level.WARNING,"String_Node_Str" + currentConnection + "String_Node_Str");
      currentConnection=null;
      lost=true;
      try {
        connection.close();
      }
 catch (      IOException e) {
        logger.log(Level.FINEST,e.getMessage(),e);
      }
    }
  }
  if (lost) {
    lifecycleService.fireLifecycleEvent(CLIENT_CONNECTION_LOST);
  }
}

Fixed version (ground truth):
public void destroyConnection(final Connection connection){
  boolean lost=false;
synchronized (this) {
    if (currentConnection != null && connection != null && currentConnection.getVersion() == connection.getVersion()) {
      logger.log(Level.WARNING,"String_Node_Str" + currentConnection + "String_Node_Str");
      while (clusterMembers.remove(currentConnection.getAddress()))       ;
      currentConnection=null;
      lost=true;
      try {
        connection.close();
      }
 catch (      IOException e) {
        logger.log(Level.FINEST,e.getMessage(),e);
      }
    }
  }
  if (lost) {
    lifecycleService.fireLifecycleEvent(CLIENT_CONNECTION_LOST);
  }
}
Program: 49623
Project: 49623
Buggy source:
public void commit(){
  if (instanceType == Instance.InstanceType.QUEUE)   commitQueue();
 else   commitMap();
}

Fixed version (ground truth):
public void commit(){
  if (instanceType == Instance.InstanceType.QUEUE) {
    commitQueue();
  }
 else {
    commitMap();
  }
}
Program: 49624
Project: 49624
Buggy source:
public boolean containsValue(String name,Object value){
  for (  TransactionRecord transactionRecord : transactionRecords) {
    if (transactionRecord.name.equals(name)) {
      if (!transactionRecord.removed) {
        if (value.equals(toObject(transactionRecord.value)))         return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean containsValue(String name,Object value){
  for (  TransactionRecord transactionRecord : transactionRecords) {
    if (transactionRecord.name.equals(name)) {
      if (!transactionRecord.removed) {
        if (value.equals(toObject(transactionRecord.value))) {
          return true;
        }
      }
    }
  }
  return false;
}
Program: 49625
Project: 49625
Buggy source:
public Data get(String name,Object key){
  TransactionRecord rec=findTransactionRecord(name,key);
  if (rec == null)   return null;
  if (rec.removed)   return null;
  rec.lastAccess=System.currentTimeMillis();
  return rec.value;
}

Fixed version (ground truth):
public Data get(String name,Object key){
  TransactionRecord rec=findTransactionRecord(name,key);
  if (rec == null) {
    return null;
  }
  if (rec.removed) {
    return null;
  }
  rec.lastAccess=System.currentTimeMillis();
  return rec.value;
}
Program: 49626
Project: 49626
Buggy source:
public void rollback(){
  if (instanceType == Instance.InstanceType.QUEUE)   rollbackQueue();
 else   rollbackMap();
}

Fixed version (ground truth):
public void rollback(){
  if (instanceType == Instance.InstanceType.QUEUE) {
    rollbackQueue();
  }
 else {
    rollbackMap();
  }
}
Program: 49627
Project: 49627
Buggy source:
public void begin() throws IllegalStateException {
  if (status == TXN_STATUS_ACTIVE)   throw new IllegalStateException("String_Node_Str");
  status=TXN_STATUS_ACTIVE;
}

Fixed version (ground truth):
public void begin() throws IllegalStateException {
  if (status == TXN_STATUS_ACTIVE) {
    throw new IllegalStateException("String_Node_Str");
  }
  status=TXN_STATUS_ACTIVE;
}
Program: 49628
Project: 49628
Buggy source:
@Test public void issue770TestIMapTryPutUnderTransaction(){
  final HazelcastInstance hz=Hazelcast.getDefaultInstance();
  Transaction tx=hz.getTransaction();
  tx.begin();
  IMap<Object,Object> map=hz.getMap("String_Node_Str");
  Assert.assertTrue(map.tryPut("String_Node_Str","String_Node_Str",100,TimeUnit.MILLISECONDS));
  Assert.assertTrue(map.tryPut("String_Node_Str","String_Node_Str",100,TimeUnit.MILLISECONDS));
  tx.commit();
  Hazelcast.shutdownAll();
}

Fixed version (ground truth):
@Test public void issue770TestIMapTryPutUnderTransaction(){
  final HazelcastInstance hz=Hazelcast.getDefaultInstance();
  Transaction tx=hz.getTransaction();
  tx.begin();
  IMap<Object,Object> map=hz.getMap("String_Node_Str");
  Assert.assertTrue(map.tryPut("String_Node_Str","String_Node_Str",100,TimeUnit.MILLISECONDS));
  Assert.assertTrue(map.tryPut("String_Node_Str","String_Node_Str",100,TimeUnit.MILLISECONDS));
  tx.commit();
}
Program: 49629
Project: 49629
Buggy source:
@BeforeClass public static void init() throws Exception {
  Hazelcast.shutdownAll();
}

Fixed version (ground truth):
@AfterClass @BeforeClass public static void init() throws Exception {
  Hazelcast.shutdownAll();
}
Program: 49630
Project: 49630
Buggy source:
@Test public void issue581testRemoveInTwoTransactionOneShouldReturnNull() throws InterruptedException {
  final IMap m=Hazelcast.getMap("String_Node_Str");
  final AtomicReference<Object> t1Return=new AtomicReference<Object>();
  final AtomicReference<Object> t2Return=new AtomicReference<Object>();
  m.put("String_Node_Str","String_Node_Str");
  new Thread("String_Node_Str"){
    @Override public void run(){
      try {
        Transaction tx=Hazelcast.getTransaction();
        tx.begin();
        t1Return.set(m.remove("String_Node_Str"));
        Thread.sleep(1000);
        tx.commit();
      }
 catch (      InterruptedException ex) {
      }
    }
  }
.start();
  Thread t2=new Thread("String_Node_Str"){
    @Override public void run(){
      try {
        Transaction tx=Hazelcast.getTransaction();
        tx.begin();
        Thread.sleep(1000);
        t2Return.set(m.remove("String_Node_Str"));
        tx.commit();
      }
 catch (      InterruptedException ex) {
      }
    }
  }
;
  t2.start();
  t2.join();
  Assert.assertEquals("String_Node_Str",t1Return.get());
  Assert.assertNull("String_Node_Str",t2Return.get());
  Hazelcast.shutdownAll();
}

Fixed version (ground truth):
@Test public void issue581testRemoveInTwoTransactionOneShouldReturnNull() throws InterruptedException {
  final IMap m=Hazelcast.getMap("String_Node_Str");
  final AtomicReference<Object> t1Return=new AtomicReference<Object>();
  final AtomicReference<Object> t2Return=new AtomicReference<Object>();
  m.put("String_Node_Str","String_Node_Str");
  new Thread("String_Node_Str"){
    @Override public void run(){
      try {
        Transaction tx=Hazelcast.getTransaction();
        tx.begin();
        t1Return.set(m.remove("String_Node_Str"));
        Thread.sleep(1000);
        tx.commit();
      }
 catch (      InterruptedException ex) {
      }
    }
  }
.start();
  Thread t2=new Thread("String_Node_Str"){
    @Override public void run(){
      try {
        Transaction tx=Hazelcast.getTransaction();
        tx.begin();
        Thread.sleep(1000);
        t2Return.set(m.remove("String_Node_Str"));
        tx.commit();
      }
 catch (      InterruptedException ex) {
      }
    }
  }
;
  t2.start();
  t2.join();
  Assert.assertEquals("String_Node_Str",t1Return.get());
  Assert.assertNull("String_Node_Str",t2Return.get());
}
Program: 49631
Project: 49631
Buggy source:
public void setAddresses(List<String> addresses){
  addressList.clear();
  for (  String address : addresses) {
    addressList.addAll(parse(address));
  }
}

Fixed version (ground truth):
public void setAddresses(List<String> addresses){
  addressList.clear();
  for (  String address : addresses) {
    addressList.addAll(AddressHelper.getSocketAddresses(address));
  }
}
Program: 49632
Project: 49632
Buggy source:
public ClientConfig addAddress(String... addresses){
  for (  String address : addresses) {
    this.addressList.addAll(parse(address));
  }
  return this;
}

Fixed version (ground truth):
public ClientConfig addAddress(String... addresses){
  for (  String address : addresses) {
    this.addressList.addAll(AddressHelper.getSocketAddresses(address));
  }
  return this;
}
Program: 49633
Project: 49633
Buggy source:
public synchronized void memberRemoved(MembershipEvent membershipEvent){
  this.clusterMembers.remove(membershipEvent.getMember().getInetSocketAddress());
}

Fixed version (ground truth):
public void memberRemoved(MembershipEvent membershipEvent){
  InetSocketAddress address=membershipEvent.getMember().getInetSocketAddress();
  Collection<InetSocketAddress> addresses=AddressHelper.getPossibleSocketAddresses(address.getAddress(),address.getPort());
  clusterMembers.removeAll(addresses);
}
Program: 49634
Project: 49634
Buggy source:
public synchronized void updateMembers(){
  Set<Member> members=client.getCluster().getMembers();
  clusterMembers.clear();
  for (  Member member : members) {
    clusterMembers.add(member.getInetSocketAddress());
  }
}

Fixed version (ground truth):
public void updateMembers(){
  Set<Member> members=client.getCluster().getMembers();
  clusterMembers.clear();
  for (  Member member : members) {
    InetSocketAddress address=member.getInetSocketAddress();
    Collection<InetSocketAddress> addresses=AddressHelper.getPossibleSocketAddresses(address.getAddress(),address.getPort());
    clusterMembers.addAll(addresses);
  }
}
Program: 49635
Project: 49635
Buggy source:
public synchronized void memberAdded(MembershipEvent membershipEvent){
  if (!this.clusterMembers.contains(membershipEvent.getMember().getInetSocketAddress())) {
    this.clusterMembers.add(membershipEvent.getMember().getInetSocketAddress());
  }
}

Fixed version (ground truth):
public void memberAdded(MembershipEvent membershipEvent){
  InetSocketAddress address=membershipEvent.getMember().getInetSocketAddress();
  Collection<InetSocketAddress> addresses=AddressHelper.getPossibleSocketAddresses(address.getAddress(),address.getPort());
  clusterMembers.addAll(addresses);
}
Program: 49636
Project: 49636
Buggy source:
public void destroyConnection(final Connection connection){
  boolean lost=false;
synchronized (this) {
    if (currentConnection != null && connection != null && currentConnection.getVersion() == connection.getVersion()) {
      logger.log(Level.WARNING,"String_Node_Str" + currentConnection + "String_Node_Str");
      currentConnection=null;
      lost=true;
      try {
        connection.close();
      }
 catch (      IOException e) {
        logger.log(Level.FINEST,e.getMessage(),e);
      }
    }
  }
  if (lost) {
    lifecycleService.fireLifecycleEvent(CLIENT_CONNECTION_LOST);
  }
}

Fixed version (ground truth):
public void destroyConnection(final Connection connection){
  boolean lost=false;
synchronized (this) {
    if (currentConnection != null && connection != null && currentConnection.getVersion() == connection.getVersion()) {
      logger.log(Level.WARNING,"String_Node_Str" + currentConnection + "String_Node_Str");
      while (clusterMembers.remove(currentConnection.getAddress()))       ;
      currentConnection=null;
      lost=true;
      try {
        connection.close();
      }
 catch (      IOException e) {
        logger.log(Level.FINEST,e.getMessage(),e);
      }
    }
  }
  if (lost) {
    lifecycleService.fireLifecycleEvent(CLIENT_CONNECTION_LOST);
  }
}
Program: 49639
Project: 49639
Buggy source:
void markAsRemoved(Record record){
  if (record.isActive()) {
    record.markRemoved();
  }
  record.setValueData(null);
  record.setMultiValues(null);
  updateIndexes(record);
  markAsDirty(record);
}

Fixed version (ground truth):
void markAsRemoved(Record record){
  markAsEvicted(record);
  markAsDirty(record);
}
Program: 49640
Project: 49640
Buggy source:
void markAsRemoved(Record record){
  if (record.isActive()) {
    record.markRemoved();
  }
  record.setValueData(null);
  record.setMultiValues(null);
  updateIndexes(record);
  markAsDirty(record);
}

Fixed version (ground truth):
void markAsRemoved(Record record){
  markAsEvicted(record);
  markAsDirty(record);
}
Program: 49642
Project: 49642
Buggy source:
void putAndUnlock(String name,Object key,Object value){
  ThreadContext tc=ThreadContext.get();
  Data dataKey=toData(key);
  CMap cmap=getMap(name);
  LocalLock localLock=cmap.mapLocalLocks.get(dataKey);
  boolean shouldUnlock=localLock != null && localLock.getThreadId() == tc.getThreadId() && localLock.getCount() == 1;
  MPut mput=tc.getCallCache(node.factory).getMPut();
  if (shouldUnlock) {
    mput.txnalPut(CONCURRENT_MAP_PUT_AND_UNLOCK,name,key,value,-1,-1);
    cmap.mapLocalLocks.remove(dataKey);
  }
 else {
    mput.txnalPut(CONCURRENT_MAP_PUT,name,key,value,-1,-1);
    localLock.decrementAndGet();
  }
  mput.clearRequest();
}

Fixed version (ground truth):
void putAndUnlock(String name,Object key,Object value){
  ThreadContext tc=ThreadContext.get();
  Data dataKey=toData(key);
  CMap cmap=getMap(name);
  LocalLock localLock=cmap.mapLocalLocks.get(dataKey);
  boolean shouldUnlock=localLock != null && localLock.getThreadId() == tc.getThreadId() && localLock.getCount() == 1;
  MPut mput=tc.getCallCache(node.factory).getMPut();
  if (shouldUnlock) {
    mput.txnalPut(CONCURRENT_MAP_PUT_AND_UNLOCK,name,key,value,-1,-1);
    cmap.mapLocalLocks.remove(dataKey);
  }
 else {
    mput.txnalPut(CONCURRENT_MAP_PUT,name,key,value,-1,-1);
    if (localLock != null) {
      localLock.decrementAndGet();
    }
  }
  mput.clearRequest();
}
Program: 49643
Project: 49643
Buggy source:
public void run(){
  try {
    q.take();
    fail();
  }
 catch (  InterruptedException e) {
    latch.countDown();
  }
}

Fixed version (ground truth):
public void run(){
  latch.countDown();
  map.putIfAbsent("String_Node_Str","String_Node_Str");
  latch.countDown();
}