Program: 54478
Project: 54478
Buggy source:
/** 
 * Compiles a particular permutation, based on a precompiled unified AST.
 * @param logger the logger to use
 * @param unifiedAst the result of a{@link #precompile(TreeLogger,WebModeCompilerFrontEnd,String[],JJSOptions,boolean)}
 * @param rebindAnswers the set of rebind answers to resolve all outstandingrebind decisions
 * @param propertyOracles All property oracles corresponding to thispermutation.
 * @return the output JavaScript
 * @throws UnableToCompleteException if an error other than{@link OutOfMemoryError} occurs
 */
public static PermutationResult compilePermutation(TreeLogger logger,UnifiedAst unifiedAst,Map<String,String> rebindAnswers,PropertyOracle[] propertyOracles,int permutationId) throws UnableToCompleteException {
  long permStart=System.currentTimeMillis();
  try {
    if (JProgram.isTracingEnabled()) {
      System.out.println("String_Node_Str");
      System.out.println("String_Node_Str");
      System.out.println("String_Node_Str");
    }
    AST ast=unifiedAst.getFreshAst();
    JProgram jprogram=ast.getJProgram();
    JsProgram jsProgram=ast.getJsProgram();
    JJSOptions options=unifiedAst.getOptions();
    Map<StandardSymbolData,JsName> symbolTable=new TreeMap<StandardSymbolData,JsName>(new SymbolData.ClassIdentComparator());
    ResolveRebinds.exec(jprogram,rebindAnswers);
    if (options.isDraftCompile()) {
      draftOptimize(jprogram);
    }
 else {
      optimize(options,jprogram);
    }
    LongCastNormalizer.exec(jprogram);
    JsoDevirtualizer.exec(jprogram);
    CatchBlockNormalizer.exec(jprogram);
    PostOptimizationCompoundAssignmentNormalizer.exec(jprogram);
    LongEmulationNormalizer.exec(jprogram);
    CastNormalizer.exec(jprogram,options.isCastCheckingDisabled());
    ArrayNormalizer.exec(jprogram);
    EqualityNormalizer.exec(jprogram);
    Pruner.exec(jprogram,false);
    jprogram.typeOracle.recomputeAfterOptimizations();
    JavaToJavaScriptMap map=GenerateJavaScriptAST.exec(jprogram,jsProgram,options.getOutput(),symbolTable);
    JsNormalizer.exec(jsProgram);
    JsSymbolResolver.exec(jsProgram);
    EvalFunctionsAtTopScope.exec(jsProgram);
    if (options.isAggressivelyOptimize()) {
      boolean didChange;
      do {
        if (Thread.interrupted()) {
          throw new InterruptedException();
        }
        didChange=false;
        didChange=JsStaticEval.exec(jsProgram) || didChange;
        didChange=JsInliner.exec(jsProgram) || didChange;
        didChange=JsUnusedFunctionRemover.exec(jsProgram) || didChange;
      }
 while (didChange);
    }
    if (jprogram.getDeclaredTypes().contains(jprogram.getFromTypeMap("String_Node_Str"))) {
      JsStackEmulator.exec(jsProgram,propertyOracles);
    }
    SoycArtifact dependencies=null;
    if (options.isAggressivelyOptimize() && options.isRunAsyncEnabled()) {
      ByteArrayOutputStream baos=new ByteArrayOutputStream();
      CodeSplitter.exec(logger,jprogram,jsProgram,map,chooseDependencyRecorder(options.isSoycEnabled(),baos));
      if (baos.size() > 0) {
        dependencies=new SoycArtifact("String_Node_Str" + permutationId + "String_Node_Str",baos.toByteArray());
      }
    }
    Map<JsName,String> obfuscateMap=Maps.create();
switch (options.getOutput()) {
case OBFUSCATED:
      obfuscateMap=JsStringInterner.exec(jprogram,jsProgram);
    JsObfuscateNamer.exec(jsProgram);
  break;
case PRETTY:
JsPrettyNamer.exec(jsProgram);
break;
case DETAILED:
obfuscateMap=JsStringInterner.exec(jprogram,jsProgram);
JsVerboseNamer.exec(jsProgram);
break;
default :
throw new InternalCompilerException("String_Node_Str");
}
JsIEBlockSizeVisitor.exec(jsProgram);
JsBreakUpLargeVarStatements.exec(jsProgram,propertyOracles);
String[] js=new String[jsProgram.getFragmentCount()];
StatementRanges[] ranges=new StatementRanges[js.length];
SizeBreakdown[] sizeBreakdowns=options.isSoycEnabled() ? new SizeBreakdown[js.length] : null;
List<Map<Range,SourceInfo>> sourceInfoMaps=options.isSoycExtra() ? new ArrayList<Map<Range,SourceInfo>>() : null;
generateJavaScriptCode(options,jsProgram,map,js,ranges,sizeBreakdowns,sourceInfoMaps);
PermutationResult toReturn=new PermutationResultImpl(js,makeSymbolMap(symbolTable),ranges,permutationId);
toReturn.getArtifacts().add(makeSoycArtifact(logger,permutationId,jprogram,js,sizeBreakdowns,sourceInfoMaps,dependencies,map,obfuscateMap));
System.out.println("String_Node_Str" + (System.currentTimeMillis() - permStart) + "String_Node_Str");
return toReturn;
}
 catch (Throwable e) {
throw logAndTranslateException(logger,e);
}
}

Fixed version (ground truth):
/** 
 * Compiles a particular permutation, based on a precompiled unified AST.
 * @param logger the logger to use
 * @param unifiedAst the result of a{@link #precompile(TreeLogger,WebModeCompilerFrontEnd,String[],JJSOptions,boolean)}
 * @param rebindAnswers the set of rebind answers to resolve all outstandingrebind decisions
 * @param propertyOracles All property oracles corresponding to thispermutation.
 * @return the output JavaScript
 * @throws UnableToCompleteException if an error other than{@link OutOfMemoryError} occurs
 */
public static PermutationResult compilePermutation(TreeLogger logger,UnifiedAst unifiedAst,Map<String,String> rebindAnswers,PropertyOracle[] propertyOracles,int permutationId) throws UnableToCompleteException {
  long permStart=System.currentTimeMillis();
  try {
    if (JProgram.isTracingEnabled()) {
      System.out.println("String_Node_Str");
      System.out.println("String_Node_Str");
      System.out.println("String_Node_Str");
    }
    AST ast=unifiedAst.getFreshAst();
    JProgram jprogram=ast.getJProgram();
    JsProgram jsProgram=ast.getJsProgram();
    JJSOptions options=unifiedAst.getOptions();
    Map<StandardSymbolData,JsName> symbolTable=new TreeMap<StandardSymbolData,JsName>(new SymbolData.ClassIdentComparator());
    ResolveRebinds.exec(jprogram,rebindAnswers);
    if (options.isDraftCompile()) {
      draftOptimize(jprogram);
    }
 else {
      optimize(options,jprogram);
    }
    LongCastNormalizer.exec(jprogram);
    JsoDevirtualizer.exec(jprogram);
    CatchBlockNormalizer.exec(jprogram);
    PostOptimizationCompoundAssignmentNormalizer.exec(jprogram);
    LongEmulationNormalizer.exec(jprogram);
    CastNormalizer.exec(jprogram,options.isCastCheckingDisabled());
    ArrayNormalizer.exec(jprogram);
    EqualityNormalizer.exec(jprogram);
    Pruner.exec(jprogram,false);
    jprogram.typeOracle.recomputeAfterOptimizations();
    JavaToJavaScriptMap map=GenerateJavaScriptAST.exec(jprogram,jsProgram,options.getOutput(),symbolTable);
    JsNormalizer.exec(jsProgram);
    JsSymbolResolver.exec(jsProgram);
    EvalFunctionsAtTopScope.exec(jsProgram);
    if (options.isAggressivelyOptimize()) {
      boolean didChange;
      do {
        if (Thread.interrupted()) {
          throw new InterruptedException();
        }
        didChange=false;
        didChange=JsStaticEval.exec(jsProgram) || didChange;
        didChange=JsInliner.exec(jsProgram) || didChange;
        didChange=JsUnusedFunctionRemover.exec(jsProgram) || didChange;
      }
 while (didChange);
    }
    if (jprogram.getDeclaredTypes().contains(jprogram.getFromTypeMap("String_Node_Str"))) {
      JsStackEmulator.exec(jsProgram,propertyOracles);
    }
    SoycArtifact dependencies=null;
    if (options.isAggressivelyOptimize() && options.isRunAsyncEnabled()) {
      ByteArrayOutputStream baos=new ByteArrayOutputStream();
      CodeSplitter.exec(logger,jprogram,jsProgram,map,chooseDependencyRecorder(options.isSoycEnabled(),baos));
      if (baos.size() == 0 && options.isSoycEnabled()) {
        recordNonSplitDependencies(jprogram,baos);
      }
      if (baos.size() > 0) {
        dependencies=new SoycArtifact("String_Node_Str" + permutationId + "String_Node_Str",baos.toByteArray());
      }
    }
    Map<JsName,String> obfuscateMap=Maps.create();
switch (options.getOutput()) {
case OBFUSCATED:
      obfuscateMap=JsStringInterner.exec(jprogram,jsProgram);
    JsObfuscateNamer.exec(jsProgram);
  break;
case PRETTY:
JsPrettyNamer.exec(jsProgram);
break;
case DETAILED:
obfuscateMap=JsStringInterner.exec(jprogram,jsProgram);
JsVerboseNamer.exec(jsProgram);
break;
default :
throw new InternalCompilerException("String_Node_Str");
}
JsIEBlockSizeVisitor.exec(jsProgram);
JsBreakUpLargeVarStatements.exec(jsProgram,propertyOracles);
String[] js=new String[jsProgram.getFragmentCount()];
StatementRanges[] ranges=new StatementRanges[js.length];
SizeBreakdown[] sizeBreakdowns=options.isSoycEnabled() ? new SizeBreakdown[js.length] : null;
List<Map<Range,SourceInfo>> sourceInfoMaps=options.isSoycExtra() ? new ArrayList<Map<Range,SourceInfo>>() : null;
generateJavaScriptCode(options,jsProgram,map,js,ranges,sizeBreakdowns,sourceInfoMaps);
PermutationResult toReturn=new PermutationResultImpl(js,makeSymbolMap(symbolTable),ranges,permutationId);
toReturn.getArtifacts().add(makeSoycArtifact(logger,permutationId,jprogram,js,sizeBreakdowns,sourceInfoMaps,dependencies,map,obfuscateMap));
System.out.println("String_Node_Str" + (System.currentTimeMillis() - permStart) + "String_Node_Str");
return toReturn;
}
 catch (Throwable e) {
throw logAndTranslateException(logger,e);
}
}