Program: 47426
Project: 47426
Buggy source:
public AbstractCacheRecordStore(final String name,final int partitionId,final NodeEngine nodeEngine,final AbstractCacheService cacheService){
  this.name=name;
  this.partitionId=partitionId;
  this.partitionCount=nodeEngine.getPartitionService().getPartitionCount();
  this.nodeEngine=nodeEngine;
  this.cacheService=cacheService;
  this.cacheConfig=cacheService.getCacheConfig(name);
  if (cacheConfig == null) {
    throw new CacheNotExistsException("String_Node_Str" + nodeEngine.getLocalMember());
  }
  this.evictionConfig=cacheConfig.getEvictionConfig();
  if (evictionConfig == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  this.records=createRecordCacheMap();
  if (cacheConfig.getCacheLoaderFactory() != null) {
    final Factory<CacheLoader> cacheLoaderFactory=cacheConfig.getCacheLoaderFactory();
    cacheLoader=cacheLoaderFactory.create();
  }
  if (cacheConfig.getCacheWriterFactory() != null) {
    final Factory<CacheWriter> cacheWriterFactory=cacheConfig.getCacheWriterFactory();
    cacheWriter=cacheWriterFactory.create();
  }
  if (cacheConfig.isStatisticsEnabled()) {
    this.statistics=cacheService.createCacheStatIfAbsent(name);
  }
  final Factory<ExpiryPolicy> expiryPolicyFactory=cacheConfig.getExpiryPolicyFactory();
  this.defaultExpiryPolicy=expiryPolicyFactory.create();
  this.maxSizeChecker=createCacheMaxSizeChecker(evictionConfig.getSize(),evictionConfig.getMaxSizePolicy());
  this.evictionPolicyEvaluator=creatEvictionPolicyEvaluator(evictionConfig);
  this.evictionChecker=createEvictionChecker(evictionConfig);
  this.evictionStrategy=creatEvictionStrategy(evictionConfig);
}

Fixed version (ground truth):
public AbstractCacheRecordStore(final String name,final int partitionId,final NodeEngine nodeEngine,final AbstractCacheService cacheService){
  this.name=name;
  this.partitionId=partitionId;
  this.partitionCount=nodeEngine.getPartitionService().getPartitionCount();
  this.nodeEngine=nodeEngine;
  this.cacheService=cacheService;
  this.cacheConfig=cacheService.getCacheConfig(name);
  if (cacheConfig == null) {
    throw new CacheNotExistsException("String_Node_Str" + nodeEngine.getLocalMember());
  }
  this.evictionConfig=cacheConfig.getEvictionConfig();
  if (evictionConfig == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  this.records=createRecordCacheMap();
  if (cacheConfig.getCacheLoaderFactory() != null) {
    final Factory<CacheLoader> cacheLoaderFactory=cacheConfig.getCacheLoaderFactory();
    cacheLoader=cacheLoaderFactory.create();
  }
  if (cacheConfig.getCacheWriterFactory() != null) {
    final Factory<CacheWriter> cacheWriterFactory=cacheConfig.getCacheWriterFactory();
    cacheWriter=cacheWriterFactory.create();
  }
  if (cacheConfig.isStatisticsEnabled()) {
    this.statistics=cacheService.createCacheStatIfAbsent(name);
  }
  final Factory<ExpiryPolicy> expiryPolicyFactory=cacheConfig.getExpiryPolicyFactory();
  this.defaultExpiryPolicy=expiryPolicyFactory.create();
  this.maxSizeChecker=createCacheMaxSizeChecker(evictionConfig.getSize(),evictionConfig.getMaxSizePolicy());
  this.evictionPolicyEvaluator=creatEvictionPolicyEvaluator(evictionConfig);
  this.evictionChecker=createEvictionChecker(evictionConfig);
  this.evictionStrategy=creatEvictionStrategy(evictionConfig);
  if (cacheWriter instanceof Closeable) {
    cacheService.addCacheResource(name,(Closeable)cacheWriter);
  }
  if (cacheLoader instanceof Closeable) {
    cacheService.addCacheResource(name,(Closeable)cacheLoader);
  }
  if (defaultExpiryPolicy instanceof Closeable) {
    cacheService.addCacheResource(name,(Closeable)defaultExpiryPolicy);
  }
}