Program: 54642
Project: 54642
Buggy source:
/** 
 * Precompiles the given module.
 * @param logger a logger to use
 * @param jjsOptions a set of compiler options
 * @param module the module to compile
 * @param genDir optional directory to dump generated source, may be<code>null</code>
 * @param generatorResourcesDir required directory to dump generator resources
 * @return the precompilation
 */
public static Precompilation precompile(TreeLogger logger,JJSOptions jjsOptions,ModuleDef module,File genDir,File generatorResourcesDir){
  try {
    CompilationState compilationState=module.getCompilationState(logger);
    String[] declEntryPts=module.getEntryPointTypeNames();
    if (declEntryPts.length == 0) {
      logger.log(TreeLogger.ERROR,"String_Node_Str",null);
      throw new UnableToCompleteException();
    }
    ArtifactSet generatedArtifacts=new ArtifactSet();
    DistillerRebindPermutationOracle rpo=new DistillerRebindPermutationOracle(module,compilationState,generatedArtifacts,new PropertyPermutations(module.getProperties()),genDir,generatorResourcesDir);
    WebModeCompilerFrontEnd frontEnd=new WebModeCompilerFrontEnd(compilationState,rpo);
    PerfLogger.start("String_Node_Str");
    UnifiedAst unifiedAst=JavaToJavaScriptCompiler.precompile(logger,frontEnd,declEntryPts,jjsOptions,rpo.getPermuationCount() == 1);
    PerfLogger.end();
    Permutation[] permutations=rpo.getPermutations();
    SortedMap<String,Permutation> merged=new TreeMap<String,Permutation>();
    for (    Permutation permutation : permutations) {
      permutation.reduceRebindAnswers(unifiedAst.getRebindRequests());
      String rebindResultsString=permutation.getRebindAnswers().toString();
      if (merged.containsKey(rebindResultsString)) {
        Permutation existing=merged.get(rebindResultsString);
        existing.mergeFrom(permutation);
      }
 else {
        merged.put(rebindResultsString,permutation);
      }
    }
    return new Precompilation(unifiedAst,merged.values(),generatedArtifacts);
  }
 catch (  UnableToCompleteException e) {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Precompiles the given module.
 * @param logger a logger to use
 * @param jjsOptions a set of compiler options
 * @param module the module to compile
 * @param genDir optional directory to dump generated source, may be<code>null</code>
 * @param generatorResourcesDir required directory to dump generator resources
 * @return the precompilation
 */
public static Precompilation precompile(TreeLogger logger,JJSOptions jjsOptions,ModuleDef module,File genDir,File generatorResourcesDir){
  try {
    CompilationState compilationState=module.getCompilationState(logger);
    String[] declEntryPts=module.getEntryPointTypeNames();
    if (declEntryPts.length == 0) {
      logger.log(TreeLogger.ERROR,"String_Node_Str",null);
      throw new UnableToCompleteException();
    }
    ArtifactSet generatedArtifacts=new ArtifactSet();
    DistillerRebindPermutationOracle rpo=new DistillerRebindPermutationOracle(module,compilationState,generatedArtifacts,new PropertyPermutations(module.getProperties()),genDir,generatorResourcesDir);
    WebModeCompilerFrontEnd frontEnd=new WebModeCompilerFrontEnd(compilationState,rpo);
    PerfLogger.start("String_Node_Str");
    UnifiedAst unifiedAst=JavaToJavaScriptCompiler.precompile(logger,frontEnd,declEntryPts,null,jjsOptions,rpo.getPermuationCount() == 1);
    PerfLogger.end();
    Permutation[] permutations=rpo.getPermutations();
    SortedMap<String,Permutation> merged=new TreeMap<String,Permutation>();
    for (    Permutation permutation : permutations) {
      permutation.reduceRebindAnswers(unifiedAst.getRebindRequests());
      String rebindResultsString=permutation.getRebindAnswers().toString();
      if (merged.containsKey(rebindResultsString)) {
        Permutation existing=merged.get(rebindResultsString);
        existing.mergeFrom(permutation);
      }
 else {
        merged.put(rebindResultsString,permutation);
      }
    }
    return new Precompilation(unifiedAst,merged.values(),generatedArtifacts);
  }
 catch (  UnableToCompleteException e) {
    return null;
  }
}