Program: 34795
Project: 34795
Buggy source:
protected AuthenticationResult mapToAuthenticationResult(AuthStatus status,JaspiRequest jaspiRequest,Subject clientSubject){
  if (tc.isEntryEnabled())   Tr.entry(tc,"String_Node_Str","String_Node_Str" + status);
  AuthenticationResult authResult=null;
  String pretty="String_Node_Str";
  if (AuthStatus.SUCCESS == status || AuthStatus.SEND_SUCCESS == status) {
    authResult=new AuthenticationResult(AuthResult.SUCCESS,clientSubject);
    pretty="String_Node_Str";
  }
 else   if (AuthStatus.SEND_CONTINUE == status) {
    int responseStatus=getResponseStatus(jaspiRequest.getHttpServletResponse());
    HttpServletRequest req=jaspiRequest.getHttpServletRequest();
switch (responseStatus) {
case HttpServletResponse.SC_UNAUTHORIZED:
      String realm=(String)jaspiRequest.getMessageInfo().getMap().get(AttributeNameConstants.WSCREDENTIAL_REALM);
    authResult=new AuthenticationResult(AuthResult.SEND_401,realm != null ? realm : (String)null);
  pretty="String_Node_Str";
break;
case HttpServletResponse.SC_MOVED_TEMPORARILY:
case HttpServletResponse.SC_SEE_OTHER:
case HttpServletResponse.SC_TEMPORARY_REDIRECT:
String loginURL=getLoginURL(jaspiRequest,req);
String query=req.getQueryString();
String originalURL=req.getRequestURL().append(query != null ? "String_Node_Str" + query : "String_Node_Str").toString();
authResult=new AuthenticationResult(AuthResult.REDIRECT,loginURL);
pretty="String_Node_Str";
ReferrerURLCookieHandler referrerURLHandler=WebConfigUtils.getWebAppSecurityConfig().createReferrerURLCookieHandler();
referrerURLHandler.setReferrerURLCookie(req,authResult,originalURL);
break;
default :
authResult=new AuthenticationResult(AuthResult.RETURN,"String_Node_Str" + responseStatus);
break;
}
}
 else if (AuthStatus.SEND_FAILURE == status) {
String detail="String_Node_Str" + status + "String_Node_Str";
authResult=new AuthenticationResult(AuthResult.FAILURE,detail);
if (tc.isDebugEnabled()) Tr.debug(tc,detail);
}
 else {
authResult=new AuthenticationResult(AuthResult.FAILURE,"String_Node_Str" + status);
}
if (authResult.getStatus().equals(AuthResult.FAILURE)) {
Tr.info(tc,"String_Node_Str",new Object[]{status,jaspiRequest.getHttpServletRequest().getRequestURI(),jaspiProviderServiceRef.getService() != null ? jaspiProviderServiceRef.getService().getClass() : null});
}
if (tc.isEntryEnabled()) Tr.exit(tc,"String_Node_Str","String_Node_Str" + pretty);
return authResult;
}

Fixed version (ground truth):
protected AuthenticationResult mapToAuthenticationResult(AuthStatus status,JaspiRequest jaspiRequest,Subject clientSubject){
  if (tc.isEntryEnabled())   Tr.entry(tc,"String_Node_Str","String_Node_Str" + status);
  AuthenticationResult authResult=null;
  String pretty="String_Node_Str";
  if (AuthStatus.SUCCESS == status || AuthStatus.SEND_SUCCESS == status) {
    authResult=new AuthenticationResult(AuthResult.SUCCESS,clientSubject);
    pretty="String_Node_Str";
  }
 else   if (AuthStatus.SEND_CONTINUE == status) {
    int responseStatus=getResponseStatus(jaspiRequest.getHttpServletResponse());
    HttpServletRequest req=jaspiRequest.getHttpServletRequest();
switch (responseStatus) {
case HttpServletResponse.SC_UNAUTHORIZED:
      String realm=(String)jaspiRequest.getMessageInfo().getMap().get(AttributeNameConstants.WSCREDENTIAL_REALM);
    authResult=new AuthenticationResult(AuthResult.SEND_401,realm != null ? realm : (String)null);
  pretty="String_Node_Str";
break;
case HttpServletResponse.SC_MOVED_TEMPORARILY:
case HttpServletResponse.SC_SEE_OTHER:
case HttpServletResponse.SC_TEMPORARY_REDIRECT:
String loginURL=getLoginURL(jaspiRequest,req);
String query=req.getQueryString();
String originalURL=req.getRequestURL().append(query != null ? "String_Node_Str" + query : "String_Node_Str").toString();
authResult=new AuthenticationResult(AuthResult.REDIRECT,loginURL);
pretty="String_Node_Str";
ReferrerURLCookieHandler referrerURLHandler=WebConfigUtils.getWebAppSecurityConfig().createReferrerURLCookieHandler();
referrerURLHandler.setReferrerURLCookie(req,authResult,originalURL);
break;
default :
authResult=new AuthenticationResult(AuthResult.RETURN,"String_Node_Str" + responseStatus);
break;
}
}
 else if (AuthStatus.SEND_FAILURE == status) {
pretty="String_Node_Str";
String detail="String_Node_Str" + pretty + "String_Node_Str";
authResult=new AuthenticationResult(AuthResult.FAILURE,detail);
if (tc.isDebugEnabled()) Tr.debug(tc,detail);
}
 else {
authResult=new AuthenticationResult(AuthResult.FAILURE,"String_Node_Str" + status);
}
if (authResult.getStatus().equals(AuthResult.FAILURE)) {
Tr.info(tc,"String_Node_Str",new Object[]{status,jaspiRequest.getHttpServletRequest().getRequestURI(),jaspiProviderServiceRef.getService() != null ? jaspiProviderServiceRef.getService().getClass() : null});
}
if (tc.isEntryEnabled()) Tr.exit(tc,"String_Node_Str","String_Node_Str" + pretty);
return authResult;
}