mirror of
https://github.com/spring-projects/spring-security.git
synced 2026-02-24 22:25:18 +00:00
Polish some methods
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
This commit is contained in:
parent
17b5cdde55
commit
67bc1d8d4a
@ -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
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user