Program: 34644
Project: 34644
Buggy source:
public static JspTranslationResult translateJsp(JspResources jspResources,JspTranslationContext context,JspConfiguration config,JspOptions options,TagLibraryCache tlc,boolean forceTagFileTranslation,List compilerOptions) throws JspCoreException {
  JspTranslationResult translationResult=new JspTranslationResult();
  Integer JspIdConsumerCounter=new Integer(-1);
  String JspIdConsumerPrefix=null;
  List tagFileDependencyIdList=new ArrayList();
  JspVisitorInputMap inputMap=new JspVisitorInputMap();
  inputMap.put("String_Node_Str",tagFileDependencyIdList);
  inputMap.put("String_Node_Str",tlc);
  inputMap.put("String_Node_Str",jspResources);
  inputMap.put("String_Node_Str",options);
  inputMap.put("String_Node_Str",jspResources.getInputSource().getRelativeURL());
  inputMap.put("String_Node_Str",JspIdConsumerCounter);
  inputMap.put("String_Node_Str",JspIdConsumerPrefix);
  String jspVisitorCollectionId=null;
  String tagFileVisitorCollectionId=null;
  if (!options.isUseInMemory()) {
    jspVisitorCollectionId=JSP_TRANSLATION_ID;
    tagFileVisitorCollectionId=TAGFILE_TRANSLATION_ID;
    if (options.isDebugEnabled()) {
      jspVisitorCollectionId=DEBUG_JSP_TRANSLATION_ID;
      tagFileVisitorCollectionId=DEBUG_TAGFILE_TRANSLATION_ID;
    }
  }
 else {
    jspVisitorCollectionId=IN_MEMORY_JSP_TRANSLATION_ID;
    tagFileVisitorCollectionId=IN_MEMORY_TAGFILE_TRANSLATION_ID;
    if (options.isDebugEnabled()) {
      jspVisitorCollectionId=IN_MEMORY_DEBUG_JSP_TRANSLATION_ID;
      tagFileVisitorCollectionId=IN_MEMORY_DEBUG_TAGFILE_TRANSLATION_ID;
    }
  }
  JspTranslator jspTranslator=JspTranslatorFactory.getFactory().createTranslator(jspVisitorCollectionId,jspResources.getInputSource(),context,config,options,tlc.getImplicitTagLibPrefixMap());
  HashMap resultMap=jspTranslator.processVisitors(inputMap);
  if (resultMap.containsKey("String_Node_Str")) {
    SmapVisitorResult smapResult=(SmapVisitorResult)resultMap.get("String_Node_Str");
    translationResult.addSmapGenerator(obtainAbsoluteRelativeURL(context,jspResources.getInputSource()),smapResult.getSmapGenerator());
  }
  translationResult.addJspLineIds(jspResources,jspTranslator.getDocument());
  if (tagFileDependencyIdList.size() > 0) {
    Object lock=tlc.getTagFileLock(tagFileDependencyIdList);
    try {
synchronized (lock) {
        List tagFilesToCompile=new ArrayList();
        List tagFilesNotToCompile=new ArrayList();
        Collection tagFileIds=new ArrayList();
        for (Iterator itr=tagFileDependencyIdList.iterator(); itr.hasNext(); ) {
          TagFileId tagFileId=(TagFileId)itr.next();
          TagLibraryInfoImpl tli=tlc.getTagLibraryInfo(tagFileId.getUri(),tagFileId.getPrefix(),jspResources.getInputSource().getRelativeURL());
          TagFileInfo tfi=tli.getTagFile(tagFileId.getTagName());
          JspInputSource tagFileInputSource=context.getJspInputSourceFactory().copyJspInputSource(tli.getInputSource(),tfi.getPath());
          TagFileResources tagFileResources=context.getJspResourcesFactory().createTagFileResources(tagFileInputSource,tfi);
          tagFileResources=tlc.getTagFileResources(tagFileResources);
          translationResult.getTagFileDependencyList().add(tagFileResources);
          if (forceTagFileTranslation && tagFileResources.getGeneratedSourceFile().getParentFile().exists() == false) {
            tagFileResources.getGeneratedSourceFile().getParentFile().mkdirs();
          }
          if (forceTagFileTranslation || tagFileResources.isOutdated()) {
            JspConfiguration tagConfiguration=config.createEmptyJspConfiguration();
            if (tli != null) {
              if (tli.getRequiredVersion() != null) {
                tagConfiguration.setJspVersion(tli.getRequiredVersion());
              }
            }
            tagConfiguration.setElIgnored(config.elIgnored());
            JspTranslator tagFileTranslator=JspTranslatorFactory.getFactory().createTranslator(tagFileVisitorCollectionId,tagFileInputSource,context,tagConfiguration,options,tlc.getImplicitTagLibPrefixMap());
            JspVisitorInputMap tagFileInputMap=new JspVisitorInputMap();
            tagFileInputMap.put("String_Node_Str",options);
            tagFileInputMap.put("String_Node_Str",tlc);
            tagFileInputMap.put("String_Node_Str",tagFileResources);
            tagFileInputMap.put("String_Node_Str",tfi);
            tagFileInputMap.put("String_Node_Str",new Boolean(true));
            tagFileInputMap.put("String_Node_Str",jspResources.getInputSource().getRelativeURL());
            HashMap results=tagFileTranslator.processVisitors(tagFileInputMap);
            if (results.containsKey("String_Node_Str")) {
              SmapVisitorResult smapResult=(SmapVisitorResult)results.get("String_Node_Str");
              translationResult.addSmapGenerator(obtainAbsoluteRelativeURL(context,tagFileResources.getInputSource()),smapResult.getSmapGenerator());
            }
            JspTranslationResult.loadJspIdList(tagFileResources,tagFileTranslator.getDocument().getDocumentElement(),tagFileIds);
            tagFileResources.syncGeneratedSource();
            tagFilesToCompile.add(tagFileResources);
          }
 else {
            tagFilesNotToCompile.add(tagFileResources);
          }
        }
        if (tagFilesToCompile.size() > 0) {
          JspResources[] resourcesToCompile=new JspResources[tagFilesToCompile.size()];
          resourcesToCompile=(JspResources[])tagFilesToCompile.toArray(resourcesToCompile);
          JspCompiler compiler=context.getJspCompilerFactory().createJspCompiler();
          JspResources[] dependencies=null;
          if (tagFilesNotToCompile.size() > 0) {
            dependencies=new JspResources[tagFilesNotToCompile.size()];
            dependencies=(JspResources[])tagFilesNotToCompile.toArray(dependencies);
          }
          JspCompilerResult compileResult=compiler.compile(resourcesToCompile,dependencies,tagFileIds,compilerOptions);
          translationResult.setTagFileCompileResult(compileResult);
          syncTagFileFiles(options,tagFilesToCompile,translationResult,context);
        }
      }
    }
  finally {
      tlc.releaseTagFileLock(tagFileDependencyIdList);
    }
  }
  return translationResult;
}

Fixed version (ground truth):
public static JspTranslationResult translateJsp(JspResources jspResources,JspTranslationContext context,JspConfiguration config,JspOptions options,TagLibraryCache tlc,boolean forceTagFileTranslation,List compilerOptions) throws JspCoreException {
  JspTranslationResult translationResult=new JspTranslationResult();
  Integer JspIdConsumerCounter=new Integer(-1);
  String JspIdConsumerPrefix=null;
  List tagFileDependencyIdList=new ArrayList();
  JspVisitorInputMap inputMap=new JspVisitorInputMap();
  inputMap.put("String_Node_Str",tagFileDependencyIdList);
  inputMap.put("String_Node_Str",tlc);
  inputMap.put("String_Node_Str",jspResources);
  inputMap.put("String_Node_Str",options);
  inputMap.put("String_Node_Str",jspResources.getInputSource().getRelativeURL());
  inputMap.put("String_Node_Str",JspIdConsumerCounter);
  inputMap.put("String_Node_Str",JspIdConsumerPrefix);
  String jspVisitorCollectionId=null;
  String tagFileVisitorCollectionId=null;
  if (!options.isUseInMemory()) {
    jspVisitorCollectionId=JSP_TRANSLATION_ID;
    tagFileVisitorCollectionId=TAGFILE_TRANSLATION_ID;
    if (options.isDebugEnabled()) {
      jspVisitorCollectionId=DEBUG_JSP_TRANSLATION_ID;
      tagFileVisitorCollectionId=DEBUG_TAGFILE_TRANSLATION_ID;
    }
  }
 else {
    jspVisitorCollectionId=IN_MEMORY_JSP_TRANSLATION_ID;
    tagFileVisitorCollectionId=IN_MEMORY_TAGFILE_TRANSLATION_ID;
    if (options.isDebugEnabled()) {
      jspVisitorCollectionId=IN_MEMORY_DEBUG_JSP_TRANSLATION_ID;
      tagFileVisitorCollectionId=IN_MEMORY_DEBUG_TAGFILE_TRANSLATION_ID;
    }
  }
  JspTranslator jspTranslator=JspTranslatorFactory.getFactory().createTranslator(jspVisitorCollectionId,jspResources.getInputSource(),context,config,options,tlc.getImplicitTagLibPrefixMap());
  HashMap resultMap=jspTranslator.processVisitors(inputMap);
  if (resultMap.containsKey("String_Node_Str")) {
    SmapVisitorResult smapResult=(SmapVisitorResult)resultMap.get("String_Node_Str");
    translationResult.addSmapGenerator(obtainAbsoluteRelativeURL(context,jspResources.getInputSource()),smapResult.getSmapGenerator());
  }
  translationResult.addJspLineIds(jspResources,jspTranslator.getDocument());
  if (tagFileDependencyIdList.size() > 0) {
    Object lock=tlc.getTagFileLock(tagFileDependencyIdList);
    try {
synchronized (lock) {
        List tagFilesToCompile=new ArrayList();
        List tagFilesNotToCompile=new ArrayList();
        Collection tagFileIds=new ArrayList();
        for (Iterator itr=tagFileDependencyIdList.iterator(); itr.hasNext(); ) {
          TagFileId tagFileId=(TagFileId)itr.next();
          TagLibraryInfoImpl tli=tlc.getTagLibraryInfo(tagFileId.getUri(),tagFileId.getPrefix(),jspResources.getInputSource().getRelativeURL());
          TagFileInfo tfi=tli.getTagFile(tagFileId.getTagName());
          JspInputSource tagFileInputSource=context.getJspInputSourceFactory().copyJspInputSource(tli.getInputSource(),tfi.getPath());
          TagFileResources tagFileResources=context.getJspResourcesFactory().createTagFileResources(tagFileInputSource,tfi);
          tagFileResources=tlc.getTagFileResources(tagFileResources);
          translationResult.getTagFileDependencyList().add(tagFileResources);
          if (forceTagFileTranslation || tagFileResources.getGeneratedSourceFile().getParentFile().exists() == false) {
            tagFileResources.getGeneratedSourceFile().getParentFile().mkdirs();
          }
          if (forceTagFileTranslation || tagFileResources.isOutdated()) {
            JspConfiguration tagConfiguration=config.createEmptyJspConfiguration();
            if (tli != null) {
              if (tli.getRequiredVersion() != null) {
                tagConfiguration.setJspVersion(tli.getRequiredVersion());
              }
            }
            tagConfiguration.setElIgnored(config.elIgnored());
            JspTranslator tagFileTranslator=JspTranslatorFactory.getFactory().createTranslator(tagFileVisitorCollectionId,tagFileInputSource,context,tagConfiguration,options,tlc.getImplicitTagLibPrefixMap());
            JspVisitorInputMap tagFileInputMap=new JspVisitorInputMap();
            tagFileInputMap.put("String_Node_Str",options);
            tagFileInputMap.put("String_Node_Str",tlc);
            tagFileInputMap.put("String_Node_Str",tagFileResources);
            tagFileInputMap.put("String_Node_Str",tfi);
            tagFileInputMap.put("String_Node_Str",new Boolean(true));
            tagFileInputMap.put("String_Node_Str",jspResources.getInputSource().getRelativeURL());
            HashMap results=tagFileTranslator.processVisitors(tagFileInputMap);
            if (results.containsKey("String_Node_Str")) {
              SmapVisitorResult smapResult=(SmapVisitorResult)results.get("String_Node_Str");
              translationResult.addSmapGenerator(obtainAbsoluteRelativeURL(context,tagFileResources.getInputSource()),smapResult.getSmapGenerator());
            }
            JspTranslationResult.loadJspIdList(tagFileResources,tagFileTranslator.getDocument().getDocumentElement(),tagFileIds);
            tagFileResources.syncGeneratedSource();
            tagFilesToCompile.add(tagFileResources);
          }
 else {
            tagFilesNotToCompile.add(tagFileResources);
          }
        }
        if (tagFilesToCompile.size() > 0) {
          JspResources[] resourcesToCompile=new JspResources[tagFilesToCompile.size()];
          resourcesToCompile=(JspResources[])tagFilesToCompile.toArray(resourcesToCompile);
          JspCompiler compiler=context.getJspCompilerFactory().createJspCompiler();
          JspResources[] dependencies=null;
          if (tagFilesNotToCompile.size() > 0) {
            dependencies=new JspResources[tagFilesNotToCompile.size()];
            dependencies=(JspResources[])tagFilesNotToCompile.toArray(dependencies);
          }
          JspCompilerResult compileResult=compiler.compile(resourcesToCompile,dependencies,tagFileIds,compilerOptions);
          translationResult.setTagFileCompileResult(compileResult);
          syncTagFileFiles(options,tagFilesToCompile,translationResult,context);
        }
      }
    }
  finally {
      tlc.releaseTagFileLock(tagFileDependencyIdList);
    }
  }
  return translationResult;
}