Program: 49388
Project: 49388
Buggy source:
private void evictMap(MapContainer mapContainer){
  MapConfig mapConfig=mapContainer.getMapConfig();
  MapConfig.EvictionPolicy evictionPolicy=mapConfig.getEvictionPolicy();
  Comparator comparator=null;
  if (evictionPolicy == MapConfig.EvictionPolicy.LRU) {
    comparator=new Comparator<AbstractRecord>(){
      public int compare(      AbstractRecord o1,      AbstractRecord o2){
        return o1.getLastAccessTime().compareTo(o2.getLastAccessTime());
      }
    }
;
  }
 else   if (evictionPolicy == MapConfig.EvictionPolicy.LFU) {
    comparator=new Comparator<AbstractRecord>(){
      public int compare(      AbstractRecord o1,      AbstractRecord o2){
        return o1.getHits().compareTo(o2.getHits());
      }
    }
;
  }
  final int evictionPercentage=mapConfig.getEvictionPercentage();
  int memberCount=nodeEngine.getClusterService().getMembers().size();
  int targetSizePerPartition=-1;
  int maxPartitionSize=0;
  final MaxSizeConfig.MaxSizePolicy maxSizePolicy=mapConfig.getMaxSizeConfig().getMaxSizePolicy();
  if (maxSizePolicy == MaxSizeConfig.MaxSizePolicy.PER_NODE) {
    maxPartitionSize=mapConfig.getMaxSizeConfig().getSize() * memberCount / nodeEngine.getPartitionService().getPartitionCount();
    targetSizePerPartition=Double.valueOf(maxPartitionSize * ((100 - evictionPercentage) / 100.0)).intValue();
  }
 else   if (maxSizePolicy == MaxSizeConfig.MaxSizePolicy.PER_PARTITION) {
    maxPartitionSize=mapConfig.getMaxSizeConfig().getSize();
    targetSizePerPartition=Double.valueOf(maxPartitionSize * ((100 - evictionPercentage) / 100.0)).intValue();
  }
  for (int i=0; i < ExecutorConfig.DEFAULT_POOL_SIZE; i++) {
    nodeEngine.getExecutionService().execute("String_Node_Str",new EvictRunner(i,mapConfig,targetSizePerPartition,comparator));
  }
}

Fixed version (ground truth):
private void evictMap(MapContainer mapContainer){
  MapConfig mapConfig=mapContainer.getMapConfig();
  MapConfig.EvictionPolicy evictionPolicy=mapConfig.getEvictionPolicy();
  Comparator comparator=null;
  if (evictionPolicy == MapConfig.EvictionPolicy.LRU) {
    comparator=new Comparator<AbstractRecord>(){
      public int compare(      AbstractRecord o1,      AbstractRecord o2){
        return o1.getLastAccessTime().compareTo(o2.getLastAccessTime());
      }
      public boolean equals(      Object obj){
        return this.equals(obj);
      }
    }
;
  }
 else   if (evictionPolicy == MapConfig.EvictionPolicy.LFU) {
    comparator=new Comparator<AbstractRecord>(){
      public int compare(      AbstractRecord o1,      AbstractRecord o2){
        return o1.getHits().compareTo(o2.getHits());
      }
      public boolean equals(      Object obj){
        return this.equals(obj);
      }
    }
;
  }
  final int evictionPercentage=mapConfig.getEvictionPercentage();
  int memberCount=nodeEngine.getClusterService().getMembers().size();
  int targetSizePerPartition=-1;
  int maxPartitionSize=0;
  final MaxSizeConfig.MaxSizePolicy maxSizePolicy=mapConfig.getMaxSizeConfig().getMaxSizePolicy();
  if (maxSizePolicy == MaxSizeConfig.MaxSizePolicy.PER_NODE) {
    maxPartitionSize=(mapConfig.getMaxSizeConfig().getSize() * memberCount / nodeEngine.getPartitionService().getPartitionCount());
    targetSizePerPartition=Double.valueOf(maxPartitionSize * ((100 - evictionPercentage) / 100.0)).intValue();
  }
 else   if (maxSizePolicy == MaxSizeConfig.MaxSizePolicy.PER_PARTITION) {
    maxPartitionSize=mapConfig.getMaxSizeConfig().getSize();
    targetSizePerPartition=Double.valueOf(maxPartitionSize * ((100 - evictionPercentage) / 100.0)).intValue();
  }
  for (int i=0; i < ExecutorConfig.DEFAULT_POOL_SIZE; i++) {
    nodeEngine.getExecutionService().execute("String_Node_Str",new EvictRunner(i,mapConfig,targetSizePerPartition,comparator,evictionPercentage));
  }
}