nus-yam/ex-repair huggingface dataset:
Program: 56867
Project: 56867
Buggy source:
public AstStatementList(List<AstStatement> statements,int block,ParserContext ctx){
  if (statements == null || statements.isEmpty()) {
    this.statements=EMPTY_ARRAY;
  }
 else {
    if (statements.size() > 0 && block != Tokens.AST_BLOCK_SET) {
      ListIterator<AstStatement> it=new ListIterator<AstStatement>(statements);
      combinedContinuousTexts(it);
      trimDirectiveWhitespacesAndComments(it,block,ctx);
      removeAndSplitDirective(it);
      combinedContinuousTexts(it);
    }
    this.statements=statements.toArray(EMPTY_ARRAY);
  }
}

Fixed version (ground truth):
public AstStatementList(List<AstStatement> statements,int block,ParserContext ctx){
  if (statements == null || statements.isEmpty()) {
    this.statements=EMPTY_ARRAY;
  }
 else {
    if (statements.size() > 0 && block != Tokens.AST_BLOCK_SET) {
      ListIterator<AstStatement> it=new ListIterator<AstStatement>(statements);
      splitStatementList(it);
      combinedContinuousTexts(it);
      trimDirectiveWhitespacesAndComments(it,block,ctx);
      removeNoopDirective(it);
      combinedContinuousTexts(it);
    }
    this.statements=statements.toArray(EMPTY_ARRAY);
  }
}
Program: 56868
Project: 56868
Buggy source:
public int getLineStop(){
  int line=lineStart;
  if (text != null) {
    int len=text.length();
    for (int i=0; i < len; i++) {
      char c=text.charAt(i);
      if (c == '\r') {
        int n=i + 1;
        if (n < len && text.charAt(n) == '\n') {
          i++;
        }
        line++;
      }
 else       if (c == '\n') {
        line++;
      }
    }
  }
  return line;
}

Fixed version (ground truth):
public int getLineStop(){
  int line=lineStart;
  if (text != null) {
    int len=text.length();
    for (int i=0; i < len; i++) {
      char c=text.charAt(i);
      if (c == '\r') {
        int n=i + 1;
        if (n < len && text.charAt(n) == '\n') {
          i++;
        }
        if (i + 1 < len) {
          line++;
        }
      }
 else       if (c == '\n') {
        if (i + 1 < len) {
          line++;
        }
      }
    }
  }
  return line;
}
Program: 56869
Project: 56869
Buggy source:
@Override public Object execute(InterpretContext ctx){
  Object value;
  try {
    value=objectExpression.execute(ctx);
  }
 catch (  InterpretException e) {
    if (!Errors.EXPRESSION_OBJECT_IS_NULL.equals(e.getMessage())) {
      value=null;
    }
 else {
      throw e;
    }
  }
  if (value != null) {
    return value;
  }
 else {
    return defaultExpression.execute(ctx);
  }
}

Fixed version (ground truth):
@Override public Object execute(InterpretContext ctx){
  Object value;
  try {
    value=objectExpression.execute(ctx);
  }
 catch (  InterpretException e) {
    if (Errors.EXPRESSION_OBJECT_IS_NULL.equals(e.getMessage())) {
      value=null;
    }
 else {
      throw e;
    }
  }
  if (value != null) {
    return value;
  }
 else {
    return defaultExpression.execute(ctx);
  }
}
Program: 56870
Project: 56870
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public void execute(InterpretContext ctx) throws InterpretException {
  Object file=fileExpression.execute(ctx);
  if (file == null) {
    throw new InterpretException(Errors.EXPRESSION_NTH_ARGUMENT_IS_NULL,"String_Node_Str").set(fileExpression.getPosition());
  }
  if (!(file instanceof String)) {
    throw new InterpretException(Errors.VARIABLE_TYPE_MISMATCH,"String_Node_Str",file.getClass(),"String_Node_Str").set(fileExpression.getPosition());
  }
  Object parameters;
  if (parametersExpression == null) {
    parameters=Collections.emptyMap();
  }
 else {
    parameters=parametersExpression.execute(ctx);
    if (parameters == null) {
      parameters=Collections.emptyMap();
    }
 else     if (!(parameters instanceof Map)) {
      throw new InterpretException(Errors.VARIABLE_TYPE_MISMATCH,"String_Node_Str",parameters.getClass(),"String_Node_Str").set(parametersExpression.getPosition());
    }
  }
  ctx.doIncludeCall((String)file,(Map<String,Object>)parameters,returnName);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void execute(InterpretContext ctx) throws InterpretException {
  Object file=fileExpression.execute(ctx);
  if (file == null) {
    throw new InterpretException(Errors.EXPRESSION_NTH_ARGUMENT_IS_NULL,"String_Node_Str").set(fileExpression.getPosition());
  }
  if (!(file instanceof String)) {
    throw new InterpretException(Errors.VARIABLE_TYPE_MISMATCH,"String_Node_Str",file.getClass(),"String_Node_Str").set(fileExpression.getPosition());
  }
  Object parameters;
  if (parametersExpression == null) {
    parameters=Collections.emptyMap();
  }
 else {
    parameters=parametersExpression.execute(ctx);
    if (parameters == null) {
      parameters=Collections.emptyMap();
    }
 else     if (!(parameters instanceof Map)) {
      throw new InterpretException(Errors.VARIABLE_TYPE_MISMATCH,"String_Node_Str",parameters.getClass(),"String_Node_Str").set(parametersExpression.getPosition());
    }
  }
  try {
    String fileName=PathUtils.getRelativePath(ctx.getTemplate().getName(),(String)file);
    ctx.doIncludeCall(fileName,(Map<String,Object>)parameters,returnName);
  }
 catch (  ResourceNotFoundException e) {
    throw new InterpretException(Errors.INCLUDE_FILE_NOT_FOUND,file).set(fileExpression.getPosition());
  }
}
Program: 56871
Project: 56871
Buggy source:
private void combinedContinuousTexts(ListIterator<AstStatement> it){
  StringBuilder sb=null;
  it.reset();
  while (it.has()) {
    AstStatement stmt=it.peek();
    if (!(stmt instanceof AstText)) {
      it.move();
      continue;
    }
    if (it.hasNext()) {
      AstStatement next=it.peek(1);
      if (!(next instanceof AstText)) {
        it.move(2);
        continue;
      }
      if (sb == null) {
        sb=new StringBuilder(256);
      }
 else {
        sb.setLength(0);
      }
      sb.append(((AstText)stmt).getText());
      it.remove();
      sb.append(((AstText)next).getText());
      it.remove();
      while (it.has()) {
        next=it.peek();
        if (next instanceof AstText) {
          sb.append(((AstText)next).getText());
          it.remove();
        }
 else {
          break;
        }
      }
      it.add(new AstText(sb.toString(),((AstText)stmt).getLineStart()));
    }
    it.move();
  }
}

Fixed version (ground truth):
private void combinedContinuousTexts(ListIterator<AstStatement> it){
  StringBuilder sb=null;
  it.reset();
  while (it.has()) {
    AstStatement stmt=it.peek();
    if (!(stmt instanceof AstText)) {
      it.move();
      continue;
    }
    if (it.hasNext()) {
      AstStatement next=it.peek(1);
      if (!(next instanceof AstText)) {
        it.move(2);
        continue;
      }
      if (sb == null) {
        sb=new StringBuilder(256);
      }
 else {
        sb.setLength(0);
      }
      sb.append(((AstText)stmt).getText());
      it.remove();
      sb.append(((AstText)next).getText());
      it.remove();
      while (it.has()) {
        next=it.peek();
        if (next instanceof AstText) {
          sb.append(((AstText)next).getText());
          it.remove();
        }
 else {
          break;
        }
      }
      it.add(new AstText(sb.toString(),((AstText)stmt).getLine()));
    }
    it.move();
  }
}
Program: 56873
Project: 56873
Buggy source:
public AstText(String text,int lineStart){
  this.text=text;
  this.lineStart=lineStart;
}

Fixed version (ground truth):
public AstText(String text,int line){
  this.text=text;
  this.line=line;
}
Program: 56874
Project: 56874
Buggy source:
protected void trimDirectiveWhitespaces(boolean trimLeft,boolean trimRight,boolean keepLeftNewLine){
  if (text == null || text.length() == 0) {
    return;
  }
  int len=text.length();
  int lpos=0;
  boolean trimedNewLine=false;
  if (trimLeft) {
    for (int i=0; i < len; i++) {
      char c=text.charAt(i);
      if (c == ' ' || c == '\t') {
        continue;
      }
 else       if (c == '\r') {
        if (keepLeftNewLine) {
          lpos=i;
          break;
        }
 else {
          trimedNewLine=true;
          int n=i + 1;
          if (n < len && text.charAt(n) == '\n') {
            lpos=n + 1;
          }
 else {
            lpos=n;
          }
          break;
        }
      }
 else       if (c == '\n') {
        if (keepLeftNewLine) {
          lpos=i;
        }
 else {
          trimedNewLine=true;
          lpos=i + 1;
        }
        break;
      }
 else {
        break;
      }
    }
  }
  int rpos=len;
  if (trimRight) {
    for (int i=len - 1; i >= 0; i--) {
      char c=text.charAt(i);
      if (c == ' ' || c == '\t') {
        continue;
      }
 else       if (c == '\n' || c == '\r') {
        rpos=i + 1;
        break;
      }
 else {
        break;
      }
    }
  }
  if (lpos < rpos) {
    text=text.substring(lpos,rpos);
  }
 else {
    text=null;
  }
  if (trimedNewLine) {
    lineStart++;
  }
}

Fixed version (ground truth):
protected void trimDirectiveWhitespaces(boolean trimLeft,boolean trimRight,boolean keepLeftNewLine){
  if (text == null || text.length() == 0) {
    return;
  }
  int len=text.length();
  int lpos=0;
  boolean trimedNewLine=false;
  if (trimLeft) {
    for (int i=0; i < len; i++) {
      char c=text.charAt(i);
      if (c == ' ' || c == '\t') {
        continue;
      }
 else       if (c == '\r') {
        if (keepLeftNewLine) {
          lpos=i;
          break;
        }
 else {
          trimedNewLine=true;
          int n=i + 1;
          if (n < len && text.charAt(n) == '\n') {
            lpos=n + 1;
          }
 else {
            lpos=n;
          }
          break;
        }
      }
 else       if (c == '\n') {
        if (keepLeftNewLine) {
          lpos=i;
        }
 else {
          trimedNewLine=true;
          lpos=i + 1;
        }
        break;
      }
 else {
        break;
      }
    }
  }
  int rpos=len;
  if (trimRight) {
    for (int i=len - 1; i >= 0; i--) {
      char c=text.charAt(i);
      if (c == ' ' || c == '\t') {
        continue;
      }
 else       if (c == '\n' || c == '\r') {
        rpos=i + 1;
        break;
      }
 else {
        break;
      }
    }
  }
  if (lpos < rpos) {
    text=text.substring(lpos,rpos);
  }
 else {
    text=null;
  }
  if (trimedNewLine) {
    line++;
  }
}
Program: 56875
Project: 56875
Buggy source:
public JetTemplateMacro resolveMacro(String name,Class<?>[] argumentTypes);

Fixed version (ground truth):
public JetTemplateMacro resolveMacro(String name,Class<?>[] argumentTypes,boolean root);
Program: 56876
Project: 56876
Buggy source:
@Override public JetTemplateMacro resolveMacro(String name,Class<?>[] argumentTypes){
  return macroResolver.resolve(name,argumentTypes);
}

Fixed version (ground truth):
@Override public JetTemplateMacro resolveMacro(String name,Class<?>[] argumentTypes,boolean root){
  JetTemplateMacro macro=macroResolver.resolve(name,argumentTypes);
  if (macro == null && root) {
    macro=engine.getGlobalResolver().resolveMacro(name,argumentTypes);
  }
  return macro;
}
Program: 56877
Project: 56877
Buggy source:
public JetTemplateImpl(JetEngine engine,Resource resource,boolean reloadable,JetSecurityManager securityManager){
  this.engine=engine;
  this.resource=resource;
  this.securityManager=securityManager;
  this.config=engine.getConfig();
  this.reloadable=reloadable;
  this.lastModified=0;
  this.macroResolver=new MacroResolver(engine.getGlobalResolver());
}

Fixed version (ground truth):
public JetTemplateImpl(JetEngine engine,Resource resource,boolean reloadable,JetSecurityManager securityManager){
  this.engine=engine;
  this.resource=resource;
  this.securityManager=securityManager;
  this.config=engine.getConfig();
  this.reloadable=reloadable;
  this.lastModified=0;
  this.macroResolver=new MacroResolver();
}
Program: 56878
Project: 56878
Buggy source:
@Override public void execute(InterpretContext ctx) throws InterpretException {
  Object[] arguments;
  if (argumentList == null) {
    arguments=ArrayUtils.EMPTY_OBJECT_ARRAY;
  }
 else {
    arguments=argumentList.execute(ctx);
  }
  JetTemplateMacro macro=last;
  if (macro == null) {
    Class<?>[] argumentTypes=ParameterUtils.getParameterTypes(arguments);
    macro=ctx.getTemplate().resolveMacro(name,argumentTypes);
    if (macro == null) {
      throw new InterpretException(Errors.MACRO_NOT_FOUND,name).set(position);
    }
    this.last=macro;
  }
  ctx.doMacroCall(macro,arguments);
}

Fixed version (ground truth):
@Override public void execute(InterpretContext ctx) throws InterpretException {
  Object[] arguments;
  if (argumentList == null) {
    arguments=ArrayUtils.EMPTY_OBJECT_ARRAY;
  }
 else {
    arguments=argumentList.execute(ctx);
  }
  JetTemplateMacro macro=last;
  if (macro == null) {
    Class<?>[] argumentTypes=ParameterUtils.getParameterTypes(arguments);
    macro=ctx.getTemplate().resolveMacro(name,argumentTypes,true);
    if (macro == null) {
      throw new InterpretException(Errors.MACRO_NOT_FOUND,name).set(position);
    }
    this.last=macro;
  }
  ctx.doMacroCall(macro,arguments);
}
Program: 56879
Project: 56879
Buggy source:
public JetTemplateMacro resolve(String name,Class<?>[] argumentTypes){
  JetTemplateMacro macro;
  if (decleardMacros != null) {
    macro=decleardMacros.get(name);
    if (macro != null) {
      return macro;
    }
  }
  if (loadedTemplates != null) {
    for (    JetTemplate template : loadedTemplates) {
      macro=template.resolveMacro(name,argumentTypes);
      if (macro != null) {
        return macro;
      }
    }
  }
  if (globalResolver != null) {
    return globalResolver.resolveMacro(name,argumentTypes);
  }
  return null;
}

Fixed version (ground truth):
public JetTemplateMacro resolve(String name,Class<?>[] argumentTypes){
  JetTemplateMacro macro;
  if (decleardMacros != null) {
    macro=decleardMacros.get(name);
    if (macro != null) {
      return macro;
    }
  }
  if (loadedTemplates != null) {
    for (    JetTemplate template : loadedTemplates) {
      macro=template.resolveMacro(name,argumentTypes,false);
      if (macro != null) {
        return macro;
      }
    }
  }
  return null;
}
Program: 56880
Project: 56880
Buggy source:
public static String macroGet(String name,Object... arguments){
  InterpretContext ctx=InterpretContext.current();
  Class<?>[] argumentTypes=ParameterUtils.getParameterTypes(arguments);
  JetTemplateMacro macro=ctx.getTemplate().resolveMacro(name,argumentTypes);
  if (macro == null) {
    throw new IllegalStateException(Errors.format(Errors.MACRO_NOT_FOUND,name));
  }
  JetWriter originWriter=ctx.getWriter();
  UnsafeCharArrayWriter out=new UnsafeCharArrayWriter(128);
  ctx.setWriter(JetWriter.create(out,originWriter.getCharset(),false,false));
  ctx.doMacroCall(macro,arguments);
  ctx.setWriter(originWriter);
  return out.toString();
}

Fixed version (ground truth):
public static String macroGet(String name,Object... arguments){
  InterpretContext ctx=InterpretContext.current();
  Class<?>[] argumentTypes=ParameterUtils.getParameterTypes(arguments);
  JetTemplateMacro macro=ctx.getTemplate().resolveMacro(name,argumentTypes,true);
  if (macro == null) {
    throw new IllegalStateException(Errors.format(Errors.MACRO_NOT_FOUND,name));
  }
  JetWriter originWriter=ctx.getWriter();
  UnsafeCharArrayWriter out=new UnsafeCharArrayWriter(128);
  ctx.setWriter(JetWriter.create(out,originWriter.getCharset(),false,false));
  ctx.doMacroCall(macro,arguments);
  ctx.setWriter(originWriter);
  return out.toString();
}
Program: 56881
Project: 56881
Buggy source:
protected void trimDirectiveWhitespaces(boolean trimLeft,boolean trimRight,boolean keepLeftNewLine){
  if (text == null || text.length() == 0) {
    return;
  }
  int len=text.length();
  int lpos=0;
  boolean trimedNewLine=false;
  if (trimLeft) {
    for (int i=0; i < len; i++) {
      char c=text.charAt(i);
      if (c == ' ' || c == '\t') {
        continue;
      }
 else       if (c == '\r') {
        if (keepLeftNewLine) {
          lpos=i;
          break;
        }
 else {
          trimedNewLine=true;
          int n=i + 1;
          if (n < len && text.charAt(n) == '\n') {
            lpos=n;
          }
 else {
            lpos=i;
          }
          break;
        }
      }
 else       if (c == '\n') {
        if (keepLeftNewLine) {
          lpos=i;
        }
 else {
          trimedNewLine=true;
          lpos=i + 1;
        }
        break;
      }
 else {
        break;
      }
    }
  }
  int rpos=len;
  if (trimRight) {
    for (int i=len - 1; i >= 0; i--) {
      char c=text.charAt(i);
      if (c == ' ' || c == '\t') {
        continue;
      }
 else       if (c == '\n' || c == '\r') {
        rpos=i + 1;
        break;
      }
 else {
        break;
      }
    }
  }
  if (lpos < rpos) {
    text=text.substring(lpos,rpos);
  }
 else {
    text=null;
  }
  if (trimedNewLine) {
    lineStart++;
  }
}

Fixed version (ground truth):
protected void trimDirectiveWhitespaces(boolean trimLeft,boolean trimRight,boolean keepLeftNewLine){
  if (text == null || text.length() == 0) {
    return;
  }
  int len=text.length();
  int lpos=0;
  boolean trimedNewLine=false;
  if (trimLeft) {
    for (int i=0; i < len; i++) {
      char c=text.charAt(i);
      if (c == ' ' || c == '\t') {
        continue;
      }
 else       if (c == '\r') {
        if (keepLeftNewLine) {
          lpos=i;
          break;
        }
 else {
          trimedNewLine=true;
          int n=i + 1;
          if (n < len && text.charAt(n) == '\n') {
            lpos=n + 1;
          }
 else {
            lpos=n;
          }
          break;
        }
      }
 else       if (c == '\n') {
        if (keepLeftNewLine) {
          lpos=i;
        }
 else {
          trimedNewLine=true;
          lpos=i + 1;
        }
        break;
      }
 else {
        break;
      }
    }
  }
  int rpos=len;
  if (trimRight) {
    for (int i=len - 1; i >= 0; i--) {
      char c=text.charAt(i);
      if (c == ' ' || c == '\t') {
        continue;
      }
 else       if (c == '\n' || c == '\r') {
        rpos=i + 1;
        break;
      }
 else {
        break;
      }
    }
  }
  if (lpos < rpos) {
    text=text.substring(lpos,rpos);
  }
 else {
    text=null;
  }
  if (trimedNewLine) {
    lineStart++;
  }
}
Program: 56882
Project: 56882
Buggy source:
private static JetEngine doCreateWebEngine(ServletContext sc,Properties config,String configLocation){
  Properties options=new Properties();
  options.setProperty(JetConfig.IO_SKIPERRORS,"String_Node_Str");
  options.setProperty(JetConfig.TEMPLATE_LOADERS,ServletResourceLoader.class.getName());
  if (config != null) {
    options.putAll(config);
  }
  if (configLocation == null) {
    configLocation=sc.getInitParameter(CONFIG_LOCATION_PARAMETER);
    if (configLocation == null || configLocation.length() == 0) {
      configLocation=JetConfig.DEFAULT_CONFIG_FILE;
    }
  }
  JetEngine engine=JetEngine.create(options,configLocation);
  JetGlobalContext ctx=engine.getGlobalContext();
  ctx.define(javax.servlet.ServletContext.class,JetWebContext.APPLICATION);
  ctx.define(javax.servlet.http.HttpSession.class,JetWebContext.SESSION);
  ctx.define(javax.servlet.http.HttpServletRequest.class,JetWebContext.REQUEST);
  ctx.define(javax.servlet.http.HttpServletResponse.class,JetWebContext.RESPONSE);
  ctx.define(java.util.Map.class,JetWebContext.APPLICATION_SCOPE);
  ctx.define(java.util.Map.class,JetWebContext.SESSION_SCOPE);
  ctx.define(java.util.Map.class,JetWebContext.REQUEST_SCOPE);
  ctx.define(java.util.Map.class,JetWebContext.PARAMETER);
  ctx.define(java.util.Map.class,JetWebContext.PARAMETER_VALUES);
  ctx.set(JetWebContext.APPLICATION,sc);
  ctx.set(JetWebContext.APPLICATION_SCOPE,new ServletContextAttributeMap(sc));
  engine.getGlobalResolver().registerTags(JetWebTags.class);
  return engine;
}

Fixed version (ground truth):
private static JetEngine doCreateWebEngine(ServletContext sc,Properties config,String configLocation){
  Properties options=new Properties();
  options.setProperty(JetConfig.IO_SKIPERRORS,"String_Node_Str");
  options.setProperty(JetConfig.TEMPLATE_LOADERS,ServletResourceLoader.class.getName());
  if (config != null) {
    options.putAll(config);
  }
  if (configLocation == null) {
    configLocation=sc.getInitParameter(CONFIG_LOCATION_PARAMETER);
    if (configLocation == null || configLocation.length() == 0) {
      configLocation=JetConfig.DEFAULT_CONFIG_FILE;
    }
  }
  JetEngine engine=JetEngine.create(options,configLocation);
  JetGlobalContext ctx=engine.getGlobalContext();
  ctx.define(javax.servlet.ServletContext.class,JetWebContext.APPLICATION);
  ctx.define(javax.servlet.http.HttpSession.class,JetWebContext.SESSION);
  ctx.define(javax.servlet.http.HttpServletRequest.class,JetWebContext.REQUEST);
  ctx.define(javax.servlet.http.HttpServletResponse.class,JetWebContext.RESPONSE);
  ctx.define(java.util.Map.class,JetWebContext.APPLICATION_SCOPE);
  ctx.define(java.util.Map.class,JetWebContext.SESSION_SCOPE);
  ctx.define(java.util.Map.class,JetWebContext.REQUEST_SCOPE);
  ctx.define(java.util.Map.class,JetWebContext.PARAM);
  ctx.define(java.util.Map.class,JetWebContext.PARAM_VALUES);
  ctx.set(JetWebContext.APPLICATION,sc);
  ctx.set(JetWebContext.APPLICATION_SCOPE,new ServletContextAttributeMap(sc));
  engine.getGlobalResolver().registerTags(JetWebTags.class);
  return engine;
}
Program: 56883
Project: 56883
Buggy source:
private void doInvoke(InterpretContext ctx,TagInvoker invoker,Object[] arguments) throws InterpretException {
  boolean useLatest=(invoker != null);
  if (invoker == null) {
    Class<?>[] argumentTypes=ParameterUtils.getParameterTypes(arguments);
    invoker=ctx.getGlobalResolver().resolveTag(name,argumentTypes);
    if (invoker == null) {
      String signature=SignatureUtils.getFunctionSignature(name,argumentTypes);
      throw new InterpretException(Errors.TAG_NOT_FOUND,signature).set(position);
    }
    this.last=invoker;
  }
  try {
    invoker.invoke(tagContext,arguments);
  }
 catch (  RuntimeException e) {
    if (useLatest && Errors.isReflectIllegalArgument(e)) {
      doInvoke(ctx,null,arguments);
    }
    throw new InterpretException(e).set(position);
  }
}

Fixed version (ground truth):
private void doInvoke(InterpretContext ctx,TagInvoker invoker,Object[] arguments) throws InterpretException {
  boolean useLatest=(invoker != null);
  if (invoker == null) {
    Class<?>[] argumentTypes=ParameterUtils.getParameterTypes(arguments);
    invoker=ctx.getGlobalResolver().resolveTag(name,argumentTypes);
    if (invoker == null) {
      String signature=SignatureUtils.getFunctionSignature(name,argumentTypes);
      throw new InterpretException(Errors.TAG_NOT_FOUND,signature).set(position);
    }
    this.last=invoker;
  }
  try {
    invoker.invoke(tagContext,arguments);
  }
 catch (  InterpretException e) {
    throw e;
  }
catch (  RuntimeException e) {
    if (useLatest && Errors.isReflectIllegalArgument(e)) {
      doInvoke(ctx,null,arguments);
    }
    throw new InterpretException(e).set(position);
  }
}
Program: 56884
Project: 56884
Buggy source:
private Object doInvoke(InterpretContext ctx,FunctionInvoker fn,Object[] arguments) throws InterpretException {
  boolean useLatest=(fn != null);
  if (fn == null) {
    Class<?>[] argumentTypes=ParameterUtils.getParameterTypes(arguments);
    fn=resolveFunction(ctx,argumentTypes);
    if (fn == null) {
      String signature=SignatureUtils.getFunctionSignature(name,argumentTypes);
      throw new InterpretException(Errors.FUNCTION_NOT_FOUND,signature).set(position);
    }
    this.last=fn;
  }
  try {
    return fn.invoke(arguments);
  }
 catch (  RuntimeException e) {
    if (useLatest && Errors.isReflectIllegalArgument(e)) {
      return doInvoke(ctx,null,arguments);
    }
    throw new InterpretException(Errors.FUNCTION_INVOKE_ERROR).cause(e).set(position);
  }
}

Fixed version (ground truth):
private Object doInvoke(InterpretContext ctx,FunctionInvoker fn,Object[] arguments) throws InterpretException {
  boolean useLatest=(fn != null);
  if (fn == null) {
    Class<?>[] argumentTypes=ParameterUtils.getParameterTypes(arguments);
    fn=resolveFunction(ctx,argumentTypes);
    if (fn == null) {
      String signature=SignatureUtils.getFunctionSignature(name,argumentTypes);
      throw new InterpretException(Errors.FUNCTION_NOT_FOUND,signature).set(position);
    }
    this.last=fn;
  }
  try {
    return fn.invoke(arguments);
  }
 catch (  InterpretException e) {
    throw e;
  }
catch (  RuntimeException e) {
    if (useLatest && Errors.isReflectIllegalArgument(e)) {
      return doInvoke(ctx,null,arguments);
    }
    throw new InterpretException(Errors.FUNCTION_INVOKE_ERROR).cause(e).set(position);
  }
}
Program: 56885
Project: 56885
Buggy source:
private Object doInvoke(InterpretContext ctx,MethodInvoker invoker,Object object,Object[] arguments) throws InterpretException {
  boolean useLatest=(invoker != null);
  if (invoker == null) {
    Class<?> objectClass=objectExpression.getResultType(ctx.getValueStack(),object);
    Class<?>[] argumentTypes=ParameterUtils.getParameterTypes(arguments);
    invoker=ctx.getGlobalResolver().resolveMethod(objectClass,name,argumentTypes,false);
    if (invoker == null) {
      String signature=SignatureUtils.getMethodSignature(objectClass,name,argumentTypes);
      throw new InterpretException(Errors.METHOD_NOT_FOUND,signature).set(position);
    }
    this.last=invoker;
  }
  try {
    Object result=invoker.invoke(object,arguments);
    if (result != null) {
      return result;
    }
 else {
      return (invoker.isVoidResult()) ? ALU.VOID : null;
    }
  }
 catch (  RuntimeException e) {
    if (useLatest && Errors.isReflectIllegalArgument(e)) {
      return doInvoke(ctx,null,object,arguments);
    }
    throw new InterpretException(Errors.METHOD_INVOKE_ERROR).cause(e).set(position);
  }
}

Fixed version (ground truth):
private Object doInvoke(InterpretContext ctx,MethodInvoker invoker,Object object,Object[] arguments) throws InterpretException {
  boolean useLatest=(invoker != null);
  if (invoker == null) {
    Class<?> objectClass=objectExpression.getResultType(ctx.getValueStack(),object);
    Class<?>[] argumentTypes=ParameterUtils.getParameterTypes(arguments);
    invoker=ctx.getGlobalResolver().resolveMethod(objectClass,name,argumentTypes,false);
    if (invoker == null) {
      String signature=SignatureUtils.getMethodSignature(objectClass,name,argumentTypes);
      throw new InterpretException(Errors.METHOD_NOT_FOUND,signature).set(position);
    }
    this.last=invoker;
  }
  try {
    Object result=invoker.invoke(object,arguments);
    if (result != null) {
      return result;
    }
 else {
      return (invoker.isVoidResult()) ? ALU.VOID : null;
    }
  }
 catch (  InterpretException e) {
    throw e;
  }
catch (  RuntimeException e) {
    if (useLatest && Errors.isReflectIllegalArgument(e)) {
      return doInvoke(ctx,null,object,arguments);
    }
    throw new InterpretException(Errors.METHOD_INVOKE_ERROR).cause(e).set(position);
  }
}
Program: 56886
Project: 56886
Buggy source:
@Override public void execute(InterpretContext ctx) throws InterpretException {
  Object[] arguments;
  if (argumentList == null) {
    arguments=ArrayUtils.EMPTY_OBJECT_ARRAY;
  }
 else {
    arguments=argumentList.execute(ctx);
  }
  JetTemplateMacro macro=last;
  if (macro == null) {
    Class<?>[] argumentTypes=ParameterUtils.getParameterTypes(arguments);
    macro=ctx.getTemplate().resolveMacro(name,argumentTypes);
    if (macro == null) {
      throw new IllegalStateException(Errors.format(Errors.MACRO_NOT_FOUND,name));
    }
    this.last=macro;
  }
  ctx.doMacroCall(macro,arguments);
}

Fixed version (ground truth):
@Override public void execute(InterpretContext ctx) throws InterpretException {
  Object[] arguments;
  if (argumentList == null) {
    arguments=ArrayUtils.EMPTY_OBJECT_ARRAY;
  }
 else {
    arguments=argumentList.execute(ctx);
  }
  JetTemplateMacro macro=last;
  if (macro == null) {
    Class<?>[] argumentTypes=ParameterUtils.getParameterTypes(arguments);
    macro=ctx.getTemplate().resolveMacro(name,argumentTypes);
    if (macro == null) {
      throw new InterpretException(Errors.MACRO_NOT_FOUND,name).set(position);
    }
    this.last=macro;
  }
  ctx.doMacroCall(macro,arguments);
}
Program: 56887
Project: 56887
Buggy source:
@Override public void execute(InterpretContext ctx) throws InterpretException {
  Object result=expression.execute(ctx);
  JetForIterator it=new JetForIterator(result);
  if (it.getSize() > 0) {
    ValueStack valueStack=ctx.getValueStack();
    Object old=valueStack.getValue(Symbols.FOR);
    valueStack.setLocal(Symbols.FOR,it);
    while (it.hasNext()) {
      Object item=it.next();
      try {
        valueStack.setLocal(identifier,item);
      }
 catch (      IllegalStateException e) {
        throw new InterpretException(Errors.FOR_ITERATOR_ERROR,it.getIndex()).cause(e).set(expression.getPosition());
      }
      statements.execute(ctx);
      int signal=ctx.getSignal();
      if (signal != InterpretContext.SIGNAL_NONE) {
        if (signal == InterpretContext.SIGNAL_BREAK) {
          ctx.setSignal(InterpretContext.SIGNAL_NONE);
          break;
        }
 else         if (signal == InterpretContext.SIGNAL_CONTINUE) {
          ctx.setSignal(InterpretContext.SIGNAL_NONE);
          continue;
        }
 else {
          return;
        }
      }
    }
    valueStack.setLocal(Symbols.FOR,old);
  }
 else   if (elseStatements != null) {
    elseStatements.execute(ctx);
  }
}

Fixed version (ground truth):
@Override public void execute(InterpretContext ctx) throws InterpretException {
  Object result=expression.execute(ctx);
  JetForIterator it=new JetForIterator(result);
  if (it.getSize() > 0) {
    ValueStack valueStack=ctx.getValueStack();
    Object outsideIdentifier=valueStack.getValue(identifier);
    Object outsideFor=valueStack.getValue(Symbols.FOR);
    valueStack.setLocal(Symbols.FOR,it);
    while (it.hasNext()) {
      Object item=it.next();
      try {
        valueStack.setLocal(identifier,item);
      }
 catch (      IllegalStateException e) {
        throw new InterpretException(Errors.FOR_ITERATOR_ERROR,it.getIndex()).cause(e).set(expression.getPosition());
      }
      statements.execute(ctx);
      int signal=ctx.getSignal();
      if (signal != InterpretContext.SIGNAL_NONE) {
        if (signal == InterpretContext.SIGNAL_BREAK) {
          ctx.setSignal(InterpretContext.SIGNAL_NONE);
          break;
        }
 else         if (signal == InterpretContext.SIGNAL_CONTINUE) {
          ctx.setSignal(InterpretContext.SIGNAL_NONE);
          continue;
        }
 else {
          return;
        }
      }
    }
    valueStack.setLocal(Symbols.FOR,outsideFor);
    valueStack.setLocal(identifier,outsideIdentifier);
  }
 else   if (elseStatements != null) {
    elseStatements.execute(ctx);
  }
}
Program: 56888
Project: 56888
Buggy source:
public void defineSymbol(String name,Class<?> type,boolean allowSameRedefine) throws IllegalStateException {
  if (type == null && strict) {
    throw new IllegalStateException(Errors.format(Errors.PARAM_TYPE_MISSING,name));
  }
  if (currentSymbols.containsKey(name)) {
    Class<?> old=currentSymbols.get(name);
    if (allowSameRedefine && type == old) {
      return;
    }
    throw new IllegalStateException(Errors.format(Errors.VAR_TYPE_REDEFINE,name));
  }
  currentSymbols.put(name,type);
}

Fixed version (ground truth):
public void defineSymbol(String name,Class<?> type,boolean allowSameRedefine) throws IllegalStateException {
  if (type == null && strict) {
    throw new IllegalStateException(Errors.format(Errors.PARAM_TYPE_MISSING,name));
  }
  if (currentSymbols.containsKey(name)) {
    Class<?> old=currentSymbols.get(name);
    if (allowSameRedefine && type == old) {
      return;
    }
    if (old == null) {
      throw new IllegalStateException(Errors.format(Errors.VAR_TYPE_DEFAINE_AFTER_USE,name));
    }
 else {
      throw new IllegalStateException(Errors.format(Errors.VAR_TYPE_REDEFINE,name));
    }
  }
  currentSymbols.put(name,type);
}
Program: 56889
Project: 56889
Buggy source:
private void doInvoke(InterpretContext ctx,TagInvoker invoker,Object[] arguments) throws InterpretException {
  boolean useLatest=(invoker != null);
  if (invoker == null) {
    Class<?>[] argumentTypes=ParameterUtils.getParameterTypes(arguments);
    invoker=ctx.getGlobalResolver().resolveTag(name,argumentTypes);
    if (invoker == null) {
      String signature=SignatureUtils.getFunctionSignature(name,argumentTypes);
      throw new InterpretException(Errors.TAG_NOT_FOUND,signature).set(position);
    }
    this.last=invoker;
  }
  try {
    invoker.invoke(tagContext,arguments);
  }
 catch (  IllegalArgumentException e) {
    if (useLatest && Errors.isReflectArgumentNotMatch(e)) {
      doInvoke(ctx,null,arguments);
    }
    throw new InterpretException(e).set(position);
  }
}

Fixed version (ground truth):
private void doInvoke(InterpretContext ctx,TagInvoker invoker,Object[] arguments) throws InterpretException {
  boolean useLatest=(invoker != null);
  if (invoker == null) {
    Class<?>[] argumentTypes=ParameterUtils.getParameterTypes(arguments);
    invoker=ctx.getGlobalResolver().resolveTag(name,argumentTypes);
    if (invoker == null) {
      String signature=SignatureUtils.getFunctionSignature(name,argumentTypes);
      throw new InterpretException(Errors.TAG_NOT_FOUND,signature).set(position);
    }
    this.last=invoker;
  }
  try {
    invoker.invoke(tagContext,arguments);
  }
 catch (  RuntimeException e) {
    if (useLatest && Errors.isReflectIllegalArgument(e)) {
      doInvoke(ctx,null,arguments);
    }
    throw new InterpretException(e).set(position);
  }
}
Program: 56890
Project: 56890
Buggy source:
private Object doInvokeGetter(InterpretContext ctx,Getter getter,Object object) throws InterpretException {
  boolean useLatest=(getter != null);
  if (getter == null) {
    Class<?> objectClass=objectExpression.getResultType(ctx.getValueStack(),object);
    getter=ctx.getGlobalResolver().resolveGetter(objectClass,name);
    if (getter == null) {
      String signature=SignatureUtils.getFieldSignature(objectClass,name);
      throw new InterpretException(Errors.PROPERTY_NOT_FOUND,signature).set(position);
    }
    this.last=getter;
  }
  try {
    return getter.get(object);
  }
 catch (  IllegalArgumentException e) {
    if (useLatest && Errors.isReflectArgumentNotMatch(e)) {
      return doInvokeGetter(ctx,null,object);
    }
    throw new InterpretException(Errors.PROPERTY_GET_ERROR).cause(e).set(position);
  }
}

Fixed version (ground truth):
private Object doInvokeGetter(InterpretContext ctx,Getter getter,Object object) throws InterpretException {
  boolean useLatest=(getter != null);
  if (getter == null) {
    Class<?> objectClass=objectExpression.getResultType(ctx.getValueStack(),object);
    getter=ctx.getGlobalResolver().resolveGetter(objectClass,name);
    if (getter == null) {
      String signature=SignatureUtils.getFieldSignature(objectClass,name);
      throw new InterpretException(Errors.PROPERTY_NOT_FOUND,signature).set(position);
    }
    this.last=getter;
  }
  try {
    return getter.get(object);
  }
 catch (  RuntimeException e) {
    if (useLatest && Errors.isReflectIllegalArgument(e)) {
      return doInvokeGetter(ctx,null,object);
    }
    throw new InterpretException(Errors.PROPERTY_GET_ERROR).cause(e).set(position);
  }
}
Program: 56891
Project: 56891
Buggy source:
private Object doInvoke(InterpretContext ctx,FunctionInvoker fn,Object[] arguments) throws InterpretException {
  boolean useLatest=(fn != null);
  if (fn == null) {
    Class<?>[] argumentTypes=ParameterUtils.getParameterTypes(arguments);
    fn=resolveFunction(ctx,argumentTypes);
    if (fn == null) {
      String signature=SignatureUtils.getFunctionSignature(name,argumentTypes);
      throw new InterpretException(Errors.FUNCTION_NOT_FOUND,signature).set(position);
    }
    this.last=fn;
  }
  try {
    return fn.invoke(arguments);
  }
 catch (  IllegalArgumentException e) {
    if (useLatest && Errors.isReflectArgumentNotMatch(e)) {
      return doInvoke(ctx,null,arguments);
    }
    throw new InterpretException(Errors.FUNCTION_INVOKE_ERROR).cause(e).set(position);
  }
}

Fixed version (ground truth):
private Object doInvoke(InterpretContext ctx,FunctionInvoker fn,Object[] arguments) throws InterpretException {
  boolean useLatest=(fn != null);
  if (fn == null) {
    Class<?>[] argumentTypes=ParameterUtils.getParameterTypes(arguments);
    fn=resolveFunction(ctx,argumentTypes);
    if (fn == null) {
      String signature=SignatureUtils.getFunctionSignature(name,argumentTypes);
      throw new InterpretException(Errors.FUNCTION_NOT_FOUND,signature).set(position);
    }
    this.last=fn;
  }
  try {
    return fn.invoke(arguments);
  }
 catch (  RuntimeException e) {
    if (useLatest && Errors.isReflectIllegalArgument(e)) {
      return doInvoke(ctx,null,arguments);
    }
    throw new InterpretException(Errors.FUNCTION_INVOKE_ERROR).cause(e).set(position);
  }
}
Program: 56892
Project: 56892
Buggy source:
private Object doInvoke(InterpretContext ctx,MethodInvoker invoker,Object object,Object[] arguments) throws InterpretException {
  boolean useLatest=(invoker != null);
  if (invoker == null) {
    Class<?> objectClass=objectExpression.getResultType(ctx.getValueStack(),object);
    Class<?>[] argumentTypes=ParameterUtils.getParameterTypes(arguments);
    invoker=ctx.getGlobalResolver().resolveMethod(objectClass,name,argumentTypes,false);
    if (invoker == null) {
      String signature=SignatureUtils.getMethodSignature(objectClass,name,argumentTypes);
      throw new InterpretException(Errors.METHOD_NOT_FOUND,signature).set(position);
    }
    this.last=invoker;
  }
  try {
    Object result=invoker.invoke(object,arguments);
    if (result != null) {
      return result;
    }
 else {
      return (invoker.isVoidResult()) ? ALU.VOID : null;
    }
  }
 catch (  IllegalArgumentException e) {
    if (useLatest && Errors.isReflectArgumentNotMatch(e)) {
      return doInvoke(ctx,null,object,arguments);
    }
    throw new InterpretException(Errors.METHOD_INVOKE_ERROR).cause(e).set(position);
  }
}

Fixed version (ground truth):
private Object doInvoke(InterpretContext ctx,MethodInvoker invoker,Object object,Object[] arguments) throws InterpretException {
  boolean useLatest=(invoker != null);
  if (invoker == null) {
    Class<?> objectClass=objectExpression.getResultType(ctx.getValueStack(),object);
    Class<?>[] argumentTypes=ParameterUtils.getParameterTypes(arguments);
    invoker=ctx.getGlobalResolver().resolveMethod(objectClass,name,argumentTypes,false);
    if (invoker == null) {
      String signature=SignatureUtils.getMethodSignature(objectClass,name,argumentTypes);
      throw new InterpretException(Errors.METHOD_NOT_FOUND,signature).set(position);
    }
    this.last=invoker;
  }
  try {
    Object result=invoker.invoke(object,arguments);
    if (result != null) {
      return result;
    }
 else {
      return (invoker.isVoidResult()) ? ALU.VOID : null;
    }
  }
 catch (  RuntimeException e) {
    if (useLatest && Errors.isReflectIllegalArgument(e)) {
      return doInvoke(ctx,null,object,arguments);
    }
    throw new InterpretException(Errors.METHOD_INVOKE_ERROR).cause(e).set(position);
  }
}
Program: 56893
Project: 56893
Buggy source:
private Object doInvoke(InterpretContext ctx,MethodInvoker invoker,Object[] arguments) throws InterpretException {
  boolean useLatest=(invoker != null);
  if (invoker == null) {
    Class<?>[] argumentTypes=ParameterUtils.getParameterTypes(arguments);
    invoker=ctx.getGlobalResolver().resolveMethod(cls,name,argumentTypes,true);
    if (invoker == null) {
      String signature=SignatureUtils.getMethodSignature(cls,name,argumentTypes);
      throw new InterpretException(Errors.METHOD_STATIC_NOT_FOUND,signature).set(position);
    }
    this.last=invoker;
  }
  try {
    Object result=invoker.invoke(null,arguments);
    if (result != null) {
      return result;
    }
 else {
      return (invoker.isVoidResult()) ? ALU.VOID : null;
    }
  }
 catch (  IllegalArgumentException e) {
    if (useLatest && Errors.isReflectArgumentNotMatch(e)) {
      return doInvoke(ctx,null,arguments);
    }
    throw new InterpretException(Errors.STATIC_METHOD_INVOKE_ERROR).cause(e).set(position);
  }
}

Fixed version (ground truth):
private Object doInvoke(InterpretContext ctx,MethodInvoker invoker,Object[] arguments) throws InterpretException {
  boolean useLatest=(invoker != null);
  if (invoker == null) {
    Class<?>[] argumentTypes=ParameterUtils.getParameterTypes(arguments);
    invoker=ctx.getGlobalResolver().resolveMethod(cls,name,argumentTypes,true);
    if (invoker == null) {
      String signature=SignatureUtils.getMethodSignature(cls,name,argumentTypes);
      throw new InterpretException(Errors.METHOD_STATIC_NOT_FOUND,signature).set(position);
    }
    this.last=invoker;
  }
  try {
    Object result=invoker.invoke(null,arguments);
    if (result != null) {
      return result;
    }
 else {
      return (invoker.isVoidResult()) ? ALU.VOID : null;
    }
  }
 catch (  RuntimeException e) {
    if (useLatest && Errors.isReflectIllegalArgument(e)) {
      return doInvoke(ctx,null,arguments);
    }
    throw new InterpretException(Errors.STATIC_METHOD_INVOKE_ERROR).cause(e).set(position);
  }
}
Program: 56894
Project: 56894
Buggy source:
@Override public Object getConvertedValue(FacesContext fc,UIComponent c,Object sval) throws ConverterException {
  Converter cnv=resolveConverter(fc,c);
  if (cnv != null) {
    return cnv.getAsObject(fc,c,(String)sval);
  }
 else {
    cnv=new DoubleConverter();
    return cnv.getAsObject(fc,c,(String)sval);
  }
}

Fixed version (ground truth):
@Override public Object getConvertedValue(FacesContext fc,UIComponent c,Object sval) throws ConverterException {
  Converter cnv=resolveConverter(fc,c,sval);
  if (cnv != null) {
    return cnv.getAsObject(fc,c,(String)sval);
  }
 else {
    cnv=new DoubleConverter();
    return cnv.getAsObject(fc,c,(String)sval);
  }
}
Program: 56895
Project: 56895
Buggy source:
protected Converter resolveConverter(FacesContext context,UIComponent c){
  if (!(c instanceof ValueHolder)) {
    return null;
  }
  Converter cnv=((ValueHolder)c).getConverter();
  if (cnv != null) {
    return cnv;
  }
 else {
    ValueExpression ve=c.getValueExpression("String_Node_Str");
    if (ve != null) {
      Class<?> valType=ve.getType(context.getELContext());
      if (valType != null && (!valType.isPrimitive())) {
        return context.getApplication().createConverter(valType);
      }
    }
    return null;
  }
}

Fixed version (ground truth):
protected Converter resolveConverter(FacesContext context,UIComponent c,Object value){
  if (!(c instanceof ValueHolder)) {
    return null;
  }
  Converter cnv=((ValueHolder)c).getConverter();
  if (cnv != null) {
    return cnv;
  }
 else {
    ValueExpression ve=c.getValueExpression("String_Node_Str");
    if (ve != null) {
      Class<?> valType=ve.getType(context.getELContext());
      if (valType != null && (!valType.isPrimitive())) {
        return context.getApplication().createConverter(valType);
      }
 else       if (valType != null && (value instanceof String)) {
        return context.getApplication().createConverter(valType);
      }
    }
    return null;
  }
}
Program: 56896
Project: 56896
Buggy source:
/** 
 * This method is called by the JSF framework to get the type-safe value of the attribute. Do not delete this method.
 */
@Override public Object getConvertedValue(FacesContext fc,UIComponent c,Object sval) throws ConverterException {
  Converter cnv=resolveConverter(fc,c);
  if (cnv != null) {
    if (sval == null || sval instanceof String) {
      return cnv.getAsObject(fc,c,(String)sval);
    }
 else {
      return cnv.getAsObject(fc,c,String.valueOf(sval));
    }
  }
 else {
    return sval;
  }
}

Fixed version (ground truth):
/** 
 * This method is called by the JSF framework to get the type-safe value of the attribute. Do not delete this method.
 */
@Override public Object getConvertedValue(FacesContext fc,UIComponent c,Object sval) throws ConverterException {
  Converter cnv=resolveConverter(fc,c,sval);
  if (cnv != null) {
    if (sval == null || sval instanceof String) {
      return cnv.getAsObject(fc,c,(String)sval);
    }
 else {
      return cnv.getAsObject(fc,c,String.valueOf(sval));
    }
  }
 else {
    return sval;
  }
}
Program: 56899
Project: 56899
Buggy source:
/** 
 * This methods generates the HTML code of the current b:breadcrumbs. <code>encodeBegin</code> generates the start of the component. After the, the JSF framework calls <code>encodeChildren()</code> to generate the HTML code between the beginning and the end of the component. For instance, in the case of a panel component the content of the panel is generated by <code>encodeChildren()</code>. After that, <code>encodeEnd()</code> is called to generate the rest of the HTML code.
 * @param context the FacesContext.
 * @param component the current b:breadcrumbs.
 * @throws IOException thrown if something goes wrong when writing the HTML code.
 */
@Override public void encodeEnd(FacesContext context,UIComponent component) throws IOException {
}

Fixed version (ground truth):
/** 
 * This methods generates the HTML code of the current b:breadcrumbs. <code>encodeBegin</code> generates the start of the component. After the, the JSF framework calls <code>encodeChildren()</code> to generate the HTML code between the beginning and the end of the component. For instance, in the case of a panel component the content of the panel is generated by <code>encodeChildren()</code>. After that, <code>encodeEnd()</code> is called to generate the rest of the HTML code.
 * @param context the FacesContext.
 * @param component the current b:breadcrumbs.
 * @throws IOException thrown if something goes wrong when writing the HTML code.
 */
@Override public void encodeEnd(FacesContext context,UIComponent component) throws IOException {
  if (!component.isRendered()) {
    return;
  }
  ResponseWriter rw=context.getResponseWriter();
  rw.endElement("String_Node_Str");
  Tooltip.activateTooltips(context,component);
}
Program: 56902
Project: 56902
Buggy source:
@Override public void encodeBegin(FacesContext context,UIComponent component) throws IOException {
  if (!component.isRendered()) {
    return;
  }
  FormGroup formGroup=(FormGroup)component;
  ResponseWriter rw=context.getResponseWriter();
  String clientId=formGroup.getClientId();
  rw.startElement("String_Node_Str",formGroup);
  Tooltip.generateTooltip(context,formGroup,rw);
  String dir=formGroup.getDir();
  if (null != dir) {
    rw.writeAttribute("String_Node_Str",dir,"String_Node_Str");
  }
  String s="String_Node_Str";
  String sclass=formGroup.getStyleClass();
  if (sclass != null) {
    s+="String_Node_Str" + sclass;
  }
  rw.writeAttribute("String_Node_Str",clientId,"String_Node_Str");
  String style=formGroup.getStyle();
  if (style != null) {
    rw.writeAttribute("String_Node_Str",style,"String_Node_Str");
  }
  rw.writeAttribute("String_Node_Str",s,"String_Node_Str");
  Tooltip.activateTooltips(context,formGroup);
  beginDisabledFieldset(formGroup,rw);
}

Fixed version (ground truth):
@Override public void encodeBegin(FacesContext context,UIComponent component) throws IOException {
  if (!component.isRendered()) {
    return;
  }
  if (getSurroundingForm(component,true) == null || !isHorizontalForm(component)) {
    throw new FacesException("String_Node_Str" + FormGroup.COMPONENT_TYPE + "String_Node_Str"+ component.getClientId()+ "String_Node_Str"+ Form.COMPONENT_TYPE);
  }
  FormGroup formGroup=(FormGroup)component;
  ResponseWriter rw=context.getResponseWriter();
  String clientId=formGroup.getClientId();
  rw.startElement("String_Node_Str",formGroup);
  Tooltip.generateTooltip(context,formGroup,rw);
  String dir=formGroup.getDir();
  if (null != dir) {
    rw.writeAttribute("String_Node_Str",dir,"String_Node_Str");
  }
  String s="String_Node_Str";
  String sclass=formGroup.getStyleClass();
  if (sclass != null) {
    s+="String_Node_Str" + sclass;
  }
  rw.writeAttribute("String_Node_Str",clientId,"String_Node_Str");
  String style=formGroup.getStyle();
  if (style != null) {
    rw.writeAttribute("String_Node_Str",style,"String_Node_Str");
  }
  rw.writeAttribute("String_Node_Str",s,"String_Node_Str");
  Tooltip.activateTooltips(context,formGroup);
  beginDisabledFieldset(formGroup,rw);
}