Polish Status Codes
Adjusted code styling to avoid nested ifs Closes gh-11725
This commit is contained in:
parent
6e45e65cac
commit
3f11622687
|
@ -414,26 +414,25 @@ public final class OpenSaml4AuthenticationProvider implements AuthenticationProv
|
|||
|
||||
private static List<String> getStatusCodes(Response response) {
|
||||
if (response.getStatus() == null) {
|
||||
return Arrays.asList(StatusCode.SUCCESS);
|
||||
return List.of(StatusCode.SUCCESS);
|
||||
}
|
||||
if (response.getStatus().getStatusCode() == null) {
|
||||
return Arrays.asList(StatusCode.SUCCESS);
|
||||
return List.of(StatusCode.SUCCESS);
|
||||
}
|
||||
|
||||
StatusCode parentStatusCode = response.getStatus().getStatusCode();
|
||||
String parentStatusCodeValue = parentStatusCode.getValue();
|
||||
if (includeChildStatusCodes.contains(parentStatusCodeValue)) {
|
||||
StatusCode statusCode = parentStatusCode.getStatusCode();
|
||||
if (statusCode != null) {
|
||||
String childStatusCodeValue = statusCode.getValue();
|
||||
if (childStatusCodeValue != null) {
|
||||
return Arrays.asList(parentStatusCodeValue, childStatusCodeValue);
|
||||
}
|
||||
}
|
||||
return Arrays.asList(parentStatusCodeValue);
|
||||
if (!includeChildStatusCodes.contains(parentStatusCodeValue)) {
|
||||
return List.of(parentStatusCodeValue);
|
||||
}
|
||||
|
||||
return Arrays.asList(parentStatusCodeValue);
|
||||
StatusCode childStatusCode = parentStatusCode.getStatusCode();
|
||||
if (childStatusCode == null) {
|
||||
return List.of(parentStatusCodeValue);
|
||||
}
|
||||
String childStatusCodeValue = childStatusCode.getValue();
|
||||
if (childStatusCodeValue == null) {
|
||||
return List.of(parentStatusCodeValue);
|
||||
}
|
||||
return List.of(parentStatusCodeValue, childStatusCodeValue);
|
||||
}
|
||||
|
||||
private static boolean isSuccess(List<String> statusCodes) {
|
||||
|
|
Loading…
Reference in New Issue