Program: 17290
Project: 17290
Buggy source:
/** 
 * Constructs a cache.
 * @param cacheName          the cache name
 * @param cacheManagerName   the cache manager name
 * @param classLoader        the class loader
 * @param configuration      the configuration
 */
RICache(String cacheName,String cacheManagerName,ClassLoader classLoader,Configuration<K,V> configuration){
  this.cacheName=cacheName;
  this.cacheManagerName=cacheManagerName;
  this.classLoader=classLoader;
  this.configuration=new RIConfiguration<K,V>(configuration);
  keyConverter=configuration.isStoreByValue() ? new RISerializingInternalConverter<K>(classLoader) : new RIReferenceInternalConverter<K>();
  valueConverter=configuration.isStoreByValue() ? new RISerializingInternalConverter<V>(classLoader) : new RIReferenceInternalConverter<V>();
  this.expiryPolicy=configuration.getExpiryPolicy();
  status=Status.UNINITIALISED;
  entries=new RISimpleInternalMap<Object,RICachedValue>();
  cacheMXBean=new RICacheMXBean<K,V>(this);
  statistics=new RICacheStatisticsMXBean(this);
  if (configuration.isManagementEnabled()) {
    setManagementEnabled(true);
  }
  if (configuration.isStatisticsEnabled()) {
    setStatisticsEnabled(true);
  }
  for (  CacheEntryListenerRegistration<? super K,? super V> r : configuration.getCacheEntryListenerRegistrations()) {
    CacheEntryListener<? super K,? super V> listener=r.getCacheEntryListener();
    CacheEntryEventFilter<? super K,? super V> filter=r.getCacheEntryFilter();
    boolean oldValueRequired=r.isOldValueRequired();
    boolean synchronous=r.isSynchronous();
    RICacheEntryListenerRegistration<K,V> registration=new RICacheEntryListenerRegistration<K,V>(listener,filter,oldValueRequired,synchronous);
    cacheEntryListenerRegistrations.put(listener,registration);
  }
}

Fixed version (ground truth):
/** 
 * Constructs a cache.
 * @param cacheName          the cache name
 * @param cacheManagerName   the cache manager name
 * @param classLoader        the class loader
 * @param configuration      the configuration
 */
RICache(String cacheName,String cacheManagerName,ClassLoader classLoader,Configuration<K,V> configuration){
  this.cacheName=cacheName;
  this.cacheManagerName=cacheManagerName;
  this.classLoader=classLoader;
  this.configuration=new RIConfiguration<K,V>(configuration);
  if (this.configuration.getCacheLoaderFactory() != null) {
    this.cacheLoader=(CacheLoader<K,V>)this.configuration.getCacheLoaderFactory().create();
  }
  if (this.configuration.getCacheWriterFactory() != null) {
    this.cacheWriter=(CacheWriter<K,V>)this.configuration.getCacheWriterFactory().create();
  }
  keyConverter=configuration.isStoreByValue() ? new RISerializingInternalConverter<K>(classLoader) : new RIReferenceInternalConverter<K>();
  valueConverter=configuration.isStoreByValue() ? new RISerializingInternalConverter<V>(classLoader) : new RIReferenceInternalConverter<V>();
  this.expiryPolicy=configuration.getExpiryPolicyFactory().create();
  status=Status.UNINITIALISED;
  entries=new RISimpleInternalMap<Object,RICachedValue>();
  cacheMXBean=new RICacheMXBean<K,V>(this);
  statistics=new RICacheStatisticsMXBean(this);
  if (configuration.isManagementEnabled()) {
    setManagementEnabled(true);
  }
  if (configuration.isStatisticsEnabled()) {
    setStatisticsEnabled(true);
  }
  for (  CacheEntryListenerRegistration<? super K,? super V> r : configuration.getCacheEntryListenerRegistrations()) {
    CacheEntryListener<? super K,? super V> listener=r.getCacheEntryListener();
    CacheEntryEventFilter<? super K,? super V> filter=r.getCacheEntryFilter();
    boolean oldValueRequired=r.isOldValueRequired();
    boolean synchronous=r.isSynchronous();
    RICacheEntryListenerRegistration<K,V> registration=new RICacheEntryListenerRegistration<K,V>(listener,filter,oldValueRequired,synchronous);
    cacheEntryListenerRegistrations.put(listener,registration);
  }
}