nus-yam/ex-repair huggingface dataset:
Program: 49709
Project: 49709
Buggy source:
public void run(){
  try {
    while (running) {
      Runnable r=null;
      while (migrationActive.get() && (r=immediateTasksQueue.poll()) != null) {
        safeRunImmediate(r);
      }
      if (!running) {
        break;
      }
      if (!migrationActive.get() || scheduledTasksQueue.isEmpty()) {
        Thread.sleep(250);
        continue;
      }
      long totalWait=0L;
      while (migrationActive.get() && running && r == null && totalWait < partitionMigrationInterval) {
        long start=System.currentTimeMillis();
        r=immediateTasksQueue.poll(1,TimeUnit.SECONDS);
        safeRunImmediate(r);
        totalWait+=(System.currentTimeMillis() - start);
      }
      if (migrationActive.get() && running) {
        r=scheduledTasksQueue.poll();
        safeRun(r);
      }
    }
  }
 catch (  InterruptedException e) {
    logger.log(Level.FINEST,"String_Node_Str" + e.getMessage(),e);
    running=false;
  }
 finally {
    clearTaskQueues();
  }
}

Fixed version (ground truth):
public void run(){
  ThreadContext.get().setCurrentFactory(concurrentMapManager.node.factory);
  try {
    while (running) {
      Runnable r=null;
      while (migrationActive.get() && (r=immediateTasksQueue.poll()) != null) {
        safeRunImmediate(r);
      }
      if (!running) {
        break;
      }
      if (!migrationActive.get() || scheduledTasksQueue.isEmpty()) {
        Thread.sleep(250);
        continue;
      }
      long totalWait=0L;
      while (migrationActive.get() && running && r == null && totalWait < partitionMigrationInterval) {
        long start=System.currentTimeMillis();
        r=immediateTasksQueue.poll(1,TimeUnit.SECONDS);
        safeRunImmediate(r);
        totalWait+=(System.currentTimeMillis() - start);
      }
      if (migrationActive.get() && running) {
        r=scheduledTasksQueue.poll();
        safeRun(r);
      }
    }
  }
 catch (  InterruptedException e) {
    logger.log(Level.FINEST,"String_Node_Str" + e.getMessage(),e);
    running=false;
  }
 finally {
    clearTaskQueues();
  }
}
Program: 49710
Project: 49710
Buggy source:
void prepareMigrationTasks(){
  PartitionStateGenerator psg=getPartitionStateGenerator();
  psg.reArrange(partitions,members,PARTITION_COUNT,scheduledQ,immediateQ);
}

Fixed version (ground truth):
void prepareMigrationTasks(){
  PartitionStateGenerator psg=getPartitionStateGenerator();
  psg.reArrange(partitions,members,PARTITION_COUNT,lostQ,immediateQ,scheduledQ);
}
Program: 49711
Project: 49711
Buggy source:
void fillMigrationQueues(){
  clearTaskQueues();
  for (  MigrationRequestTask migrationRequestTask : immediateQ) {
    immediateTasksQueue.offer(new Migrator(migrationRequestTask));
  }
  immediateQ.clear();
  for (  MigrationRequestTask migrationRequestTask : scheduledQ) {
    scheduledTasksQueue.offer(new Migrator(migrationRequestTask));
  }
  scheduledQ.clear();
}

Fixed version (ground truth):
void fillMigrationQueues(){
  clearTaskQueues();
  if (!lostQ.isEmpty()) {
    concurrentMapManager.enqueueAndReturn(new LostPartitionsAssignmentProcess(lostQ));
    logger.log(Level.INFO,"String_Node_Str" + lostQ.size() + "String_Node_Str");
  }
  for (  MigrationRequestTask migrationRequestTask : immediateQ) {
    immediateTasksQueue.offer(new Migrator(migrationRequestTask));
  }
  immediateQ.clear();
  for (  MigrationRequestTask migrationRequestTask : scheduledQ) {
    scheduledTasksQueue.offer(new Migrator(migrationRequestTask));
  }
  scheduledQ.clear();
}
Program: 49712
Project: 49712
Buggy source:
PartitionInfo[] reArrange(final PartitionInfo[] currentState,final Collection<MemberImpl> members,final int partitionCount,final List<MigrationRequestTask> scheduledTasksList,final List<MigrationRequestTask> immediateTasksList);

Fixed version (ground truth):
PartitionInfo[] reArrange(final PartitionInfo[] currentState,final Collection<MemberImpl> members,final int partitionCount,final List<MigrationRequestTask> lostPartitionTasksList,final List<MigrationRequestTask> immediateTasksList,final List<MigrationRequestTask> scheduledTasksList);
Program: 49714
Project: 49714
Buggy source:
public PartitionInfo[] reArrange(PartitionInfo[] currentState,Collection<MemberImpl> members,int partitionCount,List<MigrationRequestTask> scheduledTasksList,List<MigrationRequestTask> immediateTasksList){
  final LinkedList<NodeGroup> groups=createNodeGroups(memberGroupFactory.createMemberGroups(members));
  if (groups.size() == 0)   return currentState;
  PartitionInfo[] newState=arrange(groups,partitionCount,new CopyStateInitializer(currentState));
  finalizeArrangement(currentState,newState,Math.min(groups.size(),PartitionInfo.MAX_REPLICA_COUNT),scheduledTasksList,immediateTasksList);
  return newState;
}

Fixed version (ground truth):
public PartitionInfo[] reArrange(PartitionInfo[] currentState,Collection<MemberImpl> members,int partitionCount,List<MigrationRequestTask> lostPartitionTasksList,List<MigrationRequestTask> immediateTasksList,List<MigrationRequestTask> scheduledTasksList){
  final LinkedList<NodeGroup> groups=createNodeGroups(memberGroupFactory.createMemberGroups(members));
  if (groups.size() == 0)   return currentState;
  PartitionInfo[] newState=arrange(groups,partitionCount,new CopyStateInitializer(currentState));
  finalizeArrangement(currentState,newState,lostPartitionTasksList,immediateTasksList,scheduledTasksList);
  return newState;
}
Program: 49715
Project: 49715
Buggy source:
/** 
 * Shuts down all running Hazelcast Instances on this JVM, including the default one if it is running. It doesn't shutdown all members of the cluster but just the ones running on this JVM.
 * @see #newHazelcastInstance(Config)
 */
public static void shutdownAll(){
  com.hazelcast.impl.FactoryImpl.shutdownAll();
  defaultInstance.set(null);
}

Fixed version (ground truth):
/** 
 * Shuts down all running Hazelcast Instances on this JVM, including the default one if it is running. It doesn't shutdown all members of the cluster but just the ones running on this JVM.
 * @see #newHazelcastInstance(Config)
 */
public static void shutdownAll(){
  com.hazelcast.impl.FactoryImpl.shutdownAll();
synchronized (initLock) {
    defaultInstance.set(null);
  }
}
Program: 49716
Project: 49716
Buggy source:
public void processRequest(TextCommand command){
  if (responseThreadRunnable == null) {
    responseThreadRunnable=new ResponseThreadRunnable();
    Thread thread=new Thread(responseThreadRunnable,"String_Node_Str");
    thread.start();
  }
  parallelExecutor.execute(new CommandExecutor(command));
}

Fixed version (ground truth):
public void processRequest(TextCommand command){
  if (responseThreadRunnable == null) {
synchronized (this) {
      if (responseThreadRunnable == null) {
        responseThreadRunnable=new ResponseThreadRunnable();
        Thread thread=new Thread(responseThreadRunnable,"String_Node_Str");
        thread.start();
      }
    }
  }
  parallelExecutor.execute(new CommandExecutor(command));
}
Program: 49717
Project: 49717
Buggy source:
public void sendEvents(int eventType,String name,Data key,Data value,Map<Address,Boolean> mapListeners,Address callerAddress){
  if (mapListeners != null) {
    final Set<Map.Entry<Address,Boolean>> listeners=mapListeners.entrySet();
    for (    final Map.Entry<Address,Boolean> listener : listeners) {
      final Address toAddress=listener.getKey();
      final boolean includeValue=listener.getValue();
      if (toAddress.isThisAddress()) {
        enqueueEvent(eventType,name,key,(includeValue) ? value : null,callerAddress,true);
      }
 else {
        final Packet packet=obtainPacket();
        packet.set(name,ClusterOperation.EVENT,key,(includeValue) ? value : null);
        packet.lockAddress=callerAddress;
        packet.longValue=eventType;
        final boolean sent=send(packet,toAddress);
        if (!sent)         releasePacket(packet);
      }
    }
  }
}

Fixed version (ground truth):
public void sendEvents(int eventType,String name,Data key,Data value,Map<Address,Boolean> mapListeners,Address callerAddress){
  if (mapListeners != null) {
    final Set<Map.Entry<Address,Boolean>> listeners=mapListeners.entrySet();
    for (    final Map.Entry<Address,Boolean> listener : listeners) {
      final Address toAddress=listener.getKey();
      final boolean includeValue=listener.getValue();
      if (toAddress.isThisAddress()) {
        enqueueEvent(eventType,name,key,value,callerAddress,true);
      }
 else {
        final Packet packet=obtainPacket();
        packet.set(name,ClusterOperation.EVENT,key,(includeValue) ? value : null);
        packet.lockAddress=callerAddress;
        packet.longValue=eventType;
        final boolean sent=send(packet,toAddress);
        if (!sent)         releasePacket(packet);
      }
    }
  }
}
Program: 49718
Project: 49718
Buggy source:
/** 
 * Unregister a cluster instance.
 */
public synchronized void unregister(){
  if (!started) {
    return;
  }
  MBeanServer mbs=mBeanServer();
  Set<ObjectName> entries;
  try {
    entries=mbs.queryNames(ObjectNameSpec.getClusterNameFilter(this.name),null);
    for (    ObjectName name : entries) {
      if (mbs.isRegistered(name)) {
        mbs.unregisterMBean(name);
      }
    }
  }
 catch (  Exception e) {
    logger.log(Level.FINE,"String_Node_Str",e);
  }
  counter.decrementAndGet();
}

Fixed version (ground truth):
/** 
 * Unregister a cluster instance.
 */
public synchronized void unregister(){
  if (!started) {
    return;
  }
  MBeanServer mbs=mBeanServer();
  Set<ObjectName> entries;
  try {
    entries=mbs.queryNames(ObjectNameSpec.getClusterNameFilter(this.name),null);
    for (    ObjectName name : entries) {
      if (mbs.isRegistered(name)) {
        mbs.unregisterMBean(name);
      }
    }
  }
 catch (  Exception e) {
    logger.log(Level.FINEST,"String_Node_Str",e);
  }
  counter.decrementAndGet();
}
Program: 49719
Project: 49719
Buggy source:
/** 
 * Stop the management service
 */
public synchronized static void shutdown(){
  if (counter.get() > 0) {
    return;
  }
  MBeanServer mbs=mBeanServer();
  Set<ObjectName> entries;
  try {
    entries=mbs.queryNames(new ObjectName(ObjectNameSpec.NAME_DOMAIN + "String_Node_Str"),null);
    for (    ObjectName name : entries) {
      if (mbs.isRegistered(name)) {
        mbs.unregisterMBean(name);
      }
    }
  }
 catch (  Exception e) {
    Logger.getLogger("String_Node_Str").log(Level.FINE,"String_Node_Str",e);
  }
  if (statCollectors != null) {
    statCollectors.shutdownNow();
    statCollectors=null;
  }
}

Fixed version (ground truth):
/** 
 * Stop the management service
 */
public synchronized static void shutdown(){
  if (counter.get() > 0) {
    return;
  }
  MBeanServer mbs=mBeanServer();
  Set<ObjectName> entries;
  try {
    entries=mbs.queryNames(new ObjectName(ObjectNameSpec.NAME_DOMAIN + "String_Node_Str"),null);
    for (    ObjectName name : entries) {
      if (mbs.isRegistered(name)) {
        mbs.unregisterMBean(name);
      }
    }
  }
 catch (  Exception e) {
    Logger.getLogger("String_Node_Str").log(Level.FINEST,"String_Node_Str",e);
  }
  if (statCollectors != null) {
    statCollectors.shutdownNow();
    statCollectors=null;
  }
}
Program: 49720
Project: 49720
Buggy source:
public void entryAdded(EntryEvent<String,String> event){
  if (local) {
    localCount.incrementAndGet();
  }
 else {
    globalCount.incrementAndGet();
  }
}

Fixed version (ground truth):
public void entryAdded(EntryEvent<String,String> event){
  if (local) {
    localCount.incrementAndGet();
  }
 else {
    globalCount.incrementAndGet();
  }
  if (event.getValue() != null) {
    valueCount.incrementAndGet();
  }
}
Program: 49721
Project: 49721
Buggy source:
private void createMaps(){
  globalCount.set(0);
  localCount.set(0);
  map1=h1.getMap(n);
  map2=h2.getMap(n);
}

Fixed version (ground truth):
private void createMaps(){
  globalCount.set(0);
  localCount.set(0);
  valueCount.set(0);
  map1=h1.getMap(n);
  map2=h2.getMap(n);
}
Program: 49722
Project: 49722
Buggy source:
private EntryListener<String,String> createEntryListener(final boolean isLocal){
  return new EntryListener<String,String>(){
    private final boolean local=isLocal;
    public void entryUpdated(    EntryEvent<String,String> event){
    }
    public void entryRemoved(    EntryEvent<String,String> event){
    }
    public void entryEvicted(    EntryEvent<String,String> event){
    }
    public void entryAdded(    EntryEvent<String,String> event){
      if (local) {
        localCount.incrementAndGet();
      }
 else {
        globalCount.incrementAndGet();
      }
    }
  }
;
}

Fixed version (ground truth):
private EntryListener<String,String> createEntryListener(final boolean isLocal){
  return new EntryListener<String,String>(){
    private final boolean local=isLocal;
    public void entryUpdated(    EntryEvent<String,String> event){
    }
    public void entryRemoved(    EntryEvent<String,String> event){
    }
    public void entryEvicted(    EntryEvent<String,String> event){
    }
    public void entryAdded(    EntryEvent<String,String> event){
      if (local) {
        localCount.incrementAndGet();
      }
 else {
        globalCount.incrementAndGet();
      }
      if (event.getValue() != null) {
        valueCount.incrementAndGet();
      }
    }
  }
;
}
Program: 49723
Project: 49723
Buggy source:
@Test public void globalListenerTest() throws InterruptedException {
  map1.addEntryListener(createEntryListener(false),true);
  map2.addEntryListener(createEntryListener(false),true);
  int k=3;
  putDummyData(k);
  checkCountWithExpected(k * 2,0);
}

Fixed version (ground truth):
@Test public void globalListenerTest() throws InterruptedException {
  map1.addEntryListener(createEntryListener(false),false);
  map1.addEntryListener(createEntryListener(false),true);
  map2.addEntryListener(createEntryListener(false),true);
  int k=3;
  putDummyData(k);
  checkCountWithExpected(k * 3,0,k * 2);
}
Program: 49724
Project: 49724
Buggy source:
@Test public void globalAndLocalListenerTest2() throws InterruptedException {
  map1.addEntryListener(createEntryListener(false),true);
  map1.addLocalEntryListener(createEntryListener(true));
  map2.addEntryListener(createEntryListener(false),true);
  map2.addLocalEntryListener(createEntryListener(true));
  int k=3;
  putDummyData(k);
  checkCountWithExpected(k * 2,k);
}

Fixed version (ground truth):
@Test public void globalAndLocalListenerTest2() throws InterruptedException {
  map1.addEntryListener(createEntryListener(false),false);
  map1.addLocalEntryListener(createEntryListener(true));
  map2.addEntryListener(createEntryListener(false),true);
  map2.addLocalEntryListener(createEntryListener(true));
  map2.addEntryListener(createEntryListener(false),false);
  int k=3;
  putDummyData(k);
  checkCountWithExpected(k * 3,k,k * 2);
}
Program: 49725
Project: 49725
Buggy source:
private void checkCountWithExpected(int expectedGlobal,int expectedLocal) throws InterruptedException {
  Thread.sleep(1000 * 3);
  Assert.assertEquals(expectedLocal,localCount.get());
  Assert.assertEquals(expectedGlobal,globalCount.get());
}

Fixed version (ground truth):
private void checkCountWithExpected(int expectedGlobal,int expectedLocal,int expectedValue) throws InterruptedException {
  Thread.sleep(1000 * 3);
  Assert.assertEquals(expectedLocal,localCount.get());
  Assert.assertEquals(expectedGlobal,globalCount.get());
  Assert.assertEquals(expectedValue,valueCount.get());
}
Program: 49726
Project: 49726
Buggy source:
@Test public void localListenerTest() throws InterruptedException {
  map1.addLocalEntryListener(createEntryListener(true));
  map2.addLocalEntryListener(createEntryListener(true));
  int k=4;
  putDummyData(k);
  checkCountWithExpected(0,k);
}

Fixed version (ground truth):
@Test public void localListenerTest() throws InterruptedException {
  map1.addLocalEntryListener(createEntryListener(true));
  map2.addLocalEntryListener(createEntryListener(true));
  int k=4;
  putDummyData(k);
  checkCountWithExpected(0,k,k);
}
Program: 49727
Project: 49727
Buggy source:
@Test public void globalAndLocalListenerTest() throws InterruptedException {
  map1.addLocalEntryListener(createEntryListener(true));
  map2.addLocalEntryListener(createEntryListener(true));
  map1.addEntryListener(createEntryListener(false),true);
  map2.addEntryListener(createEntryListener(false),true);
  int k=1;
  putDummyData(k);
  checkCountWithExpected(k * 2,k);
}

Fixed version (ground truth):
@Test public void globalAndLocalListenerTest() throws InterruptedException {
  map1.addLocalEntryListener(createEntryListener(true));
  map2.addLocalEntryListener(createEntryListener(true));
  map1.addEntryListener(createEntryListener(false),false);
  map2.addEntryListener(createEntryListener(false),false);
  map2.addEntryListener(createEntryListener(false),true);
  int k=1;
  putDummyData(k);
  checkCountWithExpected(k * 3,k,k * 2);
}
Program: 49728
Project: 49728
Buggy source:
public void set(String name,ClusterOperation operation,Object objKey,Object objValue){
  this.threadId=ThreadContext.get().getThreadId();
  this.name=name;
  this.operation=operation;
  if (objKey != null) {
    key=new DataHolder(ThreadContext.get().toData(objKey));
  }
  if (objValue != null) {
    value=new DataHolder(ThreadContext.get().toData(objValue));
  }
}

Fixed version (ground truth):
public void set(String name,ClusterOperation operation,Object objKey,Object objValue){
  this.threadId=ThreadContext.get().getThreadId();
  this.name=name;
  this.operation=operation;
  if (objKey != null) {
    if (objKey instanceof Data) {
      setKey((Data)objKey);
    }
 else {
      key=new DataHolder(ThreadContext.get().toData(objKey));
    }
  }
  if (objValue != null) {
    if (objValue instanceof Data) {
      setValue((Data)objValue);
    }
 else {
      value=new DataHolder(ThreadContext.get().toData(objValue));
    }
  }
}
Program: 49729
Project: 49729
Buggy source:
public void itemRemoved(ItemEvent<String> itemEvent){
  assertEquals("String_Node_Str",itemEvent.getItem());
  latch.countDown();
}

Fixed version (ground truth):
public void itemRemoved(ItemEvent item){
}
Program: 49730
Project: 49730
Buggy source:
public void itemAdded(ItemEvent<String> itemEvent){
  assertEquals("String_Node_Str",itemEvent.getItem());
  latch.countDown();
}

Fixed version (ground truth):
public void itemAdded(ItemEvent item){
  latch.countDown();
  System.out.println(item);
}
Program: 49731
Project: 49731
Buggy source:
public void onMessage(Object message){
}

Fixed version (ground truth):
public void onMessage(Message message){
}
Program: 49733
Project: 49733
Buggy source:
@Test public void addMessageListenerWithClusterFailOver() throws InterruptedException, IOException {
  HazelcastInstance h1=Hazelcast.newHazelcastInstance(config);
  HazelcastInstance h2=Hazelcast.newHazelcastInstance(config);
  client=newHazelcastClient(h1,h2);
  final ITopic<String> topic=client.getTopic("String_Node_Str");
  final CountDownLatch latch=new CountDownLatch(3);
  final String message="String_Node_Str";
  topic.addMessageListener(new MessageListener<String>(){
    public void onMessage(    String msg){
      if (msg.equals(message)) {
        latch.countDown();
      }
    }
  }
);
  topic.publish(message);
  Map<Integer,HazelcastInstance> memberMap=getMapOfClusterMembers(h1,h2);
  HazelcastInstance h=memberMap.remove(client.getConnectionManager().getConnection().getAddress().getPort());
  h.shutdown();
  Thread.sleep(1000);
  for (int i=0; i < 2; i++) {
    new Thread(new Runnable(){
      public void run(){
        topic.publish(message);
      }
    }
).start();
  }
  assertTrue(latch.await(5,SECONDS));
}

Fixed version (ground truth):
@Test public void addMessageListenerWithClusterFailOver() throws InterruptedException, IOException {
  HazelcastInstance h1=Hazelcast.newHazelcastInstance(config);
  HazelcastInstance h2=Hazelcast.newHazelcastInstance(config);
  client=newHazelcastClient(h1,h2);
  final ITopic<String> topic=client.getTopic("String_Node_Str");
  final CountDownLatch latch=new CountDownLatch(3);
  final String message="String_Node_Str";
  topic.addMessageListener(new MessageListener<String>(){
    public void onMessage(    Message<String> msg){
      if (msg.equals(message)) {
        latch.countDown();
      }
    }
  }
);
  topic.publish(message);
  Map<Integer,HazelcastInstance> memberMap=getMapOfClusterMembers(h1,h2);
  HazelcastInstance h=memberMap.remove(client.getConnectionManager().getConnection().getAddress().getPort());
  h.shutdown();
  Thread.sleep(1000);
  for (int i=0; i < 2; i++) {
    new Thread(new Runnable(){
      public void run(){
        topic.publish(message);
      }
    }
).start();
  }
  assertTrue(latch.await(5,SECONDS));
}
Program: 49734
Project: 49734
Buggy source:
public int incrementAndGet(){
  return ++count;
}

Fixed version (ground truth):
public int incrementAndGet(){
  return count.incrementAndGet();
}
Program: 49735
Project: 49735
Buggy source:
public int decrementAndGet(){
  return --count;
}

Fixed version (ground truth):
public int decrementAndGet(){
  return count.decrementAndGet();
}
Program: 49736
Project: 49736
Buggy source:
@Override public String toString(){
  return "String_Node_Str" + "String_Node_Str" + threadId + "String_Node_Str"+ count+ '}';
}

Fixed version (ground truth):
@Override public String toString(){
  return "String_Node_Str" + "String_Node_Str" + threadId + "String_Node_Str"+ count.get()+ '}';
}
Program: 49737
Project: 49737
Buggy source:
public int getCount(){
  return count;
}

Fixed version (ground truth):
public int getCount(){
  return count.get();
}
Program: 49738
Project: 49738
Buggy source:
public void clear(){
  mapIndexes.clear();
  records.clear();
  size=0;
}

Fixed version (ground truth):
public void clear(){
  mapIndexes.clear();
  records.clear();
  size.set(0);
}
Program: 49739
Project: 49739
Buggy source:
public void index(Record record){
  final Long recordId=record.getId();
  if (record.isActive()) {
    final Record anotherRecord=records.putIfAbsent(recordId,record);
    if (anotherRecord != null) {
      record=anotherRecord;
    }
 else {
      size++;
    }
  }
 else {
    remove(record);
  }
  if (indexValue != null) {
    Long newValueIndex=-1L;
    if (record.isActive() && record.hasValueData()) {
      newValueIndex=(long)record.getValueData().hashCode();
    }
    indexValue.index(newValueIndex,record);
  }
  Long[] indexValues=record.getIndexes();
  if (indexValues != null && hasIndexedAttributes) {
    byte[] indexTypes=record.getIndexTypes();
    if (indexTypes == null || indexValues.length != indexTypes.length) {
      throw new IllegalArgumentException("String_Node_Str" + Arrays.toString(indexTypes));
    }
    Collection<Index> indexes=mapIndexes.values();
    for (    Index index : indexes) {
      if (indexValues.length > index.getAttributeIndex()) {
        Long newValue=indexValues[index.getAttributeIndex()];
        index.index(newValue,record);
      }
    }
  }
}

Fixed version (ground truth):
public void index(Record record){
  final Long recordId=record.getId();
  if (record.isActive()) {
    final Record anotherRecord=records.putIfAbsent(recordId,record);
    if (anotherRecord != null) {
      record=anotherRecord;
    }
 else {
      size.incrementAndGet();
    }
  }
 else {
    remove(record);
  }
  if (indexValue != null) {
    Long newValueIndex=-1L;
    if (record.isActive() && record.hasValueData()) {
      newValueIndex=(long)record.getValueData().hashCode();
    }
    indexValue.index(newValueIndex,record);
  }
  Long[] indexValues=record.getIndexes();
  if (indexValues != null && hasIndexedAttributes) {
    byte[] indexTypes=record.getIndexTypes();
    if (indexTypes == null || indexValues.length != indexTypes.length) {
      throw new IllegalArgumentException("String_Node_Str" + Arrays.toString(indexTypes));
    }
    Collection<Index> indexes=mapIndexes.values();
    for (    Index index : indexes) {
      if (indexValues.length > index.getAttributeIndex()) {
        Long newValue=indexValues[index.getAttributeIndex()];
        index.index(newValue,record);
      }
    }
  }
}
Program: 49740
Project: 49740
Buggy source:
public void remove(Record record){
  Record existingRecord=records.remove(record.getId());
  if (existingRecord != null) {
    size--;
  }
}

Fixed version (ground truth):
public void remove(Record record){
  Record existingRecord=records.remove(record.getId());
  if (existingRecord != null) {
    size.decrementAndGet();
  }
}
Program: 49741
Project: 49741
Buggy source:
public int size(){
  return size;
}

Fixed version (ground truth):
public int size(){
  return size.get();
}
Program: 49744
Project: 49744
Buggy source:
IQueue newQueueProxy(String name){
  IQueue queue=Hazelcast.getQueue(name);
  ClassLoader classLoader=Thread.currentThread().getContextClassLoader();
  Class[] interfaces=new Class[]{IQueue.class};
  IQueue proxy=(IQueue)Proxy.newProxyInstance(classLoader,interfaces,new ThreadBoundInvocationHandler(queue));
  mapsUsed.add(proxy);
  return proxy;
}

Fixed version (ground truth):
public static IQueue newQueueProxy(HazelcastInstance hz,String name,List listToAdd){
  IQueue queue=hz.getQueue(name);
  ClassLoader classLoader=Thread.currentThread().getContextClassLoader();
  Class[] interfaces=new Class[]{IQueue.class};
  IQueue proxy=(IQueue)Proxy.newProxyInstance(classLoader,interfaces,new ThreadBoundInvocationHandler(queue));
  if (listToAdd != null) {
    listToAdd.add(proxy);
  }
  return proxy;
}
Program: 49745
Project: 49745
Buggy source:
@Test @Ignore public void testMapEntryLastAccessTime(){
  TransactionalMap txnMap=newTransactionalMapProxy("String_Node_Str");
  TransactionalMap txnMap2=newTransactionalMapProxy("String_Node_Str");
  txnMap.put("String_Node_Str","String_Node_Str");
  MapEntry mapEntry=txnMap.getMapEntry("String_Node_Str");
  txnMap.begin();
  txnMap.get("String_Node_Str");
  mapEntry=txnMap.getMapEntry("String_Node_Str");
  txnMap.commit();
}

Fixed version (ground truth):
@Test @Ignore public void testMapEntryLastAccessTime(){
  TransactionalMap txnMap=newTransactionalMapProxy("String_Node_Str");
  TransactionalMap txnMap2=newTransactionalMapProxy("String_Node_Str");
  txnMap.put("String_Node_Str","String_Node_Str");
  MapEntry mapEntry=txnMap.getMapEntry("String_Node_Str");
  txnMap.begin();
  txnMap.get("String_Node_Str");
  mapEntry=txnMap.getMapEntry("String_Node_Str");
  System.out.println("String_Node_Str" + mapEntry.getLastAccessTime());
  txnMap.commit();
}
Program: 49746
Project: 49746
Buggy source:
IMap newMapProxy(String name){
  IMap imap=Hazelcast.getMap(name);
  ClassLoader classLoader=Thread.currentThread().getContextClassLoader();
  Class[] interfaces=new Class[]{IMap.class};
  IMap proxy=(IMap)Proxy.newProxyInstance(classLoader,interfaces,new ThreadBoundInvocationHandler(imap));
  mapsUsed.add(proxy);
  return proxy;
}

Fixed version (ground truth):
public static IMap newMapProxy(HazelcastInstance hz,String name,List listToAdd){
  IMap imap=hz.getMap(name);
  ClassLoader classLoader=Thread.currentThread().getContextClassLoader();
  Class[] interfaces=new Class[]{IMap.class};
  IMap proxy=(IMap)Proxy.newProxyInstance(classLoader,interfaces,new ThreadBoundInvocationHandler(imap));
  if (listToAdd != null) {
    listToAdd.add(proxy);
  }
  return proxy;
}
Program: 49747
Project: 49747
Buggy source:
public void processSelectionQueue(){
  while (live) {
    final Runnable runnable=selectorQueue.poll();
    if (runnable == null) {
      return;
    }
    runnable.run();
  }
}

Fixed version (ground truth):
private void processSelectionQueue(){
  while (live) {
    final Runnable runnable=selectorQueue.poll();
    if (runnable == null) {
      return;
    }
    runnable.run();
  }
}
Program: 49748
Project: 49748
Buggy source:
@Test public void addTwoMessageListener() throws InterruptedException {
  HazelcastClient hClient=getHazelcastClient();
  ITopic<String> topic=hClient.getTopic("String_Node_Str");
  final CountDownLatch latch=new CountDownLatch(2);
  final String message="String_Node_Str";
  topic.addMessageListener(new MessageListener<String>(){
    public void onMessage(    String msg){
      if (msg.equals(message)) {
        latch.countDown();
      }
    }
  }
);
  topic.addMessageListener(new MessageListener<String>(){
    public void onMessage(    String msg){
      if (msg.equals(message)) {
        latch.countDown();
      }
    }
  }
);
  topic.publish(message);
  assertTrue(latch.await(10000,TimeUnit.MILLISECONDS));
}

Fixed version (ground truth):
@Test public void addTwoMessageListener() throws InterruptedException {
  HazelcastClient hClient=getHazelcastClient();
  ITopic<String> topic=hClient.getTopic("String_Node_Str");
  final CountDownLatch latch=new CountDownLatch(2);
  final String message="String_Node_Str";
  topic.addMessageListener(new MessageListener<String>(){
    public void onMessage(    Message<String> msg){
      if (msg.getMessageObject().equals(message)) {
        latch.countDown();
      }
    }
  }
);
  topic.addMessageListener(new MessageListener<String>(){
    public void onMessage(    Message<String> msg){
      if (msg.getMessageObject().equals(message)) {
        latch.countDown();
      }
    }
  }
);
  topic.publish(message);
  assertTrue(latch.await(10000,TimeUnit.MILLISECONDS));
}
Program: 49749
Project: 49749
Buggy source:
@Test public void addMessageListener() throws InterruptedException {
  HazelcastClient hClient=getHazelcastClient();
  ITopic<String> topic=hClient.getTopic("String_Node_Str");
  final CountDownLatch latch=new CountDownLatch(1);
  final String message="String_Node_Str";
  topic.addMessageListener(new MessageListener<String>(){
    public void onMessage(    String msg){
      if (msg.equals(message)) {
        latch.countDown();
      }
    }
  }
);
  topic.publish(message);
  assertTrue(latch.await(10000,TimeUnit.MILLISECONDS));
}

Fixed version (ground truth):
@Test public void addMessageListener() throws InterruptedException {
  HazelcastClient hClient=getHazelcastClient();
  ITopic<String> topic=hClient.getTopic("String_Node_Str");
  final CountDownLatch latch=new CountDownLatch(1);
  final String message="String_Node_Str";
  topic.addMessageListener(new MessageListener<String>(){
    public void onMessage(    Message<String> msg){
      if (msg.getMessageObject().equals(message)) {
        latch.countDown();
      }
    }
  }
);
  topic.publish(message);
  assertTrue(latch.await(10000,TimeUnit.MILLISECONDS));
}
Program: 49750
Project: 49750
Buggy source:
@Test public void removeMessageListener() throws InterruptedException {
  HazelcastClient hClient=getHazelcastClient();
  ITopic<String> topic=hClient.getTopic("String_Node_Str");
  final CountDownLatch latch=new CountDownLatch(2);
  final CountDownLatch cp=new CountDownLatch(1);
  MessageListener<String> messageListener=new MessageListener<String>(){
    public void onMessage(    String msg){
      System.out.println("String_Node_Str" + msg + "String_Node_Str"+ this);
      latch.countDown();
      cp.countDown();
    }
  }
;
  final String message="String_Node_Str" + messageListener.hashCode() + "String_Node_Str";
  topic.addMessageListener(messageListener);
  topic.publish(message + "String_Node_Str");
  cp.await();
  topic.removeMessageListener(messageListener);
  topic.publish(message + "String_Node_Str");
  Thread.sleep(50);
  assertEquals(1,latch.getCount());
}

Fixed version (ground truth):
@Test public void removeMessageListener() throws InterruptedException {
  HazelcastClient hClient=getHazelcastClient();
  ITopic<String> topic=hClient.getTopic("String_Node_Str");
  final CountDownLatch latch=new CountDownLatch(2);
  final CountDownLatch cp=new CountDownLatch(1);
  MessageListener<String> messageListener=new MessageListener<String>(){
    public void onMessage(    Message<String> msg){
      System.out.println("String_Node_Str" + msg + "String_Node_Str"+ this);
      latch.countDown();
      cp.countDown();
    }
  }
;
  final String message="String_Node_Str" + messageListener.hashCode() + "String_Node_Str";
  topic.addMessageListener(messageListener);
  topic.publish(message + "String_Node_Str");
  cp.await();
  topic.removeMessageListener(messageListener);
  topic.publish(message + "String_Node_Str");
  Thread.sleep(50);
  assertEquals(1,latch.getCount());
}
Program: 49751
Project: 49751
Buggy source:
public void onMessage(String msg){
  if (msg.startsWith(message)) {
    latch.countDown();
    cp.countDown();
  }
}

Fixed version (ground truth):
public void onMessage(Message<String> msg){
  if (msg.getMessageObject().startsWith(message)) {
    latch.countDown();
    cp.countDown();
  }
}
Program: 49752
Project: 49752
Buggy source:
@Test public void add2listenerAndRemoveOne() throws InterruptedException {
  HazelcastClient hClient=getHazelcastClient();
  ITopic<String> topic=hClient.getTopic("String_Node_Str");
  final CountDownLatch latch=new CountDownLatch(4);
  final CountDownLatch cp=new CountDownLatch(2);
  final String message="String_Node_Str";
  MessageListener<String> messageListener1=new MessageListener<String>(){
    public void onMessage(    String msg){
      if (msg.startsWith(message)) {
        latch.countDown();
        cp.countDown();
      }
    }
  }
;
  MessageListener<String> messageListener2=new MessageListener<String>(){
    public void onMessage(    String msg){
      if (msg.startsWith(message)) {
        latch.countDown();
        cp.countDown();
      }
    }
  }
;
  topic.addMessageListener(messageListener1);
  topic.addMessageListener(messageListener2);
  topic.publish(message + "String_Node_Str");
  Thread.sleep(50);
  topic.removeMessageListener(messageListener1);
  cp.await();
  topic.publish(message + "String_Node_Str");
  Thread.sleep(100);
  assertEquals(1,latch.getCount());
}

Fixed version (ground truth):
@Test public void add2listenerAndRemoveOne() throws InterruptedException {
  HazelcastClient hClient=getHazelcastClient();
  ITopic<String> topic=hClient.getTopic("String_Node_Str");
  final CountDownLatch latch=new CountDownLatch(4);
  final CountDownLatch cp=new CountDownLatch(2);
  final String message="String_Node_Str";
  MessageListener<String> messageListener1=new MessageListener<String>(){
    public void onMessage(    Message<String> msg){
      if (msg.getMessageObject().startsWith(message)) {
        latch.countDown();
        cp.countDown();
      }
    }
  }
;
  MessageListener<String> messageListener2=new MessageListener<String>(){
    public void onMessage(    Message<String> msg){
      if (msg.getMessageObject().startsWith(message)) {
        latch.countDown();
        cp.countDown();
      }
    }
  }
;
  topic.addMessageListener(messageListener1);
  topic.addMessageListener(messageListener2);
  topic.publish(message + "String_Node_Str");
  Thread.sleep(50);
  topic.removeMessageListener(messageListener1);
  cp.await();
  topic.publish(message + "String_Node_Str");
  Thread.sleep(100);
  assertEquals(1,latch.getCount());
}
Program: 49753
Project: 49753
Buggy source:
@Test public void testTopicPublish(){
  ITopic<String> topic=getHazelcastClient().getTopic("String_Node_Str");
  final CountDownLatch latch=new CountDownLatch(1);
  topic.addMessageListener(new MessageListener<String>(){
    public void onMessage(    String msg){
      assertEquals("String_Node_Str",msg);
      latch.countDown();
    }
  }
);
  topic.publish("String_Node_Str");
  try {
    assertTrue(latch.await(5,TimeUnit.SECONDS));
  }
 catch (  InterruptedException ignored) {
  }
}

Fixed version (ground truth):
@Test public void testTopicPublish(){
  ITopic<String> topic=getHazelcastClient().getTopic("String_Node_Str");
  final CountDownLatch latch=new CountDownLatch(1);
  topic.addMessageListener(new MessageListener<String>(){
    public void onMessage(    Message<String> msg){
      assertEquals("String_Node_Str",msg.getMessageObject());
      latch.countDown();
    }
  }
);
  topic.publish("String_Node_Str");
  try {
    assertTrue(latch.await(5,TimeUnit.SECONDS));
  }
 catch (  InterruptedException ignored) {
  }
}
Program: 49754
Project: 49754
Buggy source:
public void onMessage(String msg){
  assertEquals("String_Node_Str",msg);
  latch.countDown();
}

Fixed version (ground truth):
public void onMessage(Message<String> msg){
  assertEquals("String_Node_Str",msg.getMessageObject());
  latch.countDown();
}
Program: 49755
Project: 49755
Buggy source:
@Test public void testNotifyMessageListeners() throws Exception {
  final MessageListenerManager manager=new MessageListenerManager();
  final String name="String_Node_Str";
  assertTrue(manager.noListenerRegistered(name));
  final String myMessage="String_Node_Str";
  final CountDownLatch latch=new CountDownLatch(1);
  MessageListener listener=new MessageListener(){
    public void onMessage(    Object message){
      if (message.equals(myMessage)) {
        latch.countDown();
      }
    }
  }
;
  manager.registerListener(name,listener);
  assertFalse(manager.noListenerRegistered(name));
  new Thread(new Runnable(){
    public void run(){
      Packet packet=new Packet();
      packet.setName(name);
      packet.setKey(toByte(myMessage));
      manager.notifyMessageListeners(packet);
    }
  }
).start();
  assertTrue(latch.await(10,TimeUnit.SECONDS));
}

Fixed version (ground truth):
@Test public void testNotifyMessageListeners() throws Exception {
  final MessageListenerManager manager=new MessageListenerManager();
  final String name="String_Node_Str";
  assertTrue(manager.noListenerRegistered(name));
  final String myMessage="String_Node_Str";
  final CountDownLatch latch=new CountDownLatch(1);
  MessageListener listener=new MessageListener<Object>(){
    public void onMessage(    Message<Object> message){
      if (message.getMessageObject().equals(myMessage)) {
        latch.countDown();
      }
    }
  }
;
  manager.registerListener(name,listener);
  assertFalse(manager.noListenerRegistered(name));
  new Thread(new Runnable(){
    public void run(){
      Packet packet=new Packet();
      packet.setName(name);
      packet.setKey(toByte(myMessage));
      manager.notifyMessageListeners(packet);
    }
  }
).start();
  assertTrue(latch.await(10,TimeUnit.SECONDS));
}
Program: 49756
Project: 49756
Buggy source:
@Test public void testRegisterMessageListener() throws Exception {
  MessageListenerManager manager=new MessageListenerManager();
  String name="String_Node_Str";
  assertTrue(manager.noListenerRegistered(name));
  MessageListener listener=new MessageListener(){
    public void onMessage(    Object message){
    }
  }
;
  manager.registerListener(name,listener);
  assertFalse(manager.noListenerRegistered(name));
}

Fixed version (ground truth):
@Test public void testRegisterMessageListener() throws Exception {
  MessageListenerManager manager=new MessageListenerManager();
  String name="String_Node_Str";
  assertTrue(manager.noListenerRegistered(name));
  MessageListener listener=new MessageListener<Object>(){
    public void onMessage(    Message<Object> message){
    }
  }
;
  manager.registerListener(name,listener);
  assertFalse(manager.noListenerRegistered(name));
}
Program: 49757
Project: 49757
Buggy source:
@Test public void testRemoveMessageListener() throws Exception {
  MessageListenerManager manager=new MessageListenerManager();
  String name="String_Node_Str";
  assertTrue(manager.noListenerRegistered(name));
  MessageListener listener=new MessageListener(){
    public void onMessage(    Object message){
    }
  }
;
  manager.registerListener(name,listener);
  assertFalse(manager.noListenerRegistered(name));
  manager.removeListener(name,listener);
  assertTrue(manager.noListenerRegistered(name));
  manager.removeListener(name,listener);
  assertTrue(manager.noListenerRegistered(name));
}

Fixed version (ground truth):
@Test public void testRemoveMessageListener() throws Exception {
  MessageListenerManager manager=new MessageListenerManager();
  String name="String_Node_Str";
  assertTrue(manager.noListenerRegistered(name));
  MessageListener listener=new MessageListener<Object>(){
    public void onMessage(    Message<Object> message){
    }
  }
;
  manager.registerListener(name,listener);
  assertFalse(manager.noListenerRegistered(name));
  manager.removeListener(name,listener);
  assertTrue(manager.noListenerRegistered(name));
  manager.removeListener(name,listener);
  assertTrue(manager.noListenerRegistered(name));
}
Program: 49758
Project: 49758
Buggy source:
public void onMessage(Object message){
  if (message.equals(myMessage)) {
    latch.countDown();
  }
}

Fixed version (ground truth):
public void onMessage(Message<Object> message){
  if (message.getMessageObject().equals(myMessage)) {
    latch.countDown();
  }
}
Program: 49759
Project: 49759
Buggy source:
protected static Object getConvertedRealValue(Object firstValue,Object value){
  if (firstValue == null)   return value;
  if (firstValue.getClass() == value.getClass()) {
    return value;
  }
 else {
    return getRealObject(firstValue,String.valueOf(value));
  }
}

Fixed version (ground truth):
protected static Object getConvertedRealValue(Object firstValue,Object value){
  if (firstValue == null)   return value;
  if (firstValue.getClass() == value.getClass()) {
    return value;
  }
 else {
    return getRealObject(firstValue,value);
  }
}
Program: 49761
Project: 49761
Buggy source:
public int deflate(){
  deflater.setInput(uncompressedBuffer.array(),0,uncompressedBuffer.position());
  deflater.finish();
  final int count=deflater.deflate(compressedBuffer.array());
  deflater.reset();
  return count;
}

Fixed version (ground truth):
public int deflate(){
  try {
    deflater.setInput(uncompressedBuffer.array(),0,uncompressedBuffer.position());
    deflater.finish();
    final int count=deflater.deflate(compressedBuffer.array());
    return count;
  }
  finally {
    deflater.reset();
  }
}
Program: 49762
Project: 49762
Buggy source:
public int inflate(int length) throws DataFormatException {
  inflater.setInput(compressedBuffer.array(),0,length);
  final int count=inflater.inflate(uncompressedBuffer.array());
  uncompressedBuffer.limit(count);
  uncompressedBuffer.position(0);
  inflater.reset();
  return count;
}

Fixed version (ground truth):
public int inflate(int length) throws DataFormatException {
  try {
    inflater.setInput(compressedBuffer.array(),0,length);
    final int count=inflater.inflate(uncompressedBuffer.array());
    uncompressedBuffer.limit(count);
    uncompressedBuffer.position(0);
    return count;
  }
  finally {
    inflater.reset();
  }
}
Program: 49763
Project: 49763
Buggy source:
public void run(){
  while (running) {
    try {
      customRun();
    }
 catch (    InterruptedException e) {
      return;
    }
  }
  notifyMonitor();
}

Fixed version (ground truth):
public void run(){
  try {
    while (running) {
      try {
        customRun();
      }
 catch (      InterruptedException e) {
        return;
      }
    }
  }
  finally {
    terminate();
  }
}
Program: 49764
Project: 49764
Buggy source:
public void shutdown(){
synchronized (monitor) {
    if (running) {
      this.running=false;
      try {
        monitor.wait();
      }
 catch (      InterruptedException ignored) {
      }
    }
  }
}

Fixed version (ground truth):
public void shutdown(){
  if (terminated) {
    return;
  }
synchronized (monitor) {
    running=false;
    while (!terminated) {
      try {
        monitor.wait();
      }
 catch (      InterruptedException ignored) {
      }
    }
  }
}
Program: 49765
Project: 49765
Buggy source:
@Test public void testShutdown() throws Exception {
  final ClientRunnable clientRunnable=new ClientRunnable(){
    @Override protected void customRun() throws InterruptedException {
    }
  }
;
  final CountDownLatch latch1=new CountDownLatch(1);
  final CountDownLatch latch2=new CountDownLatch(1);
  final CountDownLatch latchShutDown=new CountDownLatch(1);
  new Thread(new Runnable(){
    public void run(){
      try {
        latch1.await();
        latch2.countDown();
        clientRunnable.shutdown();
        latchShutDown.countDown();
      }
 catch (      InterruptedException e) {
      }
    }
  }
).start();
  latch1.countDown();
  latch2.await();
  Thread.sleep(10);
  clientRunnable.notifyMonitor();
  assertTrue(latchShutDown.await(5,TimeUnit.SECONDS));
  assertFalse(clientRunnable.running);
}

Fixed version (ground truth):
@Test public void testShutdown() throws Exception {
  final ClientRunnable clientRunnable=new ClientRunnable(){
    @Override protected void customRun() throws InterruptedException {
    }
  }
;
  final CountDownLatch latch1=new CountDownLatch(1);
  final CountDownLatch latch2=new CountDownLatch(1);
  final CountDownLatch latchShutDown=new CountDownLatch(1);
  new Thread(new Runnable(){
    public void run(){
      try {
        latch1.await();
        latch2.countDown();
        clientRunnable.shutdown();
        latchShutDown.countDown();
      }
 catch (      InterruptedException e) {
      }
    }
  }
).start();
  latch1.countDown();
  latch2.await();
  Thread.sleep(10);
  clientRunnable.terminate();
  assertTrue(latchShutDown.await(5,TimeUnit.SECONDS));
  assertFalse(clientRunnable.running);
}
Program: 49766
Project: 49766
Buggy source:
protected String getValue(org.w3c.dom.Node node){
  return getTextContent(node).trim();
}

Fixed version (ground truth):
protected String getValue(org.w3c.dom.Node node){
  return node != null ? getTextContent(node).trim() : "String_Node_Str";
}
Program: 49767
Project: 49767
Buggy source:
public TopicConfig getTopicConfig(final String name){
  TopicConfig config;
  if ((config=lookupByPattern(mapTopicConfigs,name)) != null) {
    return config;
  }
  TopicConfig defConfig=mapTopicConfigs.get("String_Node_Str");
  if (defConfig == null) {
    defConfig=new TopicConfig();
    defConfig.setName("String_Node_Str");
    addTopicConfig(defConfig);
  }
  config=new TopicConfig(defConfig);
  config.setName(name);
  addTopicConfig(defConfig);
  return config;
}

Fixed version (ground truth):
public TopicConfig getTopicConfig(final String name){
  TopicConfig config;
  if ((config=lookupByPattern(mapTopicConfigs,name)) != null) {
    return config;
  }
  TopicConfig defConfig=mapTopicConfigs.get("String_Node_Str");
  if (defConfig == null) {
    defConfig=new TopicConfig();
    defConfig.setName("String_Node_Str");
    addTopicConfig(defConfig);
  }
  config=new TopicConfig(defConfig);
  config.setName(name);
  addTopicConfig(config);
  return config;
}
Program: 49769
Project: 49769
Buggy source:
public Long[] getIndexValues(Object value){
  if (hasIndexedAttributes) {
    int indexCount=mapIndexes.size();
    Long[] newIndexes=new Long[indexCount];
    if (value instanceof Data) {
      value=toObject((Data)value);
    }
    Collection<Index> indexes=mapIndexes.values();
    for (    Index index : indexes) {
      int attributedIndex=index.getAttributeIndex();
      newIndexes[attributedIndex]=index.extractLongValue(value);
    }
    if (indexTypes == null || indexTypes.length != indexCount) {
synchronized (indexTypesLock) {
        if (indexTypes == null || indexTypes.length != indexCount) {
          indexTypes=new byte[indexCount];
          for (          Index index : indexes) {
            int attributedIndex=index.getAttributeIndex();
            indexTypes[attributedIndex]=index.getIndexType();
          }
        }
      }
    }
    return newIndexes;
  }
  return null;
}

Fixed version (ground truth):
public Long[] getIndexValues(Object value){
  if (hasIndexedAttributes) {
    int indexCount=mapIndexes.size();
    Long[] newIndexes=new Long[indexCount];
    if (value instanceof Data) {
      value=toObject((Data)value);
    }
    Collection<Index> indexes=mapIndexes.values();
    for (    Index index : indexes) {
      int attributedIndex=index.getAttributeIndex();
      newIndexes[attributedIndex]=index.extractLongValue(value);
    }
    byte[] _indexTypes=indexTypes;
    if (_indexTypes == null || _indexTypes.length != indexCount) {
synchronized (indexTypesLock) {
        _indexTypes=indexTypes;
        if (_indexTypes == null || _indexTypes.length != indexCount) {
          _indexTypes=new byte[indexCount];
          for (          Index index : indexes) {
            int attributedIndex=index.getAttributeIndex();
            _indexTypes[attributedIndex]=index.getIndexType();
          }
          indexTypes=_indexTypes;
        }
      }
    }
    return newIndexes;
  }
  return null;
}