Polish some methods

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
This commit is contained in:
Tran Ngoc Nhan 2025-08-24 13:55:32 +07:00 committed by Josh Cummings
parent 17b5cdde55
commit 67bc1d8d4a
2 changed files with 13 additions and 14 deletions

View File

@ -71,14 +71,13 @@ final class DefaultServiceAuthenticationDetails extends WebAuthenticationDetails
@Override
public boolean equals(Object obj) {
if (this == obj) {
if (super.equals(obj)) {
return true;
}
if (!super.equals(obj) || !(obj instanceof DefaultServiceAuthenticationDetails)) {
return false;
if (obj instanceof DefaultServiceAuthenticationDetails that) {
return this.serviceUrl.equals(that.getServiceUrl());
}
ServiceAuthenticationDetails that = (ServiceAuthenticationDetails) obj;
return this.serviceUrl.equals(that.getServiceUrl());
return false;
}
@Override

View File

@ -193,15 +193,15 @@ public class DefaultSavedRequest implements SavedRequest {
* @since 4.2
*/
private void addParameters(Map<String, String[]> parameters) {
if (!ObjectUtils.isEmpty(parameters)) {
for (String paramName : parameters.keySet()) {
Object paramValues = parameters.get(paramName);
if (paramValues instanceof String[]) {
this.addParameter(paramName, (String[]) paramValues);
}
else {
logger.warn("ServletRequest.getParameterMap() returned non-String array");
}
if (ObjectUtils.isEmpty(parameters)) {
return;
}
for (Map.Entry<String, String[]> entry : parameters.entrySet()) {
String name = entry.getKey();
String[] values = entry.getValue();
if (values != null) {
this.parameters.put(name, values);
}
}
}