Program: 34798
Project: 34798
Buggy source:
/** 
 * @param webRequest
 * @return
 */
protected AuthenticationResult handleJaspi(WebRequest webRequest,HashMap<String,Object> props){
  AuthenticationResult authResult=JASPI_CONT;
  if (webAuthenticatorRef != null) {
    WebAuthenticator jaspiAuthenticator=webAuthenticatorRef.getService("String_Node_Str");
    if (jaspiAuthenticator != null) {
      if (props == null) {
        authResult=handleSSO(webRequest,null);
        if (authResult.getStatus() == AuthResult.CONTINUE) {
          authResult=handleSSO(webRequest,"String_Node_Str");
          if (authResult.getStatus() == AuthResult.SUCCESS) {
            Map<String,Object> requestProps=new HashMap<String,Object>();
            requestProps.put("String_Node_Str",authResult.getSubject());
            webRequest.setProperties(requestProps);
          }
          authResult=jaspiAuthenticator.authenticate(webRequest);
          if (authResult.getStatus() != AuthResult.CONTINUE) {
            String authHeader=webRequest.getHttpServletRequest().getHeader("String_Node_Str");
            if (authHeader != null && authHeader.startsWith("String_Node_Str")) {
              String basicAuthHeader=decodeCookieString(authHeader.substring(6));
              int index=basicAuthHeader.indexOf(':');
              String uid=basicAuthHeader.substring(0,index);
              authResult.setAuditCredValue(uid);
            }
            authResult.setAuditCredType(AuditEvent.CRED_TYPE_JASPIC);
          }
        }
      }
 else {
        try {
          authResult=jaspiAuthenticator.authenticate(webRequest.getHttpServletRequest(),webRequest.getHttpServletResponse(),props);
          if (authResult.getStatus() != AuthResult.CONTINUE) {
            String authHeader=webRequest.getHttpServletRequest().getHeader("String_Node_Str");
            if (authHeader != null && authHeader.startsWith("String_Node_Str")) {
              String basicAuthHeader=decodeCookieString(authHeader.substring(6));
              int index=basicAuthHeader.indexOf(':');
              String uid=basicAuthHeader.substring(0,index);
              authResult.setAuditCredValue(uid);
            }
            authResult.setAuditCredType(AuditEvent.CRED_TYPE_JASPIC);
          }
        }
 catch (        Exception e) {
          if (tc.isDebugEnabled()) {
            Tr.debug(tc,"String_Node_Str",e);
          }
        }
      }
      if (authResult.getStatus() == AuthResult.SUCCESS) {
        boolean registerSession=false;
        Map<String,Object> reqProps=webRequest.getProperties();
        if (reqProps != null) {
          registerSession=Boolean.valueOf((String)reqProps.get("String_Node_Str")).booleanValue();
        }
        if (registerSession) {
          SSOCookieHelper ssoCh=new SSOCookieHelperImpl(webAppSecurityConfig,"String_Node_Str");
          ssoCh.addSSOCookiesToResponse(authResult.getSubject(),webRequest.getHttpServletRequest(),webRequest.getHttpServletResponse());
        }
        SSOCookieHelper ssoCh=webAppSecurityConfig.createSSOCookieHelper();
        HttpServletResponse res=webRequest.getHttpServletResponse();
        if (!res.isCommitted()) {
          PostParameterHelper postParameterHelper=new PostParameterHelper(webAppSecurityConfig);
          postParameterHelper.restore(webRequest.getHttpServletRequest(),res);
        }
        if (props != null && props.get("String_Node_Str") != null && props.get("String_Node_Str").equals("String_Node_Str")) {
        }
 else {
          if (!res.isCommitted()) {
            ssoCh.removeSSOCookieFromResponse(res);
          }
        }
      }
    }
  }
  return authResult;
}

Fixed version (ground truth):
/** 
 * @param webRequest
 * @return
 */
protected AuthenticationResult handleJaspi(WebRequest webRequest,HashMap<String,Object> props){
  AuthenticationResult authResult=JASPI_CONT;
  if (webAuthenticatorRef != null) {
    WebAuthenticator jaspiAuthenticator=webAuthenticatorRef.getService("String_Node_Str");
    if (jaspiAuthenticator != null) {
      if (props == null) {
        authResult=handleSSO(webRequest,null);
        if (authResult.getStatus() == AuthResult.CONTINUE) {
          authResult=handleSSO(webRequest,"String_Node_Str");
          if (authResult.getStatus() == AuthResult.SUCCESS) {
            Map<String,Object> requestProps=new HashMap<String,Object>();
            requestProps.put("String_Node_Str",authResult.getSubject());
            webRequest.setProperties(requestProps);
          }
          authResult=jaspiAuthenticator.authenticate(webRequest);
          if (authResult.getStatus() != AuthResult.CONTINUE) {
            String authHeader=webRequest.getHttpServletRequest().getHeader("String_Node_Str");
            if (authHeader != null && authHeader.startsWith("String_Node_Str")) {
              String basicAuthHeader=decodeCookieString(authHeader.substring(6));
              int index=basicAuthHeader.indexOf(':');
              String uid=basicAuthHeader.substring(0,index);
              authResult.setAuditCredValue(uid);
            }
            authResult.setAuditCredType(AuditEvent.CRED_TYPE_JASPIC);
          }
        }
      }
 else {
        try {
          authResult=jaspiAuthenticator.authenticate(webRequest.getHttpServletRequest(),webRequest.getHttpServletResponse(),props);
          if (authResult.getStatus() != AuthResult.CONTINUE) {
            String authHeader=webRequest.getHttpServletRequest().getHeader("String_Node_Str");
            if (authHeader != null && authHeader.startsWith("String_Node_Str")) {
              String basicAuthHeader=decodeCookieString(authHeader.substring(6));
              int index=basicAuthHeader.indexOf(':');
              String uid=basicAuthHeader.substring(0,index);
              authResult.setAuditCredValue(uid);
            }
            authResult.setAuditCredType(AuditEvent.CRED_TYPE_JASPIC);
          }
        }
 catch (        Exception e) {
          if (tc.isDebugEnabled()) {
            Tr.debug(tc,"String_Node_Str",e);
          }
          authResult=new AuthenticationResult(AuthResult.FAILURE,e.getMessage());
        }
      }
      if (authResult.getStatus() == AuthResult.SUCCESS) {
        boolean registerSession=false;
        Map<String,Object> reqProps=webRequest.getProperties();
        if (reqProps != null) {
          registerSession=Boolean.valueOf((String)reqProps.get("String_Node_Str")).booleanValue();
        }
        if (registerSession) {
          SSOCookieHelper ssoCh=new SSOCookieHelperImpl(webAppSecurityConfig,"String_Node_Str");
          ssoCh.addSSOCookiesToResponse(authResult.getSubject(),webRequest.getHttpServletRequest(),webRequest.getHttpServletResponse());
        }
        SSOCookieHelper ssoCh=webAppSecurityConfig.createSSOCookieHelper();
        HttpServletResponse res=webRequest.getHttpServletResponse();
        if (!res.isCommitted()) {
          PostParameterHelper postParameterHelper=new PostParameterHelper(webAppSecurityConfig);
          postParameterHelper.restore(webRequest.getHttpServletRequest(),res);
        }
        if (props != null && props.get("String_Node_Str") != null && props.get("String_Node_Str").equals("String_Node_Str")) {
        }
 else {
          if (!res.isCommitted()) {
            ssoCh.removeSSOCookieFromResponse(res);
          }
        }
      }
    }
  }
  return authResult;
}