nus-yam/ex-repair huggingface dataset:
Program: 15753
Project: 15753
Buggy source:
ParameterRole getParameterRole(int idx){
  if (idx == 0) {
    return ParameterRole.ASSIGNMENT_TARGET;
  }
 else {
    final int argDescsEnd=paramNames.length * 2 + 1;
    if (idx < argDescsEnd) {
      if (idx % 2 == 1) {
        return ParameterRole.PARAMETER_NAME;
      }
 else {
        return ParameterRole.PARAMETER_DEFAULT;
      }
    }
 else     if (idx == argDescsEnd) {
      return ParameterRole.CATCH_ALL_PARAMETER_NAME;
    }
 else     if (idx == argDescsEnd + 1) {
      return ParameterRole.AST_NODE_SUBTYPE;
    }
 else {
      throw new IndexOutOfBoundsException();
    }
  }
}

Fixed version (ground truth):
ParameterRole getParameterRole(int idx){
  if (idx == 0) {
    return ParameterRole.ASSIGNMENT_TARGET;
  }
 else {
    final int argDescsEnd=paramNames.length * 2 + 1;
    if (idx < argDescsEnd) {
      if (idx % 2 != 0) {
        return ParameterRole.PARAMETER_NAME;
      }
 else {
        return ParameterRole.PARAMETER_DEFAULT;
      }
    }
 else     if (idx == argDescsEnd) {
      return ParameterRole.CATCH_ALL_PARAMETER_NAME;
    }
 else     if (idx == argDescsEnd + 1) {
      return ParameterRole.AST_NODE_SUBTYPE;
    }
 else {
      throw new IndexOutOfBoundsException();
    }
  }
}
Program: 15754
Project: 15754
Buggy source:
public void testAccuracy() throws ParseException {
  Date d=DF.parse("String_Node_Str");
  assertEquals("String_Node_Str",dateToISO8601UTCDateTimeString(d,true));
  assertEquals("String_Node_Str",dateToISO8601String(d,true,true,true,DateUtil.ACCURACY_MILLISECONDS,null));
  assertEquals("String_Node_Str",dateToISO8601String(d,true,true,true,DateUtil.ACCURACY_SECONDS,null));
  assertEquals("String_Node_Str",dateToISO8601String(d,true,true,true,DateUtil.ACCURACY_MINUTES,null));
  assertEquals("String_Node_Str",dateToISO8601String(d,true,true,true,DateUtil.ACCURACY_HOURS,null));
}

Fixed version (ground truth):
public void testAccuracy() throws ParseException {
  Date d=df.parse("String_Node_Str");
  assertEquals("String_Node_Str",dateToISO8601UTCDateTimeString(d,true));
  assertEquals("String_Node_Str",dateToISO8601String(d,true,true,true,DateUtil.ACCURACY_MILLISECONDS,null));
  assertEquals("String_Node_Str",dateToISO8601String(d,true,true,true,DateUtil.ACCURACY_SECONDS,null));
  assertEquals("String_Node_Str",dateToISO8601String(d,true,true,true,DateUtil.ACCURACY_MINUTES,null));
  assertEquals("String_Node_Str",dateToISO8601String(d,true,true,true,DateUtil.ACCURACY_HOURS,null));
}
Program: 15756
Project: 15756
Buggy source:
public void testLocalTime() throws ParseException {
  Date dsum=DF.parse("String_Node_Str");
  Date dwin=DF.parse("String_Node_Str");
  TimeZone tzRome=TimeZone.getTimeZone("String_Node_Str");
  if (tzRome.getOffset(0) == 0) {
    throw new RuntimeException("String_Node_Str");
  }
  assertEquals("String_Node_Str",dateToISO8601DateTimeString(dsum,tzRome));
  assertEquals("String_Node_Str",dateToISO8601DateTimeString(dwin,tzRome));
  assertEquals("String_Node_Str",dateToISO8601DateString(dsum,tzRome));
  assertEquals("String_Node_Str",dateToISO8601DateString(dwin,tzRome));
  assertEquals("String_Node_Str",dateToISO8601TimeString(dsum,tzRome));
  assertEquals("String_Node_Str",dateToISO8601TimeString(dwin,tzRome));
  TimeZone tzNY=TimeZone.getTimeZone("String_Node_Str");
  if (tzNY.getOffset(0) == 0) {
    throw new RuntimeException("String_Node_Str");
  }
  assertEquals("String_Node_Str",dateToISO8601DateTimeString(dsum,tzNY));
  assertEquals("String_Node_Str",dateToISO8601DateTimeString(dwin,tzNY));
  assertEquals("String_Node_Str",dateToISO8601DateString(dsum,tzNY));
  assertEquals("String_Node_Str",dateToISO8601DateString(dwin,tzNY));
  assertEquals("String_Node_Str",dateToISO8601TimeString(dsum,tzNY));
  assertEquals("String_Node_Str",dateToISO8601TimeString(dwin,tzNY));
  TimeZone tzFixed=TimeZone.getTimeZone("String_Node_Str");
  assertEquals("String_Node_Str",dateToISO8601DateTimeString(dsum,tzFixed));
  assertEquals("String_Node_Str",dateToISO8601DateTimeString(dwin,tzFixed));
}

Fixed version (ground truth):
public void testLocalTime() throws ParseException {
  Date dsum=df.parse("String_Node_Str");
  Date dwin=df.parse("String_Node_Str");
  TimeZone tzRome=TimeZone.getTimeZone("String_Node_Str");
  if (tzRome.getOffset(0) == 0) {
    throw new RuntimeException("String_Node_Str");
  }
  assertEquals("String_Node_Str",dateToISO8601DateTimeString(dsum,tzRome));
  assertEquals("String_Node_Str",dateToISO8601DateTimeString(dwin,tzRome));
  assertEquals("String_Node_Str",dateToISO8601DateString(dsum,tzRome));
  assertEquals("String_Node_Str",dateToISO8601DateString(dwin,tzRome));
  assertEquals("String_Node_Str",dateToISO8601TimeString(dsum,tzRome));
  assertEquals("String_Node_Str",dateToISO8601TimeString(dwin,tzRome));
  TimeZone tzNY=TimeZone.getTimeZone("String_Node_Str");
  if (tzNY.getOffset(0) == 0) {
    throw new RuntimeException("String_Node_Str");
  }
  assertEquals("String_Node_Str",dateToISO8601DateTimeString(dsum,tzNY));
  assertEquals("String_Node_Str",dateToISO8601DateTimeString(dwin,tzNY));
  assertEquals("String_Node_Str",dateToISO8601DateString(dsum,tzNY));
  assertEquals("String_Node_Str",dateToISO8601DateString(dwin,tzNY));
  assertEquals("String_Node_Str",dateToISO8601TimeString(dsum,tzNY));
  assertEquals("String_Node_Str",dateToISO8601TimeString(dwin,tzNY));
  TimeZone tzFixed=TimeZone.getTimeZone("String_Node_Str");
  assertEquals("String_Node_Str",dateToISO8601DateTimeString(dsum,tzFixed));
  assertEquals("String_Node_Str",dateToISO8601DateTimeString(dwin,tzFixed));
}
Program: 15757
Project: 15757
Buggy source:
private Object acquireTemplateSource(String path) throws IOException {
  int asterisk=path.indexOf(ASTERISK);
  if (asterisk == -1) {
    return templateLoader.findTemplateSource(path);
  }
  StringTokenizer tok=new StringTokenizer(path,"String_Node_Str");
  int lastAsterisk=-1;
  List tokpath=new ArrayList();
  while (tok.hasMoreTokens()) {
    String pathToken=tok.nextToken();
    if (pathToken.equals(ASTERISKSTR)) {
      if (lastAsterisk != -1) {
        tokpath.remove(lastAsterisk);
      }
      lastAsterisk=tokpath.size();
    }
    tokpath.add(pathToken);
  }
  String basePath=concatPath(tokpath,0,lastAsterisk);
  String resourcePath=concatPath(tokpath,lastAsterisk + 1,tokpath.size());
  if (resourcePath.endsWith("String_Node_Str")) {
    resourcePath=resourcePath.substring(0,resourcePath.length() - 1);
  }
  StringBuffer buf=new StringBuffer(path.length()).append(basePath);
  int l=basePath.length();
  boolean debug=logger.isDebugEnabled();
  for (; ; ) {
    String fullPath=buf.append(resourcePath).toString();
    if (debug) {
      logger.debug("String_Node_Str" + StringUtil.jQuoteNoXSS(fullPath));
    }
    Object templateSource=templateLoader.findTemplateSource(fullPath);
    if (templateSource != null) {
      return templateSource;
    }
    if (l == 0) {
      return null;
    }
    l=basePath.lastIndexOf(SLASH,l - 2) + 1;
    buf.setLength(l);
  }
}

Fixed version (ground truth):
private Object acquireTemplateSource(String path) throws IOException {
  int asterisk=path.indexOf(ASTERISK);
  if (asterisk == -1) {
    return templateLoader.findTemplateSource(path);
  }
  StringTokenizer tok=new StringTokenizer(path,"String_Node_Str");
  int lastAsterisk=-1;
  List tokpath=new ArrayList();
  while (tok.hasMoreTokens()) {
    String pathToken=tok.nextToken();
    if (pathToken.equals(ASTERISKSTR)) {
      if (lastAsterisk != -1) {
        tokpath.remove(lastAsterisk);
      }
      lastAsterisk=tokpath.size();
    }
    tokpath.add(pathToken);
  }
  if (lastAsterisk == -1) {
    return templateLoader.findTemplateSource(path);
  }
  String basePath=concatPath(tokpath,0,lastAsterisk);
  String resourcePath=concatPath(tokpath,lastAsterisk + 1,tokpath.size());
  if (resourcePath.endsWith("String_Node_Str")) {
    resourcePath=resourcePath.substring(0,resourcePath.length() - 1);
  }
  StringBuffer buf=new StringBuffer(path.length()).append(basePath);
  int l=basePath.length();
  boolean debug=logger.isDebugEnabled();
  for (; ; ) {
    String fullPath=buf.append(resourcePath).toString();
    if (debug) {
      logger.debug("String_Node_Str" + StringUtil.jQuoteNoXSS(fullPath));
    }
    Object templateSource=templateLoader.findTemplateSource(fullPath);
    if (templateSource != null) {
      return templateSource;
    }
    if (l == 0) {
      return null;
    }
    l=basePath.lastIndexOf(SLASH,l - 2) + 1;
    buf.setLength(l);
  }
}
Program: 15758
Project: 15758
Buggy source:
void accept(Environment env) throws TemplateException, IOException {
  for (int i=0; i < nestedElements.size(); i++) {
    ConditionalBlock cblock=(ConditionalBlock)nestedElements.get(i);
    Expression condition=cblock.condition;
    if (condition == null || condition.evalToBoolean(env)) {
      if (cblock.nestedBlock != null) {
        env.visit(cblock.nestedBlock);
      }
      return;
    }
  }
}

Fixed version (ground truth):
void accept(Environment env) throws TemplateException, IOException {
  for (int i=0; i < nestedElements.size(); i++) {
    ConditionalBlock cblock=(ConditionalBlock)nestedElements.get(i);
    Expression condition=cblock.condition;
    env.replaceElemetStackTop(cblock);
    if (condition == null || condition.evalToBoolean(env)) {
      if (cblock.nestedBlock != null) {
        env.visit(cblock.nestedBlock);
      }
      return;
    }
  }
}
Program: 15759
Project: 15759
Buggy source:
protected String dump(boolean canonical){
  return canonical ? nestedBlock.getCanonicalForm() : nestedBlock.getDescription();
}

Fixed version (ground truth):
protected String dump(boolean canonical){
  if (canonical) {
    StringBuffer sb=new StringBuffer();
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
    if (nestedBlock == null) {
      sb.append("String_Node_Str");
    }
 else {
      sb.append("String_Node_Str");
      sb.append(nestedBlock.getCanonicalForm());
      sb.append("String_Node_Str");
    }
    return sb.toString();
  }
 else {
    return "String_Node_Str";
  }
}
Program: 15760
Project: 15760
Buggy source:
private TemplateElement replaceTopElement(TemplateElement element){
  return (TemplateElement)elementStack.set(elementStack.size() - 1,element);
}

Fixed version (ground truth):
private TemplateElement replaceTopElement(TemplateElement element){
  return (TemplateElement)instructionStack.set(instructionStack.size() - 1,element);
}
Program: 15761
Project: 15761
Buggy source:
private void popElement(){
  elementStack.remove(elementStack.size() - 1);
}

Fixed version (ground truth):
private void popElement(){
  instructionStack.remove(instructionStack.size() - 1);
}
Program: 15762
Project: 15762
Buggy source:
/** 
 * Outputs the instruction stack. Useful for debugging.  {@link TemplateException}s incorporate this information in their stack traces.
 */
public void outputInstructionStack(PrintWriter pw){
  pw.println("String_Node_Str");
  ListIterator stackIter=elementStack.listIterator(elementStack.size());
  boolean topElement=true;
  while (stackIter.hasPrevious()) {
    TemplateElement stackEl=(TemplateElement)stackIter.previous();
    if (stackEl.isShownInStackTrace() || !stackIter.hasNext()) {
      if (topElement) {
        pw.print("String_Node_Str");
        topElement=false;
      }
 else {
        pw.print("String_Node_Str");
      }
      pw.println(getStackTraceElementLine(stackEl));
    }
  }
  pw.println("String_Node_Str");
  pw.flush();
}

Fixed version (ground truth):
/** 
 * Outputs the instruction stack. Useful for debugging.  {@link TemplateException}s incorporate this information in their stack traces.
 */
public void outputInstructionStack(PrintWriter pw){
  pw.println("String_Node_Str");
  ListIterator stackIter=instructionStack.listIterator(instructionStack.size());
  boolean topElement=true;
  while (stackIter.hasPrevious()) {
    TemplateElement stackEl=(TemplateElement)stackIter.previous();
    if (stackEl.isShownInStackTrace() || !stackIter.hasNext()) {
      if (topElement) {
        pw.print("String_Node_Str");
        topElement=false;
      }
 else {
        pw.print("String_Node_Str");
      }
      pw.println(getStackTraceItemLine(stackEl));
    }
  }
  pw.println("String_Node_Str");
  pw.flush();
}
Program: 15763
Project: 15763
Buggy source:
private void pushElement(TemplateElement element){
  elementStack.add(element);
}

Fixed version (ground truth):
private void pushElement(TemplateElement element){
  instructionStack.add(element);
}
Program: 15764
Project: 15764
Buggy source:
/** 
 * Returns the description of the top element in the stack, or   {@code null} if the stack is empty.This is used internally for error message creation.
 */
String getInstructionStackTop(){
  if (elementStack.size() == 0)   return null;
  return getStackTraceElementLine((TemplateElement)elementStack.get(elementStack.size() - 1));
}

Fixed version (ground truth):
/** 
 * Returns the description of the top element in the stack, or   {@code null} if the stack is empty.This is used internally for error message creation.
 */
String getInstructionStackTop(){
  if (instructionStack.size() == 0)   return null;
  return getStackTraceItemLine((TemplateElement)instructionStack.get(instructionStack.size() - 1));
}
Program: 15765
Project: 15765
Buggy source:
InvalidReferenceException newInvalidReferenceException(Environment env){
  if (env != null && env.getFastInvalidReferenceExceptions()) {
    return InvalidReferenceException.FAST_INSTANCE;
  }
 else {
    return new InvalidReferenceException(MessageUtil.decorateErrorDescription("String_Node_Str",this,"String_Node_Str" + "String_Node_Str" + StringUtil.encloseAsTag(this.getTemplate(),"String_Node_Str") + "String_Node_Str"+ StringUtil.encloseAsTag(this.getTemplate(),"String_Node_Str")+ "String_Node_Str"+ StringUtil.encloseAsTag(this.getTemplate(),"String_Node_Str")+ "String_Node_Str"),env);
  }
}

Fixed version (ground truth):
InvalidReferenceException newInvalidReferenceException(Environment env){
  if (env != null && env.getFastInvalidReferenceExceptions()) {
    return InvalidReferenceException.FAST_INSTANCE;
  }
 else {
    return new InvalidReferenceException(MessageUtil.decorateErrorDescription("String_Node_Str",this,"String_Node_Str" + "String_Node_Str" + StringUtil.encloseAsTag(this.getTemplate(),"String_Node_Str") + "String_Node_Str"+ StringUtil.encloseAsTag(this.getTemplate(),"String_Node_Str")+ "String_Node_Str"+ StringUtil.encloseAsTag(this.getTemplate(),"String_Node_Str")+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"),env);
  }
}
Program: 15766
Project: 15766
Buggy source:
private static String[] rawDescToMessageAndDesc(String rawDesc,Throwable cause,Environment env){
  String desc;
  if (rawDesc != null && rawDesc.length() != 0) {
    desc=rawDesc;
  }
 else   if (cause != null) {
    desc="String_Node_Str" + cause.getClass().getName() + "String_Node_Str"+ cause.getMessage();
  }
 else {
    desc="String_Node_Str";
  }
  String message;
  if (env != null) {
    String stackTop=Internal_CoreAPI.getInstructionStackTop(env);
    if (stackTop != null) {
      message=desc + "String_Node_Str" + THE_FAILING_INSTRUCTION+ "String_Node_Str"+ Internal_CoreAPI.getInstructionStackTop(env);
      desc=message.substring(0,desc.length());
    }
 else {
      message=desc;
    }
  }
 else {
    message=desc;
  }
  return new String[]{message,desc};
}

Fixed version (ground truth):
private static String[] rawDescToMessageAndDesc(String rawDesc,Throwable cause,Environment env){
  String desc;
  if (rawDesc != null && rawDesc.length() != 0) {
    desc=rawDesc;
  }
 else   if (cause != null) {
    desc="String_Node_Str" + cause.getClass().getName() + "String_Node_Str"+ cause.getMessage();
  }
 else {
    desc="String_Node_Str";
  }
  String message;
  if (env != null) {
    String stackTop=Internal_CoreAPI.getInstructionStackTop(env);
    if (stackTop != null) {
      int stackSize=Internal_CoreAPI.getDisplayedInstructionStackSize(env);
      message=desc + "String_Node_Str" + THE_FAILING_INSTRUCTION+ (stackSize > 1 ? "String_Node_Str" + (stackSize - 1) + "String_Node_Str" : "String_Node_Str")+ "String_Node_Str"+ stackTop;
      desc=message.substring(0,desc.length());
    }
 else {
      message=desc;
    }
  }
 else {
    message=desc;
  }
  return new String[]{message,desc};
}
Program: 15767
Project: 15767
Buggy source:
/** 
 * Returns a class name without "java.lang." and "java.util." prefix; useful for printing class names in error messages.
 * @param pClass can be {@code null}, in which case the method returns   {@code null}.
 * @param shortenFreeMarkerClasses if {@code true}, it will also shorten FreeMarker class names. The exact rules aren't specified and might change over time, but right now,   {@code freemarker.ext.beans.NumberModel} forexample becomes to  {@code f.e.b.NumberModel}. 
 * @since 2.4
 */
public static String getShortClassName(Class pClass,boolean shortenFreeMarkerClasses){
  if (pClass == null)   return null;
  String cn=pClass.getName();
  if (cn.startsWith("String_Node_Str") || cn.startsWith("String_Node_Str")) {
    return cn.substring(10);
  }
 else {
    if (shortenFreeMarkerClasses) {
      if (cn.startsWith("String_Node_Str")) {
        return "String_Node_Str" + cn.substring(19);
      }
 else       if (cn.startsWith("String_Node_Str")) {
        return "String_Node_Str" + cn.substring(20);
      }
 else       if (cn.startsWith("String_Node_Str")) {
        return "String_Node_Str" + cn.substring(14);
      }
 else       if (cn.startsWith("String_Node_Str")) {
        return "String_Node_Str" + cn.substring(10);
      }
    }
    return cn;
  }
}

Fixed version (ground truth):
/** 
 * Returns a class name without "java.lang." and "java.util." prefix; useful for printing class names in error messages.
 * @param pClass can be {@code null}, in which case the method returns   {@code null}.
 * @param shortenFreeMarkerClasses if {@code true}, it will also shorten FreeMarker class names. The exact rules aren't specified and might change over time, but right now,   {@code freemarker.ext.beans.NumberModel} forexample becomes to  {@code f.e.b.NumberModel}. 
 * @since 2.4
 */
public static String getShortClassName(Class pClass,boolean shortenFreeMarkerClasses){
  if (pClass == null) {
    return null;
  }
 else   if (pClass.isArray()) {
    return getShortClassName(pClass.getComponentType()) + "String_Node_Str";
  }
 else {
    String cn=pClass.getName();
    if (cn.startsWith("String_Node_Str") || cn.startsWith("String_Node_Str")) {
      return cn.substring(10);
    }
 else {
      if (shortenFreeMarkerClasses) {
        if (cn.startsWith("String_Node_Str")) {
          return "String_Node_Str" + cn.substring(19);
        }
 else         if (cn.startsWith("String_Node_Str")) {
          return "String_Node_Str" + cn.substring(20);
        }
 else         if (cn.startsWith("String_Node_Str")) {
          return "String_Node_Str" + cn.substring(14);
        }
 else         if (cn.startsWith("String_Node_Str")) {
          return "String_Node_Str" + cn.substring(10);
        }
      }
      return cn;
    }
  }
}
Program: 15768
Project: 15768
Buggy source:
/** 
 * Same as   {@link #jQuoteNoXSS(String)} but also escapes <code>'&lt;'</code>as <code>\u003C</code>. This is used for log messages to prevent XSS on poorly written Web-based log viewers. 
 */
public static String jQuoteNoXSS(String s){
  if (s == null) {
    return "String_Node_Str";
  }
  int ln=s.length();
  StringBuffer b=new StringBuffer(ln + 4);
  b.append('"');
  for (int i=0; i < ln; i++) {
    char c=s.charAt(i);
    if (c == '"') {
      b.append("String_Node_Str");
    }
 else     if (c == '\\') {
      b.append("String_Node_Str");
    }
 else     if (c == '<') {
      b.append("String_Node_Str");
    }
 else     if (c < 0x20) {
      if (c == '\n') {
        b.append("String_Node_Str");
      }
 else       if (c == '\r') {
        b.append("String_Node_Str");
      }
 else       if (c == '\f') {
        b.append("String_Node_Str");
      }
 else       if (c == '\b') {
        b.append("String_Node_Str");
      }
 else       if (c == '\t') {
        b.append("String_Node_Str");
      }
 else {
        b.append("String_Node_Str");
        int x=c / 0x10;
        b.append((char)(x < 0xA ? x + '0' : x - 0xA + 'A'));
        x=c & 0xF;
        b.append((char)(x < 0xA ? x + '0' : x - 0xA + 'A'));
      }
    }
 else {
      b.append(c);
    }
  }
  b.append('"');
  return b.toString();
}

Fixed version (ground truth):
/** 
 * Same as   {@link #jQuoteNoXSS(String)} but also escapes <code>'&lt;'</code>as <code>\u003C</code>. This is used for log messages to prevent XSS on poorly written Web-based log viewers. 
 */
public static String jQuoteNoXSS(String s){
  if (s == null) {
    return "String_Node_Str";
  }
  int ln=s.length();
  StringBuffer b=new StringBuffer(ln + 4);
  b.append('"');
  for (int i=0; i < ln; i++) {
    char c=s.charAt(i);
    if (c == '"') {
      b.append("String_Node_Str");
    }
 else     if (c == '\\') {
      b.append("String_Node_Str");
    }
 else     if (c == '<') {
      b.append("String_Node_Str");
    }
 else     if (c < 0x20) {
      if (c == '\n') {
        b.append("String_Node_Str");
      }
 else       if (c == '\r') {
        b.append("String_Node_Str");
      }
 else       if (c == '\f') {
        b.append("String_Node_Str");
      }
 else       if (c == '\b') {
        b.append("String_Node_Str");
      }
 else       if (c == '\t') {
        b.append("String_Node_Str");
      }
 else {
        b.append("String_Node_Str");
        int x=c / 0x10;
        b.append(toHexDigit(x));
        x=c & 0xF;
        b.append(toHexDigit(x));
      }
    }
 else {
      b.append(c);
    }
  }
  b.append('"');
  return b.toString();
}
Program: 15769
Project: 15769
Buggy source:
/** 
 * Escapes a <code>String</code> according the JSON string literal escaping rules. The resulting string will <em>not</em> be quoted; the caller have to ensure that they are there in the final output. <p>Beware, it doesn't escape <tt>'</tt>, as JSON string must be delimited with <tt>"</tt>, and JSON has no <tt>\'</tt> escape either! <p>It will escape <tt>/</tt> as <tt>\/</tt> if it's after <tt>&lt;</tt>, to avoid <tt>&lt;/script></tt>. <p>It will escape <tt>></tt> as <tt>\</tt><tt>u003E</tt> if it's after <tt>]]</tt>, to avoid closing a CDATA section. <p>All characters under UCS code point 0x20 will be escaped. Where they have no dedicated escape sequence in JSON, they will be replaced with hexadecimal escape (<tt>\</tt><tt>u<i>XXXX</i></tt>). 
 */
public static String jsonStringEnc(String s){
  int ln=s.length();
  for (int i=0; i < ln; i++) {
    char c=s.charAt(i);
    if (c == '"' || c == '\\' || c < 0x20 || (c == '/' && i > 0 && s.charAt(i - 1) == '<') || (c == '>' && i > 1 && s.charAt(i - 1) == ']' && s.charAt(i - 2) == ']')) {
      StringBuffer b=new StringBuffer(ln + 4);
      b.append(s.substring(0,i));
      while (true) {
        if (c == '"') {
          b.append("String_Node_Str");
        }
 else         if (c == '\\') {
          b.append("String_Node_Str");
        }
 else         if (c == '/' && i > 0 && s.charAt(i - 1) == '<') {
          b.append("String_Node_Str");
        }
 else         if (c == '>' && i > 1 && s.charAt(i - 1) == ']' && s.charAt(i - 2) == ']') {
          b.append("String_Node_Str");
        }
 else         if (c < 0x20) {
          if (c == '\n') {
            b.append("String_Node_Str");
          }
 else           if (c == '\r') {
            b.append("String_Node_Str");
          }
 else           if (c == '\f') {
            b.append("String_Node_Str");
          }
 else           if (c == '\b') {
            b.append("String_Node_Str");
          }
 else           if (c == '\t') {
            b.append("String_Node_Str");
          }
 else {
            b.append("String_Node_Str");
            int x=c / 0x10;
            b.append((char)(x < 0xA ? x + '0' : x - 0xA + 'A'));
            x=c & 0xF;
            b.append((char)(x < 0xA ? x + '0' : x - 0xA + 'A'));
          }
        }
 else {
          b.append(c);
        }
        i++;
        if (i >= ln) {
          return b.toString();
        }
        c=s.charAt(i);
      }
    }
  }
  return s;
}

Fixed version (ground truth):
/** 
 * Escapes a   {@link String} to be safely insertable into a JSON string literal; for more see{@link #jsStringEnc(String,boolean) jsStringEnc(s, true)}.
 */
public static String jsonStringEnc(String s){
  return jsStringEnc(s,true);
}
Program: 15770
Project: 15770
Buggy source:
/** 
 * Quotes string as Java Language string literal. Returns string <code>"null"</code> if <code>s</code> is <code>null</code>.
 */
public static String jQuote(String s){
  if (s == null) {
    return "String_Node_Str";
  }
  int ln=s.length();
  StringBuffer b=new StringBuffer(ln + 4);
  b.append('"');
  for (int i=0; i < ln; i++) {
    char c=s.charAt(i);
    if (c == '"') {
      b.append("String_Node_Str");
    }
 else     if (c == '\\') {
      b.append("String_Node_Str");
    }
 else     if (c < 0x20) {
      if (c == '\n') {
        b.append("String_Node_Str");
      }
 else       if (c == '\r') {
        b.append("String_Node_Str");
      }
 else       if (c == '\f') {
        b.append("String_Node_Str");
      }
 else       if (c == '\b') {
        b.append("String_Node_Str");
      }
 else       if (c == '\t') {
        b.append("String_Node_Str");
      }
 else {
        b.append("String_Node_Str");
        int x=c / 0x10;
        b.append((char)(x < 0xA ? x + '0' : x - 0xA + 'A'));
        x=c & 0xF;
        b.append((char)(x < 0xA ? x + '0' : x - 0xA + 'A'));
      }
    }
 else {
      b.append(c);
    }
  }
  b.append('"');
  return b.toString();
}

Fixed version (ground truth):
/** 
 * Quotes string as Java Language string literal. Returns string <code>"null"</code> if <code>s</code> is <code>null</code>.
 */
public static String jQuote(String s){
  if (s == null) {
    return "String_Node_Str";
  }
  int ln=s.length();
  StringBuffer b=new StringBuffer(ln + 4);
  b.append('"');
  for (int i=0; i < ln; i++) {
    char c=s.charAt(i);
    if (c == '"') {
      b.append("String_Node_Str");
    }
 else     if (c == '\\') {
      b.append("String_Node_Str");
    }
 else     if (c < 0x20) {
      if (c == '\n') {
        b.append("String_Node_Str");
      }
 else       if (c == '\r') {
        b.append("String_Node_Str");
      }
 else       if (c == '\f') {
        b.append("String_Node_Str");
      }
 else       if (c == '\b') {
        b.append("String_Node_Str");
      }
 else       if (c == '\t') {
        b.append("String_Node_Str");
      }
 else {
        b.append("String_Node_Str");
        int x=c / 0x10;
        b.append(toHexDigit(x));
        x=c & 0xF;
        b.append(toHexDigit(x));
      }
    }
 else {
      b.append(c);
    }
  }
  b.append('"');
  return b.toString();
}
Program: 15771
Project: 15771
Buggy source:
/** 
 * Escapes a <code>String</code> according the JavaScript string literal escaping rules. The resulting string will not be quoted. <p>It escapes both <tt>'</tt> and <tt>"</tt>. In additional it escapes <tt>></tt> as <tt>\></tt> (to avoid <tt>&lt;/script></tt>). <p>All characters under UCS code point 0x20 will be escaped. Where they have no dedicated escape sequence in JavaScript, they will be replaced with hexadecimal escape (<tt>\</tt><tt>u<i>XXXX</i></tt>). 
 */
public static String javaScriptStringEnc(String s){
  int ln=s.length();
  for (int i=0; i < ln; i++) {
    char c=s.charAt(i);
    if (c == '"' || c == '\'' || c == '\\' || c == '>' || c < 0x20) {
      StringBuffer b=new StringBuffer(ln + 4);
      b.append(s.substring(0,i));
      while (true) {
        if (c == '"') {
          b.append("String_Node_Str");
        }
 else         if (c == '\'') {
          b.append("String_Node_Str");
        }
 else         if (c == '\\') {
          b.append("String_Node_Str");
        }
 else         if (c == '>') {
          b.append("String_Node_Str");
        }
 else         if (c < 0x20) {
          if (c == '\n') {
            b.append("String_Node_Str");
          }
 else           if (c == '\r') {
            b.append("String_Node_Str");
          }
 else           if (c == '\f') {
            b.append("String_Node_Str");
          }
 else           if (c == '\b') {
            b.append("String_Node_Str");
          }
 else           if (c == '\t') {
            b.append("String_Node_Str");
          }
 else {
            b.append("String_Node_Str");
            int x=c / 0x10;
            b.append((char)(x < 0xA ? x + '0' : x - 0xA + 'A'));
            x=c & 0xF;
            b.append((char)(x < 0xA ? x + '0' : x - 0xA + 'A'));
          }
        }
 else {
          b.append(c);
        }
        i++;
        if (i >= ln) {
          return b.toString();
        }
        c=s.charAt(i);
      }
    }
  }
  return s;
}

Fixed version (ground truth):
/** 
 * Escapes a   {@link String} to be safely insertable into a JavaScript string literal; for more see{@link #jsStringEnc(String,boolean) jsStringEnc(s, false)}.
 */
public static String javaScriptStringEnc(String s){
  return jsStringEnc(s,false);
}
Program: 15773
Project: 15773
Buggy source:
TemplateModel _getAsTemplateModel(Environment env) throws TemplateException {
  TemplateModel model=target.getAsTemplateModel(env);
  if (model instanceof TemplateScalarModel) {
    return new BIMethod(((TemplateScalarModel)model).getAsString());
  }
  throw target.newUnexpectedTypeException(model,"String_Node_Str");
}

Fixed version (ground truth):
TemplateModel _getAsTemplateModel(Environment env) throws TemplateException {
  return new BIMethod(target.getCoercedStringValue(env,"String_Node_Str"));
}
Program: 15774
Project: 15774
Buggy source:
protected Expression deepCloneWithIdentifierReplaced_inner(String replacedIdentifier,Expression replacement,ReplacemenetState replacementState){
  try {
    BuiltIn clone=(BuiltIn)clone();
    clone.target=target.deepCloneWithIdentifierReplaced(replacedIdentifier,replacement,replacementState);
    return clone;
  }
 catch (  CloneNotSupportedException e) {
    throw new InternalError();
  }
}

Fixed version (ground truth):
protected Expression deepCloneWithIdentifierReplaced_inner(String replacedIdentifier,Expression replacement,ReplacemenetState replacementState){
  try {
    BuiltIn clone=(BuiltIn)clone();
    clone.target=target.deepCloneWithIdentifierReplaced(replacedIdentifier,replacement,replacementState);
    return clone;
  }
 catch (  CloneNotSupportedException e) {
    throw new RuntimeException("String_Node_Str" + e);
  }
}
Program: 15775
Project: 15775
Buggy source:
TemplateModel calculateResult(String s,Environment env){
  return new urlBIResult(s,env);
}

Fixed version (ground truth):
TemplateModel calculateResult(String s,Environment env) throws TemplateException {
  return new BIMethod(s);
}
Program: 15776
Project: 15776
Buggy source:
/** 
 * Outputs the string value of the enclosed expression.
 */
void accept(Environment env) throws TemplateException, IOException {
  env.getOut().write(escapedExpression.getStringValue(env));
}

Fixed version (ground truth):
/** 
 * Outputs the string value of the enclosed expression.
 */
void accept(Environment env) throws TemplateException, IOException {
  env.getOut().write(escapedExpression.getCoercedStringValue(env));
}
Program: 15777
Project: 15777
Buggy source:
private TemplateModel dealWithNumericalKey(TemplateModel targetModel,int index,Environment env) throws TemplateException {
  if (targetModel instanceof TemplateSequenceModel) {
    TemplateSequenceModel tsm=(TemplateSequenceModel)targetModel;
    int size;
    try {
      size=tsm.size();
    }
 catch (    Exception e) {
      size=Integer.MAX_VALUE;
    }
    return index < size ? tsm.get(index) : null;
  }
  try {
    String s=target.getStringValue(env);
    try {
      return new SimpleScalar(s.substring(index,index + 1));
    }
 catch (    RuntimeException re) {
      throw new TemplateException("String_Node_Str",re,env);
    }
  }
 catch (  NonStringException e) {
    throw target.newUnexpectedTypeException(targetModel,"String_Node_Str");
  }
}

Fixed version (ground truth):
private TemplateModel dealWithNumericalKey(TemplateModel targetModel,int index,Environment env) throws TemplateException {
  if (targetModel instanceof TemplateSequenceModel) {
    TemplateSequenceModel tsm=(TemplateSequenceModel)targetModel;
    int size;
    try {
      size=tsm.size();
    }
 catch (    Exception e) {
      size=Integer.MAX_VALUE;
    }
    return index < size ? tsm.get(index) : null;
  }
  try {
    String s=target.getCoercedStringValue(env);
    try {
      return new SimpleScalar(s.substring(index,index + 1));
    }
 catch (    RuntimeException re) {
      throw new TemplateException("String_Node_Str",re,env);
    }
  }
 catch (  NonStringException e) {
    throw target.newUnexpectedTypeException(targetModel,"String_Node_Str");
  }
}
Program: 15780
Project: 15780
Buggy source:
NonStringException newNonStringException(TemplateModel model) throws InvalidReferenceException {
  Environment env=Environment.getCurrentEnvironment();
  assertNonNull(model);
  return new NonStringException(MessageUtil.decorateErrorDescription(unexpectedTypeErrorDescription(MessageUtil.TYPES_USABLE_WHERE_STRING_IS_EXPECTED,model),this),env);
}

Fixed version (ground truth):
NonStringException newNonStringException(TemplateModel model,String tip) throws InvalidReferenceException {
  Environment env=Environment.getCurrentEnvironment();
  assertNonNull(model);
  return new NonStringException(MessageUtil.decorateErrorDescription(unexpectedTypeErrorDescription(MessageUtil.TYPES_USABLE_WHERE_STRING_IS_EXPECTED,model),this,tip),env);
}
Program: 15781
Project: 15781
Buggy source:
SequenceHash(Environment env) throws TemplateException {
  keyMap=new HashMap();
  ArrayList keyList=new ArrayList(size);
  ArrayList valueList=new ArrayList(size);
  for (int i=0; i < size; i++) {
    Expression keyExp=(Expression)keys.get(i);
    Expression valExp=(Expression)values.get(i);
    String key=keyExp.getStringValue(env);
    TemplateModel value=valExp.getAsTemplateModel(env);
    if (env == null || !env.isClassicCompatible()) {
      valExp.assertNonNull(value);
    }
    keyMap.put(key,value);
    keyList.add(key);
    valueList.add(value);
  }
  keyCollection=new CollectionAndSequence(new SimpleSequence(keyList));
  valueCollection=new CollectionAndSequence(new SimpleSequence(valueList));
}

Fixed version (ground truth):
SequenceHash(Environment env) throws TemplateException {
  keyMap=new HashMap();
  ArrayList keyList=new ArrayList(size);
  ArrayList valueList=new ArrayList(size);
  for (int i=0; i < size; i++) {
    Expression keyExp=(Expression)keys.get(i);
    Expression valExp=(Expression)values.get(i);
    String key=keyExp.getCoercedStringValue(env);
    TemplateModel value=valExp.getAsTemplateModel(env);
    if (env == null || !env.isClassicCompatible()) {
      valExp.assertNonNull(value);
    }
    keyMap.put(key,value);
    keyList.add(key);
    valueList.add(value);
  }
  keyCollection=new CollectionAndSequence(new SimpleSequence(keyList));
  valueCollection=new CollectionAndSequence(new SimpleSequence(valueList));
}
Program: 15782
Project: 15782
Buggy source:
/** 
 * @param template the template that this <tt>Include</tt> is a part of.
 * @param includedTemplateName the name of the template to be included.
 * @param encodingExp the encoding to be used or null, if it is a default.
 * @param parseExp whether the template should be parsed (or is raw text)
 */
Include(Template template,Expression includedTemplateName,Expression encodingExp,Expression parseExp) throws ParseException {
  String templatePath1=template.getName();
  if (templatePath1 == null) {
    templatePath1="String_Node_Str";
  }
  int lastSlash=templatePath1.lastIndexOf('/');
  templatePath=lastSlash == -1 ? "String_Node_Str" : templatePath1.substring(0,lastSlash + 1);
  this.includedTemplateName=includedTemplateName;
  if (encodingExp instanceof StringLiteral) {
    encoding=encodingExp.toString();
    encoding=encoding.substring(1,encoding.length() - 1);
  }
 else {
    this.encodingExp=encodingExp;
  }
  if (parseExp == null) {
    parse=true;
  }
 else   if (parseExp.isLiteral()) {
    try {
      if (parseExp instanceof StringLiteral) {
        parse=StringUtil.getYesNo(parseExp.getStringValue(null));
      }
 else {
        try {
          parse=parseExp.isTrue(null);
        }
 catch (        NonBooleanException e) {
          throw new ParseException("String_Node_Str",parseExp);
        }
      }
    }
 catch (    TemplateException e) {
      throw new UndeclaredThrowableException(e);
    }
  }
 else {
    this.parseExp=parseExp;
  }
}

Fixed version (ground truth):
/** 
 * @param template the template that this <tt>Include</tt> is a part of.
 * @param includedTemplateName the name of the template to be included.
 * @param encodingExp the encoding to be used or null, if it is a default.
 * @param parseExp whether the template should be parsed (or is raw text)
 */
Include(Template template,Expression includedTemplateName,Expression encodingExp,Expression parseExp) throws ParseException {
  String templatePath1=template.getName();
  if (templatePath1 == null) {
    templatePath1="String_Node_Str";
  }
  int lastSlash=templatePath1.lastIndexOf('/');
  templatePath=lastSlash == -1 ? "String_Node_Str" : templatePath1.substring(0,lastSlash + 1);
  this.includedTemplateName=includedTemplateName;
  if (encodingExp instanceof StringLiteral) {
    encoding=encodingExp.toString();
    encoding=encoding.substring(1,encoding.length() - 1);
  }
 else {
    this.encodingExp=encodingExp;
  }
  if (parseExp == null) {
    parse=true;
  }
 else   if (parseExp.isLiteral()) {
    try {
      if (parseExp instanceof StringLiteral) {
        parse=StringUtil.getYesNo(parseExp.getCoercedStringValue(null));
      }
 else {
        try {
          parse=parseExp.isTrue(null);
        }
 catch (        NonBooleanException e) {
          throw new ParseException("String_Node_Str",parseExp);
        }
      }
    }
 catch (    TemplateException e) {
      throw new UndeclaredThrowableException(e);
    }
  }
 else {
    this.parseExp=parseExp;
  }
}
Program: 15783
Project: 15783
Buggy source:
void accept(Environment env) throws TemplateException, IOException {
  String templateNameString=includedTemplateName.getStringValue(env);
  String enc=encoding;
  if (encoding == null && encodingExp != null) {
    enc=encodingExp.getStringValue(env);
  }
  boolean parse=this.parse;
  if (parseExp != null) {
    TemplateModel tm=parseExp.getAsTemplateModel(env);
    if (tm == null) {
      if (env.isClassicCompatible()) {
        parse=false;
      }
 else {
        parseExp.assertNonNull(tm);
      }
    }
    if (tm instanceof TemplateScalarModel) {
      parse=getYesNo(EvaluationUtil.getString((TemplateScalarModel)tm,parseExp,env));
    }
 else {
      parse=parseExp.isTrue(env);
    }
  }
  Template includedTemplate;
  try {
    templateNameString=TemplateCache.getFullTemplatePath(env,templatePath,templateNameString);
    includedTemplate=env.getTemplateForInclusion(templateNameString,enc,parse);
  }
 catch (  ParseException pe) {
    String msg="String_Node_Str" + StringUtil.jQuote(templateNameString) + "String_Node_Str"+ pe.getMessage();
    throw new TemplateException(msg,pe,env);
  }
catch (  IOException ioe) {
    String msg="String_Node_Str" + StringUtil.jQuote(templateNameString) + "String_Node_Str"+ ioe;
    throw new TemplateException(msg,ioe,env);
  }
  env.include(includedTemplate);
}

Fixed version (ground truth):
void accept(Environment env) throws TemplateException, IOException {
  String templateNameString=includedTemplateName.getCoercedStringValue(env);
  String enc=encoding;
  if (encoding == null && encodingExp != null) {
    enc=encodingExp.getCoercedStringValue(env);
  }
  boolean parse=this.parse;
  if (parseExp != null) {
    TemplateModel tm=parseExp.getAsTemplateModel(env);
    if (tm == null) {
      if (env.isClassicCompatible()) {
        parse=false;
      }
 else {
        parseExp.assertNonNull(tm);
      }
    }
    if (tm instanceof TemplateScalarModel) {
      parse=getYesNo(EvaluationUtil.getString((TemplateScalarModel)tm,parseExp,env));
    }
 else {
      parse=parseExp.isTrue(env);
    }
  }
  Template includedTemplate;
  try {
    templateNameString=TemplateCache.getFullTemplatePath(env,templatePath,templateNameString);
    includedTemplate=env.getTemplateForInclusion(templateNameString,enc,parse);
  }
 catch (  ParseException pe) {
    String msg="String_Node_Str" + StringUtil.jQuote(templateNameString) + "String_Node_Str"+ pe.getMessage();
    throw new TemplateException(msg,pe,env);
  }
catch (  IOException ioe) {
    String msg="String_Node_Str" + StringUtil.jQuote(templateNameString) + "String_Node_Str"+ ioe;
    throw new TemplateException(msg,ioe,env);
  }
  env.include(includedTemplate);
}
Program: 15786
Project: 15786
Buggy source:
TemplateModel _getAsTemplateModel(Environment env) throws TemplateException {
  TemplateModel tm=target.getAsTemplateModel(env);
  String classname=null;
  try {
    classname=((TemplateScalarModel)tm).getAsString();
  }
 catch (  ClassCastException cce) {
    target.newUnexpectedTypeException(tm,"String_Node_Str");
  }
catch (  NullPointerException npe) {
    throw target.newInvalidReferenceException();
  }
  return new ConstructorFunction(classname,env,this,target.getTemplate());
}

Fixed version (ground truth):
TemplateModel _getAsTemplateModel(Environment env) throws TemplateException {
  TemplateModel tm=target.getAsTemplateModel(env);
  String classname=null;
  try {
    classname=((TemplateScalarModel)tm).getAsString();
  }
 catch (  ClassCastException cce) {
    throw target.newUnexpectedTypeException(tm,"String_Node_Str");
  }
catch (  NullPointerException npe) {
    throw target.newInvalidReferenceException();
  }
  return new ConstructorFunction(classname,env,this,target.getTemplate());
}
Program: 15788
Project: 15788
Buggy source:
/** 
 * Invokes the method, passing it the arguments from the list. The actual method to call from several overloaded methods will be chosen based on the classes of the arguments.
 * @throws TemplateModelException if the method cannot be chosenunambiguously.
 */
public Object exec(List arguments) throws TemplateModelException {
  MemberAndArguments maa=overloadedMethods.getMemberAndArguments(arguments);
  Method method=(Method)maa.getMember();
  try {
    return overloadedMethods.getWrapper().invokeMethod(object,method,maa.getArgs());
  }
 catch (  Exception e) {
    while (e instanceof InvocationTargetException) {
      Throwable t=((InvocationTargetException)e).getTargetException();
      if (t instanceof Exception) {
        e=(Exception)t;
      }
 else {
        break;
      }
    }
    if ((method.getModifiers() & Modifier.STATIC) != 0) {
      throw new TemplateModelException("String_Node_Str" + method + "String_Node_Str",e);
    }
 else {
      StringBuffer buf=new StringBuffer();
      Object[] args=maa.getArgs();
      for (int i=0; i < args.length; ++i) {
        Object arg=args[i];
        buf.append(arg == null ? "String_Node_Str" : arg.getClass().getName()).append(',');
      }
      throw new TemplateModelException("String_Node_Str" + method + "String_Node_Str"+ object+ "String_Node_Str"+ buf+ "String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
/** 
 * Invokes the method, passing it the arguments from the list. The actual method to call from several overloaded methods will be chosen based on the classes of the arguments.
 * @throws TemplateModelException if the method cannot be chosenunambiguously.
 */
public Object exec(List arguments) throws TemplateModelException {
  MemberAndArguments maa=overloadedMethods.getMemberAndArguments(arguments);
  Method method=(Method)maa.getMember();
  try {
    return overloadedMethods.getWrapper().invokeMethod(object,method,maa.getArgs());
  }
 catch (  Exception e) {
    while (e instanceof InvocationTargetException) {
      Throwable t=((InvocationTargetException)e).getTargetException();
      if (t instanceof Exception) {
        e=(Exception)t;
      }
 else {
        break;
      }
    }
    if ((method.getModifiers() & Modifier.STATIC) != 0) {
      throw new TemplateModelException("String_Node_Str" + method + "String_Node_Str",e);
    }
 else {
      StringBuffer buf=new StringBuffer();
      Object[] args=maa.getArgs();
      for (int i=0; i < args.length; ++i) {
        Object arg=args[i];
        buf.append(arg == null ? "String_Node_Str" : arg.getClass().getName()).append(',');
      }
      throw new TemplateModelException("String_Node_Str" + method + "String_Node_Str"+ object.getClass().getName()+ "String_Node_Str"+ StringUtil.jQuote(StringUtil.tryToString(object))+ "String_Node_Str"+ buf+ "String_Node_Str",e);
    }
  }
}
Program: 15789
Project: 15789
Buggy source:
/** 
 * Invokes the method, passing it the arguments from the list.
 */
public Object exec(List arguments) throws TemplateModelException {
  try {
    return wrapper.invokeMethod(object,(Method)getMember(),unwrapArguments(arguments,wrapper));
  }
 catch (  TemplateModelException e) {
    throw e;
  }
catch (  Exception e) {
    while (e instanceof InvocationTargetException) {
      Throwable t=((InvocationTargetException)e).getTargetException();
      if (t instanceof Exception) {
        e=(Exception)t;
      }
 else {
        break;
      }
    }
    if ((getMember().getModifiers() & Modifier.STATIC) != 0) {
      throw new TemplateModelException("String_Node_Str" + StringUtil.jQuote(getMember()) + "String_Node_Str",e);
    }
 else {
      throw new TemplateModelException("String_Node_Str" + StringUtil.jQuote(getMember()) + "String_Node_Str"+ object.getClass().getName()+ "String_Node_Str"+ StringUtil.jQuote(object)+ "String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
/** 
 * Invokes the method, passing it the arguments from the list.
 */
public Object exec(List arguments) throws TemplateModelException {
  try {
    return wrapper.invokeMethod(object,(Method)getMember(),unwrapArguments(arguments,wrapper));
  }
 catch (  TemplateModelException e) {
    throw e;
  }
catch (  Exception e) {
    while (e instanceof InvocationTargetException) {
      Throwable t=((InvocationTargetException)e).getTargetException();
      if (t instanceof Exception) {
        e=(Exception)t;
      }
 else {
        break;
      }
    }
    if ((getMember().getModifiers() & Modifier.STATIC) != 0) {
      throw new TemplateModelException("String_Node_Str" + StringUtil.jQuote(getMember()) + "String_Node_Str",e);
    }
 else {
      throw new TemplateModelException("String_Node_Str" + StringUtil.jQuote(getMember()) + "String_Node_Str"+ object.getClass().getName()+ "String_Node_Str"+ StringUtil.jQuote(StringUtil.tryToString(object))+ "String_Node_Str",e);
    }
  }
}
Program: 15791
Project: 15791
Buggy source:
public TestJspTaglibs(String name,String filename){
  super(name);
}

Fixed version (ground truth):
public TestJspTaglibs(String name,String filename,boolean noOutput){
  super(name);
}