Program: 37508
Project: 37508
Buggy source:
@Override public void doFilter(ServletRequest arg0,ServletResponse arg1,FilterChain chain) throws IOException, ServletException {
  HttpServletRequest request=(HttpServletRequest)arg0;
  HttpServletResponse response=(HttpServletResponse)arg1;
  String tempPass=null;
  tempPass=request.getHeader("String_Node_Str");
  if (tempPass != null) {
    tempPass=tempPass.substring(6,tempPass.length());
    String tempPassdeCode="String_Node_Str";
    BASE64Decoder decoder=new BASE64Decoder();
    try {
      byte[] b=decoder.decodeBuffer(tempPass);
      tempPassdeCode=new String(b);
    }
 catch (    Exception e) {
      return;
    }
    String userReqId="String_Node_Str";
    String userReqPwd="String_Node_Str";
    userReqId=tempPassdeCode.substring(0,tempPassdeCode.indexOf("String_Node_Str"));
    userReqPwd=tempPassdeCode.substring(tempPassdeCode.indexOf("String_Node_Str") + 1);
    User user=null;
    user=idcService.IdentityCheckService(userReqId,userReqPwd);
    if (user.getUserType().equals(User.UserType.Anonymous)) {
      writeError401Response(response);
      chain.doFilter(request,response);
      return;
    }
 else {
      request.getSession().setAttribute("String_Node_Str",user.getUserId());
    }
  }
  HttpSession session=request.getSession();
  Principal principal=Principal.getAnonymousPrincipal();
  if (null != session) {
    Object userId=session.getAttribute("String_Node_Str");
    if (null != userId) {
      principal=new Principal((Long)userId);
    }
  }
  PrincipalHolder.setPrincipal(principal);
  chain.doFilter(request,response);
  PrincipalHolder.remove();
}

Fixed version (ground truth):
@Override public void doFilter(ServletRequest arg0,ServletResponse arg1,FilterChain chain) throws IOException, ServletException {
  HttpServletRequest request=(HttpServletRequest)arg0;
  HttpServletResponse response=(HttpServletResponse)arg1;
  String tempPass=null;
  tempPass=request.getHeader("String_Node_Str");
  if (tempPass != null) {
    tempPass=tempPass.substring(6,tempPass.length());
    String tempPassdeCode="String_Node_Str";
    BASE64Decoder decoder=new BASE64Decoder();
    try {
      byte[] b=decoder.decodeBuffer(tempPass);
      tempPassdeCode=new String(b);
    }
 catch (    Exception e) {
      return;
    }
    String userReqId="String_Node_Str";
    String userReqPwd="String_Node_Str";
    userReqId=tempPassdeCode.substring(0,tempPassdeCode.indexOf("String_Node_Str"));
    userReqPwd=tempPassdeCode.substring(tempPassdeCode.indexOf("String_Node_Str") + 1);
    User user=null;
    IdentityCheckService idcService=ServiceBeanUtil.getIdentityCheckService();
    user=idcService.IdentityCheckService(userReqId,userReqPwd);
    if (null == user) {
      request.getSession().removeAttribute("String_Node_Str");
      writeError401Response(response);
      return;
    }
 else {
      request.getSession().setAttribute("String_Node_Str",user.getUserId());
    }
  }
  HttpSession session=request.getSession();
  Principal principal=Principal.getAnonymousPrincipal();
  if (null != session) {
    Object userId=session.getAttribute("String_Node_Str");
    if (null != userId) {
      principal=new Principal((Long)userId);
    }
  }
  PrincipalHolder.setPrincipal(principal);
  chain.doFilter(request,response);
  PrincipalHolder.remove();
}