nus-yam/ex-repair huggingface dataset:
Program: 48439
Project: 48439
Buggy source:
public static void writeAttributeValue(Object value,ObjectDataOutput out) throws IOException {
  Class<?> type=value.getClass();
  if (type.equals(Boolean.class)) {
    out.writeByte(PRIMITIVE_TYPE_BOOLEAN);
    out.writeBoolean((Boolean)value);
  }
 else   if (type.equals(Byte.class)) {
    out.writeByte(PRIMITIVE_TYPE_BYTE);
    out.writeByte((Byte)value);
  }
 else   if (type.equals(Short.class)) {
    out.writeByte(PRIMITIVE_TYPE_SHORT);
    out.writeShort((Short)value);
  }
 else   if (type.equals(Integer.class)) {
    out.writeByte(PRIMITIVE_TYPE_INTEGER);
    out.writeInt((Integer)value);
  }
 else   if (type.equals(Long.class)) {
    out.writeByte(PRIMITIVE_TYPE_LONG);
    out.writeLong((Long)value);
  }
 else   if (type.equals(Float.class)) {
    out.writeByte(PRIMITIVE_TYPE_FLOAT);
    out.writeFloat((Float)value);
  }
 else   if (type.equals(Double.class)) {
    out.writeByte(PRIMITIVE_TYPE_DOUBLE);
    out.writeDouble((Double)value);
  }
 else   if (type.equals(String.class)) {
    out.writeByte(PRIMITIVE_TYPE_UTF);
    out.writeUTF((String)value);
  }
}

Fixed version (ground truth):
public static void writeAttributeValue(Object value,ObjectDataOutput out) throws IOException {
  Class<?> type=value.getClass();
  if (type.equals(Boolean.class)) {
    out.writeByte(PRIMITIVE_TYPE_BOOLEAN);
    out.writeBoolean((Boolean)value);
  }
 else   if (type.equals(Byte.class)) {
    out.writeByte(PRIMITIVE_TYPE_BYTE);
    out.writeByte((Byte)value);
  }
 else   if (type.equals(Short.class)) {
    out.writeByte(PRIMITIVE_TYPE_SHORT);
    out.writeShort((Short)value);
  }
 else   if (type.equals(Integer.class)) {
    out.writeByte(PRIMITIVE_TYPE_INTEGER);
    out.writeInt((Integer)value);
  }
 else   if (type.equals(Long.class)) {
    out.writeByte(PRIMITIVE_TYPE_LONG);
    out.writeLong((Long)value);
  }
 else   if (type.equals(Float.class)) {
    out.writeByte(PRIMITIVE_TYPE_FLOAT);
    out.writeFloat((Float)value);
  }
 else   if (type.equals(Double.class)) {
    out.writeByte(PRIMITIVE_TYPE_DOUBLE);
    out.writeDouble((Double)value);
  }
 else   if (type.equals(String.class)) {
    out.writeByte(PRIMITIVE_TYPE_UTF);
    out.writeUTF((String)value);
  }
 else {
    throw new IllegalStateException("String_Node_Str");
  }
}
Program: 48442
Project: 48442
Buggy source:
protected ICompletableFuture<Data> getAsyncInternal(final Data key){
  final NodeEngine nodeEngine=getNodeEngine();
  final MapService mapService=getService();
  int partitionId=nodeEngine.getPartitionService().getPartitionId(key);
  final boolean nearCacheEnabled=mapConfig.isNearCacheEnabled();
  if (nearCacheEnabled) {
    Object cached=mapService.getFromNearCache(name,key);
    if (cached != null && NearCache.NULL_OBJECT.equals(cached)) {
      return new CompletedFuture<Data>(nodeEngine.getSerializationService(),cached,nodeEngine.getExecutionService().getExecutor(ExecutionService.ASYNC_EXECUTOR));
    }
  }
  GetOperation operation=new GetOperation(name,key);
  try {
    return nodeEngine.getOperationService().invokeOnPartition(SERVICE_NAME,operation,partitionId);
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
}

Fixed version (ground truth):
protected ICompletableFuture<Data> getAsyncInternal(final Data key){
  final NodeEngine nodeEngine=getNodeEngine();
  final MapService mapService=getService();
  int partitionId=nodeEngine.getPartitionService().getPartitionId(key);
  final boolean nearCacheEnabled=mapConfig.isNearCacheEnabled();
  if (nearCacheEnabled) {
    Object cached=mapService.getFromNearCache(name,key);
    if (cached != null) {
      if (NearCache.NULL_OBJECT.equals(cached)) {
        cached=null;
      }
      return new CompletedFuture<Data>(nodeEngine.getSerializationService(),cached,nodeEngine.getExecutionService().getExecutor(ExecutionService.ASYNC_EXECUTOR));
    }
  }
  GetOperation operation=new GetOperation(name,key);
  try {
    return nodeEngine.getOperationService().invokeOnPartition(SERVICE_NAME,operation,partitionId);
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
}
Program: 48445
Project: 48445
Buggy source:
protected ICompletableFuture<Data> getAsyncInternal(final Data key){
  final NodeEngine nodeEngine=getNodeEngine();
  final MapService mapService=getService();
  int partitionId=nodeEngine.getPartitionService().getPartitionId(key);
  final boolean nearCacheEnabled=mapConfig.isNearCacheEnabled();
  if (nearCacheEnabled) {
    Object cached=mapService.getFromNearCache(name,key);
    if (cached != null && NearCache.NULL_OBJECT.equals(cached)) {
      return new CompletedFuture<Data>(nodeEngine.getSerializationService(),cached,nodeEngine.getExecutionService().getExecutor(ExecutionService.ASYNC_EXECUTOR));
    }
  }
  GetOperation operation=new GetOperation(name,key);
  try {
    return nodeEngine.getOperationService().invokeOnPartition(SERVICE_NAME,operation,partitionId);
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
}

Fixed version (ground truth):
protected ICompletableFuture<Data> getAsyncInternal(final Data key){
  final NodeEngine nodeEngine=getNodeEngine();
  final MapService mapService=getService();
  int partitionId=nodeEngine.getPartitionService().getPartitionId(key);
  final boolean nearCacheEnabled=mapConfig.isNearCacheEnabled();
  if (nearCacheEnabled) {
    Object cached=mapService.getFromNearCache(name,key);
    if (cached != null) {
      if (NearCache.NULL_OBJECT.equals(cached)) {
        cached=null;
      }
      return new CompletedFuture<Data>(nodeEngine.getSerializationService(),cached,nodeEngine.getExecutionService().getExecutor(ExecutionService.ASYNC_EXECUTOR));
    }
  }
  GetOperation operation=new GetOperation(name,key);
  try {
    return nodeEngine.getOperationService().invokeOnPartition(SERVICE_NAME,operation,partitionId);
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
}
Program: 48446
Project: 48446
Buggy source:
@Test public void testGetAsync() throws Exception {
  final String mapName="String_Node_Str";
  Config config=new Config();
  config.getMapConfig(mapName).setNearCacheConfig(new NearCacheConfig());
  final TestHazelcastInstanceFactory hazelcastInstanceFactory=createHazelcastInstanceFactory(2);
  HazelcastInstance instance1=hazelcastInstanceFactory.newHazelcastInstance(config);
  HazelcastInstance instance2=hazelcastInstanceFactory.newHazelcastInstance(config);
  IMap<Integer,Integer> map=instance1.getMap(mapName);
  HashSet keys=new HashSet();
  int size=1000;
  for (int i=0; i < size; i++) {
    map.put(i,i);
    keys.add(i);
  }
  for (int i=0; i < size; i++) {
    map.get(i);
  }
  for (int i=0; i < size; i++) {
    final Future<Integer> async=map.getAsync(i);
    System.out.println(async.get());
  }
  NearCacheStats stats2=map.getLocalMapStats().getNearCacheStats();
  assertTrue("String_Node_Str",400 < stats2.getHits());
}

Fixed version (ground truth):
@Test public void testGetAsync() throws Exception {
  final String mapName="String_Node_Str";
  Config config=new Config();
  config.getMapConfig(mapName).setNearCacheConfig(new NearCacheConfig());
  final TestHazelcastInstanceFactory hazelcastInstanceFactory=createHazelcastInstanceFactory(2);
  HazelcastInstance instance1=hazelcastInstanceFactory.newHazelcastInstance(config);
  HazelcastInstance instance2=hazelcastInstanceFactory.newHazelcastInstance(config);
  IMap<Integer,Integer> map=instance1.getMap(mapName);
  HashSet keys=new HashSet();
  int size=1000;
  for (int i=0; i < size; i++) {
    map.put(i,i);
    keys.add(i);
  }
  for (int i=0; i < size; i++) {
    map.get(i);
  }
  for (int i=0; i < size; i++) {
    final Future<Integer> async=map.getAsync(i);
  }
  NearCacheStats stats2=map.getLocalMapStats().getNearCacheStats();
  assertTrue("String_Node_Str",400 < stats2.getHits());
}
Program: 48447
Project: 48447
Buggy source:
@Override public Collection<V> values(Predicate predicate){
  PagingPredicate pagingPredicate=null;
  if (predicate instanceof PagingPredicate) {
    pagingPredicate=(PagingPredicate)predicate;
    pagingPredicate.setIterationType(IterationType.VALUE);
    if (pagingPredicate.getPage() > 0 && pagingPredicate.getAnchor() == null) {
      pagingPredicate.previousPage();
      values(pagingPredicate);
      pagingPredicate.nextPage();
    }
  }
  MapQueryRequest request=new MapQueryRequest(name,predicate,IterationType.VALUE);
  QueryResultSet result=invoke(request);
  List<V> values=new ArrayList<V>(result.size());
  for (  Object data : result) {
    V value=toObject((Data)data);
    values.add(value);
  }
  if (pagingPredicate != null) {
    Collections.sort(values,SortingUtil.newComparator(pagingPredicate.getComparator()));
    if (values.size() > pagingPredicate.getPageSize()) {
      values=values.subList(0,pagingPredicate.getPageSize());
    }
    Object anchor=null;
    if (values.size() != 0) {
      anchor=values.get(values.size() - 1);
    }
    PagingPredicateAccessor.setPagingPredicateAnchor(pagingPredicate,new AbstractMap.SimpleImmutableEntry(null,anchor));
  }
  return values;
}

Fixed version (ground truth):
@Override public Collection<V> values(Predicate predicate){
  PagingPredicate pagingPredicate=null;
  if (predicate instanceof PagingPredicate) {
    pagingPredicate=(PagingPredicate)predicate;
    pagingPredicate.setIterationType(IterationType.VALUE);
    if (pagingPredicate.getPage() > 0 && pagingPredicate.getAnchor() == null) {
      pagingPredicate.previousPage();
      values(pagingPredicate);
      pagingPredicate.nextPage();
    }
  }
  MapQueryRequest request=new MapQueryRequest(name,predicate,IterationType.VALUE);
  QueryResultSet result=invoke(request);
  if (pagingPredicate == null) {
    final ArrayList<V> values=new ArrayList<V>(result.size());
    for (    Object data : result) {
      V value=toObject(data);
      values.add(value);
    }
    return values;
  }
  List<Entry<Object,V>> valueEntryList=new ArrayList<Entry<Object,V>>(result.size());
  for (  QueryResultEntry entry : result.getEntries()) {
    K key=toObject(entry.getKeyData());
    V value=toObject(entry.getValueData());
    valueEntryList.add(new AbstractMap.SimpleImmutableEntry<Object,V>(key,value));
  }
  Collections.sort(valueEntryList,SortingUtil.newComparator(pagingPredicate.getComparator(),IterationType.VALUE));
  if (valueEntryList.size() > pagingPredicate.getPageSize()) {
    valueEntryList=valueEntryList.subList(0,pagingPredicate.getPageSize());
  }
  Entry anchor=null;
  if (valueEntryList.size() != 0) {
    anchor=valueEntryList.get(valueEntryList.size() - 1);
  }
  PagingPredicateAccessor.setPagingPredicateAnchor(pagingPredicate,anchor);
  final ArrayList<V> values=new ArrayList<V>(valueEntryList.size());
  for (  Entry<Object,V> objectVEntry : valueEntryList) {
    values.add(objectVEntry.getValue());
  }
  return values;
}
Program: 48448
Project: 48448
Buggy source:
@Override public Set<K> keySet(Predicate predicate){
  PagingPredicate pagingPredicate=null;
  if (predicate instanceof PagingPredicate) {
    pagingPredicate=(PagingPredicate)predicate;
    pagingPredicate.setIterationType(IterationType.KEY);
    if (pagingPredicate.getPage() > 0 && pagingPredicate.getAnchor() == null) {
      pagingPredicate.previousPage();
      keySet(pagingPredicate);
      pagingPredicate.nextPage();
    }
  }
  MapQueryRequest request=new MapQueryRequest(name,predicate,IterationType.KEY);
  QueryResultSet result=invoke(request);
  List<K> keyList=new ArrayList<K>(result.size());
  for (  Object data : result) {
    K key=toObject((Data)data);
    keyList.add(key);
  }
  if (pagingPredicate != null) {
    Collections.sort(keyList,SortingUtil.newComparator(pagingPredicate.getComparator()));
    if (keyList.size() > pagingPredicate.getPageSize()) {
      keyList=keyList.subList(0,pagingPredicate.getPageSize());
    }
    Object anchor=null;
    if (keyList.size() != 0) {
      anchor=keyList.get(keyList.size() - 1);
    }
    PagingPredicateAccessor.setPagingPredicateAnchor(pagingPredicate,new AbstractMap.SimpleImmutableEntry(anchor,null));
  }
  return new HashSet<K>(keyList);
}

Fixed version (ground truth):
@Override public Set<K> keySet(Predicate predicate){
  PagingPredicate pagingPredicate=null;
  if (predicate instanceof PagingPredicate) {
    pagingPredicate=(PagingPredicate)predicate;
    pagingPredicate.setIterationType(IterationType.KEY);
    if (pagingPredicate.getPage() > 0 && pagingPredicate.getAnchor() == null) {
      pagingPredicate.previousPage();
      keySet(pagingPredicate);
      pagingPredicate.nextPage();
    }
  }
  MapQueryRequest request=new MapQueryRequest(name,predicate,IterationType.KEY);
  QueryResultSet result=invoke(request);
  if (pagingPredicate == null) {
    final HashSet<K> keySet=new HashSet<K>();
    for (    Object o : result) {
      final K key=toObject(o);
      keySet.add(key);
    }
    return keySet;
  }
  final Comparator<Entry> comparator=SortingUtil.newComparator(pagingPredicate.getComparator(),IterationType.KEY);
  final SortedQueryResultSet sortedResult=new SortedQueryResultSet(comparator,IterationType.KEY,pagingPredicate.getPageSize());
  for (  QueryResultEntry entry : result.getEntries()) {
    final K key=toObject(entry.getKeyData());
    final V value=toObject(entry.getValueData());
    sortedResult.add(new AbstractMap.SimpleImmutableEntry<K,V>(key,value));
  }
  PagingPredicateAccessor.setPagingPredicateAnchor(pagingPredicate,sortedResult.last());
  return (Set<K>)sortedResult;
}
Program: 48449
Project: 48449
Buggy source:
@Override public boolean open(NodeEngine nodeEngine){
  NodeEngineImpl nei=(NodeEngineImpl)nodeEngine;
  MapService mapService=nei.getService(MapService.SERVICE_NAME);
  ss=nei.getSerializationService();
  RecordStore recordStore=mapService.getRecordStore(partitionId,mapName);
  iterator=recordStore.entrySetData().iterator();
  return true;
}

Fixed version (ground truth):
@Override public boolean open(NodeEngine nodeEngine){
  NodeEngineImpl nei=(NodeEngineImpl)nodeEngine;
  PartitionService ps=nei.getPartitionService();
  MapService mapService=nei.getService(MapService.SERVICE_NAME);
  ss=nei.getSerializationService();
  Address partitionOwner=ps.getPartitionOwner(partitionId);
  if (partitionOwner == null) {
    return false;
  }
  RecordStore recordStore=mapService.getRecordStore(partitionId,mapName);
  iterator=recordStore.entrySetData().iterator();
  return true;
}
Program: 48450
Project: 48450
Buggy source:
@Override public boolean open(NodeEngine nodeEngine){
  NodeEngineImpl nei=(NodeEngineImpl)nodeEngine;
  MultiMapService multiMapService=nei.getService(MultiMapService.SERVICE_NAME);
  ss=nei.getSerializationService();
  multiMapContainer=multiMapService.getOrCreateCollectionContainer(partitionId,multiMapName);
  isBinary=multiMapContainer.getConfig().isBinary();
  keyIterator=multiMapContainer.keySet().iterator();
  return true;
}

Fixed version (ground truth):
@Override public boolean open(NodeEngine nodeEngine){
  NodeEngineImpl nei=(NodeEngineImpl)nodeEngine;
  PartitionService ps=nei.getPartitionService();
  MultiMapService multiMapService=nei.getService(MultiMapService.SERVICE_NAME);
  ss=nei.getSerializationService();
  Address partitionOwner=ps.getPartitionOwner(partitionId);
  if (partitionOwner == null) {
    return false;
  }
  multiMapContainer=multiMapService.getOrCreateCollectionContainer(partitionId,multiMapName);
  isBinary=multiMapContainer.getConfig().isBinary();
  keyIterator=multiMapContainer.keySet().iterator();
  return true;
}
Program: 48451
Project: 48451
Buggy source:
@Override public void run() throws Exception {
  MapReduceService mapReduceService=getService();
  JobSupervisor supervisor=mapReduceService.getJobSupervisor(getName(),getJobId());
  if (supervisor == null) {
    result=new RequestPartitionResult(NO_SUPERVISOR,-1);
    return;
  }
  JobProcessInformationImpl processInformation=supervisor.getJobProcessInformation();
  while (true) {
    JobPartitionState.State newState=JobPartitionState.State.WAITING;
    JobPartitionState[] partitionStates=processInformation.getPartitionStates();
    JobPartitionState oldPartitionState=partitionStates[partitionId];
    if (oldPartitionState == null || getCallerAddress().equals(oldPartitionState.getOwner())) {
      result=new RequestPartitionResult(CHECK_STATE_FAILED,partitionId);
      return;
    }
    JobPartitionState newPartitionState=new JobPartitionStateImpl(getCallerAddress(),newState);
    if (processInformation.updatePartitionState(partitionId,oldPartitionState,newPartitionState)) {
      result=new RequestPartitionResult(SUCCESSFUL,partitionId);
      return;
    }
  }
}

Fixed version (ground truth):
@Override public void run() throws Exception {
  MapReduceService mapReduceService=getService();
  JobSupervisor supervisor=mapReduceService.getJobSupervisor(getName(),getJobId());
  if (supervisor == null) {
    result=new RequestPartitionResult(NO_SUPERVISOR,-1);
    return;
  }
  JobProcessInformationImpl processInformation=supervisor.getJobProcessInformation();
  while (true) {
    JobPartitionState[] partitionStates=processInformation.getPartitionStates();
    JobPartitionState oldPartitionState=partitionStates[partitionId];
    if (oldPartitionState == null || !getCallerAddress().equals(oldPartitionState.getOwner())) {
      result=new RequestPartitionResult(CHECK_STATE_FAILED,partitionId);
      return;
    }
    if (processInformation.updatePartitionState(partitionId,oldPartitionState,null)) {
      result=new RequestPartitionResult(SUCCESSFUL,partitionId);
      return;
    }
  }
}
Program: 48452
Project: 48452
Buggy source:
private void postponePartitionProcessing(int partitionId) throws Exception {
  RequestPartitionResult result=mapReduceService.processRequest(supervisor.getJobOwner(),new PostPonePartitionProcessing(name,jobId,partitionId),name);
  if (result.getResultState() != SUCCESSFUL) {
    throw new RuntimeException("String_Node_Str" + partitionId);
  }
}

Fixed version (ground truth):
private void postponePartitionProcessing(int partitionId) throws Exception {
  RequestPartitionResult result=mapReduceService.processRequest(supervisor.getJobOwner(),new PostPonePartitionProcessing(name,jobId,partitionId),name);
  if (result.getResultState() != SUCCESSFUL) {
    throw new RuntimeException("String_Node_Str" + partitionId + "String_Node_Str"+ result.getResultState());
  }
}
Program: 48453
Project: 48453
Buggy source:
private MapStoreConfig createMapStoreConfig(final org.w3c.dom.Node node){
  MapStoreConfig mapStoreConfig=new MapStoreConfig();
  final NamedNodeMap atts=node.getAttributes();
  for (int a=0; a < atts.getLength(); a++) {
    final org.w3c.dom.Node att=atts.item(a);
    final String value=getTextContent(att).trim();
    if (att.getNodeName().equals("String_Node_Str")) {
      mapStoreConfig.setEnabled(checkTrue(value));
    }
 else     if ("String_Node_Str".equals(att.getNodeName())) {
      final MapStoreConfig.InitialLoadMode mode=att != null ? MapStoreConfig.InitialLoadMode.valueOf(upperCaseInternal(getTextContent(att))) : MapStoreConfig.InitialLoadMode.LAZY;
      mapStoreConfig.setInitialLoadMode(mode);
    }
  }
  for (  org.w3c.dom.Node n : new IterableNodeList(node.getChildNodes())) {
    final String nodeName=cleanNodeName(n.getNodeName());
    if ("String_Node_Str".equals(nodeName)) {
      mapStoreConfig.setClassName(getTextContent(n).trim());
    }
 else     if ("String_Node_Str".equals(nodeName)) {
      mapStoreConfig.setFactoryClassName(getTextContent(n).trim());
    }
 else     if ("String_Node_Str".equals(nodeName)) {
      mapStoreConfig.setWriteDelaySeconds(getIntegerValue("String_Node_Str",getTextContent(n).trim(),MapStoreConfig.DEFAULT_WRITE_DELAY_SECONDS));
    }
 else     if ("String_Node_Str".equals(nodeName)) {
      fillProperties(n,mapStoreConfig.getProperties());
    }
  }
  return mapStoreConfig;
}

Fixed version (ground truth):
private MapStoreConfig createMapStoreConfig(final org.w3c.dom.Node node){
  MapStoreConfig mapStoreConfig=new MapStoreConfig();
  final NamedNodeMap atts=node.getAttributes();
  for (int a=0; a < atts.getLength(); a++) {
    final org.w3c.dom.Node att=atts.item(a);
    final String value=getTextContent(att).trim();
    if ("String_Node_Str".equals(att.getNodeName())) {
      mapStoreConfig.setEnabled(checkTrue(value));
    }
 else     if ("String_Node_Str".equals(att.getNodeName())) {
      final MapStoreConfig.InitialLoadMode mode=att != null ? MapStoreConfig.InitialLoadMode.valueOf(upperCaseInternal(getTextContent(att))) : MapStoreConfig.InitialLoadMode.LAZY;
      mapStoreConfig.setInitialLoadMode(mode);
    }
  }
  for (  org.w3c.dom.Node n : new IterableNodeList(node.getChildNodes())) {
    final String nodeName=cleanNodeName(n.getNodeName());
    if ("String_Node_Str".equals(nodeName)) {
      mapStoreConfig.setClassName(getTextContent(n).trim());
    }
 else     if ("String_Node_Str".equals(nodeName)) {
      mapStoreConfig.setFactoryClassName(getTextContent(n).trim());
    }
 else     if ("String_Node_Str".equals(nodeName)) {
      mapStoreConfig.setWriteDelaySeconds(getIntegerValue("String_Node_Str",getTextContent(n).trim(),MapStoreConfig.DEFAULT_WRITE_DELAY_SECONDS));
    }
 else     if ("String_Node_Str".equals(nodeName)) {
      fillProperties(n,mapStoreConfig.getProperties());
    }
  }
  return mapStoreConfig;
}
Program: 48454
Project: 48454
Buggy source:
private void doRemoveEndpoint(Connection connection,ClientEndpoint endpoint){
  removeEndpoint(connection,true);
  if (!endpoint.isFirstConnection()) {
    return;
  }
  NodeEngine nodeEngine=node.nodeEngine;
  Collection<MemberImpl> memberList=nodeEngine.getClusterService().getMemberList();
  for (  MemberImpl member : memberList) {
    ClientDisconnectionOperation op=new ClientDisconnectionOperation(endpoint.getUuid());
    op.setNodeEngine(nodeEngine).setServiceName(SERVICE_NAME).setService(this).setResponseHandler(ResponseHandlerFactory.createEmptyResponseHandler());
    if (member.localMember()) {
      nodeEngine.getOperationService().runOperation(op);
    }
 else {
      nodeEngine.getOperationService().send(op,member.getAddress());
    }
  }
}

Fixed version (ground truth):
private void doRemoveEndpoint(Connection connection,ClientEndpoint endpoint){
  removeEndpoint(connection,true);
  if (!endpoint.isFirstConnection()) {
    return;
  }
  NodeEngine nodeEngine=node.nodeEngine;
  Collection<MemberImpl> memberList=nodeEngine.getClusterService().getMemberList();
  OperationService operationService=nodeEngine.getOperationService();
  for (  MemberImpl member : memberList) {
    ClientDisconnectionOperation op=new ClientDisconnectionOperation(endpoint.getUuid());
    op.setNodeEngine(nodeEngine).setServiceName(SERVICE_NAME).setService(ClientEngineImpl.this).setResponseHandler(createEmptyResponseHandler());
    if (member.localMember()) {
      operationService.runOperation(op);
    }
 else {
      operationService.send(op,member.getAddress());
    }
  }
}
Program: 48455
Project: 48455
Buggy source:
@Override public void run(){
  try {
    RequestPartitionResult result=mapReduceService.processRequest(supervisor.getJobOwner(),new RequestMemberIdAssignment(name,jobId),name);
    if (result.getResultState() == NO_SUPERVISOR) {
      return;
    }
 else     if (result.getResultState() == NO_MORE_PARTITIONS) {
      return;
    }
    int partitionId=result.getPartitionId();
    KeyValueSource<KeyIn,ValueIn> delegate=keyValueSource;
    if (supervisor.getConfiguration().isCommunicateStats()) {
      delegate=new KeyValueSourceFacade<KeyIn,ValueIn>(keyValueSource,supervisor);
    }
    delegate.reset();
    if (delegate.open(nodeEngine)) {
      DefaultContext<KeyOut,ValueOut> context=supervisor.getOrCreateContext(MapCombineTask.this);
      processMapping(partitionId,context,delegate);
      delegate.close();
      finalizeMapping(partitionId,context);
    }
 else {
      postponePartitionProcessing(partitionId);
    }
  }
 catch (  Throwable t) {
    notifyRemoteException(supervisor,t);
    if (t instanceof Error) {
      ExceptionUtil.sneakyThrow(t);
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    RequestPartitionResult result=mapReduceService.processRequest(supervisor.getJobOwner(),new RequestMemberIdAssignment(name,jobId),name);
    if (result.getResultState() == NO_SUPERVISOR) {
      return;
    }
 else     if (result.getResultState() == NO_MORE_PARTITIONS) {
      return;
    }
    int partitionId=result.getPartitionId();
    KeyValueSource<KeyIn,ValueIn> delegate=keyValueSource;
    if (supervisor.getConfiguration().isCommunicateStats()) {
      delegate=new KeyValueSourceFacade<KeyIn,ValueIn>(keyValueSource,supervisor);
    }
    delegate.reset();
    if (delegate.open(nodeEngine)) {
      DefaultContext<KeyOut,ValueOut> context=supervisor.getOrCreateContext(MapCombineTask.this);
      processMapping(partitionId,context,delegate);
      delegate.close();
      finalizeMapping(partitionId,context);
    }
 else {
      postponePartitionProcessing(partitionId);
    }
  }
 catch (  Throwable t) {
    handleProcessorThrowable(t);
  }
}
Program: 48456
Project: 48456
Buggy source:
@Override @SuppressWarnings({"String_Node_Str"}) public JobPartitionState[] getPartitionStates(){
  return partitionStates;
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public JobPartitionState[] getPartitionStates(){
  return partitionStates;
}
Program: 48457
Project: 48457
Buggy source:
@Override @SuppressWarnings({"String_Node_Str"}) public JobPartitionState[] getPartitionStates(){
  return partitionStates;
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public JobPartitionState[] getPartitionStates(){
  return partitionStates;
}
Program: 48458
Project: 48458
Buggy source:
private void handleManagementCenterConfig(final Node node){
  NamedNodeMap attrs=node.getAttributes();
  final Node enabledNode=attrs.getNamedItem("String_Node_Str");
  boolean enabled=enabledNode != null && checkTrue(getTextContent(enabledNode));
  final Node intervalNode=attrs.getNamedItem("String_Node_Str");
  final int interval=intervalNode != null ? getIntegerValue("String_Node_Str",getTextContent(intervalNode),5) : 5;
  final Node securityTokenNode=attrs.getNamedItem("String_Node_Str");
  final String securityToken=getTextContent(securityTokenNode);
  if (securityToken != null && enabledNode == null) {
    enabled=true;
  }
  final Node clusterIdNode=attrs.getNamedItem("String_Node_Str");
  final String clusterId=getTextContent(clusterIdNode);
  final String url=getTextContent(node);
  ManagementCenterConfig managementCenterConfig=config.getManagementCenterConfig();
  managementCenterConfig.setEnabled(enabled);
  managementCenterConfig.setUpdateInterval(interval);
  managementCenterConfig.setSecurityToken("String_Node_Str".equals(securityToken) ? null : securityToken);
  managementCenterConfig.setClusterId("String_Node_Str".equals(clusterId) ? null : clusterId);
  managementCenterConfig.setUrl("String_Node_Str".equals(url) ? null : url);
}

Fixed version (ground truth):
private void handleManagementCenterConfig(final Node node){
  NamedNodeMap attrs=node.getAttributes();
  final Node enabledNode=attrs.getNamedItem("String_Node_Str");
  boolean enabled=enabledNode != null && checkTrue(getTextContent(enabledNode));
  final Node intervalNode=attrs.getNamedItem("String_Node_Str");
  final int interval=intervalNode != null ? getIntegerValue("String_Node_Str",getTextContent(intervalNode),5) : 5;
  final Node securityTokenNode=attrs.getNamedItem("String_Node_Str");
  final String securityToken=getTextContent(securityTokenNode);
  if ((securityToken != null && !"String_Node_Str".equals(securityToken)) && enabledNode == null) {
    enabled=true;
  }
  final Node clusterIdNode=attrs.getNamedItem("String_Node_Str");
  final String clusterId=getTextContent(clusterIdNode);
  final String url=getTextContent(node);
  ManagementCenterConfig managementCenterConfig=config.getManagementCenterConfig();
  managementCenterConfig.setEnabled(enabled);
  managementCenterConfig.setUpdateInterval(interval);
  managementCenterConfig.setSecurityToken("String_Node_Str".equals(securityToken) ? null : securityToken);
  managementCenterConfig.setClusterId("String_Node_Str".equals(clusterId) ? null : clusterId);
  managementCenterConfig.setUrl("String_Node_Str".equals(url) ? null : url);
}
Program: 48459
Project: 48459
Buggy source:
private SimpleMapTest(final int threadCount,final int entryCount,final int valueSize,final int getPercentage,final int putPercentage,final boolean load){
  this.threadCount=threadCount;
  this.entryCount=entryCount;
  this.valueSize=valueSize;
  this.getPercentage=getPercentage;
  this.putPercentage=putPercentage;
  this.load=load;
  Config cfg=new XmlConfigBuilder().build();
  cfg.getManagementCenterConfig().setEnabled(true);
  instance=Hazelcast.newHazelcastInstance(cfg);
  logger=instance.getLoggingService().getLogger("String_Node_Str");
}

Fixed version (ground truth):
private SimpleMapTest(final int threadCount,final int entryCount,final int valueSize,final int getPercentage,final int putPercentage,final boolean load){
  this.threadCount=threadCount;
  this.entryCount=entryCount;
  this.valueSize=valueSize;
  this.getPercentage=getPercentage;
  this.putPercentage=putPercentage;
  this.load=load;
  Config cfg=new XmlConfigBuilder().build();
  instance=Hazelcast.newHazelcastInstance(cfg);
  logger=instance.getLoggingService().getLogger("String_Node_Str");
}
Program: 48460
Project: 48460
Buggy source:
public void destroy(){
  if (registrationId != null) {
    BaseClientRemoveListenerRequest request;
    if (cacheType == ClientNearCacheType.Map) {
      request=new MapRemoveEntryListenerRequest(mapName,registrationId);
    }
 else     if (cacheType == ClientNearCacheType.ReplicatedMap) {
      request=new ClientReplicatedMapRemoveEntryListenerRequest(mapName,registrationId);
    }
 else {
      throw new IllegalStateException("String_Node_Str");
    }
    ListenerUtil.stopListening(context,request,registrationId);
  }
  cache.clear();
}

Fixed version (ground truth):
public void destroy(){
  if (registrationId != null) {
    BaseClientRemoveListenerRequest request;
    if (cacheType == ClientNearCacheType.Map) {
      request=new MapRemoveEntryListenerRequest(mapName,registrationId);
    }
 else {
      throw new IllegalStateException("String_Node_Str");
    }
    ListenerUtil.stopListening(context,request,registrationId);
  }
  cache.clear();
}
Program: 48461
Project: 48461
Buggy source:
private void addInvalidateListener(){
}

Fixed version (ground truth):
private void addInvalidateListener(){
  try {
    ClientRequest request;
    EventHandler handler;
    if (cacheType == ClientNearCacheType.Map) {
      request=new MapAddEntryListenerRequest(mapName,false);
      handler=new EventHandler<PortableEntryEvent>(){
        public void handle(        PortableEntryEvent event){
          cache.remove(event.getKey());
        }
      }
;
    }
 else {
      throw new IllegalStateException("String_Node_Str");
    }
    registrationId=ListenerUtil.listen(context,request,null,handler);
  }
 catch (  Exception e) {
    Logger.getLogger(ClientNearCache.class).severe("String_Node_Str",e);
  }
}
Program: 48462
Project: 48462
Buggy source:
@Override public void publishReplicationEvent(String serviceName,ReplicationEventObject eventObject){
  WanReplicationEvent replicationEvent=new WanReplicationEvent(serviceName,eventObject);
  if (!q.offer(replicationEvent)) {
    q.poll();
    q.offer(replicationEvent);
  }
}

Fixed version (ground truth):
@Override public void publishReplicationEvent(String serviceName,ReplicationEventObject eventObject){
  WanReplicationEvent replicationEvent=new WanReplicationEvent(serviceName,eventObject);
  if (eventQueue.offer(replicationEvent)) {
    return;
  }
  eventQueue.poll();
  if (!eventQueue.offer(replicationEvent)) {
    logger.warning("String_Node_Str" + replicationEvent);
  }
}
Program: 48463
Project: 48463
Buggy source:
public void run(){
  Connection conn=null;
  while (running) {
    try {
      WanReplicationEvent event=(failureQ.size() > 0) ? failureQ.removeFirst() : q.take();
      if (conn == null) {
        conn=getConnection();
        if (conn != null) {
          boolean authorized=checkAuthorization(groupName,password,conn.getEndPoint());
          if (!authorized) {
            conn.close();
            conn=null;
            if (logger != null) {
              logger.severe("String_Node_Str");
            }
          }
        }
      }
      if (conn != null && conn.live()) {
        Data data=node.nodeEngine.getSerializationService().toData(event);
        Packet packet=new Packet(data,node.nodeEngine.getSerializationContext());
        packet.setHeader(Packet.HEADER_WAN_REPLICATION);
        node.nodeEngine.send(packet,conn);
      }
 else {
        failureQ.addFirst(event);
        conn=null;
      }
    }
 catch (    InterruptedException e) {
      running=false;
    }
catch (    Throwable e) {
      if (logger != null) {
        logger.warning(e);
      }
      conn=null;
    }
  }
}

Fixed version (ground truth):
public void run(){
  Connection conn=null;
  while (running) {
    try {
      WanReplicationEvent event=(failureQ.size() > 0) ? failureQ.removeFirst() : eventQueue.take();
      if (conn == null) {
        conn=getConnection();
        if (conn != null) {
          boolean authorized=checkAuthorization(groupName,password,conn.getEndPoint());
          if (!authorized) {
            conn.close();
            conn=null;
            if (logger != null) {
              logger.severe("String_Node_Str");
            }
          }
        }
      }
      if (conn != null && conn.live()) {
        Data data=node.nodeEngine.getSerializationService().toData(event);
        Packet packet=new Packet(data,node.nodeEngine.getSerializationContext());
        packet.setHeader(Packet.HEADER_WAN_REPLICATION);
        node.nodeEngine.send(packet,conn);
      }
 else {
        failureQ.addFirst(event);
        conn=null;
      }
    }
 catch (    InterruptedException e) {
      running=false;
    }
catch (    Throwable e) {
      if (logger != null) {
        logger.warning(e);
      }
      conn=null;
    }
  }
}
Program: 48464
Project: 48464
Buggy source:
@Override public <T>T executeTransaction(TransactionOptions options,TransactionalTask<T> task) throws TransactionException {
  final TransactionContext context=newTransactionContext(options);
  context.beginTransaction();
  try {
    final T value=task.execute(context);
    context.commitTransaction();
    return value;
  }
 catch (  Throwable e) {
    context.rollbackTransaction();
    if (e instanceof TransactionException) {
      throw (TransactionException)e;
    }
    if (e.getCause() instanceof TransactionException) {
      throw (TransactionException)e.getCause();
    }
    if (e instanceof RuntimeException) {
      throw (RuntimeException)e;
    }
    throw new TransactionException(e);
  }
}

Fixed version (ground truth):
@Override public <T>T executeTransaction(TransactionOptions options,TransactionalTask<T> task) throws TransactionException {
  return transactionManager.executeTransaction(options,task);
}
Program: 48466
Project: 48466
Buggy source:
@Override public TransactionContext newTransactionContext(TransactionOptions options){
  return new TransactionContextProxy(this,options);
}

Fixed version (ground truth):
@Override public TransactionContext newTransactionContext(TransactionOptions options){
  return transactionManager.newTransactionContext(options);
}
Program: 48467
Project: 48467
Buggy source:
void doShutdown(){
  CLIENTS.remove(id);
  executionService.shutdown();
  partitionService.stop();
  clusterService.stop();
  connectionManager.shutdown();
  proxyManager.destroy();
}

Fixed version (ground truth):
void doShutdown(){
  CLIENTS.remove(id);
  executionService.shutdown();
  partitionService.stop();
  clusterService.stop();
  transactionManager.shutdown();
  connectionManager.shutdown();
  proxyManager.destroy();
}
Program: 48468
Project: 48468
Buggy source:
public XAResource getXaResource(){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
public XAResource getXaResource(){
  if (xaResource == null) {
    xaResource=new XaResourceProxy(this);
  }
  return xaResource;
}
Program: 48469
Project: 48469
Buggy source:
public TransactionContextProxy(HazelcastClient client,TransactionOptions options){
  try {
    this.connection=client.getConnectionManager().tryToConnect(null);
  }
 catch (  Exception e) {
    throw new HazelcastException("String_Node_Str",e);
  }
  this.client=client;
  this.transaction=new TransactionProxy(client,options,connection);
}

Fixed version (ground truth):
public TransactionContextProxy(ClientTransactionManager transactionManager,TransactionOptions options){
  this.transactionManager=transactionManager;
  this.client=transactionManager.getClient();
  try {
    this.connection=client.getConnectionManager().tryToConnect(null);
  }
 catch (  Exception e) {
    throw new HazelcastException("String_Node_Str",e);
  }
  this.transaction=new TransactionProxy(client,options,connection);
}
Program: 48470
Project: 48470
Buggy source:
public void commitTransaction() throws TransactionException {
  transaction.commit();
}

Fixed version (ground truth):
public void commitTransaction() throws TransactionException {
  transaction.commit(true);
}
Program: 48471
Project: 48471
Buggy source:
@Override public <T>T executeTransaction(TransactionOptions options,TransactionalTask<T> task) throws TransactionException {
  final TransactionContext context=newTransactionContext(options);
  context.beginTransaction();
  try {
    final T value=task.execute(context);
    context.commitTransaction();
    return value;
  }
 catch (  Throwable e) {
    context.rollbackTransaction();
    if (e instanceof TransactionException) {
      throw (TransactionException)e;
    }
    if (e.getCause() instanceof TransactionException) {
      throw (TransactionException)e.getCause();
    }
    if (e instanceof RuntimeException) {
      throw (RuntimeException)e;
    }
    throw new TransactionException(e);
  }
}

Fixed version (ground truth):
@Override public <T>T executeTransaction(TransactionOptions options,TransactionalTask<T> task) throws TransactionException {
  return transactionManager.executeTransaction(options,task);
}
Program: 48473
Project: 48473
Buggy source:
@Override public TransactionContext newTransactionContext(TransactionOptions options){
  return new TransactionContextProxy(this,options);
}

Fixed version (ground truth):
@Override public TransactionContext newTransactionContext(TransactionOptions options){
  return transactionManager.newTransactionContext(options);
}
Program: 48474
Project: 48474
Buggy source:
public XAResource getXaResource(){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
public XAResource getXaResource(){
  if (xaResource == null) {
    xaResource=new XaResourceProxy(this);
  }
  return xaResource;
}
Program: 48475
Project: 48475
Buggy source:
public TransactionContextProxy(HazelcastClient client,TransactionOptions options){
  this.client=client;
  this.connection=connect();
  if (connection == null) {
    throw new HazelcastException("String_Node_Str");
  }
  this.transaction=new TransactionProxy(client,options,connection);
}

Fixed version (ground truth):
public TransactionContextProxy(ClientTransactionManager transactionManager,TransactionOptions options){
  this.transactionManager=transactionManager;
  this.client=transactionManager.getClient();
  this.connection=transactionManager.connect();
  if (connection == null) {
    throw new HazelcastException("String_Node_Str");
  }
  this.transaction=new TransactionProxy(client,options,connection);
}
Program: 48476
Project: 48476
Buggy source:
public void commitTransaction() throws TransactionException {
  transaction.commit();
}

Fixed version (ground truth):
public void commitTransaction() throws TransactionException {
  transaction.commit(true);
}
Program: 48477
Project: 48477
Buggy source:
private void handleMap(HttpPostCommand command,String uri){
  int indexEnd=uri.indexOf('/',URI_MAPS.length());
  String mapName=uri.substring(URI_MAPS.length(),indexEnd);
  String key=uri.substring(indexEnd + 1);
  byte[] data=command.getData();
  textCommandService.put(mapName,key,new RestValue(data,command.getContentType()),0);
  command.setResponse(HttpCommand.RES_204);
}

Fixed version (ground truth):
private void handleMap(HttpPostCommand command,String uri){
  int indexEnd=uri.indexOf('/',URI_MAPS.length());
  String mapName=uri.substring(URI_MAPS.length(),indexEnd);
  String key=uri.substring(indexEnd + 1);
  byte[] data=command.getData();
  textCommandService.put(mapName,key,new RestValue(data,command.getContentType()),-1);
  command.setResponse(HttpCommand.RES_204);
}
Program: 48478
Project: 48478
Buggy source:
private boolean doAwait(long time,TimeUnit unit,long threadId) throws InterruptedException {
  final long timeoutInMillis=unit.toMillis(time);
  AwaitRequest awaitRequest=new AwaitRequest(namespace,lockProxy.getName(),timeoutInMillis,threadId,conditionId);
  return invoke(awaitRequest);
}

Fixed version (ground truth):
private boolean doAwait(long time,TimeUnit unit,long threadId) throws InterruptedException {
  final long timeoutInMillis=unit.toMillis(time);
  AwaitRequest awaitRequest=new AwaitRequest(namespace,lockProxy.getName(),timeoutInMillis,threadId,conditionId);
  final Boolean result=invoke(awaitRequest);
  return result;
}
Program: 48481
Project: 48481
Buggy source:
private void fireEvictCache(){
  if (canEvict.compareAndSet(true,false)) {
    try {
      context.getExecutionService().execute(new Runnable(){
        public void run(){
          try {
            TreeSet<CacheRecord<K>> records=new TreeSet<CacheRecord<K>>(cache.values());
            int evictSize=cache.size() * evictionPercentage / 100;
            int i=0;
            for (            CacheRecord<K> record : records) {
              cache.remove(record.key);
              if (++i > evictSize)               break;
            }
          }
  finally {
            canEvict.set(true);
          }
        }
      }
);
    }
 catch (    RejectedExecutionException e) {
      canEvict.set(true);
    }
catch (    Exception e) {
      throw ExceptionUtil.rethrow(e);
    }
  }
}

Fixed version (ground truth):
private void fireEvictCache(){
  if (canEvict.compareAndSet(true,false)) {
    try {
      context.getExecutionService().execute(new Runnable(){
        public void run(){
          try {
            TreeSet<CacheRecord<K>> records=new TreeSet<CacheRecord<K>>(comparator);
            records.addAll(cache.values());
            int evictSize=cache.size() * evictionPercentage / 100;
            int i=0;
            for (            CacheRecord<K> record : records) {
              cache.remove(record.key);
              if (++i > evictSize)               break;
            }
          }
  finally {
            canEvict.set(true);
          }
        }
      }
);
    }
 catch (    RejectedExecutionException e) {
      canEvict.set(true);
    }
catch (    Exception e) {
      throw ExceptionUtil.rethrow(e);
    }
  }
}
Program: 48482
Project: 48482
Buggy source:
private EventHandler<PortableEntryEvent> createHandler(final EntryListener<K,V> listener,final boolean includeValue){
  return new EventHandler<PortableEntryEvent>(){
    public void handle(    PortableEntryEvent event){
      V value=null;
      V oldValue=null;
      if (includeValue) {
        value=toObject(event.getValue());
        oldValue=toObject(event.getOldValue());
      }
      K key=toObject(event.getKey());
      Member member=getContext().getClusterService().getMember(event.getUuid());
      EntryEvent<K,V> entryEvent=new EntryEvent<K,V>(name,member,event.getEventType().getType(),key,oldValue,value);
switch (event.getEventType()) {
case ADDED:
        listener.entryAdded(entryEvent);
      break;
case REMOVED:
    listener.entryRemoved(entryEvent);
  break;
case UPDATED:
listener.entryUpdated(entryEvent);
break;
case EVICTED:
listener.entryEvicted(entryEvent);
break;
}
}
}
;
}

Fixed version (ground truth):
private EventHandler<PortableEntryEvent> createHandler(final EntryListener<K,V> listener,final boolean includeValue){
  return new EventHandler<PortableEntryEvent>(){
    public void handle(    PortableEntryEvent event){
      V value=null;
      V oldValue=null;
      if (includeValue) {
        value=toObject(event.getValue());
        oldValue=toObject(event.getOldValue());
      }
      K key=toObject(event.getKey());
      Member member=getContext().getClusterService().getMember(event.getUuid());
      EntryEvent<K,V> entryEvent=new EntryEvent<K,V>(name,member,event.getEventType().getType(),key,oldValue,value);
switch (event.getEventType()) {
case ADDED:
        listener.entryAdded(entryEvent);
      break;
case REMOVED:
    listener.entryRemoved(entryEvent);
  break;
case UPDATED:
listener.entryUpdated(entryEvent);
break;
case EVICTED:
listener.entryEvicted(entryEvent);
break;
default :
throw new IllegalArgumentException("String_Node_Str" + event.getEventType());
}
}
}
;
}
Program: 48483
Project: 48483
Buggy source:
public void handle(PortableEntryEvent event){
  V value=null;
  V oldValue=null;
  if (includeValue) {
    value=toObject(event.getValue());
    oldValue=toObject(event.getOldValue());
  }
  K key=toObject(event.getKey());
  Member member=getContext().getClusterService().getMember(event.getUuid());
  EntryEvent<K,V> entryEvent=new EntryEvent<K,V>(name,member,event.getEventType().getType(),key,oldValue,value);
switch (event.getEventType()) {
case ADDED:
    listener.entryAdded(entryEvent);
  break;
case REMOVED:
listener.entryRemoved(entryEvent);
break;
case UPDATED:
listener.entryUpdated(entryEvent);
break;
case EVICTED:
listener.entryEvicted(entryEvent);
break;
}
}

Fixed version (ground truth):
public void handle(PortableEntryEvent event){
  V value=null;
  V oldValue=null;
  if (includeValue) {
    value=toObject(event.getValue());
    oldValue=toObject(event.getOldValue());
  }
  K key=toObject(event.getKey());
  Member member=getContext().getClusterService().getMember(event.getUuid());
  EntryEvent<K,V> entryEvent=new EntryEvent<K,V>(name,member,event.getEventType().getType(),key,oldValue,value);
switch (event.getEventType()) {
case ADDED:
    listener.entryAdded(entryEvent);
  break;
case REMOVED:
listener.entryRemoved(entryEvent);
break;
case UPDATED:
listener.entryUpdated(entryEvent);
break;
case EVICTED:
listener.entryEvicted(entryEvent);
break;
default :
throw new IllegalArgumentException("String_Node_Str" + event.getEventType());
}
}
Program: 48484
Project: 48484
Buggy source:
@Override public V get(long timeout,TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
  ValidationUtil.isNotNull(unit,"String_Node_Str");
  latch.await(timeout,unit);
  if (!isDone()) {
    throw new TimeoutException("String_Node_Str");
  }
  return getResult();
}

Fixed version (ground truth):
@Override public V get(long timeout,TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
  ValidationUtil.isNotNull(unit,"String_Node_Str");
  if (!latch.await(timeout,unit) || !isDone()) {
    throw new TimeoutException("String_Node_Str");
  }
  return getResult();
}