Cleanup redundant type casts
This commit is contained in:
@@ -23,7 +23,7 @@ public final class ExpressionUtils {
|
||||
|
||||
public static boolean evaluateAsBoolean(Expression expr, EvaluationContext ctx) {
|
||||
try {
|
||||
return ((Boolean) expr.getValue(ctx, Boolean.class)).booleanValue();
|
||||
return expr.getValue(ctx, Boolean.class).booleanValue();
|
||||
}
|
||||
catch (EvaluationException e) {
|
||||
throw new IllegalArgumentException("Failed to evaluate expression '"
|
||||
|
||||
@@ -98,7 +98,7 @@ public class MapBasedMethodSecurityMetadataSource extends
|
||||
Class<?> clazz) {
|
||||
RegisteredMethod registeredMethod = new RegisteredMethod(method, clazz);
|
||||
if (methodMap.containsKey(registeredMethod)) {
|
||||
return (List<ConfigAttribute>) methodMap.get(registeredMethod);
|
||||
return methodMap.get(registeredMethod);
|
||||
}
|
||||
// Search superclass
|
||||
if (clazz.getSuperclass() != null) {
|
||||
@@ -166,7 +166,7 @@ public class MapBasedMethodSecurityMetadataSource extends
|
||||
// register all matching methods
|
||||
for (Method method : matchingMethods) {
|
||||
RegisteredMethod registeredMethod = new RegisteredMethod(method, javaType);
|
||||
String regMethodName = (String) this.nameMap.get(registeredMethod);
|
||||
String regMethodName = this.nameMap.get(registeredMethod);
|
||||
|
||||
if ((regMethodName == null)
|
||||
|| (!regMethodName.equals(name) && (regMethodName.length() <= name
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
package org.springframework.security.jackson2;
|
||||
|
||||
import com.fasterxml.jackson.core.Version;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.module.SimpleModule;
|
||||
import org.springframework.security.authentication.AnonymousAuthenticationToken;
|
||||
import org.springframework.security.authentication.BadCredentialsException;
|
||||
@@ -54,7 +53,7 @@ public class CoreJackson2Module extends SimpleModule {
|
||||
|
||||
@Override
|
||||
public void setupModule(SetupContext context) {
|
||||
SecurityJackson2Modules.enableDefaultTyping((ObjectMapper) context.getOwner());
|
||||
SecurityJackson2Modules.enableDefaultTyping(context.getOwner());
|
||||
context.setMixInAnnotations(AnonymousAuthenticationToken.class, AnonymousAuthenticationTokenMixin.class);
|
||||
context.setMixInAnnotations(RememberMeAuthenticationToken.class, RememberMeAuthenticationTokenMixin.class);
|
||||
context.setMixInAnnotations(SimpleGrantedAuthority.class, SimpleGrantedAuthorityMixin.class);
|
||||
|
||||
Reference in New Issue
Block a user