Polish some methods
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
This commit is contained in:
committed by
Josh Cummings
parent
17b5cdde55
commit
67bc1d8d4a
+4
-5
@@ -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
|
||||
|
||||
+9
-9
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user