Program: 17250
Project: 17250
Buggy source:
/** 
 * Constructs a cache.
 * @param cacheManager  the CacheManager that's creating the RICache
 * @param cacheName     the name of the Cache
 * @param classLoader   the ClassLoader the RICache will use for loading classes
 * @param configuration the Configuration of the Cache
 */
RICache(RICacheManager cacheManager,String cacheName,ClassLoader classLoader,Configuration<K,V> configuration){
  this.cacheManager=cacheManager;
  this.cacheName=cacheName;
  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();
  entries=new RISimpleInternalMap<Object,RICachedValue>();
  cacheMXBean=new RICacheMXBean<K,V>(this);
  statistics=new RICacheStatisticsMXBean(this);
  isClosed=false;
  if (configuration.isManagementEnabled()) {
    setManagementEnabled(true);
  }
  if (configuration.isStatisticsEnabled()) {
    setStatisticsEnabled(true);
  }
  for (  CacheEntryListenerDefinition<K,V> definition : configuration.getCacheEntryListenerDefinitions()) {
    RICacheEntryListenerRegistration<K,V> registration=new RICacheEntryListenerRegistration<K,V>(definition);
    cacheEntryListenerRegistrations.put(registration.getCacheEntryListener(),registration);
  }
}

Fixed version (ground truth):
/** 
 * Constructs a cache.
 * @param cacheManager  the CacheManager that's creating the RICache
 * @param cacheName     the name of the Cache
 * @param classLoader   the ClassLoader the RICache will use for loading classes
 * @param configuration the Configuration of the Cache
 */
RICache(RICacheManager cacheManager,String cacheName,ClassLoader classLoader,Configuration<K,V> configuration){
  this.cacheManager=cacheManager;
  this.cacheName=cacheName;
  this.configuration=new MutableConfiguration<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();
  entries=new RISimpleInternalMap<Object,RICachedValue>();
  cacheMXBean=new RICacheMXBean<K,V>(this);
  statistics=new RICacheStatisticsMXBean(this);
  isClosed=false;
  if (configuration.isManagementEnabled()) {
    setManagementEnabled(true);
  }
  if (configuration.isStatisticsEnabled()) {
    setStatisticsEnabled(true);
  }
  for (  CacheEntryListenerDefinition<K,V> definition : configuration.getCacheEntryListenerDefinitions()) {
    RICacheEntryListenerRegistration<K,V> registration=new RICacheEntryListenerRegistration<K,V>(definition);
    cacheEntryListenerRegistrations.put(registration.getCacheEntryListener(),registration);
  }
}