Program: 54644
Project: 54644
Buggy source:
/** 
 * Performs a precompilation, returning a unified AST.
 * @param logger the logger to use
 * @param compilerFrontEnd the compiler front ent
 * @param declEntryPts the set of entry classes
 * @param options the compiler options
 * @param singlePermutation if true, do not pre-optimize the resulting AST orallow serialization of the result
 * @return the unified AST used to drive permutation compiles
 * @throws UnableToCompleteException if an error other than{@link OutOfMemoryError} occurs
 */
public static UnifiedAst precompile(TreeLogger logger,WebModeCompilerFrontEnd compilerFrontEnd,String[] declEntryPts,JJSOptions options,boolean singlePermutation) throws UnableToCompleteException {
  if (declEntryPts.length == 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  RebindPermutationOracle rpo=compilerFrontEnd.getRebindPermutationOracle();
  Set<String> allEntryPoints=new TreeSet<String>();
  for (  String element : declEntryPts) {
    String[] all=rpo.getAllPossibleRebindAnswers(logger,element);
    Util.addAll(allEntryPoints,all);
  }
  allEntryPoints.addAll(JProgram.CODEGEN_TYPES_SET);
  allEntryPoints.addAll(JProgram.INDEX_TYPES_SET);
  CompilationUnitDeclaration[] goldenCuds=compilerFrontEnd.getCompilationUnitDeclarations(logger,allEntryPoints.toArray(new String[0]));
  checkForErrors(logger,goldenCuds,false);
  PerfLogger.start("String_Node_Str");
  JProgram jprogram=new JProgram();
  JsProgram jsProgram=new JsProgram();
  try {
    TypeMap typeMap=new TypeMap(jprogram);
    TypeDeclaration[] allTypeDeclarations=BuildTypeMap.exec(typeMap,goldenCuds,jsProgram);
    checkForErrors(logger,goldenCuds,true);
    jprogram.typeOracle.computeBeforeAST();
    GenerateJavaAST.exec(allTypeDeclarations,typeMap,jprogram,jsProgram,options.isEnableAssertions());
    checkForErrors(logger,goldenCuds,true);
    goldenCuds=null;
    typeMap=null;
    allTypeDeclarations=null;
    FixAssignmentToUnbox.exec(jprogram);
    if (options.isEnableAssertions()) {
      AssertionNormalizer.exec(jprogram);
    }
 else {
      AssertionRemover.exec(jprogram);
    }
    ReplaceRebinds.exec(logger,jprogram,rpo);
    findEntryPoints(logger,rpo,declEntryPts,jprogram);
    JavaScriptObjectNormalizer.exec(jprogram);
    if (!singlePermutation) {
      optimize(options,jprogram);
    }
    Set<String> rebindRequests=new HashSet<String>();
    RecordRebinds.exec(jprogram,rebindRequests);
    return new UnifiedAst(options,new AST(jprogram,jsProgram),singlePermutation,rebindRequests);
  }
 catch (  Throwable e) {
    throw logAndTranslateException(logger,e);
  }
 finally {
    PerfLogger.end();
  }
}

Fixed version (ground truth):
/** 
 * Performs a precompilation, returning a unified AST.
 * @param logger the logger to use
 * @param compilerFrontEnd the compiler front ent
 * @param declEntryPts the set of entry classes declared in a GWT module;these will be automatically rebound
 * @param additionalRootTypes additional classes that should serve as coderoots; will not be rebound; may be <code>null</code>
 * @param options the compiler options
 * @param singlePermutation if true, do not pre-optimize the resulting AST orallow serialization of the result
 * @return the unified AST used to drive permutation compiles
 * @throws UnableToCompleteException if an error other than{@link OutOfMemoryError} occurs
 */
public static UnifiedAst precompile(TreeLogger logger,WebModeCompilerFrontEnd compilerFrontEnd,String[] declEntryPts,String[] additionalRootTypes,JJSOptions options,boolean singlePermutation) throws UnableToCompleteException {
  if (additionalRootTypes == null) {
    additionalRootTypes=Empty.STRINGS;
  }
  if (declEntryPts.length + additionalRootTypes.length == 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  RebindPermutationOracle rpo=compilerFrontEnd.getRebindPermutationOracle();
  Set<String> allRootTypes=new TreeSet<String>();
  for (  String element : declEntryPts) {
    String[] all=rpo.getAllPossibleRebindAnswers(logger,element);
    Collections.addAll(allRootTypes,all);
  }
  Collections.addAll(allRootTypes,additionalRootTypes);
  allRootTypes.addAll(JProgram.CODEGEN_TYPES_SET);
  allRootTypes.addAll(JProgram.INDEX_TYPES_SET);
  CompilationUnitDeclaration[] goldenCuds=compilerFrontEnd.getCompilationUnitDeclarations(logger,allRootTypes.toArray(new String[0]));
  checkForErrors(logger,goldenCuds,false);
  PerfLogger.start("String_Node_Str");
  JProgram jprogram=new JProgram();
  JsProgram jsProgram=new JsProgram();
  try {
    TypeMap typeMap=new TypeMap(jprogram);
    TypeDeclaration[] allTypeDeclarations=BuildTypeMap.exec(typeMap,goldenCuds,jsProgram);
    checkForErrors(logger,goldenCuds,true);
    jprogram.typeOracle.computeBeforeAST();
    GenerateJavaAST.exec(allTypeDeclarations,typeMap,jprogram,jsProgram,options.isEnableAssertions());
    checkForErrors(logger,goldenCuds,true);
    goldenCuds=null;
    typeMap=null;
    allTypeDeclarations=null;
    FixAssignmentToUnbox.exec(jprogram);
    if (options.isEnableAssertions()) {
      AssertionNormalizer.exec(jprogram);
    }
 else {
      AssertionRemover.exec(jprogram);
    }
    ReplaceRebinds.exec(logger,jprogram,rpo);
    findEntryPoints(logger,rpo,declEntryPts,jprogram);
    JavaScriptObjectNormalizer.exec(jprogram);
    if (!singlePermutation) {
      optimize(options,jprogram);
    }
    Set<String> rebindRequests=new HashSet<String>();
    RecordRebinds.exec(jprogram,rebindRequests);
    return new UnifiedAst(options,new AST(jprogram,jsProgram),singlePermutation,rebindRequests);
  }
 catch (  Throwable e) {
    throw logAndTranslateException(logger,e);
  }
 finally {
    PerfLogger.end();
  }
}