Program: 80764
Project: 80764
Buggy source:
public void invoke(ServletContext sc,HttpServletRequest req,HttpServletResponse resp,String[] pathArgs){
  try {
    req.setCharacterEncoding(inputCharset);
  }
 catch (  UnsupportedEncodingException e) {
    if (log.isWarnEnabled())     log.warn(getExceptionMessage(e),e);
    throw Lang.wrapThrow(e);
  }
  resp.setCharacterEncoding(outputCharset);
  if (null != filters)   for (  ActionFilter filter : filters) {
    View view=filter.match(req,method);
    if (null != view) {
      try {
        view.render(req,resp,null);
      }
 catch (      Throwable e) {
        if (log.isWarnEnabled())         log.warn(getExceptionMessage(e),e);
        throw Lang.wrapThrow(e);
      }
      return;
    }
  }
  RequestIocContext reqContext=null;
  try {
    Object[] args=adaptor.adapt(sc,req,resp,pathArgs);
    Object obj;
    if (null != module) {
      obj=module;
    }
 else {
      Ioc ioc=Mvcs.getIoc(sc);
      if (null == ioc)       throw Lang.makeThrow("String_Node_Str",moduleName);
      if (ioc instanceof Ioc2) {
        reqContext=new RequestIocContext(req);
        SessionIocContext sessionContext=new SessionIocContext(req.getSession());
        IocContext myContext=new ComboContext(reqContext,sessionContext);
        obj=((Ioc2)ioc).get(moduleType,moduleName,myContext);
      }
 else       obj=ioc.get(moduleType,moduleName);
    }
    Object re=method.invoke(obj,args);
    if (re instanceof View)     ((View)re).render(req,resp,null);
 else     ok.render(req,resp,re);
  }
 catch (  Throwable e) {
    if (e instanceof InvocationTargetException && e.getCause() != null)     e=e.getCause();
    if (log.isDebugEnabled())     log.debug(getExceptionMessage(e),e);
    try {
      fail.render(req,resp,e);
    }
 catch (    Throwable e1) {
      if (log.isWarnEnabled())       log.warn(getExceptionMessage(e1),e1);
      resp.reset();
      try {
        resp.getWriter().write(e1.getMessage());
        resp.flushBuffer();
      }
 catch (      IOException e2) {
        if (log.isWarnEnabled())         log.warn(getExceptionMessage(e2),e2);
        throw Lang.wrapThrow(e2);
      }
    }
  }
 finally {
    if (null != reqContext)     reqContext.depose();
  }
}

Fixed version (ground truth):
public void invoke(ServletContext sc,HttpServletRequest req,HttpServletResponse resp,String[] pathArgs){
  try {
    req.setCharacterEncoding(inputCharset);
  }
 catch (  UnsupportedEncodingException e) {
    if (log.isWarnEnabled())     log.warn(getExceptionMessage(e),e);
    throw Lang.wrapThrow(e);
  }
  resp.setCharacterEncoding(outputCharset);
  if (null != filters)   for (  ActionFilter filter : filters) {
    View view=filter.match(sc,req,method);
    if (null != view) {
      try {
        view.render(req,resp,null);
      }
 catch (      Throwable e) {
        if (log.isWarnEnabled())         log.warn(getExceptionMessage(e),e);
        throw Lang.wrapThrow(e);
      }
      return;
    }
  }
  RequestIocContext reqContext=null;
  try {
    Object[] args=adaptor.adapt(sc,req,resp,pathArgs);
    Object obj;
    if (null != module) {
      obj=module;
    }
 else {
      Ioc ioc=Mvcs.getIoc(sc);
      if (null == ioc)       throw Lang.makeThrow("String_Node_Str",moduleName);
      if (ioc instanceof Ioc2) {
        reqContext=new RequestIocContext(req);
        SessionIocContext sessionContext=new SessionIocContext(req.getSession());
        IocContext myContext=new ComboContext(reqContext,sessionContext);
        obj=((Ioc2)ioc).get(moduleType,moduleName,myContext);
      }
 else       obj=ioc.get(moduleType,moduleName);
    }
    Object re=method.invoke(obj,args);
    if (re instanceof View)     ((View)re).render(req,resp,null);
 else     ok.render(req,resp,re);
  }
 catch (  Throwable e) {
    if (e instanceof InvocationTargetException && e.getCause() != null)     e=e.getCause();
    if (log.isDebugEnabled())     log.debug(getExceptionMessage(e),e);
    try {
      fail.render(req,resp,e);
    }
 catch (    Throwable e1) {
      if (log.isWarnEnabled())       log.warn(getExceptionMessage(e1),e1);
      resp.reset();
      try {
        resp.getWriter().write(e1.getMessage());
        resp.flushBuffer();
      }
 catch (      IOException e2) {
        if (log.isWarnEnabled())         log.warn(getExceptionMessage(e2),e2);
        throw Lang.wrapThrow(e2);
      }
    }
  }
 finally {
    if (null != reqContext)     reqContext.depose();
  }
}