nus-yam/ex-repair huggingface dataset:
Program: 45823
Project: 45823
Buggy source:
public String build(){
  return builder.toString();
}

Fixed version (ground truth):
String build(){
  return builder.toString();
}
Program: 45825
Project: 45825
Buggy source:
public PhoneHomeParameterCreator addParam(String key,String value){
  if (hasParameterBefore) {
    builder.append("String_Node_Str");
  }
 else {
    hasParameterBefore=true;
  }
  try {
    builder.append(key).append("String_Node_Str").append(URLEncoder.encode(value,"String_Node_Str"));
  }
 catch (  UnsupportedEncodingException e) {
    ExceptionUtil.rethrow(e);
  }
  parameters.put(key,value);
  return this;
}

Fixed version (ground truth):
PhoneHomeParameterCreator addParam(String key,String value){
  if (hasParameterBefore) {
    builder.append("String_Node_Str");
  }
 else {
    hasParameterBefore=true;
  }
  try {
    builder.append(key).append("String_Node_Str").append(URLEncoder.encode(value,"String_Node_Str"));
  }
 catch (  UnsupportedEncodingException e) {
    throw rethrow(e);
  }
  parameters.put(key,value);
  return this;
}
Program: 45826
Project: 45826
Buggy source:
private void addClientInfo(Node hazelcastNode,PhoneHomeParameterCreator parameterCreator){
  Map<ClientType,Integer> clusterClientStats=hazelcastNode.clientEngine.getConnectedClientStats();
  parameterCreator.addParam("String_Node_Str",Integer.toString(clusterClientStats.get(ClientType.CPP)));
  parameterCreator.addParam("String_Node_Str",Integer.toString(clusterClientStats.get(ClientType.CSHARP)));
  parameterCreator.addParam("String_Node_Str",Integer.toString(clusterClientStats.get(ClientType.JAVA)));
  parameterCreator.addParam("String_Node_Str",Integer.toString(clusterClientStats.get(ClientType.NODEJS)));
  parameterCreator.addParam("String_Node_Str",Integer.toString(clusterClientStats.get(ClientType.PYTHON)));
}

Fixed version (ground truth):
private void addClientInfo(Node hazelcastNode,PhoneHomeParameterCreator parameterCreator){
  Map<ClientType,Integer> clusterClientStats=hazelcastNode.clientEngine.getConnectedClientStats();
  parameterCreator.addParam("String_Node_Str",Integer.toString(clusterClientStats.get(ClientType.CPP))).addParam("String_Node_Str",Integer.toString(clusterClientStats.get(ClientType.CSHARP))).addParam("String_Node_Str",Integer.toString(clusterClientStats.get(ClientType.JAVA))).addParam("String_Node_Str",Integer.toString(clusterClientStats.get(ClientType.NODEJS))).addParam("String_Node_Str",Integer.toString(clusterClientStats.get(ClientType.PYTHON)));
}
Program: 45827
Project: 45827
Buggy source:
public Map<String,String> getParameters(){
  return parameters;
}

Fixed version (ground truth):
Map<String,String> getParameters(){
  return parameters;
}
Program: 45828
Project: 45828
Buggy source:
public void shutdown(){
}

Fixed version (ground truth):
public void shutdown(){
  if (phoneHomeFuture != null) {
    phoneHomeFuture.cancel(true);
  }
}
Program: 45830
Project: 45830
Buggy source:
@Test public void testConvertToLetter() throws Exception {
  PhoneHome phoneHome=new PhoneHome();
  assertEquals("String_Node_Str",phoneHome.convertToLetter(4));
  assertEquals("String_Node_Str",phoneHome.convertToLetter(9));
  assertEquals("String_Node_Str",phoneHome.convertToLetter(19));
  assertEquals("String_Node_Str",phoneHome.convertToLetter(39));
  assertEquals("String_Node_Str",phoneHome.convertToLetter(59));
  assertEquals("String_Node_Str",phoneHome.convertToLetter(99));
  assertEquals("String_Node_Str",phoneHome.convertToLetter(149));
  assertEquals("String_Node_Str",phoneHome.convertToLetter(299));
  assertEquals("String_Node_Str",phoneHome.convertToLetter(599));
  assertEquals("String_Node_Str",phoneHome.convertToLetter(1000));
}

Fixed version (ground truth):
@Test public void testConvertToLetter(){
  PhoneHome phoneHome=new PhoneHome();
  assertEquals("String_Node_Str",phoneHome.convertToLetter(4));
  assertEquals("String_Node_Str",phoneHome.convertToLetter(9));
  assertEquals("String_Node_Str",phoneHome.convertToLetter(19));
  assertEquals("String_Node_Str",phoneHome.convertToLetter(39));
  assertEquals("String_Node_Str",phoneHome.convertToLetter(59));
  assertEquals("String_Node_Str",phoneHome.convertToLetter(99));
  assertEquals("String_Node_Str",phoneHome.convertToLetter(149));
  assertEquals("String_Node_Str",phoneHome.convertToLetter(299));
  assertEquals("String_Node_Str",phoneHome.convertToLetter(599));
  assertEquals("String_Node_Str",phoneHome.convertToLetter(1000));
}
Program: 45831
Project: 45831
Buggy source:
@Override public void afterRun() throws Exception {
  LocalQueueStatsImpl queueStats=getQueueService().getLocalQueueStatsImpl(name);
  if (response == null) {
    queueStats.incrementEmptyPolls();
  }
 else {
    queueStats.incrementPolls();
    publishEvent(ItemEventType.REMOVED,data);
  }
}

Fixed version (ground truth):
@Override public void afterRun() throws Exception {
  LocalQueueStatsImpl queueStats=getQueueService().getLocalQueueStatsImpl(name);
  if (data == null) {
    queueStats.incrementEmptyPolls();
  }
 else {
    queueStats.incrementPolls();
    publishEvent(ItemEventType.REMOVED,data);
  }
}
Program: 45832
Project: 45832
Buggy source:
@Override public void run(){
  while (!Thread.currentThread().isInterrupted()) {
    try {
      TransactionContext transactionContext=hazelcastInstance.newTransactionContext();
      transactionContext.beginTransaction();
      try {
        final Object item=transactionContext.getQueue(inQueueName).poll();
        if (item != null && !transactionContext.getQueue(outQueueName).offer(item)) {
          throw new RuntimeException("String_Node_Str");
        }
        transactionContext.commitTransaction();
        if (item != null) {
          counter.incrementAndGet();
        }
      }
 catch (      HazelcastInstanceNotActiveException e) {
        throw e;
      }
catch (      Exception e) {
        try {
          transactionContext.rollbackTransaction();
        }
 catch (        HazelcastInstanceNotActiveException ignored) {
        }
      }
    }
 catch (    HazelcastInstanceNotActiveException e) {
      break;
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  assertEquals(0,listener.removes.get());
}
Program: 45833
Project: 45833
Buggy source:
@Override public Object execute(TransactionalTaskContext context) throws TransactionException {
  TransactionalQueue<String> queue=context.getQueue(queueName);
  queue.offer("String_Node_Str");
  return null;
}

Fixed version (ground truth):
@Override public Object execute(TransactionalTaskContext ctx) throws TransactionException {
  TransactionalQueue<Object> queue=ctx.getQueue(name);
  return queue.poll();
}
Program: 45834
Project: 45834
Buggy source:
Set<QueryableEntry<K,V>> filter(QueryContext queryContext);

Fixed version (ground truth):
/** 
 * Produces a filtered entry set by utilizing the indexes available while executing the query in the given query context. <p> The query engine assumes this method produces the result set faster than a simple evaluation of the predicate on every entry.
 * @param queryContext the query context to access the indexes.
 * @return the produced filtered entry set.
 */
Set<QueryableEntry<K,V>> filter(QueryContext queryContext);
Program: 45835
Project: 45835
Buggy source:
boolean isIndexed(QueryContext queryContext);

Fixed version (ground truth):
/** 
 * Signals to the query engine that this predicate is able to utilize the indexes available while executing the query in the given query context.
 * @param queryContext the query context to consult for the availableindexes.
 * @return {@code true} if this predicate is able to use the indexes tospeed up the processing,  {@code false} otherwise.
 */
boolean isIndexed(QueryContext queryContext);
Program: 45836
Project: 45836
Buggy source:
boolean apply(Map.Entry<K,V> mapEntry);

Fixed version (ground truth):
/** 
 * Applies this predicate to the given map entry. <p> Implementations <i>must</i> be thread-safe, since this method may be called by multiple threads concurrently.
 * @param mapEntry the map entry to apply this predicate to.
 * @return {@code true} if the given map entry matches this predicate,{@code false} otherwise.
 */
boolean apply(Map.Entry<K,V> mapEntry);
Program: 45837
Project: 45837
Buggy source:
Set<QueryableEntry> getSubRecords(ComparisonType comparisonType,Comparable searchedValue);

Fixed version (ground truth):
/** 
 * Produces a result set containing entries whose attribute values are satisfy the comparison of the given type with the given value.
 * @param comparisonType the type of the comparison to perform.
 * @param searchedValue  the value to compare against.
 * @return the produced result set.
 */
Set<QueryableEntry> getSubRecords(ComparisonType comparisonType,Comparable searchedValue);
Program: 45838
Project: 45838
Buggy source:
void removeEntryIndex(Data key,Object value);

Fixed version (ground truth):
/** 
 * Removes the entry having the given key and the value from this index.
 * @param key   the key of the entry to remove.
 * @param value the value of the entry to remove.
 * @throws QueryException if there were errors while extracting theattribute value from the entry.
 */
void removeEntryIndex(Data key,Object value);
Program: 45839
Project: 45839
Buggy source:
/** 
 * Add entry to this index.
 * @param e entry
 * @param oldValue or null if there is no old value
 * @throws QueryException
 */
void saveEntryIndex(QueryableEntry e,Object oldValue) throws QueryException ;

Fixed version (ground truth):
/** 
 * Saves the given entry into this index.
 * @param entry    the entry to save.
 * @param oldValue the previous old value associated with the entry or{@code null} if the entry is new.
 * @throws QueryException if there were errors while extracting theattribute value from the entry.
 */
void saveEntryIndex(QueryableEntry entry,Object oldValue);
Program: 45840
Project: 45840
Buggy source:
/** 
 * Clear out entries from the index
 */
void clear();

Fixed version (ground truth):
/** 
 * Clears out all entries from this index.
 */
void clear();
Program: 45841
Project: 45841
Buggy source:
Set<QueryableEntry> getRecords(Comparable value);

Fixed version (ground truth):
/** 
 * Produces a result set containing entries whose attribute values are equal to at least one of the given values.
 * @param values the values to compare against.
 * @return the produced result set.
 */
Set<QueryableEntry> getRecords(Comparable[] values);
Program: 45842
Project: 45842
Buggy source:
/** 
 * Release all resources hold by the index. (ie. Native memory for HD)
 */
void destroy();

Fixed version (ground truth):
/** 
 * Releases all resources hold by this index, e.g. the allocated native memory for the HD index.
 */
void destroy();
Program: 45843
Project: 45843
Buggy source:
Set<QueryableEntry> getSubRecordsBetween(Comparable from,Comparable to);

Fixed version (ground truth):
/** 
 * Produces a result set by performing a range query on this index. <p> More precisely, this method produces a result set containing entries whose attribute values are greater than or equal to the given  {@code from} value and less than or equal to the given {@code to} value.
 * @param from the beginning of the range (inclusive).
 * @param to   the end of the range (inclusive).
 * @return the produced result set.
 */
Set<QueryableEntry> getSubRecordsBetween(Comparable from,Comparable to);
Program: 45844
Project: 45844
Buggy source:
String getAttributeName();

Fixed version (ground truth):
/** 
 * @return the name of the attribute for which this index is built.
 */
String getAttributeName();
Program: 45845
Project: 45845
Buggy source:
boolean isOrdered();

Fixed version (ground truth):
/** 
 * Tells whether this index is ordered or not. <p> Ordered indexes support the fast evaluation of range queries. Unordered indexes are still capable to execute range queries, but the performance would be about the same as the full scan performance.
 * @return {@code true} if this index is ordered, {@code false} otherwise.
 * @see #getSubRecords
 * @see #getSubRecordsBetween
 */
boolean isOrdered();
Program: 45846
Project: 45846
Buggy source:
/** 
 * Return converter associated with this Index. It can return <code>null</code> if no entry has been saved yet.
 * @return
 */
TypeConverter getConverter();

Fixed version (ground truth):
/** 
 * @return the converter associated with this index; or {@code null} if theconverter is not known because there were no saves to this index and the attribute type is not inferred yet.
 */
TypeConverter getConverter();
Program: 45847
Project: 45847
Buggy source:
public Index getIndex(String attributeName){
  if (indexes == null) {
    return null;
  }
 else {
    return indexes.getIndex(attributeName);
  }
}

Fixed version (ground truth):
/** 
 * Obtains the index available for the given attribute in this query context.
 * @param attributeName the name of the attribute to obtain the index for.
 * @return the obtained index or {@code null} if there is no index availablefor the given attribute.
 */
public Index getIndex(String attributeName){
  if (indexes == null) {
    return null;
  }
 else {
    return indexes.getIndex(attributeName);
  }
}
Program: 45848
Project: 45848
Buggy source:
public QueryContext(Indexes indexes){
  this.indexes=indexes;
}

Fixed version (ground truth):
/** 
 * Creates a new query context with the given available indexes.
 * @param indexes the indexes available for the query context.
 */
public QueryContext(Indexes indexes){
  this.indexes=indexes;
}
Program: 45849
Project: 45849
Buggy source:
public ConfigCheck createConfigCheck(){
  String joinerType=joiner == null ? "String_Node_Str" : joiner.getType();
  return new ConfigCheck(config,joinerType,clusterService.getClusterVersion());
}

Fixed version (ground truth):
public ConfigCheck createConfigCheck(){
  String joinerType=joiner == null ? "String_Node_Str" : joiner.getType();
  return new ConfigCheck(config,joinerType);
}
Program: 45850
Project: 45850
Buggy source:
public ConfigCheck(Config config,String joinerType,Version clusterVersion){
  this.joinerType=joinerType;
  this.clusterVersion=clusterVersion;
  properties.put(PARTITION_COUNT.getName(),config.getProperty(PARTITION_COUNT.getName()));
  properties.put(APPLICATION_VALIDATION_TOKEN.getName(),config.getProperty(APPLICATION_VALIDATION_TOKEN.getName()));
  GroupConfig groupConfig=config.getGroupConfig();
  if (groupConfig != null) {
    this.groupName=groupConfig.getName();
    this.groupPassword=config.getGroupConfig().getPassword();
  }
  final PartitionGroupConfig partitionGroupConfig=config.getPartitionGroupConfig();
  if (partitionGroupConfig != null) {
    partitionGroupEnabled=partitionGroupConfig.isEnabled();
    if (partitionGroupEnabled) {
      memberGroupType=partitionGroupConfig.getGroupType();
    }
 else {
      memberGroupType=PartitionGroupConfig.MemberGroupType.PER_MEMBER;
    }
  }
}

Fixed version (ground truth):
public ConfigCheck(Config config,String joinerType){
  this.joinerType=joinerType;
  properties.put(PARTITION_COUNT.getName(),config.getProperty(PARTITION_COUNT.getName()));
  properties.put(APPLICATION_VALIDATION_TOKEN.getName(),config.getProperty(APPLICATION_VALIDATION_TOKEN.getName()));
  GroupConfig groupConfig=config.getGroupConfig();
  if (groupConfig != null) {
    this.groupName=groupConfig.getName();
  }
  final PartitionGroupConfig partitionGroupConfig=config.getPartitionGroupConfig();
  if (partitionGroupConfig != null) {
    partitionGroupEnabled=partitionGroupConfig.isEnabled();
    if (partitionGroupEnabled) {
      memberGroupType=partitionGroupConfig.getGroupType();
    }
 else {
      memberGroupType=PartitionGroupConfig.MemberGroupType.PER_MEMBER;
    }
  }
}
Program: 45851
Project: 45851
Buggy source:
@Test public void testGroupPasswordNotLeak_whenVersionAboveThreeNine(){
  final Config config=new Config();
  config.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(true).setMulticastTimeoutSeconds(3);
  config.getNetworkConfig().getJoin().getTcpIpConfig().setEnabled(false);
  final AtomicBoolean leaked=new AtomicBoolean(false);
  ObjectDataOutput odo=mock(ObjectDataOutput.class);
  try {
    ConfigCheck configCheck=new ConfigCheck(config,"String_Node_Str",Versions.CURRENT_CLUSTER_VERSION);
    configCheck.writeData(odo);
  }
 catch (  IOException e) {
    fail(e.getMessage());
  }
  try {
    ArgumentCaptor<String> captor=ArgumentCaptor.forClass(String.class);
    verify(odo,times(7)).writeUTF(captor.capture());
    List<String> values=captor.getAllValues();
    if (values.contains(config.getGroupConfig().getPassword())) {
      leaked.set(true);
    }
  }
 catch (  IOException e) {
    fail(e.getMessage());
  }
  assertEquals("String_Node_Str",false,leaked.get());
}

Fixed version (ground truth):
@Test public void testGroupPasswordNotLeak_whenVersionAboveThreeNine(){
  final Config config=new Config();
  config.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(true).setMulticastTimeoutSeconds(3);
  config.getNetworkConfig().getJoin().getTcpIpConfig().setEnabled(false);
  final AtomicBoolean leaked=new AtomicBoolean(false);
  ObjectDataOutput odo=mock(ObjectDataOutput.class);
  try {
    ConfigCheck configCheck=new ConfigCheck(config,"String_Node_Str");
    configCheck.writeData(odo);
  }
 catch (  IOException e) {
    fail(e.getMessage());
  }
  try {
    ArgumentCaptor<String> captor=ArgumentCaptor.forClass(String.class);
    verify(odo,times(7)).writeUTF(captor.capture());
    List<String> values=captor.getAllValues();
    if (values.contains(config.getGroupConfig().getPassword())) {
      leaked.set(true);
    }
  }
 catch (  IOException e) {
    fail(e.getMessage());
  }
  assertEquals("String_Node_Str",false,leaked.get());
}
Program: 45852
Project: 45852
Buggy source:
@Test public void testDestroyAndCreateProxyWithNearCache(){
  factory.newHazelcastInstance();
  ClientConfig clientConfig=new ClientConfig();
  clientConfig.addNearCacheConfig(getNearCacheConfig("String_Node_Str"));
  final HazelcastInstance client=factory.newHazelcastClient(clientConfig);
  int createPutGetThreadCount=2;
  int destroyThreadCount=2;
  ExecutorService pool=Executors.newFixedThreadPool(createPutGetThreadCount + destroyThreadCount);
  final AtomicBoolean isRunning=new AtomicBoolean(true);
  final AtomicReference<Exception> exception=new AtomicReference<Exception>();
  for (int i=0; i < destroyThreadCount; i++) {
    pool.execute(new Runnable(){
      @Override public void run(){
        while (isRunning.get()) {
          for (          DistributedObject distributedObject : client.getDistributedObjects())           distributedObject.destroy();
        }
      }
    }
);
  }
  for (int i=0; i < createPutGetThreadCount; i++) {
    pool.execute(new Runnable(){
      @Override public void run(){
        try {
          while (isRunning.get()) {
            IMap<Object,Object> map=client.getMap("String_Node_Str");
            map.put(1,1);
            map.get(1);
          }
        }
 catch (        Exception e) {
          isRunning.set(false);
          e.printStackTrace(System.out);
          exception.set(e);
        }
      }
    }
);
  }
  sleepSeconds(5);
  isRunning.set(false);
  pool.shutdown();
  assertNull(exception.get());
}

Fixed version (ground truth):
@Test public void testDestroyAndCreateProxyWithNearCache(){
  factory.newHazelcastInstance();
  ClientConfig clientConfig=new ClientConfig();
  clientConfig.addNearCacheConfig(getNearCacheConfig("String_Node_Str"));
  final HazelcastInstance client=factory.newHazelcastClient(clientConfig);
  int createPutGetThreadCount=2;
  int destroyThreadCount=2;
  ExecutorService pool=Executors.newFixedThreadPool(createPutGetThreadCount + destroyThreadCount);
  final AtomicBoolean isRunning=new AtomicBoolean(true);
  final AtomicReference<Exception> exception=new AtomicReference<Exception>();
  for (int i=0; i < destroyThreadCount; i++) {
    pool.execute(new Runnable(){
      @Override public void run(){
        while (isRunning.get()) {
          for (          DistributedObject distributedObject : client.getDistributedObjects()) {
            distributedObject.destroy();
          }
        }
      }
    }
);
  }
  for (int i=0; i < createPutGetThreadCount; i++) {
    pool.execute(new Runnable(){
      @Override public void run(){
        try {
          while (isRunning.get()) {
            IMap<Object,Object> map=client.getMap("String_Node_Str");
            map.put(1,1);
            map.get(1);
          }
        }
 catch (        Exception e) {
          isRunning.set(false);
          e.printStackTrace(System.out);
          exception.set(e);
        }
      }
    }
);
  }
  sleepSeconds(5);
  isRunning.set(false);
  pool.shutdown();
  assertNull(exception.get());
}
Program: 45853
Project: 45853
Buggy source:
@Test public void testBigIntegerConvert_whenPassedDoubleValue_thenConvertToBigInteger() throws Exception {
  Double doubleValue=3.141593;
  Comparable expectedBigIntValue=BigInteger.valueOf(doubleValue.longValue());
  Comparable comparable=TypeConverters.BIG_INTEGER_CONVERTER.convert(doubleValue);
  assertThat(comparable,allOf(is(instanceOf(BigInteger.class)),is(equalTo(expectedBigIntValue))));
}

Fixed version (ground truth):
@Test public void testBigIntegerConvert_whenPassedDoubleValue_thenConvertToBigInteger(){
  Double doubleValue=3.141593;
  Comparable expectedBigIntValue=BigInteger.valueOf(doubleValue.longValue());
  Comparable comparable=TypeConverters.BIG_INTEGER_CONVERTER.convert(doubleValue);
  assertThat(comparable,allOf(is(instanceOf(BigInteger.class)),is(equalTo(expectedBigIntValue))));
}
Program: 45854
Project: 45854
Buggy source:
@Test public void testBigIntegerConvert_whenPassedLongValue_thenConvertToBigInteger() throws Exception {
  Long longValue=3141593L;
  Comparable expectedBigIntValue=BigInteger.valueOf(longValue.longValue());
  Comparable comparable=TypeConverters.BIG_INTEGER_CONVERTER.convert(longValue);
  assertThat(comparable,allOf(is(instanceOf(BigInteger.class)),is(equalTo(expectedBigIntValue))));
}

Fixed version (ground truth):
@Test public void testBigIntegerConvert_whenPassedLongValue_thenConvertToBigInteger(){
  Long longValue=3141593L;
  Comparable expectedBigIntValue=BigInteger.valueOf(longValue);
  Comparable comparable=TypeConverters.BIG_INTEGER_CONVERTER.convert(longValue);
  assertThat(comparable,allOf(is(instanceOf(BigInteger.class)),is(equalTo(expectedBigIntValue))));
}
Program: 45855
Project: 45855
Buggy source:
@Test public void testBigDecimalConvert_whenPassedHugeBigIntegerValue_thenConvertToBigDecimal() throws Exception {
  BigInteger value=BigInteger.ONE.add(BigInteger.valueOf(Long.MAX_VALUE));
  Comparable expectedDecimal=BigDecimal.valueOf(Long.MAX_VALUE).add(BigDecimal.ONE);
  Comparable comparable=TypeConverters.BIG_DECIMAL_CONVERTER.convert(value);
  assertThat(comparable,allOf(is(instanceOf(BigDecimal.class)),is(equalTo(expectedDecimal))));
}

Fixed version (ground truth):
@Test public void testBigDecimalConvert_whenPassedHugeBigIntegerValue_thenConvertToBigDecimal(){
  BigInteger value=BigInteger.ONE.add(BigInteger.valueOf(Long.MAX_VALUE));
  Comparable expectedDecimal=BigDecimal.valueOf(Long.MAX_VALUE).add(BigDecimal.ONE);
  Comparable comparable=TypeConverters.BIG_DECIMAL_CONVERTER.convert(value);
  assertThat(comparable,allOf(is(instanceOf(BigDecimal.class)),is(equalTo(expectedDecimal))));
}
Program: 45856
Project: 45856
Buggy source:
@Test public void testCharConvert_whenPassedString_thenConvertToChar(){
  final Comparable value="String_Node_Str";
  final Comparable expectedCharacter='f';
  final Comparable actualCharacter=TypeConverters.CHAR_CONVERTER.convert(value);
  assertThat(actualCharacter,allOf(is(instanceOf(Character.class)),is(equalTo(expectedCharacter))));
}

Fixed version (ground truth):
@Test public void testCharConvert_whenPassedString_thenConvertToChar(){
  Comparable value="String_Node_Str";
  Comparable expectedCharacter='f';
  Comparable actualCharacter=TypeConverters.CHAR_CONVERTER.convert(value);
  assertThat(actualCharacter,allOf(is(instanceOf(Character.class)),is(equalTo(expectedCharacter))));
}
Program: 45857
Project: 45857
Buggy source:
@Test public void testBigDecimalConvert_whenPassedLongValue_thenConvertToBigDecimal() throws Exception {
  Long longValue=3141593L;
  Comparable expectedDecimal=BigDecimal.valueOf(longValue.longValue());
  Comparable comparable=TypeConverters.BIG_DECIMAL_CONVERTER.convert(longValue);
  assertThat(comparable,allOf(is(instanceOf(BigDecimal.class)),is(equalTo(expectedDecimal))));
}

Fixed version (ground truth):
@Test public void testBigDecimalConvert_whenPassedLongValue_thenConvertToBigDecimal(){
  Long longValue=3141593L;
  Comparable expectedDecimal=BigDecimal.valueOf(longValue);
  Comparable comparable=TypeConverters.BIG_DECIMAL_CONVERTER.convert(longValue);
  assertThat(comparable,allOf(is(instanceOf(BigDecimal.class)),is(equalTo(expectedDecimal))));
}
Program: 45858
Project: 45858
Buggy source:
@Test public void testBigDecimalConvert_whenPassedDoubleValue_thenConvertToBigDecimal() throws Exception {
  Double doubleValue=3.141593;
  Comparable expectedDecimal=new BigDecimal(doubleValue);
  Comparable comparable=TypeConverters.BIG_DECIMAL_CONVERTER.convert(doubleValue);
  assertThat(comparable,allOf(is(instanceOf(BigDecimal.class)),is(equalTo(expectedDecimal))));
}

Fixed version (ground truth):
/** 
 * Checks that the   {@link TypeConverters#BIG_DECIMAL_CONVERTER} doesn't return a rounded {@link BigDecimal}.
 */
@Test public void testBigDecimalConvert_whenPassedDoubleValue_thenConvertToBigDecimal(){
  Double doubleValue=3.141593;
  Comparable expectedDecimal=BigDecimal.valueOf(doubleValue);
  Comparable unexpectedDecimal=new BigDecimal(doubleValue);
  Comparable comparable=TypeConverters.BIG_DECIMAL_CONVERTER.convert(doubleValue);
  assertThat(comparable,allOf(is(instanceOf(BigDecimal.class)),is(equalTo(expectedDecimal)),not(equalTo(unexpectedDecimal))));
}
Program: 45859
Project: 45859
Buggy source:
@Test public void testBigIntegerConvert_whenPassedNullValue_thenConvertToBigInteger() throws Exception {
  Comparable value="String_Node_Str";
  thrown.expect(NumberFormatException.class);
  thrown.expectMessage(startsWith("String_Node_Str"));
  TypeConverters.BIG_INTEGER_CONVERTER.convert(value);
}

Fixed version (ground truth):
@Test public void testBigIntegerConvert_whenPassedNullValue_thenConvertToBigInteger(){
  Comparable value="String_Node_Str";
  thrown.expect(NumberFormatException.class);
  thrown.expectMessage(startsWith("String_Node_Str"));
  TypeConverters.BIG_INTEGER_CONVERTER.convert(value);
}
Program: 45860
Project: 45860
Buggy source:
@Test public void testBigIntegerConvert_whenPassedBigDecimalValue_thenConvertToBigInteger() throws Exception {
  BigDecimal value=BigDecimal.valueOf(4.9999);
  Comparable expectedBigIntValue=BigInteger.valueOf(value.longValue());
  Comparable comparable=TypeConverters.BIG_INTEGER_CONVERTER.convert(value);
  assertThat(comparable,allOf(is(instanceOf(BigInteger.class)),is(equalTo(expectedBigIntValue))));
}

Fixed version (ground truth):
@Test public void testBigIntegerConvert_whenPassedBigDecimalValue_thenConvertToBigInteger(){
  BigDecimal value=BigDecimal.valueOf(4.9999);
  Comparable expectedBigIntValue=BigInteger.valueOf(value.longValue());
  Comparable comparable=TypeConverters.BIG_INTEGER_CONVERTER.convert(value);
  assertThat(comparable,allOf(is(instanceOf(BigInteger.class)),is(equalTo(expectedBigIntValue))));
}
Program: 45861
Project: 45861
Buggy source:
@Test public void testBigDecimalConvert_whenPassedFloatValue_thenConvertToBigDecimal() throws Exception {
  Float floatValue=3.141593F;
  Comparable expectedDecimal=new BigDecimal(floatValue);
  Comparable comparable=TypeConverters.BIG_DECIMAL_CONVERTER.convert(floatValue);
  assertThat(comparable,allOf(is(instanceOf(BigDecimal.class)),is(equalTo(expectedDecimal))));
}

Fixed version (ground truth):
/** 
 * Checks that the   {@link TypeConverters#BIG_DECIMAL_CONVERTER} doesn't return a rounded {@link BigDecimal}.
 */
@Test public void testBigDecimalConvert_whenPassedFloatValue_thenConvertToBigDecimal(){
  Float floatValue=3.141593F;
  Comparable expectedDecimal=BigDecimal.valueOf(floatValue);
  Comparable unexpectedDecimal=new BigDecimal(floatValue);
  Comparable comparable=TypeConverters.BIG_DECIMAL_CONVERTER.convert(floatValue);
  assertThat(comparable,allOf(is(instanceOf(BigDecimal.class)),is(equalTo(expectedDecimal)),not(equalTo(unexpectedDecimal))));
}
Program: 45862
Project: 45862
Buggy source:
@Test public void testBigDecimalConvert_whenPassedIntegerValue_thenConvertToBigDecimal() throws Exception {
  Integer integerValue=3141593;
  Comparable expectedDecimal=new BigDecimal(integerValue.toString());
  Comparable comparable=TypeConverters.BIG_DECIMAL_CONVERTER.convert(integerValue);
  assertThat(comparable,allOf(is(instanceOf(BigDecimal.class)),is(equalTo(expectedDecimal))));
}

Fixed version (ground truth):
@Test public void testBigDecimalConvert_whenPassedIntegerValue_thenConvertToBigDecimal(){
  Integer integerValue=3141593;
  Comparable expectedDecimal=new BigDecimal(integerValue.toString());
  Comparable comparable=TypeConverters.BIG_DECIMAL_CONVERTER.convert(integerValue);
  assertThat(comparable,allOf(is(instanceOf(BigDecimal.class)),is(equalTo(expectedDecimal))));
}
Program: 45863
Project: 45863
Buggy source:
@Test public void testBigDecimalConvert_whenPassedNullValue_thenConvertToBigDecimal() throws Exception {
  Comparable value="String_Node_Str";
  thrown.expect(NumberFormatException.class);
  TypeConverters.BIG_DECIMAL_CONVERTER.convert(value);
}

Fixed version (ground truth):
@Test public void testBigDecimalConvert_whenPassedNullValue_thenConvertToBigDecimal(){
  Comparable value="String_Node_Str";
  thrown.expect(NumberFormatException.class);
  TypeConverters.BIG_DECIMAL_CONVERTER.convert(value);
}
Program: 45864
Project: 45864
Buggy source:
@Test public void testBigDecimalConvert_whenPassedBigIntegerValue_thenConvertToBigDecimal() throws Exception {
  BigInteger value=BigInteger.ONE;
  Comparable expectedDecimal=BigDecimal.valueOf(value.longValue());
  Comparable comparable=TypeConverters.BIG_DECIMAL_CONVERTER.convert(value);
  assertThat(comparable,allOf(is(instanceOf(BigDecimal.class)),is(equalTo(expectedDecimal))));
}

Fixed version (ground truth):
@Test public void testBigDecimalConvert_whenPassedBigIntegerValue_thenConvertToBigDecimal(){
  BigInteger value=BigInteger.ONE;
  Comparable expectedDecimal=BigDecimal.valueOf(value.longValue());
  Comparable comparable=TypeConverters.BIG_DECIMAL_CONVERTER.convert(value);
  assertThat(comparable,allOf(is(instanceOf(BigDecimal.class)),is(equalTo(expectedDecimal))));
}
Program: 45865
Project: 45865
Buggy source:
@Test public void testBigIntegerConvert_whenPassedFloatValue_thenConvertToBigInteger() throws Exception {
  Float doubleValue=3.141593F;
  Comparable expectedBigIntValue=BigInteger.valueOf(3);
  Comparable comparable=TypeConverters.BIG_INTEGER_CONVERTER.convert(doubleValue);
  assertThat(comparable,allOf(is(instanceOf(BigInteger.class)),is(equalTo(expectedBigIntValue))));
}

Fixed version (ground truth):
@Test public void testBigIntegerConvert_whenPassedFloatValue_thenConvertToBigInteger(){
  Float doubleValue=3.141593F;
  Comparable expectedBigIntValue=BigInteger.valueOf(3);
  Comparable comparable=TypeConverters.BIG_INTEGER_CONVERTER.convert(doubleValue);
  assertThat(comparable,allOf(is(instanceOf(BigInteger.class)),is(equalTo(expectedBigIntValue))));
}
Program: 45866
Project: 45866
Buggy source:
@Test public void testBigIntegerConvert_whenPassedBigIntegerValue_thenConvertToBigInteger() throws Exception {
  BigInteger value=BigInteger.ONE;
  Comparable expectedBigIntValue=BigInteger.valueOf(value.longValue());
  Comparable comparable=TypeConverters.BIG_INTEGER_CONVERTER.convert(value);
  assertThat(comparable,allOf(is(instanceOf(BigInteger.class)),is(equalTo(expectedBigIntValue))));
}

Fixed version (ground truth):
@Test public void testBigIntegerConvert_whenPassedBigIntegerValue_thenConvertToBigInteger(){
  BigInteger value=BigInteger.ONE;
  Comparable expectedBigIntValue=BigInteger.valueOf(value.longValue());
  Comparable comparable=TypeConverters.BIG_INTEGER_CONVERTER.convert(value);
  assertThat(comparable,allOf(is(instanceOf(BigInteger.class)),is(equalTo(expectedBigIntValue))));
}
Program: 45867
Project: 45867
Buggy source:
@Test public void testBigDecimalConvert_whenPassedBooleanValue_thenConvertToBigDecimal() throws Exception {
  Boolean value=Boolean.TRUE;
  Comparable trueAsDecimal=BigDecimal.ONE;
  Comparable comparable=TypeConverters.BIG_DECIMAL_CONVERTER.convert(value);
  assertThat(comparable,allOf(is(instanceOf(BigDecimal.class)),is(equalTo(trueAsDecimal))));
}

Fixed version (ground truth):
@Test @SuppressWarnings("String_Node_Str") public void testBigDecimalConvert_whenPassedBooleanValue_thenConvertToBigDecimal(){
  Boolean value=Boolean.TRUE;
  Comparable trueAsDecimal=BigDecimal.ONE;
  Comparable comparable=TypeConverters.BIG_DECIMAL_CONVERTER.convert(value);
  assertThat(comparable,allOf(is(instanceOf(BigDecimal.class)),is(equalTo(trueAsDecimal))));
}
Program: 45868
Project: 45868
Buggy source:
@Test public void testCharConvert_whenPassedNumeric_thenConvertToChar(){
  final Comparable value=1;
  final Comparable expectedCharacter=(char)1;
  final Comparable actualCharacter=TypeConverters.CHAR_CONVERTER.convert(value);
  assertThat(actualCharacter,allOf(is(instanceOf(Character.class)),is(equalTo(expectedCharacter))));
}

Fixed version (ground truth):
@Test public void testCharConvert_whenPassedNumeric_thenConvertToChar(){
  Comparable value=1;
  Comparable expectedCharacter=(char)1;
  Comparable actualCharacter=TypeConverters.CHAR_CONVERTER.convert(value);
  assertThat(actualCharacter,allOf(is(instanceOf(Character.class)),is(equalTo(expectedCharacter))));
}
Program: 45869
Project: 45869
Buggy source:
@Test public void testCharConvert_whenPassedEmptyString_thenConvertToChar(){
  final Comparable value="String_Node_Str";
  thrown.expect(IllegalArgumentException.class);
  TypeConverters.CHAR_CONVERTER.convert(value);
}

Fixed version (ground truth):
@Test public void testCharConvert_whenPassedEmptyString_thenConvertToChar(){
  Comparable value="String_Node_Str";
  thrown.expect(IllegalArgumentException.class);
  TypeConverters.CHAR_CONVERTER.convert(value);
}
Program: 45870
Project: 45870
Buggy source:
@Test public void testBigIntegerConvert_whenPassedIntegerValue_thenConvertToBigInteger() throws Exception {
  Integer integerValue=3141593;
  Comparable expectedBigIntValue=BigInteger.valueOf(integerValue.longValue());
  Comparable comparable=TypeConverters.BIG_INTEGER_CONVERTER.convert(integerValue);
  assertThat(comparable,allOf(is(instanceOf(BigInteger.class)),is(equalTo(expectedBigIntValue))));
}

Fixed version (ground truth):
@Test public void testBigIntegerConvert_whenPassedIntegerValue_thenConvertToBigInteger(){
  Integer integerValue=3141593;
  Comparable expectedBigIntValue=BigInteger.valueOf(integerValue.longValue());
  Comparable comparable=TypeConverters.BIG_INTEGER_CONVERTER.convert(integerValue);
  assertThat(comparable,allOf(is(instanceOf(BigInteger.class)),is(equalTo(expectedBigIntValue))));
}
Program: 45871
Project: 45871
Buggy source:
@Test public void testBigDecimalConvert_whenPassedStringValue_thenConvertToBigDecimal() throws Exception {
  String stringValue="String_Node_Str";
  Comparable expectedDecimal=new BigDecimal(stringValue);
  Comparable comparable=TypeConverters.BIG_DECIMAL_CONVERTER.convert(stringValue);
  assertThat(comparable,allOf(is(instanceOf(BigDecimal.class)),is(equalTo(expectedDecimal))));
}

Fixed version (ground truth):
@Test public void testBigDecimalConvert_whenPassedStringValue_thenConvertToBigDecimal(){
  String stringValue="String_Node_Str";
  Comparable expectedDecimal=new BigDecimal(stringValue);
  Comparable comparable=TypeConverters.BIG_DECIMAL_CONVERTER.convert(stringValue);
  assertThat(comparable,allOf(is(instanceOf(BigDecimal.class)),is(equalTo(expectedDecimal))));
}
Program: 45872
Project: 45872
Buggy source:
@Test public void testBigIntegerConvert_whenPassedStringValue_thenConvertToBigInteger() throws Exception {
  String stringValue="String_Node_Str";
  Comparable expectedBigIntValue=new BigInteger(stringValue);
  Comparable comparable=TypeConverters.BIG_INTEGER_CONVERTER.convert(stringValue);
  assertThat(comparable,allOf(is(instanceOf(BigInteger.class)),is(equalTo(expectedBigIntValue))));
}

Fixed version (ground truth):
@Test public void testBigIntegerConvert_whenPassedStringValue_thenConvertToBigInteger(){
  String stringValue="String_Node_Str";
  Comparable expectedBigIntValue=new BigInteger(stringValue);
  Comparable comparable=TypeConverters.BIG_INTEGER_CONVERTER.convert(stringValue);
  assertThat(comparable,allOf(is(instanceOf(BigInteger.class)),is(equalTo(expectedBigIntValue))));
}
Program: 45873
Project: 45873
Buggy source:
@Test public void testBigIntegerConvert_whenPassedHugeBigDecimalValue_thenConvertToBigInteger() throws Exception {
  BigDecimal value=BigDecimal.ONE.add(BigDecimal.valueOf(Long.MAX_VALUE));
  Comparable expectedBigIntValue=BigInteger.valueOf(Long.MAX_VALUE).add(BigInteger.ONE);
  Comparable comparable=TypeConverters.BIG_INTEGER_CONVERTER.convert(value);
  assertThat(comparable,allOf(is(instanceOf(BigInteger.class)),is(equalTo(expectedBigIntValue))));
}

Fixed version (ground truth):
@Test public void testBigIntegerConvert_whenPassedHugeBigDecimalValue_thenConvertToBigInteger(){
  BigDecimal value=BigDecimal.ONE.add(BigDecimal.valueOf(Long.MAX_VALUE));
  Comparable expectedBigIntValue=BigInteger.valueOf(Long.MAX_VALUE).add(BigInteger.ONE);
  Comparable comparable=TypeConverters.BIG_INTEGER_CONVERTER.convert(value);
  assertThat(comparable,allOf(is(instanceOf(BigInteger.class)),is(equalTo(expectedBigIntValue))));
}
Program: 45874
Project: 45874
Buggy source:
@Test public void testBigIntegerConvert_whenPassedBooleanValue_thenConvertToBigInteger() throws Exception {
  Boolean value=Boolean.TRUE;
  Comparable trueAsNumber=BigInteger.ONE;
  Comparable comparable=TypeConverters.BIG_INTEGER_CONVERTER.convert(value);
  assertThat(comparable,allOf(is(instanceOf(BigInteger.class)),is(equalTo(trueAsNumber))));
}

Fixed version (ground truth):
@Test @SuppressWarnings("String_Node_Str") public void testBigIntegerConvert_whenPassedBooleanValue_thenConvertToBigInteger(){
  Boolean value=Boolean.TRUE;
  Comparable trueAsNumber=BigInteger.ONE;
  Comparable comparable=TypeConverters.BIG_INTEGER_CONVERTER.convert(value);
  assertThat(comparable,allOf(is(instanceOf(BigInteger.class)),is(equalTo(trueAsNumber))));
}
Program: 45875
Project: 45875
Buggy source:
@Test public void shutdownMasterMember_withoutPartitionInitialization(){
  HazelcastInstance hz1=factory.newHazelcastInstance();
  HazelcastInstance hz2=factory.newHazelcastInstance();
  HazelcastInstance hz3=factory.newHazelcastInstance();
  hz1.shutdown();
}

Fixed version (ground truth):
@Test @SuppressWarnings("String_Node_Str") public void shutdownMasterMember_withoutPartitionInitialization(){
  HazelcastInstance hz1=factory.newHazelcastInstance();
  HazelcastInstance hz2=factory.newHazelcastInstance();
  HazelcastInstance hz3=factory.newHazelcastInstance();
  hz1.shutdown();
}
Program: 45876
Project: 45876
Buggy source:
@Test public void shutdownSlaveMember_whilePartitionsMigrating(){
  Config config=new Config();
  config.setProperty(GroupProperty.PARTITION_COUNT.getName(),"String_Node_Str");
  config.setProperty(GroupProperty.PARTITION_MIGRATION_INTERVAL.getName(),"String_Node_Str");
  HazelcastInstance hz1=factory.newHazelcastInstance(config);
  warmUpPartitions(hz1);
  HazelcastInstance hz2=factory.newHazelcastInstance(config);
  HazelcastInstance hz3=factory.newHazelcastInstance(config);
  hz2.shutdown();
  assertPartitionAssignments();
}

Fixed version (ground truth):
@Test @SuppressWarnings("String_Node_Str") public void shutdownSlaveMember_whilePartitionsMigrating(){
  Config config=new Config().setProperty(GroupProperty.PARTITION_COUNT.getName(),"String_Node_Str").setProperty(GroupProperty.PARTITION_MIGRATION_INTERVAL.getName(),"String_Node_Str");
  HazelcastInstance hz1=factory.newHazelcastInstance(config);
  warmUpPartitions(hz1);
  HazelcastInstance hz2=factory.newHazelcastInstance(config);
  HazelcastInstance hz3=factory.newHazelcastInstance(config);
  hz2.shutdown();
  assertPartitionAssignments();
}
Program: 45877
Project: 45877
Buggy source:
@Test public void shutdownMemberAndCluster_withoutPartitionInitialization() throws Exception {
  shutdownMemberAndCluster(false);
}

Fixed version (ground truth):
@Test public void shutdownMemberAndCluster_withoutPartitionInitialization(){
  shutdownMemberAndCluster(false);
}
Program: 45878
Project: 45878
Buggy source:
@Test public void shutdownMemberAndCluster_withPartitionInitialization() throws Exception {
  shutdownMemberAndCluster(true);
}

Fixed version (ground truth):
@Test public void shutdownMemberAndCluster_withPartitionInitialization(){
  shutdownMemberAndCluster(true);
}
Program: 45879
Project: 45879
Buggy source:
@Test public void shutdownMasterMember_whenClusterPassive_withoutPartitionInitialization() throws Exception {
  shutdownMember_whenClusterNotActive(true,false,ClusterState.PASSIVE);
}

Fixed version (ground truth):
@Test public void shutdownMasterMember_whenClusterPassive_withoutPartitionInitialization(){
  shutdownMember_whenClusterNotActive(true,false,ClusterState.PASSIVE);
}
Program: 45880
Project: 45880
Buggy source:
private void shutdownMemberAndCluster(boolean initializePartitions) throws Exception {
  Config config=new Config();
  HazelcastInstance master=factory.newHazelcastInstance(config);
  HazelcastInstance[] slaves=factory.newInstances(config,3);
  if (initializePartitions) {
    warmUpPartitions(master);
  }
  master.shutdown();
  changeClusterStateEventually(slaves[0],ClusterState.PASSIVE);
  slaves[0].getCluster().shutdown();
}

Fixed version (ground truth):
private void shutdownMemberAndCluster(boolean initializePartitions){
  Config config=new Config();
  HazelcastInstance master=factory.newHazelcastInstance(config);
  HazelcastInstance[] slaves=factory.newInstances(config,3);
  if (initializePartitions) {
    warmUpPartitions(master);
  }
  master.shutdown();
  changeClusterStateEventually(slaves[0],ClusterState.PASSIVE);
  slaves[0].getCluster().shutdown();
}
Program: 45881
Project: 45881
Buggy source:
@Test public void shutdownMasterMember_whilePartitionsMigrating(){
  Config config=newConfig();
  HazelcastInstance hz1=factory.newHazelcastInstance(config);
  warmUpPartitions(hz1);
  HazelcastInstance hz2=factory.newHazelcastInstance(config);
  HazelcastInstance hz3=factory.newHazelcastInstance(config);
  hz1.shutdown();
  assertPartitionAssignments();
}

Fixed version (ground truth):
@Test @SuppressWarnings("String_Node_Str") public void shutdownMasterMember_whilePartitionsMigrating(){
  Config config=newConfig();
  HazelcastInstance hz1=factory.newHazelcastInstance(config);
  warmUpPartitions(hz1);
  HazelcastInstance hz2=factory.newHazelcastInstance(config);
  HazelcastInstance hz3=factory.newHazelcastInstance(config);
  hz1.shutdown();
  assertPartitionAssignments();
}
Program: 45882
Project: 45882
Buggy source:
@Test public void shutdownSlaveMember_whenClusterFrozen_withPartitionInitialization() throws Exception {
  shutdownMember_whenClusterNotActive(false,true,ClusterState.FROZEN);
}

Fixed version (ground truth):
@Test public void shutdownSlaveMember_whenClusterFrozen_withPartitionInitialization(){
  shutdownMember_whenClusterNotActive(false,true,ClusterState.FROZEN);
}
Program: 45883
Project: 45883
Buggy source:
@Test public void shutdownMasterMember_whenClusterFrozen_withPartitionInitialization() throws Exception {
  shutdownMember_whenClusterNotActive(true,true,ClusterState.FROZEN);
}

Fixed version (ground truth):
@Test public void shutdownMasterMember_whenClusterFrozen_withPartitionInitialization(){
  shutdownMember_whenClusterNotActive(true,true,ClusterState.FROZEN);
}
Program: 45884
Project: 45884
Buggy source:
@Test public void shutdownMasterMember_whenClusterFrozen_withoutPartitionInitialization() throws Exception {
  shutdownMember_whenClusterNotActive(true,false,ClusterState.FROZEN);
}

Fixed version (ground truth):
@Test public void shutdownMasterMember_whenClusterFrozen_withoutPartitionInitialization(){
  shutdownMember_whenClusterNotActive(true,false,ClusterState.FROZEN);
}
Program: 45885
Project: 45885
Buggy source:
@Test public void shutdownSlaveMember_whenClusterPassive_withPartitionInitialization() throws Exception {
  shutdownMember_whenClusterNotActive(false,true,ClusterState.PASSIVE);
}

Fixed version (ground truth):
@Test public void shutdownSlaveMember_whenClusterPassive_withPartitionInitialization(){
  shutdownMember_whenClusterNotActive(false,true,ClusterState.PASSIVE);
}
Program: 45886
Project: 45886
Buggy source:
private void shutdownMember_whenClusterNotActive(boolean shutdownMaster,boolean initializePartitions,ClusterState state) throws Exception {
  Config config=new Config();
  HazelcastInstance master=factory.newHazelcastInstance(config);
  HazelcastInstance[] slaves=factory.newInstances(config,3);
  if (initializePartitions) {
    warmUpPartitions(slaves);
  }
  changeClusterStateEventually(slaves[0],state);
  InternalPartition[] partitionsBefore=getPartitionTable(master);
  if (shutdownMaster) {
    master.shutdown();
  }
 else {
    slaves[0].shutdown();
  }
  InternalPartition[] partitionsAfter=getPartitionTable(slaves[slaves.length - 1]);
  assertPartitionTableEquals(partitionsBefore,partitionsAfter);
}

Fixed version (ground truth):
private void shutdownMember_whenClusterNotActive(boolean shutdownMaster,boolean initializePartitions,ClusterState state){
  Config config=new Config();
  HazelcastInstance master=factory.newHazelcastInstance(config);
  HazelcastInstance[] slaves=factory.newInstances(config,3);
  if (initializePartitions) {
    warmUpPartitions(slaves);
  }
  changeClusterStateEventually(slaves[0],state);
  InternalPartition[] partitionsBefore=getPartitionTable(master);
  if (shutdownMaster) {
    master.shutdown();
  }
 else {
    slaves[0].shutdown();
  }
  InternalPartition[] partitionsAfter=getPartitionTable(slaves[slaves.length - 1]);
  assertPartitionTableEquals(partitionsBefore,partitionsAfter);
}
Program: 45887
Project: 45887
Buggy source:
private void assertPartitionTableEquals(InternalPartition[] partitions1,InternalPartition[] partitions2){
  assertEquals(partitions1.length,partitions2.length);
  for (int i=0; i < partitions1.length; i++) {
    assertPartitionEquals(partitions1[i],partitions2[i]);
  }
}

Fixed version (ground truth):
private static void assertPartitionTableEquals(InternalPartition[] partitions1,InternalPartition[] partitions2){
  assertEquals(partitions1.length,partitions2.length);
  for (int i=0; i < partitions1.length; i++) {
    assertPartitionEquals(partitions1[i],partitions2[i]);
  }
}
Program: 45888
Project: 45888
Buggy source:
private Config newConfig(){
  Config config=new Config();
  config.setProperty(GroupProperty.PARTITION_COUNT.getName(),"String_Node_Str");
  config.setProperty(GroupProperty.PARTITION_MIGRATION_INTERVAL.getName(),"String_Node_Str");
  return config;
}

Fixed version (ground truth):
private static Config newConfig(){
  return new Config().setProperty(GroupProperty.PARTITION_COUNT.getName(),"String_Node_Str").setProperty(GroupProperty.PARTITION_MIGRATION_INTERVAL.getName(),"String_Node_Str");
}
Program: 45889
Project: 45889
Buggy source:
@Test public void shutdownMasterMember_whenClusterPassive_withPartitionInitialization() throws Exception {
  shutdownMember_whenClusterNotActive(true,true,ClusterState.PASSIVE);
}

Fixed version (ground truth):
@Test public void shutdownMasterMember_whenClusterPassive_withPartitionInitialization(){
  shutdownMember_whenClusterNotActive(true,true,ClusterState.PASSIVE);
}
Program: 45890
Project: 45890
Buggy source:
private InternalPartition[] getPartitionTable(HazelcastInstance instance){
  InternalPartitionServiceImpl partitionService=getNode(instance).partitionService;
  return partitionService.getPartitionStateManager().getPartitionsCopy();
}

Fixed version (ground truth):
private static InternalPartition[] getPartitionTable(HazelcastInstance instance){
  InternalPartitionServiceImpl partitionService=getNode(instance).partitionService;
  return partitionService.getPartitionStateManager().getPartitionsCopy();
}