Program: 82532
Project: 82532
Buggy source:
private void setupFlushCacheTimer(){
  _timerCacheFlush=new Timer("String_Node_Str",true);
  _timerCacheFlush.schedule(new TimerTask(){
    @Override public void run(){
      clearMapOfOldTables(_tableAnalyzers);
      clearMapOfOldTables(_tableDescriptors);
      clearMapOfOldTables(_layoutManagers);
      clearMapOfOldTables(_layoutCache);
      clearMapOfOldTables(_tableSimilarity);
      Map<String,Map<String,BlurIndex>> oldIndexesThatNeedToBeClosed=clearMapOfOldTables(_indexes);
      for (      String table : oldIndexesThatNeedToBeClosed.keySet()) {
        Map<String,BlurIndex> indexes=oldIndexesThatNeedToBeClosed.get(table);
        if (indexes == null) {
          continue;
        }
        for (        String shard : indexes.keySet()) {
          BlurIndex index=indexes.get(shard);
          if (index == null) {
            continue;
          }
          close(index,table,shard);
        }
      }
      for (      String table : _indexes.keySet()) {
        Map<String,BlurIndex> shardMap=_indexes.get(table);
        if (shardMap != null) {
          Set<String> shards=new HashSet<String>(shardMap.keySet());
          Set<String> shardsToServe=getShardsToServe(table);
          shards.removeAll(shardsToServe);
          if (!shards.isEmpty()) {
            LOG.info("String_Node_Str",table,shards);
          }
          for (          String shard : shards) {
            LOG.info("String_Node_Str",table,shard);
            BlurIndex index=shardMap.remove(shard);
            close(index,table,shard);
          }
        }
      }
    }
  }
,_delay,_delay);
}

Fixed version (ground truth):
private void setupFlushCacheTimer(){
  _timerCacheFlush=new Timer("String_Node_Str",true);
  _timerCacheFlush.schedule(new TimerTask(){
    @Override public void run(){
      try {
        cleanup();
      }
 catch (      Throwable e) {
        LOG.error("String_Node_Str",e);
      }
    }
    private void cleanup(){
      clearMapOfOldTables(_tableAnalyzers);
      clearMapOfOldTables(_tableDescriptors);
      clearMapOfOldTables(_layoutManagers);
      clearMapOfOldTables(_layoutCache);
      clearMapOfOldTables(_tableSimilarity);
      Map<String,Map<String,BlurIndex>> oldIndexesThatNeedToBeClosed=clearMapOfOldTables(_indexes);
      for (      String table : oldIndexesThatNeedToBeClosed.keySet()) {
        Map<String,BlurIndex> indexes=oldIndexesThatNeedToBeClosed.get(table);
        if (indexes == null) {
          continue;
        }
        for (        String shard : indexes.keySet()) {
          BlurIndex index=indexes.get(shard);
          if (index == null) {
            continue;
          }
          close(index,table,shard);
        }
      }
      for (      String table : _indexes.keySet()) {
        Map<String,BlurIndex> shardMap=_indexes.get(table);
        if (shardMap != null) {
          Set<String> shards=new HashSet<String>(shardMap.keySet());
          Set<String> shardsToServe=getShardsToServe(table);
          shards.removeAll(shardsToServe);
          if (!shards.isEmpty()) {
            LOG.info("String_Node_Str",table,shards);
          }
          for (          String shard : shards) {
            LOG.info("String_Node_Str",table,shard);
            BlurIndex index=shardMap.remove(shard);
            close(index,table,shard);
          }
        }
      }
    }
  }
,_delay,_delay);
}