Program: 49688
Project: 49688
Buggy source:
CMap(ConcurrentMapManager concurrentMapManager,String name){
  this.concurrentMapManager=concurrentMapManager;
  this.logger=concurrentMapManager.node.getLogger(CMap.class.getName());
  this.PARTITION_COUNT=concurrentMapManager.PARTITION_COUNT;
  this.node=concurrentMapManager.node;
  this.thisAddress=concurrentMapManager.thisAddress;
  this.name=name;
  mapForQueue=name.startsWith(MAP_FOR_QUEUE);
  instanceType=ConcurrentMapManager.getInstanceType(name);
  String mapConfigName=name.substring(2);
  if (isMultiMap() || mapConfigName.startsWith(HAZELCAST) || mapConfigName.startsWith(AS_LIST)|| mapConfigName.startsWith(AS_SET)) {
    mapConfig=new MapConfig();
  }
 else   if (mapForQueue) {
    String queueShortName=name.substring(4);
    QueueConfig qConfig=node.getConfig().findMatchingQueueConfig(queueShortName);
    mapConfig=node.getConfig().findMatchingMapConfig(qConfig.getBackingMapRef());
  }
 else {
    mapConfig=node.getConfig().findMatchingMapConfig(mapConfigName);
  }
  this.mapIndexService=new MapIndexService(mapConfig.isValueIndexed());
  setRuntimeConfig(mapConfig);
  if (mapForQueue || node.groupProperties.ELASTIC_MEMORY_ENABLED.getBoolean()) {
    cacheValue=false;
  }
  MapStoreConfig mapStoreConfig=mapConfig.getMapStoreConfig();
  int writeDelaySeconds=-1;
  if (!node.isLiteMember() && mapStoreConfig != null) {
    try {
      MapStoreFactory factory=(MapStoreFactory)mapStoreConfig.getFactoryImplementation();
      if (factory == null) {
        String factoryClassName=mapStoreConfig.getFactoryClassName();
        if (factoryClassName != null && !"String_Node_Str".equals(factoryClassName)) {
          factory=(MapStoreFactory)Serializer.loadClass(node.getConfig().getClassLoader(),factoryClassName).newInstance();
        }
      }
      Object storeInstance=factory == null ? mapStoreConfig.getImplementation() : factory.newMapStore(name,mapStoreConfig.getProperties());
      if (storeInstance == null) {
        String mapStoreClassName=mapStoreConfig.getClassName();
        storeInstance=Serializer.loadClass(node.getConfig().getClassLoader(),mapStoreClassName).newInstance();
      }
      mapStoreWrapper=new MapStoreWrapper(storeInstance,node.factory.getHazelcastInstanceProxy(),mapStoreConfig.getProperties(),mapConfigName,mapStoreConfig.isEnabled());
      if (!mapStoreWrapper.isMapLoader() && !mapStoreWrapper.isMapStore()) {
        throw new Exception("String_Node_Str" + storeInstance.getClass().getName() + "String_Node_Str");
      }
    }
 catch (    Exception e) {
      logger.log(Level.SEVERE,e.getMessage(),e);
    }
    writeDelaySeconds=mapStoreConfig.getWriteDelaySeconds();
  }
  writeDelayMillis=(writeDelaySeconds == -1) ? -1L : writeDelaySeconds * 1000L;
  if (writeDelaySeconds > 0) {
    removeDelayMillis=concurrentMapManager.GLOBAL_REMOVE_DELAY_MILLIS + writeDelayMillis;
  }
 else {
    removeDelayMillis=concurrentMapManager.GLOBAL_REMOVE_DELAY_MILLIS;
  }
  loader=(mapStoreWrapper == null || !mapStoreWrapper.isMapLoader()) ? null : mapStoreWrapper;
  store=(mapStoreWrapper == null || !mapStoreWrapper.isMapStore()) ? null : mapStoreWrapper;
  NearCacheConfig nearCacheConfig=mapConfig.getNearCacheConfig();
  if (nearCacheConfig == null) {
    nearCache=null;
  }
 else {
    NearCache nearCache=new NearCache(this,SortedHashMap.getOrderingTypeByName(nearCacheConfig.getEvictionPolicy()),nearCacheConfig.getMaxSize(),nearCacheConfig.getTimeToLiveSeconds() * 1000L,nearCacheConfig.getMaxIdleSeconds() * 1000L,nearCacheConfig.isInvalidateOnChange());
    final NearCache anotherNearCache=concurrentMapManager.mapCaches.putIfAbsent(name,nearCache);
    if (anotherNearCache != null) {
      nearCache=anotherNearCache;
    }
    this.nearCache=nearCache;
  }
  this.mergePolicy=getMergePolicy(mapConfig.getMergePolicy());
  this.creationTime=System.currentTimeMillis();
  WanReplicationRef wanReplicationRef=mapConfig.getWanReplicationRef();
  if (wanReplicationRef != null) {
    this.localUpdateListener=node.wanReplicationService.getWanReplication(wanReplicationRef.getName());
    this.wanMergePolicy=getMergePolicy(wanReplicationRef.getMergePolicy());
  }
 else {
    this.localUpdateListener=null;
    this.wanMergePolicy=null;
  }
  if (instanceType.isMultiMap()) {
    String shortMultiMapName=name.substring(4);
    multiMapConfig=node.getConfig().getMultiMapConfig(shortMultiMapName);
    if (multiMapConfig.getValueCollectionType() == MultiMapConfig.ValueCollectionType.SET) {
      multiMapSet=true;
    }
 else {
      multiMapSet=false;
    }
  }
 else {
    multiMapConfig=null;
    multiMapSet=false;
  }
  if (!mapForQueue) {
    initializeIndexes();
    initializeListeners();
  }
}

Fixed version (ground truth):
CMap(ConcurrentMapManager concurrentMapManager,String name){
  this.concurrentMapManager=concurrentMapManager;
  this.logger=concurrentMapManager.node.getLogger(CMap.class.getName());
  this.PARTITION_COUNT=concurrentMapManager.PARTITION_COUNT;
  this.node=concurrentMapManager.node;
  this.thisAddress=concurrentMapManager.thisAddress;
  this.name=name;
  mapForQueue=name.startsWith(MAP_FOR_QUEUE);
  instanceType=ConcurrentMapManager.getInstanceType(name);
  String mapConfigName=name.substring(2);
  if (isMultiMap() || mapConfigName.startsWith(HAZELCAST) || mapConfigName.startsWith(AS_LIST)|| mapConfigName.startsWith(AS_SET)) {
    mapConfig=new MapConfig();
  }
 else   if (mapForQueue) {
    String queueShortName=name.substring(4);
    QueueConfig qConfig=node.getConfig().findMatchingQueueConfig(queueShortName);
    mapConfig=node.getConfig().findMatchingMapConfig(qConfig.getBackingMapRef());
  }
 else {
    mapConfig=node.getConfig().findMatchingMapConfig(mapConfigName);
  }
  this.mapIndexService=new MapIndexService(mapConfig.isValueIndexed());
  setRuntimeConfig(mapConfig);
  if (mapForQueue || node.groupProperties.ELASTIC_MEMORY_ENABLED.getBoolean()) {
    cacheValue=false;
  }
  MapStoreConfig mapStoreConfig=mapConfig.getMapStoreConfig();
  int writeDelaySeconds=-1;
  if (!node.isLiteMember() && mapStoreConfig != null) {
    try {
      MapStoreFactory factory=(MapStoreFactory)mapStoreConfig.getFactoryImplementation();
      if (factory == null) {
        String factoryClassName=mapStoreConfig.getFactoryClassName();
        if (factoryClassName != null && !"String_Node_Str".equals(factoryClassName)) {
          factory=(MapStoreFactory)Serializer.loadClass(node.getConfig().getClassLoader(),factoryClassName).newInstance();
        }
      }
      Object storeInstance=factory == null ? mapStoreConfig.getImplementation() : factory.newMapStore(name,mapStoreConfig.getProperties());
      if (storeInstance == null) {
        String mapStoreClassName=mapStoreConfig.getClassName();
        storeInstance=Serializer.loadClass(node.getConfig().getClassLoader(),mapStoreClassName).newInstance();
      }
      mapStoreWrapper=new MapStoreWrapper(storeInstance,node.factory.getHazelcastInstanceProxy(),mapStoreConfig.getProperties(),mapConfigName,mapStoreConfig.isEnabled());
      if (!mapStoreWrapper.isMapLoader() && !mapStoreWrapper.isMapStore()) {
        throw new Exception("String_Node_Str" + storeInstance.getClass().getName() + "String_Node_Str");
      }
    }
 catch (    Exception e) {
      logger.log(Level.SEVERE,e.getMessage(),e);
    }
    writeDelaySeconds=mapStoreConfig.getWriteDelaySeconds();
  }
  writeDelayMillis=(writeDelaySeconds == -1) ? -1L : writeDelaySeconds * 1000L;
  if (writeDelaySeconds > 0) {
    removeDelayMillis=concurrentMapManager.GLOBAL_REMOVE_DELAY_MILLIS + writeDelayMillis;
  }
 else {
    removeDelayMillis=concurrentMapManager.GLOBAL_REMOVE_DELAY_MILLIS;
  }
  loader=(mapStoreWrapper == null || !mapStoreWrapper.isMapLoader()) ? null : mapStoreWrapper;
  store=(mapStoreWrapper == null || !mapStoreWrapper.isMapStore()) ? null : mapStoreWrapper;
  NearCacheConfig nearCacheConfig=mapConfig.getNearCacheConfig();
  if (nearCacheConfig == null) {
    nearCache=null;
  }
 else {
    NearCache nearCache=new NearCache(this,SortedHashMap.getOrderingTypeByName(nearCacheConfig.getEvictionPolicy()),nearCacheConfig.getMaxSize(),nearCacheConfig.getTimeToLiveSeconds() * 1000L,nearCacheConfig.getMaxIdleSeconds() * 1000L,nearCacheConfig.isInvalidateOnChange());
    final NearCache anotherNearCache=concurrentMapManager.mapCaches.putIfAbsent(name,nearCache);
    if (anotherNearCache != null) {
      nearCache=anotherNearCache;
    }
    this.nearCache=nearCache;
  }
  int CLEANUP_DELAY_SECONDS=node.groupProperties.CLEANUP_DELAY_SECONDS.getInteger();
  if (CLEANUP_DELAY_SECONDS <= 0) {
    logger.log(Level.WARNING,GroupProperties.PROP_CLEANUP_DELAY_SECONDS + "String_Node_Str");
    CLEANUP_DELAY_SECONDS=1;
  }
  cleanupDelayMillis=CLEANUP_DELAY_SECONDS * 1000;
  this.mergePolicy=getMergePolicy(mapConfig.getMergePolicy());
  this.creationTime=System.currentTimeMillis();
  WanReplicationRef wanReplicationRef=mapConfig.getWanReplicationRef();
  if (wanReplicationRef != null) {
    this.localUpdateListener=node.wanReplicationService.getWanReplication(wanReplicationRef.getName());
    this.wanMergePolicy=getMergePolicy(wanReplicationRef.getMergePolicy());
  }
 else {
    this.localUpdateListener=null;
    this.wanMergePolicy=null;
  }
  if (instanceType.isMultiMap()) {
    String shortMultiMapName=name.substring(4);
    multiMapConfig=node.getConfig().getMultiMapConfig(shortMultiMapName);
    if (multiMapConfig.getValueCollectionType() == MultiMapConfig.ValueCollectionType.SET) {
      multiMapSet=true;
    }
 else {
      multiMapSet=false;
    }
  }
 else {
    multiMapConfig=null;
    multiMapSet=false;
  }
  if (!mapForQueue) {
    initializeIndexes();
    initializeListeners();
  }
}