Program: 29390
Project: 29390
Buggy source:
/** 
 * Generates JS source code given a Soy parse tree, an options object, and an optional bundle of translated messages.
 * @param soyTree The Soy parse tree to generate JS source code for.
 * @param templateRegistry The template registry that contains all the template information.
 * @param jsSrcOptions The compilation options relevant to this backend.
 * @param msgBundle The bundle of translated messages, or null to use the messages from the Soysource.
 * @param errorReporter The Soy error reporter that collects errors during code generation.
 * @return A list of strings where each string represents the JS source code that belongs in oneJS file. The generated JS files correspond one-to-one to the original Soy source files.
 */
public List<String> genJsSrc(SoyFileSetNode soyTree,TemplateRegistry templateRegistry,SoyJsSrcOptions jsSrcOptions,@Nullable SoyMsgBundle msgBundle,ErrorReporter errorReporter){
  Preconditions.checkState(!jsSrcOptions.getUseGoogIsRtlForBidiGlobalDir() || jsSrcOptions.shouldProvideRequireSoyNamespaces() || jsSrcOptions.shouldProvideRequireJsFunctions(),"String_Node_Str" + "String_Node_Str");
  try (GuiceSimpleScope.InScope inScope=apiCallScope.enter()){
    inScope.seed(SoyJsSrcOptions.class,jsSrcOptions);
    BidiGlobalDir bidiGlobalDir=SoyBidiUtils.decodeBidiGlobalDirFromJsOptions(jsSrcOptions.getBidiGlobalDir(),jsSrcOptions.getUseGoogIsRtlForBidiGlobalDir());
    ApiCallScopeUtils.seedSharedParams(inScope,msgBundle,bidiGlobalDir);
    if (jsSrcOptions.shouldGenerateGoogMsgDefs()) {
      new ExtractMsgVariablesVisitor().exec(soyTree);
      Preconditions.checkState(bidiGlobalDir != null,"String_Node_Str");
    }
 else {
      Preconditions.checkState(bidiGlobalDir == null || bidiGlobalDir.isStaticValue(),"String_Node_Str");
      new InsertMsgsVisitor(msgBundle,errorReporter).exec(soyTree);
      new CombineConsecutiveRawTextNodesVisitor().exec(soyTree);
    }
    optimizeBidiCodeGenVisitorProvider.get().exec(soyTree);
    return genJsCodeVisitorProvider.get().gen(soyTree,templateRegistry,errorReporter);
  }
 }

Fixed version (ground truth):
/** 
 * Generates JS source code given a Soy parse tree, an options object, and an optional bundle of translated messages.
 * @param soyTree The Soy parse tree to generate JS source code for.
 * @param templateRegistry The template registry that contains all the template information.
 * @param jsSrcOptions The compilation options relevant to this backend.
 * @param msgBundle The bundle of translated messages, or null to use the messages from the Soysource.
 * @param errorReporter The Soy error reporter that collects errors during code generation.
 * @return A list of strings where each string represents the JS source code that belongs in oneJS file. The generated JS files correspond one-to-one to the original Soy source files.
 */
public List<String> genJsSrc(SoyFileSetNode soyTree,TemplateRegistry templateRegistry,SoyJsSrcOptions jsSrcOptions,@Nullable SoyMsgBundle msgBundle,ErrorReporter errorReporter){
  Preconditions.checkState(!jsSrcOptions.getUseGoogIsRtlForBidiGlobalDir() || jsSrcOptions.shouldProvideRequireSoyNamespaces() || jsSrcOptions.shouldProvideRequireJsFunctions(),"String_Node_Str" + "String_Node_Str");
  try (GuiceSimpleScope.InScope inScope=apiCallScope.enter()){
    inScope.seed(SoyJsSrcOptions.class,jsSrcOptions);
    BidiGlobalDir bidiGlobalDir=SoyBidiUtils.decodeBidiGlobalDirFromJsOptions(jsSrcOptions.getBidiGlobalDir(),jsSrcOptions.getUseGoogIsRtlForBidiGlobalDir());
    ApiCallScopeUtils.seedSharedParams(inScope,msgBundle,bidiGlobalDir);
    if (jsSrcOptions.shouldGenerateGoogMsgDefs()) {
      new ExtractMsgVariablesVisitor().exec(soyTree);
      Preconditions.checkState(bidiGlobalDir != null,"String_Node_Str");
    }
 else {
      Preconditions.checkState(bidiGlobalDir == null || bidiGlobalDir.isStaticValue(),"String_Node_Str");
      new InsertMsgsVisitor(msgBundle,errorReporter).exec(soyTree);
      new CombineConsecutiveRawTextNodesPass().run(soyTree);
    }
    optimizeBidiCodeGenVisitorProvider.get().exec(soyTree);
    return genJsCodeVisitorProvider.get().gen(soyTree,templateRegistry,errorReporter);
  }
 }