Program: 175665
Project: 175665
Buggy source:
/** 
 * Intercept unauthenticated requests for specific URLs and redirect to login page.
 * @see Filter#doFilter(ServletRequest,ServletResponse,FilterChain)
 */
@Override public void doFilter(ServletRequest req,ServletResponse res,FilterChain chain) throws IOException, ServletException {
  HttpServletRequest request=(HttpServletRequest)req;
  HttpServletResponse response=(HttpServletResponse)res;
  String target=request.getRequestURI();
  if (target.startsWith("String_Node_Str") || "String_Node_Str".equals(target)) {
    String loginType=request.getParameter("String_Node_Str");
    String queryString=request.getQueryString();
    if (queryString == null) {
      queryString="String_Node_Str";
    }
 else {
      queryString=queryString.replace("String_Node_Str" + loginType + "String_Node_Str","String_Node_Str");
      queryString=queryString.replace("String_Node_Str" + loginType,"String_Node_Str");
      queryString=queryString.replace("String_Node_Str" + loginType,"String_Node_Str");
      if (queryString.length() > 0) {
        queryString="String_Node_Str" + queryString;
      }
    }
    HttpSession session=request.getSession(false);
    if (session == null || session.getAttribute("String_Node_Str") == null || !"String_Node_Str".equals(session.getAttribute("String_Node_Str"))) {
      session=request.getSession(true);
      session.setAttribute("String_Node_Str",target);
      if (loginType == null) {
        response.sendRedirect(response.encodeRedirectURL("String_Node_Str" + queryString));
      }
 else       if ("String_Node_Str".equals(loginType)) {
        response.sendRedirect(response.encodeRedirectURL("String_Node_Str" + loginType + "String_Node_Str"+ queryString));
      }
 else {
        response.sendRedirect("String_Node_Str" + loginType + "String_Node_Str"+ queryString);
      }
    }
  }
  chain.doFilter(req,res);
}

Fixed version (ground truth):
/** 
 * Intercept unauthenticated requests for specific URLs and redirect to login page.
 * @see Filter#doFilter(ServletRequest,ServletResponse,FilterChain)
 */
@Override public void doFilter(ServletRequest req,ServletResponse res,FilterChain chain) throws IOException, ServletException {
  HttpServletRequest request=(HttpServletRequest)req;
  HttpServletResponse response=(HttpServletResponse)res;
  String target=request.getRequestURI();
  if (target.startsWith("String_Node_Str") || "String_Node_Str".equals(target) || "String_Node_Str".equals(target)) {
    String loginType=request.getParameter("String_Node_Str");
    String queryString=request.getQueryString();
    if (queryString == null) {
      queryString="String_Node_Str";
    }
 else {
      queryString=queryString.replace("String_Node_Str" + loginType + "String_Node_Str","String_Node_Str");
      queryString=queryString.replace("String_Node_Str" + loginType,"String_Node_Str");
      queryString=queryString.replace("String_Node_Str" + loginType,"String_Node_Str");
      if (queryString.length() > 0) {
        queryString="String_Node_Str" + queryString;
      }
    }
    HttpSession session=request.getSession(false);
    if (session == null || session.getAttribute("String_Node_Str") == null || !"String_Node_Str".equals(session.getAttribute("String_Node_Str"))) {
      session=request.getSession(true);
      session.setAttribute("String_Node_Str",target);
      if (loginType == null) {
        response.sendRedirect(response.encodeRedirectURL("String_Node_Str" + queryString));
      }
 else       if ("String_Node_Str".equals(loginType)) {
        response.sendRedirect(response.encodeRedirectURL("String_Node_Str" + loginType + "String_Node_Str"+ queryString));
      }
 else {
        response.sendRedirect("String_Node_Str" + loginType + "String_Node_Str"+ queryString);
      }
      return;
    }
  }
  chain.doFilter(req,res);
}