Program: 11874
Project: 11874
Buggy source:
public void handleDirective(String directive,JETMark start,JETMark stop,Map<String,String> attributes) throws JETException {
  if (directive.equals("String_Node_Str")) {
    String fileURI=attributes.get("String_Node_Str");
    if (fileURI != null) {
      String currentURI=start.getFile();
      String[] resolvedFileURI=resolveLocation(templateURIPath,currentURI,fileURI);
      if (resolvedFileURI[0].equals(currentURI)) {
        boolean loop=true;
        if (templateURIPath != null) {
          String baseURI=start.getBaseURI();
          if (baseURI != null) {
            for (int i=0; i < templateURIPath.length; ++i) {
              if (baseURI.equals(templateURIPath[i])) {
                resolvedFileURI=resolveLocation(templateURIPath,i + 1,currentURI,fileURI);
                loop=false;
              }
            }
          }
        }
        if (loop) {
          return;
        }
      }
      try {
        BufferedInputStream bufferedInputStream=new BufferedInputStream(openStream(resolvedFileURI[1]));
        reader.stackStream(resolvedFileURI[2],resolvedFileURI[0],bufferedInputStream,null);
        if ("String_Node_Str".equals(attributes.get("String_Node_Str"))) {
          skipSections.push(new SkipSection(sectionDepth + 1,!skipping));
        }
        if (fSavedLine != null) {
          return;
        }
      }
 catch (      JETException exception) {
        String failType=attributes.get("String_Node_Str");
        if ("String_Node_Str".equals(failType)) {
          skipSections.push(new SkipSection(sectionDepth + 1,false));
        }
 else         if (!"String_Node_Str".equals(failType)) {
          throw new JETException(CodeGenPlugin.getPlugin().getString("String_Node_Str",new Object[]{resolvedFileURI[1],start.format("String_Node_Str")}),exception);
        }
      }
    }
 else {
      throw new JETException(CodeGenPlugin.getPlugin().getString("String_Node_Str",new Object[]{"String_Node_Str",start.format("String_Node_Str")}));
    }
  }
 else   if (directive.equals("String_Node_Str")) {
    sectionDepth++;
    SkipSection skipSection=skipSections.isEmpty() ? null : (SkipSection)skipSections.peek();
    if (skipSection == null || skipSection.depth != sectionDepth) {
      throw new JETException(CodeGenPlugin.getPlugin().getString("String_Node_Str",new Object[]{start.format("String_Node_Str")}));
    }
 else     if (skipSection.skip) {
      skipping=true;
    }
  }
 else   if (directive.equals("String_Node_Str")) {
    if (sectionDepth == 0) {
      throw new JETException(CodeGenPlugin.getPlugin().getString("String_Node_Str",new Object[]{"String_Node_Str","String_Node_Str",start.format("String_Node_Str")}));
    }
    sectionDepth--;
    if (skipSections.pop().skip) {
      skipping=false;
    }
  }
 else   if (directive.equals("String_Node_Str")) {
    if (skeleton != null) {
    }
 else {
      skeleton=new JETSkeleton();
      String skeletonURI=attributes.get("String_Node_Str");
      if (skeletonURI != null) {
        try {
          BufferedInputStream bufferedInputStream=new BufferedInputStream(openStream(resolveLocation(templateURIPath,templateURI,skeletonURI)[1]));
          byte[] input=new byte[bufferedInputStream.available()];
          bufferedInputStream.read(input);
          bufferedInputStream.close();
          skeleton.setCompilationUnitContents(new String(input));
        }
 catch (        IOException exception) {
          throw new JETException(exception);
        }
      }
      for (      Map.Entry<String,String> entry : attributes.entrySet()) {
        if (entry.getKey().equals("String_Node_Str")) {
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          skeleton.setPackageName(entry.getValue());
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          skeleton.addImports(entry.getValue());
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          skeleton.setClassName(entry.getValue());
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          skeleton.setNLString(entry.getValue());
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          parser.setStartTag(entry.getValue());
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          parser.setEndTag(entry.getValue());
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
        }
 else         throw new JETException(CodeGenPlugin.getPlugin().getString("String_Node_Str",new Object[]{entry.getKey(),start.format("String_Node_Str")}));
      }
      handleNewSkeleton();
    }
  }
  fSavedLine=null;
}

Fixed version (ground truth):
public void handleDirective(String directive,JETMark start,JETMark stop,Map<String,String> attributes) throws JETException {
  if (directive.equals("String_Node_Str")) {
    String fileURI=attributes.get("String_Node_Str");
    if (fileURI != null) {
      String currentURI=start.getFile();
      String[] resolvedFileURI=resolveLocation(templateURIPath,currentURI,fileURI);
      if (resolvedFileURI[0].equals(currentURI)) {
        boolean loop=true;
        if (templateURIPath != null) {
          String baseURI=start.getBaseURI();
          if (baseURI != null) {
            for (int i=0; i < templateURIPath.length; ++i) {
              if (baseURI.equals(templateURIPath[i])) {
                resolvedFileURI=resolveLocation(templateURIPath,i + 1,currentURI,fileURI);
                loop=false;
              }
            }
          }
        }
        if (loop) {
          return;
        }
      }
      try {
        BufferedInputStream bufferedInputStream=new BufferedInputStream(openStream(resolvedFileURI[1]));
        reader.stackStream(resolvedFileURI[2],resolvedFileURI[0],bufferedInputStream,null);
        if ("String_Node_Str".equals(attributes.get("String_Node_Str"))) {
          skipSections.push(new SkipSection(sectionDepth + 1,!skipping));
        }
        if (fSavedLine != null) {
          return;
        }
      }
 catch (      JETException exception) {
        String failType=attributes.get("String_Node_Str");
        if ("String_Node_Str".equals(failType)) {
          skipSections.push(new SkipSection(sectionDepth + 1,false));
        }
 else         if (!"String_Node_Str".equals(failType)) {
          throw new JETException(CodeGenPlugin.getPlugin().getString("String_Node_Str",new Object[]{resolvedFileURI[1],start.format("String_Node_Str")}),exception);
        }
      }
    }
 else {
      throw new JETException(CodeGenPlugin.getPlugin().getString("String_Node_Str",new Object[]{"String_Node_Str",start.format("String_Node_Str")}));
    }
  }
 else   if (directive.equals("String_Node_Str")) {
    sectionDepth++;
    SkipSection skipSection=skipSections.isEmpty() ? null : (SkipSection)skipSections.peek();
    if (skipSection == null || skipSection.depth != sectionDepth) {
      throw new JETException(CodeGenPlugin.getPlugin().getString("String_Node_Str",new Object[]{start.format("String_Node_Str")}));
    }
 else     if (skipSection.skip) {
      skipping=true;
    }
  }
 else   if (directive.equals("String_Node_Str")) {
    if (sectionDepth == 0) {
      throw new JETException(CodeGenPlugin.getPlugin().getString("String_Node_Str",new Object[]{"String_Node_Str","String_Node_Str",start.format("String_Node_Str")}));
    }
    sectionDepth--;
    if (skipSections.pop().skip) {
      skipping=false;
    }
  }
 else   if (directive.equals("String_Node_Str")) {
    if (skeleton != null) {
    }
 else {
      skeleton=new JETSkeleton();
      String skeletonURI=attributes.get("String_Node_Str");
      if (skeletonURI != null) {
        try {
          BufferedInputStream bufferedInputStream=new BufferedInputStream(openStream(resolveLocation(templateURIPath,templateURI,skeletonURI)[1]));
          byte[] input=new byte[bufferedInputStream.available()];
          bufferedInputStream.read(input);
          bufferedInputStream.close();
          skeleton.setCompilationUnitContents(new String(input));
        }
 catch (        IOException exception) {
          throw new JETException(exception);
        }
      }
      for (      Map.Entry<String,String> entry : attributes.entrySet()) {
        if (entry.getKey().equals("String_Node_Str")) {
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          skeleton.setPackageName(entry.getValue());
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          skeleton.addImports(entry.getValue());
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          skeleton.setClassName(entry.getValue());
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          skeleton.setNLString(entry.getValue());
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          parser.setStartTag(entry.getValue());
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          parser.setEndTag(entry.getValue());
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
        }
 else {
          throw new JETException(CodeGenPlugin.getPlugin().getString("String_Node_Str",new Object[]{entry.getKey(),start.format("String_Node_Str")}));
        }
      }
      handleNewSkeleton();
    }
  }
  fSavedLine=null;
}