Program: 47375
Project: 47375
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=createEvictionPolicyEvaluator(evictionConfig);
  this.evictionChecker=createEvictionChecker(evictionConfig);
  this.evictionStrategy=createEvictionStrategy(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);
  }
}

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.getMaximumSizePolicy());
  this.evictionPolicyEvaluator=createEvictionPolicyEvaluator(evictionConfig);
  this.evictionChecker=createEvictionChecker(evictionConfig);
  this.evictionStrategy=createEvictionStrategy(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);
  }
}