Program: 43584
Project: 43584
Buggy source:
public void invoke(HttpServletRequest req,HttpServletResponse resp,String[] pathArgs){
  try {
    req.setCharacterEncoding(inputCharset);
  }
 catch (  UnsupportedEncodingException e) {
    logException(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) {
        logException(e);
        throw Lang.wrapThrow(e);
      }
      return;
    }
  }
  RequestIocContext reqContext=null;
  try {
    Object[] args=adaptor.adapt(req,resp,pathArgs);
    Object obj;
    if (null != module) {
      obj=module;
    }
 else {
      Ioc ioc=Mvcs.getIoc(req);
      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,re);
 else     ok.render(req,resp,re);
  }
 catch (  Throwable e) {
    if (e instanceof InvocationTargetException && e.getCause() != null)     e=e.getCause();
    if (log.isDebugEnabled())     logException(e);
    try {
      fail.render(req,resp,e);
    }
 catch (    Throwable e1) {
      logException(e1);
      resp.reset();
      try {
        resp.getWriter().write(e1.getMessage());
        resp.flushBuffer();
      }
 catch (      IOException e2) {
        logException(e2);
        throw Lang.wrapThrow(e2);
      }
    }
  }
 finally {
    if (null != reqContext)     reqContext.depose();
  }
}

Fixed version (ground truth):
public void invoke(HttpServletRequest req,HttpServletResponse resp,String[] pathArgs){
  try {
    req.setCharacterEncoding(inputCharset);
  }
 catch (  UnsupportedEncodingException e) {
    logException(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) {
        logException(e);
        throw Lang.wrapThrow(e);
      }
      return;
    }
  }
  RequestIocContext reqContext=null;
  try {
    Object[] args=adaptor.adapt(req,resp,pathArgs);
    Object obj;
    if (null != module) {
      obj=module;
    }
 else {
      Ioc ioc=Mvcs.getIoc(req);
      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())     logException(e);
    try {
      fail.render(req,resp,e);
    }
 catch (    Throwable e1) {
      logException(e1);
      resp.reset();
      try {
        resp.getWriter().write(e1.getMessage());
        resp.flushBuffer();
      }
 catch (      IOException e2) {
        logException(e2);
        throw Lang.wrapThrow(e2);
      }
    }
  }
 finally {
    if (null != reqContext)     reqContext.depose();
  }
}