nus-yam/ex-repair huggingface dataset:
Program: 47285
Project: 47285
Buggy source:
void setProtocol(final String protocol){
  final CountDownLatch latch=new CountDownLatch(1);
  ioSelector.addTask(new Runnable(){
    public void run(){
      createWriter(protocol);
      latch.countDown();
    }
  }
);
  ioSelector.wakeup();
  try {
    latch.await(TIMEOUT,TimeUnit.SECONDS);
  }
 catch (  InterruptedException e) {
    logger.finest("String_Node_Str",e);
  }
}

Fixed version (ground truth):
void setProtocol(final String protocol){
  final CountDownLatch latch=new CountDownLatch(1);
  ioSelector.addTaskAndWakeup(new Runnable(){
    public void run(){
      createWriter(protocol);
      latch.countDown();
    }
  }
);
  try {
    latch.await(TIMEOUT,TimeUnit.SECONDS);
  }
 catch (  InterruptedException e) {
    logger.finest("String_Node_Str",e);
  }
}
Program: 47286
Project: 47286
Buggy source:
/** 
 * Makes sure this WriteHandler is scheduled to be executed by the IO thread. <p/> This call is made by 'outside' threads that interact with the connection. For example when a packet is placed on the connection to be written. It will never be made by an IO thread. <p/> If the WriteHandler already is scheduled, the call is ignored.
 */
private void schedule(){
  if (scheduled.get()) {
    return;
  }
  if (!scheduled.compareAndSet(false,true)) {
    return;
  }
  ioSelector.addTask(this);
  ioSelector.wakeup();
}

Fixed version (ground truth):
/** 
 * Makes sure this WriteHandler is scheduled to be executed by the IO thread. <p/> This call is made by 'outside' threads that interact with the connection. For example when a packet is placed on the connection to be written. It will never be made by an IO thread. <p/> If the WriteHandler already is scheduled, the call is ignored.
 */
private void schedule(){
  if (scheduled.get()) {
    return;
  }
  if (!scheduled.compareAndSet(false,true)) {
    return;
  }
  ioSelector.addTaskAndWakeup(this);
}
Program: 47287
Project: 47287
Buggy source:
public void shutdown(){
  writeQueue.clear();
  urgentWriteQueue.clear();
  final CountDownLatch latch=new CountDownLatch(1);
  ioSelector.addTask(new Runnable(){
    @Override public void run(){
      try {
        socketChannel.closeOutbound();
      }
 catch (      IOException e) {
        logger.finest("String_Node_Str",e);
      }
 finally {
        latch.countDown();
      }
    }
  }
);
  ioSelector.wakeup();
  try {
    latch.await(TIMEOUT,TimeUnit.SECONDS);
  }
 catch (  InterruptedException e) {
    EmptyStatement.ignore(e);
  }
}

Fixed version (ground truth):
public void shutdown(){
  writeQueue.clear();
  urgentWriteQueue.clear();
  final CountDownLatch latch=new CountDownLatch(1);
  ioSelector.addTaskAndWakeup(new Runnable(){
    @Override public void run(){
      try {
        socketChannel.closeOutbound();
      }
 catch (      IOException e) {
        logger.finest("String_Node_Str",e);
      }
 finally {
        latch.countDown();
      }
    }
  }
);
  try {
    latch.await(TIMEOUT,TimeUnit.SECONDS);
  }
 catch (  InterruptedException e) {
    EmptyStatement.ignore(e);
  }
}
Program: 47288
Project: 47288
Buggy source:
@Override public V get(K key,ExpiryPolicy expiryPolicy){
  final Future<V> f=getAsync(key,expiryPolicy);
  try {
    return f.get();
  }
 catch (  Throwable e) {
    throw ExceptionUtil.rethrowAllowedTypeFirst(e,CacheException.class);
  }
}

Fixed version (ground truth):
@Override public V get(K key,ExpiryPolicy expiryPolicy){
  final Future<V> f=getAsync(key,expiryPolicy);
  try {
    return toObject(f.get());
  }
 catch (  Throwable e) {
    throw ExceptionUtil.rethrowAllowedTypeFirst(e,CacheException.class);
  }
}
Program: 47289
Project: 47289
Buggy source:
@Override public V getAndRemove(K key){
  final ICompletableFuture<V> f=removeAsyncInternal(key,null,false,true,true);
  try {
    return f.get();
  }
 catch (  Throwable e) {
    throw ExceptionUtil.rethrowAllowedTypeFirst(e,CacheException.class);
  }
}

Fixed version (ground truth):
@Override public V getAndRemove(K key){
  final ICompletableFuture<V> f=removeAsyncInternal(key,null,false,true,true);
  try {
    return toObject(f.get());
  }
 catch (  Throwable e) {
    throw ExceptionUtil.rethrowAllowedTypeFirst(e,CacheException.class);
  }
}
Program: 47290
Project: 47290
Buggy source:
@Override public boolean replace(Data key,Object oldValue,Object newValue,ExpiryPolicy expiryPolicy,String caller,int completionId){
  expiryPolicy=getExpiryPolicy(expiryPolicy);
  final long now=Clock.currentTimeMillis();
  final long start=isStatisticsEnabled() ? System.nanoTime() : 0;
  boolean isHit=false;
  boolean replaced=false;
  R record=records.get(key);
  boolean isExpired=record != null && record.isExpiredAt(now);
  try {
    if (record == null || isExpired) {
      replaced=false;
    }
 else {
      isHit=true;
      Object currentValue=toValue(record);
      if (compare(currentValue,toValue(oldValue))) {
        replaced=updateRecordWithExpiry(key,newValue,record,expiryPolicy,now,false,completionId);
      }
 else {
        onRecordAccess(record,expiryPolicy,now);
        replaced=false;
      }
    }
    if (!replaced) {
      publishEvent(CacheEventType.COMPLETED,key,null,null,false,completionId);
    }
    onReplace(key,oldValue,newValue,expiryPolicy,caller,false,record,isExpired,replaced);
    updateReplaceStat(replaced,isHit,start);
    updateHasExpiringEntry(record);
    return replaced;
  }
 catch (  Throwable error) {
    onReplaceError(key,oldValue,newValue,expiryPolicy,caller,false,record,isExpired,replaced,error);
    throw ExceptionUtil.rethrow(error);
  }
}

Fixed version (ground truth):
@Override public boolean replace(Data key,Object oldValue,Object newValue,ExpiryPolicy expiryPolicy,String caller,int completionId){
  expiryPolicy=getExpiryPolicy(expiryPolicy);
  final long now=Clock.currentTimeMillis();
  final long start=isStatisticsEnabled() ? System.nanoTime() : 0;
  boolean isHit=false;
  boolean replaced=false;
  R record=records.get(key);
  boolean isExpired=record != null && record.isExpiredAt(now);
  try {
    if (record == null || isExpired) {
      replaced=false;
    }
 else {
      isHit=true;
      Object currentValue=toStorageValue(record);
      if (compare(currentValue,toStorageValue(oldValue))) {
        replaced=updateRecordWithExpiry(key,newValue,record,expiryPolicy,now,false,completionId);
      }
 else {
        onRecordAccess(record,expiryPolicy,now);
        replaced=false;
      }
    }
    if (!replaced) {
      publishEvent(CacheEventType.COMPLETED,key,null,null,false,completionId);
    }
    onReplace(key,oldValue,newValue,expiryPolicy,caller,false,record,isExpired,replaced);
    updateReplaceStat(replaced,isHit,start);
    updateHasExpiringEntry(record);
    return replaced;
  }
 catch (  Throwable error) {
    onReplaceError(key,oldValue,newValue,expiryPolicy,caller,false,record,isExpired,replaced,error);
    throw ExceptionUtil.rethrow(error);
  }
}
Program: 47291
Project: 47291
Buggy source:
protected <T>T toValue(Object obj){
  if (obj instanceof Data) {
    return (T)dataToValue((Data)obj);
  }
 else   if (obj instanceof CacheRecord) {
    return (T)recordToValue((R)obj);
  }
 else {
    return (T)obj;
  }
}

Fixed version (ground truth):
protected Object toValue(Object obj){
  if (obj instanceof Data) {
    return dataToValue((Data)obj);
  }
 else   if (obj instanceof CacheRecord) {
    return recordToValue((R)obj);
  }
 else {
    return obj;
  }
}
Program: 47292
Project: 47292
Buggy source:
protected abstract <T>R valueToRecord(T value);

Fixed version (ground truth):
protected abstract R valueToRecord(Object value);
Program: 47293
Project: 47293
Buggy source:
protected abstract <T>T recordToValue(R record);

Fixed version (ground truth):
protected abstract Object recordToValue(R record);
Program: 47294
Project: 47294
Buggy source:
@Override public boolean remove(Data key,Object value,String caller,int completionId){
  final long now=Clock.currentTimeMillis();
  final long start=System.nanoTime();
  R record=records.get(key);
  boolean isExpired=record != null && record.isExpiredAt(now);
  int hitCount=0;
  boolean removed=false;
  try {
    if (record == null || isExpired) {
      if (isStatisticsEnabled()) {
        statistics.increaseCacheMisses(1);
      }
      removed=false;
    }
 else {
      hitCount++;
      if (compare(toValue(record),toValue(value))) {
        deleteCacheEntry(key);
        removed=deleteRecord(key,completionId);
      }
 else {
        long expiryTime=onRecordAccess(record,defaultExpiryPolicy,now);
        processExpiredEntry(key,record,expiryTime,now);
        removed=false;
      }
    }
    if (!removed) {
      publishEvent(CacheEventType.COMPLETED,key,null,null,false,completionId);
    }
    onRemove(key,value,caller,false,record,removed);
    if (records.size() == 0) {
      hasExpiringEntry=false;
    }
    updateRemoveStatistics(removed,hitCount,start);
    return removed;
  }
 catch (  Throwable error) {
    onRemoveError(key,null,caller,false,record,removed,error);
    throw ExceptionUtil.rethrow(error);
  }
}

Fixed version (ground truth):
@Override public boolean remove(Data key,Object value,String caller,int completionId){
  final long now=Clock.currentTimeMillis();
  final long start=System.nanoTime();
  R record=records.get(key);
  boolean isExpired=record != null && record.isExpiredAt(now);
  int hitCount=0;
  boolean removed=false;
  try {
    if (record == null || isExpired) {
      if (isStatisticsEnabled()) {
        statistics.increaseCacheMisses(1);
      }
      removed=false;
    }
 else {
      hitCount++;
      if (compare(toStorageValue(record),toStorageValue(value))) {
        deleteCacheEntry(key);
        removed=deleteRecord(key,completionId);
      }
 else {
        long expiryTime=onRecordAccess(record,defaultExpiryPolicy,now);
        processExpiredEntry(key,record,expiryTime,now);
        removed=false;
      }
    }
    if (!removed) {
      publishEvent(CacheEventType.COMPLETED,key,null,null,false,completionId);
    }
    onRemove(key,value,caller,false,record,removed);
    if (records.size() == 0) {
      hasExpiringEntry=false;
    }
    updateRemoveStatistics(removed,hitCount,start);
    return removed;
  }
 catch (  Throwable error) {
    onRemoveError(key,null,caller,false,record,removed,error);
    throw ExceptionUtil.rethrow(error);
  }
}
Program: 47295
Project: 47295
Buggy source:
protected abstract <T>T dataToValue(Data data);

Fixed version (ground truth):
protected abstract Object dataToValue(Data data);
Program: 47296
Project: 47296
Buggy source:
protected abstract <T>Data valueToData(T value);

Fixed version (ground truth):
protected abstract Data valueToData(Object value);
Program: 47297
Project: 47297
Buggy source:
/** 
 * Gets the TopicOverloadPolicy for this reliable topic. 
 * @return the TopicOverloadPolicy.
 */
public TopicOverloadPolicy getTopicOverloadPolicy(){
  return topicOverloadPolicy;
}

Fixed version (ground truth):
/** 
 * Gets the TopicOverloadPolicy for this reliable topic.
 * @return the TopicOverloadPolicy.
 */
public TopicOverloadPolicy getTopicOverloadPolicy(){
  return topicOverloadPolicy;
}
Program: 47298
Project: 47298
Buggy source:
/** 
 * Scans the source object for any fields/methods that have been given a name prefix with   {@link Probe} annotation, and registering these fields/methods as metrics. If metrics with the same name already exist, their source/inputs will be updated. Multiple registrations of the same object are ignored. If an object has no @Gauge annotations, the call is ignored.
 * @param source     the source object to scan.
 * @param namePrefix search the source object for fields/methods that have this name prefix.
 * @throws NullPointerException     if namePrefix or source is null.
 * @throws IllegalArgumentException if the source contains Gauge annotation on a field/method of unsupported type.
 */
<S>void scanAndRegister(S source,String namePrefix);

Fixed version (ground truth):
/** 
 * Scans the source object for any fields/methods that have been given a name prefix with   {@link Probe}annotation, and registering these fields/methods as metrics. If metrics with the same name already exist, their source/inputs will be updated. Multiple registrations of the same object are ignored. If an object has no @Gauge annotations, the call is ignored.
 * @param source     the source object to scan.
 * @param namePrefix search the source object for fields/methods that have this name prefix.
 * @throws NullPointerException     if namePrefix or source is null.
 * @throws IllegalArgumentException if the source contains Gauge annotation on a field/method of unsupported type.
 */
<S>void scanAndRegister(S source,String namePrefix);
Program: 47299
Project: 47299
Buggy source:
/** 
 * Registers a probe. If a Metric with the given name already has an input, that input will be overwritten.
 * @param source  the source object.
 * @param name  the name of the metric.
 * @param input the input for the metric.
 * @throws NullPointerException if name or input is null.
 */
<S>void register(S source,String name,DoubleProbe<S> input);

Fixed version (ground truth):
/** 
 * Registers a probe. If a Metric with the given name already has an input, that input will be overwritten.
 * @param source the source object.
 * @param name   the name of the metric.
 * @param input  the input for the metric.
 * @throws NullPointerException if name or input is null.
 */
<S>void register(S source,String name,DoubleProbe<S> input);
Program: 47300
Project: 47300
Buggy source:
/** 
 * Gets the accessible object probe type for this class object type. accessible object probe    class object      TYPE_PRIMITIVE_LONG = 1    byte, short, int, long TYPE_LONG_NUMBER = 2       Byte, Short, Integer, Long, AtomicInteger, AtomicLong TYPE_DOUBLE_PRIMITIVE = 3  double, float TYPE_DOUBLE_NUMBER = 4     Double, Float TYPE_COLLECTION = 5        Collection TYPE_MAP = 6               Map TYPE_COUNTER = 7           Counter
 * @param classType the class object type.
 * @return the accessible object probe type.
 */
static int getType(Class classType){
  Integer type=TYPES.get(classType);
  if (type != null) {
    return type;
  }
  List<Class<?>> flattenedClasses=new ArrayList<Class<?>>();
  flatten(classType,flattenedClasses);
  for (  Class<?> clazz : flattenedClasses) {
    type=TYPES.get(clazz);
    if (type != null) {
      return type;
    }
  }
  return -1;
}

Fixed version (ground truth):
/** 
 * Gets the accessible object probe type for this class object type. accessible object probe    class object TYPE_PRIMITIVE_LONG = 1    byte, short, int, long TYPE_LONG_NUMBER = 2       Byte, Short, Integer, Long, AtomicInteger, AtomicLong TYPE_DOUBLE_PRIMITIVE = 3  double, float TYPE_DOUBLE_NUMBER = 4     Double, Float TYPE_COLLECTION = 5        Collection TYPE_MAP = 6               Map TYPE_COUNTER = 7           Counter
 * @param classType the class object type.
 * @return the accessible object probe type.
 */
static int getType(Class classType){
  Integer type=TYPES.get(classType);
  if (type != null) {
    return type;
  }
  List<Class<?>> flattenedClasses=new ArrayList<Class<?>>();
  flatten(classType,flattenedClasses);
  for (  Class<?> clazz : flattenedClasses) {
    type=TYPES.get(clazz);
    if (type != null) {
      return type;
    }
  }
  return -1;
}
Program: 47301
Project: 47301
Buggy source:
public void cleanResources(ConstructorFunction<Object,Throwable> responseCtor,ClientConnection connection){
  final Iterator<Map.Entry<Integer,ClientInvocation>> iter=callIdMap.entrySet().iterator();
  while (iter.hasNext()) {
    final Map.Entry<Integer,ClientInvocation> entry=iter.next();
    final ClientInvocation invocation=entry.getValue();
    if (invocation.getSendConnection().equals(connection)) {
      iter.remove();
      invocation.notifyException(responseCtor.createNew(null));
      eventHandlerMap.remove(entry.getKey());
    }
  }
  final Iterator<ClientInvocation> iterator=eventHandlerMap.values().iterator();
  while (iterator.hasNext()) {
    final ClientInvocation invocation=iterator.next();
    if (invocation.getSendConnection().equals(connection)) {
      iterator.remove();
      invocation.notifyException(responseCtor.createNew(null));
    }
  }
}

Fixed version (ground truth):
public void cleanResources(ConstructorFunction<Object,Throwable> responseCtor,ClientConnection connection){
  final Iterator<Map.Entry<Integer,ClientInvocation>> iter=callIdMap.entrySet().iterator();
  while (iter.hasNext()) {
    final Map.Entry<Integer,ClientInvocation> entry=iter.next();
    final ClientInvocation invocation=entry.getValue();
    if (connection.equals(invocation.getSendConnection())) {
      iter.remove();
      invocation.notifyException(responseCtor.createNew(null));
      eventHandlerMap.remove(entry.getKey());
    }
  }
  final Iterator<ClientInvocation> iterator=eventHandlerMap.values().iterator();
  while (iterator.hasNext()) {
    final ClientInvocation invocation=iterator.next();
    if (connection.equals(invocation.getSendConnection())) {
      iterator.remove();
      invocation.notifyException(responseCtor.createNew(null));
    }
  }
}
Program: 47302
Project: 47302
Buggy source:
public void cleanResources(ConstructorFunction<Object,Throwable> responseCtor,ClientConnection connection){
  final Iterator<Map.Entry<Integer,ClientInvocation>> iter=callIdMap.entrySet().iterator();
  while (iter.hasNext()) {
    final Map.Entry<Integer,ClientInvocation> entry=iter.next();
    final ClientInvocation invocation=entry.getValue();
    if (invocation.getSendConnection().equals(connection)) {
      iter.remove();
      invocation.notify(responseCtor.createNew(null));
      eventHandlerMap.remove(entry.getKey());
    }
  }
  final Iterator<ClientInvocation> iterator=eventHandlerMap.values().iterator();
  while (iterator.hasNext()) {
    final ClientInvocation invocation=iterator.next();
    if (invocation.getSendConnection().equals(connection)) {
      iterator.remove();
      invocation.notify(responseCtor.createNew(null));
    }
  }
}

Fixed version (ground truth):
public void cleanResources(ConstructorFunction<Object,Throwable> responseCtor,ClientConnection connection){
  final Iterator<Map.Entry<Integer,ClientInvocation>> iter=callIdMap.entrySet().iterator();
  while (iter.hasNext()) {
    final Map.Entry<Integer,ClientInvocation> entry=iter.next();
    final ClientInvocation invocation=entry.getValue();
    if (connection.equals(invocation.getSendConnection())) {
      iter.remove();
      invocation.notify(responseCtor.createNew(null));
      eventHandlerMap.remove(entry.getKey());
    }
  }
  final Iterator<ClientInvocation> iterator=eventHandlerMap.values().iterator();
  while (iterator.hasNext()) {
    final ClientInvocation invocation=iterator.next();
    if (connection.equals(invocation.getSendConnection())) {
      iterator.remove();
      invocation.notify(responseCtor.createNew(null));
    }
  }
}
Program: 47303
Project: 47303
Buggy source:
@Override public V get(K key,ExpiryPolicy expiryPolicy){
  final Future<V> f=getAsync(key,expiryPolicy);
  try {
    return f.get();
  }
 catch (  Throwable e) {
    throw ExceptionUtil.rethrowAllowedTypeFirst(e,CacheException.class);
  }
}

Fixed version (ground truth):
@Override public V get(K key,ExpiryPolicy expiryPolicy){
  final Future<V> f=getAsync(key,expiryPolicy);
  try {
    return toObject(f.get());
  }
 catch (  Throwable e) {
    throw ExceptionUtil.rethrowAllowedTypeFirst(e,CacheException.class);
  }
}
Program: 47304
Project: 47304
Buggy source:
@Override public V getAndRemove(K key){
  final ICompletableFuture<V> f=removeAsyncInternal(key,null,false,true,true);
  try {
    return f.get();
  }
 catch (  Throwable e) {
    throw ExceptionUtil.rethrowAllowedTypeFirst(e,CacheException.class);
  }
}

Fixed version (ground truth):
@Override public V getAndRemove(K key){
  final ICompletableFuture<V> f=removeAsyncInternal(key,null,false,true,true);
  try {
    return toObject(f.get());
  }
 catch (  Throwable e) {
    throw ExceptionUtil.rethrowAllowedTypeFirst(e,CacheException.class);
  }
}
Program: 47305
Project: 47305
Buggy source:
@Override public V get(K key,ExpiryPolicy expiryPolicy){
  final Future<V> f=getAsync(key,expiryPolicy);
  try {
    return f.get();
  }
 catch (  Throwable e) {
    throw ExceptionUtil.rethrowAllowedTypeFirst(e,CacheException.class);
  }
}

Fixed version (ground truth):
@Override public V get(K key,ExpiryPolicy expiryPolicy){
  final Future<V> f=getAsync(key,expiryPolicy);
  try {
    return toObject(f.get());
  }
 catch (  Throwable e) {
    throw ExceptionUtil.rethrowAllowedTypeFirst(e,CacheException.class);
  }
}
Program: 47306
Project: 47306
Buggy source:
@Override public V getAndRemove(K key){
  final ICompletableFuture<V> f=removeAsyncInternal(key,null,false,true,true);
  try {
    return f.get();
  }
 catch (  Throwable e) {
    throw ExceptionUtil.rethrowAllowedTypeFirst(e,CacheException.class);
  }
}

Fixed version (ground truth):
@Override public V getAndRemove(K key){
  final ICompletableFuture<V> f=removeAsyncInternal(key,null,false,true,true);
  try {
    return toObject(f.get());
  }
 catch (  Throwable e) {
    throw ExceptionUtil.rethrowAllowedTypeFirst(e,CacheException.class);
  }
}
Program: 47307
Project: 47307
Buggy source:
@Override public boolean replace(Data key,Object oldValue,Object newValue,ExpiryPolicy expiryPolicy,String source,int completionId){
  expiryPolicy=getExpiryPolicy(expiryPolicy);
  final long now=Clock.currentTimeMillis();
  final long start=isStatisticsEnabled() ? System.nanoTime() : 0;
  boolean isHit=false;
  boolean replaced=false;
  R record=records.get(key);
  boolean isExpired=record != null && record.isExpiredAt(now);
  try {
    if (record == null || isExpired) {
      replaced=false;
    }
 else {
      isHit=true;
      Object currentValue=toValue(record);
      if (compare(currentValue,toValue(oldValue))) {
        replaced=updateRecordWithExpiry(key,newValue,record,expiryPolicy,now,false,completionId);
      }
 else {
        onRecordAccess(key,record,expiryPolicy,now);
        replaced=false;
      }
    }
    if (!replaced) {
      publishEvent(CacheEventType.COMPLETED,key,null,null,false,completionId,CacheRecord.EXPIRATION_TIME_NOT_AVAILABLE);
    }
    onReplace(key,oldValue,newValue,expiryPolicy,source,false,record,isExpired,replaced);
    updateReplaceStat(replaced,isHit,start);
    updateHasExpiringEntry(record);
    return replaced;
  }
 catch (  Throwable error) {
    onReplaceError(key,oldValue,newValue,expiryPolicy,source,false,record,isExpired,replaced,error);
    throw ExceptionUtil.rethrow(error);
  }
}

Fixed version (ground truth):
@Override public boolean replace(Data key,Object oldValue,Object newValue,ExpiryPolicy expiryPolicy,String source,int completionId){
  expiryPolicy=getExpiryPolicy(expiryPolicy);
  final long now=Clock.currentTimeMillis();
  final long start=isStatisticsEnabled() ? System.nanoTime() : 0;
  boolean isHit=false;
  boolean replaced=false;
  R record=records.get(key);
  boolean isExpired=record != null && record.isExpiredAt(now);
  try {
    if (record == null || isExpired) {
      replaced=false;
    }
 else {
      isHit=true;
      Object currentValue=toStorageValue(record);
      if (compare(currentValue,toStorageValue(oldValue))) {
        replaced=updateRecordWithExpiry(key,newValue,record,expiryPolicy,now,false,completionId);
      }
 else {
        onRecordAccess(key,record,expiryPolicy,now);
        replaced=false;
      }
    }
    if (!replaced) {
      publishEvent(CacheEventType.COMPLETED,key,null,null,false,completionId,CacheRecord.EXPIRATION_TIME_NOT_AVAILABLE);
    }
    onReplace(key,oldValue,newValue,expiryPolicy,source,false,record,isExpired,replaced);
    updateReplaceStat(replaced,isHit,start);
    updateHasExpiringEntry(record);
    return replaced;
  }
 catch (  Throwable error) {
    onReplaceError(key,oldValue,newValue,expiryPolicy,source,false,record,isExpired,replaced,error);
    throw ExceptionUtil.rethrow(error);
  }
}
Program: 47308
Project: 47308
Buggy source:
protected <T>T toValue(Object obj){
  if (obj instanceof Data) {
    return (T)dataToValue((Data)obj);
  }
 else   if (obj instanceof CacheRecord) {
    return (T)recordToValue((R)obj);
  }
 else {
    return (T)obj;
  }
}

Fixed version (ground truth):
protected Object toValue(Object obj){
  if (obj instanceof Data) {
    return dataToValue((Data)obj);
  }
 else   if (obj instanceof CacheRecord) {
    return recordToValue((R)obj);
  }
 else {
    return obj;
  }
}
Program: 47309
Project: 47309
Buggy source:
protected abstract <T>T recordToValue(R record);

Fixed version (ground truth):
protected abstract Object recordToValue(R record);
Program: 47310
Project: 47310
Buggy source:
public boolean remove(Data key,Object value,String source,int completionId,String origin){
  final long now=Clock.currentTimeMillis();
  final long start=System.nanoTime();
  R record=records.get(key);
  boolean isExpired=record != null && record.isExpiredAt(now);
  int hitCount=0;
  boolean removed=false;
  try {
    if (record == null || isExpired) {
      if (isStatisticsEnabled()) {
        statistics.increaseCacheMisses(1);
      }
      removed=false;
    }
 else {
      hitCount++;
      if (compare(toValue(record),toValue(value))) {
        deleteCacheEntry(key);
        removed=deleteRecord(key,completionId,source,origin);
      }
 else {
        long expiryTime=onRecordAccess(key,record,defaultExpiryPolicy,now);
        processExpiredEntry(key,record,expiryTime,now,source,origin);
        removed=false;
      }
    }
    if (!removed) {
      publishEvent(CacheEventType.COMPLETED,key,null,null,false,completionId,CacheRecord.EXPIRATION_TIME_NOT_AVAILABLE,origin);
    }
    onRemove(key,value,source,false,record,removed);
    if (records.size() == 0) {
      hasExpiringEntry=false;
    }
    updateRemoveStatistics(removed,hitCount,start);
    return removed;
  }
 catch (  Throwable error) {
    onRemoveError(key,null,source,false,record,removed,error);
    throw ExceptionUtil.rethrow(error);
  }
}

Fixed version (ground truth):
public boolean remove(Data key,Object value,String source,int completionId,String origin){
  final long now=Clock.currentTimeMillis();
  final long start=System.nanoTime();
  R record=records.get(key);
  boolean isExpired=record != null && record.isExpiredAt(now);
  int hitCount=0;
  boolean removed=false;
  try {
    if (record == null || isExpired) {
      if (isStatisticsEnabled()) {
        statistics.increaseCacheMisses(1);
      }
      removed=false;
    }
 else {
      hitCount++;
      if (compare(toStorageValue(record),toStorageValue(value))) {
        deleteCacheEntry(key);
        removed=deleteRecord(key,completionId,source,origin);
      }
 else {
        long expiryTime=onRecordAccess(key,record,defaultExpiryPolicy,now);
        processExpiredEntry(key,record,expiryTime,now,source,origin);
        removed=false;
      }
    }
    if (!removed) {
      publishEvent(CacheEventType.COMPLETED,key,null,null,false,completionId,CacheRecord.EXPIRATION_TIME_NOT_AVAILABLE,origin);
    }
    onRemove(key,value,source,false,record,removed);
    if (records.size() == 0) {
      hasExpiringEntry=false;
    }
    updateRemoveStatistics(removed,hitCount,start);
    return removed;
  }
 catch (  Throwable error) {
    onRemoveError(key,null,source,false,record,removed,error);
    throw ExceptionUtil.rethrow(error);
  }
}
Program: 47311
Project: 47311
Buggy source:
protected abstract <T>T dataToValue(Data data);

Fixed version (ground truth):
protected abstract Object dataToValue(Data data);
Program: 47312
Project: 47312
Buggy source:
protected abstract <T>Data valueToData(T value);

Fixed version (ground truth):
protected abstract Data valueToData(Object value);
Program: 47313
Project: 47313
Buggy source:
@Override protected <T>T dataToValue(Data data){
  return (T)serializationService.toObject(data);
}

Fixed version (ground truth):
@Override protected Object dataToValue(Data data){
  return serializationService.toObject(data);
}
Program: 47314
Project: 47314
Buggy source:
@Override protected <T>T recordToValue(CacheRecord record){
  Object value=record.getValue();
  if (value instanceof Data) {
    return dataToValue((Data)value);
  }
 else {
    return (T)value;
  }
}

Fixed version (ground truth):
@Override protected Object recordToValue(CacheRecord record){
  Object value=record.getValue();
  if (value instanceof Data) {
switch (cacheConfig.getInMemoryFormat()) {
case BINARY:
      return value;
case OBJECT:
    return dataToValue((Data)value);
default :
  throw new IllegalStateException("String_Node_Str" + cacheConfig.getInMemoryFormat());
}
}
 else {
return value;
}
}
Program: 47315
Project: 47315
Buggy source:
@Override protected <T>CacheRecord createRecord(T value,long creationTime,long expiryTime){
  evictIfRequired();
  return cacheRecordFactory.newRecordWithExpiry(value,creationTime,expiryTime);
}

Fixed version (ground truth):
@Override protected CacheRecord createRecord(Object value,long creationTime,long expiryTime){
  evictIfRequired();
  return cacheRecordFactory.newRecordWithExpiry(value,creationTime,expiryTime);
}
Program: 47316
Project: 47316
Buggy source:
@Override protected <T>Data valueToData(T value){
  return cacheService.toData(value);
}

Fixed version (ground truth):
@Override protected Data valueToData(Object value){
  return cacheService.toData(value);
}
Program: 47317
Project: 47317
Buggy source:
@Override public V get(K key,ExpiryPolicy expiryPolicy){
  final Future<V> f=getAsync(key,expiryPolicy);
  try {
    return f.get();
  }
 catch (  Throwable e) {
    throw ExceptionUtil.rethrowAllowedTypeFirst(e,CacheException.class);
  }
}

Fixed version (ground truth):
@Override public V get(K key,ExpiryPolicy expiryPolicy){
  final Future<V> f=getAsync(key,expiryPolicy);
  try {
    return toObject(f.get());
  }
 catch (  Throwable e) {
    throw ExceptionUtil.rethrowAllowedTypeFirst(e,CacheException.class);
  }
}
Program: 47318
Project: 47318
Buggy source:
@Override public V getAndRemove(K key){
  final ICompletableFuture<V> f=removeAsyncInternal(key,null,false,true,true);
  try {
    return f.get();
  }
 catch (  Throwable e) {
    throw ExceptionUtil.rethrowAllowedTypeFirst(e,CacheException.class);
  }
}

Fixed version (ground truth):
@Override public V getAndRemove(K key){
  final ICompletableFuture<V> f=removeAsyncInternal(key,null,false,true,true);
  try {
    return toObject(f.get());
  }
 catch (  Throwable e) {
    throw ExceptionUtil.rethrowAllowedTypeFirst(e,CacheException.class);
  }
}
Program: 47319
Project: 47319
Buggy source:
@Override public V get(K key,ExpiryPolicy expiryPolicy){
  final Future<V> f=getAsync(key,expiryPolicy);
  try {
    return f.get();
  }
 catch (  Throwable e) {
    throw ExceptionUtil.rethrowAllowedTypeFirst(e,CacheException.class);
  }
}

Fixed version (ground truth):
@Override public V get(K key,ExpiryPolicy expiryPolicy){
  final Future<V> f=getAsync(key,expiryPolicy);
  try {
    return toObject(f.get());
  }
 catch (  Throwable e) {
    throw ExceptionUtil.rethrowAllowedTypeFirst(e,CacheException.class);
  }
}
Program: 47320
Project: 47320
Buggy source:
@Override public V getAndRemove(K key){
  final ICompletableFuture<V> f=removeAsyncInternal(key,null,false,true,true);
  try {
    return f.get();
  }
 catch (  Throwable e) {
    throw ExceptionUtil.rethrowAllowedTypeFirst(e,CacheException.class);
  }
}

Fixed version (ground truth):
@Override public V getAndRemove(K key){
  final ICompletableFuture<V> f=removeAsyncInternal(key,null,false,true,true);
  try {
    return toObject(f.get());
  }
 catch (  Throwable e) {
    throw ExceptionUtil.rethrowAllowedTypeFirst(e,CacheException.class);
  }
}
Program: 47321
Project: 47321
Buggy source:
@Override public boolean replace(Data key,Object oldValue,Object newValue,ExpiryPolicy expiryPolicy,String source,int completionId){
  expiryPolicy=getExpiryPolicy(expiryPolicy);
  final long now=Clock.currentTimeMillis();
  final long start=isStatisticsEnabled() ? System.nanoTime() : 0;
  boolean isHit=false;
  boolean replaced=false;
  R record=records.get(key);
  boolean isExpired=record != null && record.isExpiredAt(now);
  try {
    if (record == null || isExpired) {
      replaced=false;
    }
 else {
      isHit=true;
      Object currentValue=toValue(record);
      if (compare(currentValue,toValue(oldValue))) {
        replaced=updateRecordWithExpiry(key,newValue,record,expiryPolicy,now,false,completionId);
      }
 else {
        onRecordAccess(key,record,expiryPolicy,now);
        replaced=false;
      }
    }
    if (!replaced) {
      publishEvent(CacheEventType.COMPLETED,key,null,null,false,completionId,CacheRecord.EXPIRATION_TIME_NOT_AVAILABLE);
    }
    onReplace(key,oldValue,newValue,expiryPolicy,source,false,record,isExpired,replaced);
    updateReplaceStat(replaced,isHit,start);
    updateHasExpiringEntry(record);
    return replaced;
  }
 catch (  Throwable error) {
    onReplaceError(key,oldValue,newValue,expiryPolicy,source,false,record,isExpired,replaced,error);
    throw ExceptionUtil.rethrow(error);
  }
}

Fixed version (ground truth):
@Override public boolean replace(Data key,Object oldValue,Object newValue,ExpiryPolicy expiryPolicy,String source,int completionId){
  expiryPolicy=getExpiryPolicy(expiryPolicy);
  final long now=Clock.currentTimeMillis();
  final long start=isStatisticsEnabled() ? System.nanoTime() : 0;
  boolean isHit=false;
  boolean replaced=false;
  R record=records.get(key);
  boolean isExpired=record != null && record.isExpiredAt(now);
  try {
    if (record == null || isExpired) {
      replaced=false;
    }
 else {
      isHit=true;
      Object currentValue=toStorageValue(record);
      if (compare(currentValue,toStorageValue(oldValue))) {
        replaced=updateRecordWithExpiry(key,newValue,record,expiryPolicy,now,false,completionId);
      }
 else {
        onRecordAccess(key,record,expiryPolicy,now);
        replaced=false;
      }
    }
    if (!replaced) {
      publishEvent(CacheEventType.COMPLETED,key,null,null,false,completionId,CacheRecord.EXPIRATION_TIME_NOT_AVAILABLE);
    }
    onReplace(key,oldValue,newValue,expiryPolicy,source,false,record,isExpired,replaced);
    updateReplaceStat(replaced,isHit,start);
    updateHasExpiringEntry(record);
    return replaced;
  }
 catch (  Throwable error) {
    onReplaceError(key,oldValue,newValue,expiryPolicy,source,false,record,isExpired,replaced,error);
    throw ExceptionUtil.rethrow(error);
  }
}
Program: 47322
Project: 47322
Buggy source:
protected <T>T toValue(Object obj){
  if (obj instanceof Data) {
    return (T)dataToValue((Data)obj);
  }
 else   if (obj instanceof CacheRecord) {
    return (T)recordToValue((R)obj);
  }
 else {
    return (T)obj;
  }
}

Fixed version (ground truth):
protected Object toValue(Object obj){
  if (obj instanceof Data) {
    return dataToValue((Data)obj);
  }
 else   if (obj instanceof CacheRecord) {
    return recordToValue((R)obj);
  }
 else {
    return obj;
  }
}
Program: 47323
Project: 47323
Buggy source:
protected abstract <T>T recordToValue(R record);

Fixed version (ground truth):
protected abstract Object recordToValue(R record);
Program: 47324
Project: 47324
Buggy source:
public boolean remove(Data key,Object value,String source,int completionId,String origin){
  final long now=Clock.currentTimeMillis();
  final long start=System.nanoTime();
  R record=records.get(key);
  boolean isExpired=record != null && record.isExpiredAt(now);
  int hitCount=0;
  boolean removed=false;
  try {
    if (record == null || isExpired) {
      if (isStatisticsEnabled()) {
        statistics.increaseCacheMisses(1);
      }
      removed=false;
    }
 else {
      hitCount++;
      if (compare(toValue(record),toValue(value))) {
        deleteCacheEntry(key);
        removed=deleteRecord(key,completionId,source,origin);
      }
 else {
        long expiryTime=onRecordAccess(key,record,defaultExpiryPolicy,now);
        processExpiredEntry(key,record,expiryTime,now,source,origin);
        removed=false;
      }
    }
    if (!removed) {
      publishEvent(CacheEventType.COMPLETED,key,null,null,false,completionId,CacheRecord.EXPIRATION_TIME_NOT_AVAILABLE,origin);
    }
    onRemove(key,value,source,false,record,removed);
    if (records.size() == 0) {
      hasExpiringEntry=false;
    }
    updateRemoveStatistics(removed,hitCount,start);
    return removed;
  }
 catch (  Throwable error) {
    onRemoveError(key,null,source,false,record,removed,error);
    throw ExceptionUtil.rethrow(error);
  }
}

Fixed version (ground truth):
public boolean remove(Data key,Object value,String source,int completionId,String origin){
  final long now=Clock.currentTimeMillis();
  final long start=System.nanoTime();
  R record=records.get(key);
  boolean isExpired=record != null && record.isExpiredAt(now);
  int hitCount=0;
  boolean removed=false;
  try {
    if (record == null || isExpired) {
      if (isStatisticsEnabled()) {
        statistics.increaseCacheMisses(1);
      }
      removed=false;
    }
 else {
      hitCount++;
      if (compare(toStorageValue(record),toStorageValue(value))) {
        deleteCacheEntry(key);
        removed=deleteRecord(key,completionId,source,origin);
      }
 else {
        long expiryTime=onRecordAccess(key,record,defaultExpiryPolicy,now);
        processExpiredEntry(key,record,expiryTime,now,source,origin);
        removed=false;
      }
    }
    if (!removed) {
      publishEvent(CacheEventType.COMPLETED,key,null,null,false,completionId,CacheRecord.EXPIRATION_TIME_NOT_AVAILABLE,origin);
    }
    onRemove(key,value,source,false,record,removed);
    if (records.size() == 0) {
      hasExpiringEntry=false;
    }
    updateRemoveStatistics(removed,hitCount,start);
    return removed;
  }
 catch (  Throwable error) {
    onRemoveError(key,null,source,false,record,removed,error);
    throw ExceptionUtil.rethrow(error);
  }
}
Program: 47325
Project: 47325
Buggy source:
protected abstract <T>T dataToValue(Data data);

Fixed version (ground truth):
protected abstract Object dataToValue(Data data);
Program: 47326
Project: 47326
Buggy source:
protected abstract <T>Data valueToData(T value);

Fixed version (ground truth):
protected abstract Data valueToData(Object value);
Program: 47327
Project: 47327
Buggy source:
@Override protected <T>T dataToValue(Data data){
  return (T)serializationService.toObject(data);
}

Fixed version (ground truth):
@Override protected Object dataToValue(Data data){
  return serializationService.toObject(data);
}
Program: 47328
Project: 47328
Buggy source:
@Override protected <T>T recordToValue(CacheRecord record){
  Object value=record.getValue();
  if (value instanceof Data) {
    return dataToValue((Data)value);
  }
 else {
    return (T)value;
  }
}

Fixed version (ground truth):
@Override protected Object recordToValue(CacheRecord record){
  Object value=record.getValue();
  if (value instanceof Data) {
switch (cacheConfig.getInMemoryFormat()) {
case BINARY:
      return value;
case OBJECT:
    return dataToValue((Data)value);
default :
  throw new IllegalStateException("String_Node_Str" + cacheConfig.getInMemoryFormat());
}
}
 else {
return value;
}
}
Program: 47329
Project: 47329
Buggy source:
@Override protected <T>CacheRecord createRecord(T value,long creationTime,long expiryTime){
  evictIfRequired();
  return cacheRecordFactory.newRecordWithExpiry(value,creationTime,expiryTime);
}

Fixed version (ground truth):
@Override protected CacheRecord createRecord(Object value,long creationTime,long expiryTime){
  evictIfRequired();
  return cacheRecordFactory.newRecordWithExpiry(value,creationTime,expiryTime);
}
Program: 47330
Project: 47330
Buggy source:
@Override protected <T>Data valueToData(T value){
  return cacheService.toData(value);
}

Fixed version (ground truth):
@Override protected Data valueToData(Object value){
  return cacheService.toData(value);
}
Program: 47331
Project: 47331
Buggy source:
@Override public V get(K key,ExpiryPolicy expiryPolicy){
  final Future<V> f=getAsync(key,expiryPolicy);
  try {
    return f.get();
  }
 catch (  Throwable e) {
    throw ExceptionUtil.rethrowAllowedTypeFirst(e,CacheException.class);
  }
}

Fixed version (ground truth):
@Override public V get(K key,ExpiryPolicy expiryPolicy){
  final Future<V> f=getAsync(key,expiryPolicy);
  try {
    return toObject(f.get());
  }
 catch (  Throwable e) {
    throw ExceptionUtil.rethrowAllowedTypeFirst(e,CacheException.class);
  }
}
Program: 47332
Project: 47332
Buggy source:
@Override public V getAndRemove(K key){
  final ICompletableFuture<V> f=removeAsyncInternal(key,null,false,true,true);
  try {
    return f.get();
  }
 catch (  Throwable e) {
    throw ExceptionUtil.rethrowAllowedTypeFirst(e,CacheException.class);
  }
}

Fixed version (ground truth):
@Override public V getAndRemove(K key){
  final ICompletableFuture<V> f=removeAsyncInternal(key,null,false,true,true);
  try {
    return toObject(f.get());
  }
 catch (  Throwable e) {
    throw ExceptionUtil.rethrowAllowedTypeFirst(e,CacheException.class);
  }
}
Program: 47333
Project: 47333
Buggy source:
@Override public boolean replace(Data key,Object oldValue,Object newValue,ExpiryPolicy expiryPolicy,String caller,int completionId){
  expiryPolicy=getExpiryPolicy(expiryPolicy);
  final long now=Clock.currentTimeMillis();
  final long start=isStatisticsEnabled() ? System.nanoTime() : 0;
  boolean isHit=false;
  boolean replaced=false;
  R record=records.get(key);
  boolean isExpired=record != null && record.isExpiredAt(now);
  try {
    if (record == null || isExpired) {
      replaced=false;
    }
 else {
      isHit=true;
      Object currentValue=toValue(record);
      if (compare(currentValue,toValue(oldValue))) {
        replaced=updateRecordWithExpiry(key,newValue,record,expiryPolicy,now,false,completionId);
      }
 else {
        onRecordAccess(record,expiryPolicy,now);
        replaced=false;
      }
    }
    if (!replaced) {
      publishEvent(CacheEventType.COMPLETED,key,null,null,false,completionId);
    }
    onReplace(key,oldValue,newValue,expiryPolicy,caller,false,record,isExpired,replaced);
    updateReplaceStat(replaced,isHit,start);
    updateHasExpiringEntry(record);
    return replaced;
  }
 catch (  Throwable error) {
    onReplaceError(key,oldValue,newValue,expiryPolicy,caller,false,record,isExpired,replaced,error);
    throw ExceptionUtil.rethrow(error);
  }
}

Fixed version (ground truth):
@Override public boolean replace(Data key,Object oldValue,Object newValue,ExpiryPolicy expiryPolicy,String caller,int completionId){
  expiryPolicy=getExpiryPolicy(expiryPolicy);
  final long now=Clock.currentTimeMillis();
  final long start=isStatisticsEnabled() ? System.nanoTime() : 0;
  boolean isHit=false;
  boolean replaced=false;
  R record=records.get(key);
  boolean isExpired=record != null && record.isExpiredAt(now);
  try {
    if (record == null || isExpired) {
      replaced=false;
    }
 else {
      isHit=true;
      Object currentValue=toStorageValue(record);
      if (compare(currentValue,toStorageValue(oldValue))) {
        replaced=updateRecordWithExpiry(key,newValue,record,expiryPolicy,now,false,completionId);
      }
 else {
        onRecordAccess(record,expiryPolicy,now);
        replaced=false;
      }
    }
    if (!replaced) {
      publishEvent(CacheEventType.COMPLETED,key,null,null,false,completionId);
    }
    onReplace(key,oldValue,newValue,expiryPolicy,caller,false,record,isExpired,replaced);
    updateReplaceStat(replaced,isHit,start);
    updateHasExpiringEntry(record);
    return replaced;
  }
 catch (  Throwable error) {
    onReplaceError(key,oldValue,newValue,expiryPolicy,caller,false,record,isExpired,replaced,error);
    throw ExceptionUtil.rethrow(error);
  }
}
Program: 47334
Project: 47334
Buggy source:
protected <T>T toValue(Object obj){
  if (obj instanceof Data) {
    return (T)dataToValue((Data)obj);
  }
 else   if (obj instanceof CacheRecord) {
    return (T)recordToValue((R)obj);
  }
 else {
    return (T)obj;
  }
}

Fixed version (ground truth):
protected Object toValue(Object obj){
  if (obj instanceof Data) {
    return dataToValue((Data)obj);
  }
 else   if (obj instanceof CacheRecord) {
    return recordToValue((R)obj);
  }
 else {
    return obj;
  }
}
Program: 47335
Project: 47335
Buggy source:
protected abstract <T>R valueToRecord(T value);

Fixed version (ground truth):
protected abstract R valueToRecord(Object value);
Program: 47336
Project: 47336
Buggy source:
protected abstract <T>T recordToValue(R record);

Fixed version (ground truth):
protected abstract Object recordToValue(R record);
Program: 47337
Project: 47337
Buggy source:
@Override public boolean remove(Data key,Object value,String caller,int completionId){
  final long now=Clock.currentTimeMillis();
  final long start=System.nanoTime();
  R record=records.get(key);
  boolean isExpired=record != null && record.isExpiredAt(now);
  int hitCount=0;
  boolean removed=false;
  try {
    if (record == null || isExpired) {
      if (isStatisticsEnabled()) {
        statistics.increaseCacheMisses(1);
      }
      removed=false;
    }
 else {
      hitCount++;
      if (compare(toValue(record),toValue(value))) {
        deleteCacheEntry(key);
        removed=deleteRecord(key,completionId);
      }
 else {
        long expiryTime=onRecordAccess(record,defaultExpiryPolicy,now);
        processExpiredEntry(key,record,expiryTime,now);
        removed=false;
      }
    }
    if (!removed) {
      publishEvent(CacheEventType.COMPLETED,key,null,null,false,completionId);
    }
    onRemove(key,value,caller,false,record,removed);
    if (records.size() == 0) {
      hasExpiringEntry=false;
    }
    updateRemoveStatistics(removed,hitCount,start);
    return removed;
  }
 catch (  Throwable error) {
    onRemoveError(key,null,caller,false,record,removed,error);
    throw ExceptionUtil.rethrow(error);
  }
}

Fixed version (ground truth):
@Override public boolean remove(Data key,Object value,String caller,int completionId){
  final long now=Clock.currentTimeMillis();
  final long start=System.nanoTime();
  R record=records.get(key);
  boolean isExpired=record != null && record.isExpiredAt(now);
  int hitCount=0;
  boolean removed=false;
  try {
    if (record == null || isExpired) {
      if (isStatisticsEnabled()) {
        statistics.increaseCacheMisses(1);
      }
      removed=false;
    }
 else {
      hitCount++;
      if (compare(toStorageValue(record),toStorageValue(value))) {
        deleteCacheEntry(key);
        removed=deleteRecord(key,completionId);
      }
 else {
        long expiryTime=onRecordAccess(record,defaultExpiryPolicy,now);
        processExpiredEntry(key,record,expiryTime,now);
        removed=false;
      }
    }
    if (!removed) {
      publishEvent(CacheEventType.COMPLETED,key,null,null,false,completionId);
    }
    onRemove(key,value,caller,false,record,removed);
    if (records.size() == 0) {
      hasExpiringEntry=false;
    }
    updateRemoveStatistics(removed,hitCount,start);
    return removed;
  }
 catch (  Throwable error) {
    onRemoveError(key,null,caller,false,record,removed,error);
    throw ExceptionUtil.rethrow(error);
  }
}
Program: 47338
Project: 47338
Buggy source:
protected abstract <T>T dataToValue(Data data);

Fixed version (ground truth):
protected abstract Object dataToValue(Data data);
Program: 47339
Project: 47339
Buggy source:
protected abstract <T>Data valueToData(T value);

Fixed version (ground truth):
protected abstract Data valueToData(Object value);
Program: 47340
Project: 47340
Buggy source:
@Override protected <T>T recordToValue(CacheRecord record){
  Object value=record.getValue();
  if (value instanceof Data) {
    return dataToValue((Data)value);
  }
 else {
    return (T)value;
  }
}

Fixed version (ground truth):
@Override protected Object recordToValue(CacheRecord record){
  Object value=record.getValue();
  if (value instanceof Data) {
switch (cacheConfig.getInMemoryFormat()) {
case BINARY:
      return value;
case OBJECT:
    return dataToValue((Data)value);
default :
  throw new IllegalStateException("String_Node_Str" + cacheConfig.getInMemoryFormat());
}
}
 else {
return value;
}
}
Program: 47341
Project: 47341
Buggy source:
@Override protected <T>T dataToValue(Data data){
  return (T)serializationService.toObject(data);
}

Fixed version (ground truth):
@Override protected Object dataToValue(Data data){
  return serializationService.toObject(data);
}