Cleanup Code Style Issues
Cleanup Code Style Issues
This commit is contained in:
@@ -55,5 +55,5 @@ public @interface Secured {
|
||||
*
|
||||
* @return String[] The secure method attributes
|
||||
*/
|
||||
public String[] value();
|
||||
String[] value();
|
||||
}
|
||||
|
||||
@@ -48,11 +48,11 @@ class MethodSecurityEvaluationContext extends StandardEvaluationContext {
|
||||
* for each instance. Use the constructor which takes the resolver, as an argument
|
||||
* thus allowing for caching.
|
||||
*/
|
||||
public MethodSecurityEvaluationContext(Authentication user, MethodInvocation mi) {
|
||||
MethodSecurityEvaluationContext(Authentication user, MethodInvocation mi) {
|
||||
this(user, mi, new DefaultSecurityParameterNameDiscoverer());
|
||||
}
|
||||
|
||||
public MethodSecurityEvaluationContext(Authentication user, MethodInvocation mi,
|
||||
MethodSecurityEvaluationContext(Authentication user, MethodInvocation mi,
|
||||
ParameterNameDiscoverer parameterNameDiscoverer) {
|
||||
this.mi = mi;
|
||||
this.parameterNameDiscoverer = parameterNameDiscoverer;
|
||||
|
||||
@@ -40,7 +40,7 @@ public interface RoleHierarchy {
|
||||
* @param authorities - List of the directly assigned authorities.
|
||||
* @return List of all reachable authorities given the assigned authorities.
|
||||
*/
|
||||
public Collection<? extends GrantedAuthority> getReachableGrantedAuthorities(
|
||||
Collection<? extends GrantedAuthority> getReachableGrantedAuthorities(
|
||||
Collection<? extends GrantedAuthority> authorities);
|
||||
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ public final class DelegatingMethodSecurityMetadataSource extends
|
||||
private final Method method;
|
||||
private final Class<?> targetClass;
|
||||
|
||||
public DefaultCacheKey(Method method, Class<?> targetClass) {
|
||||
DefaultCacheKey(Method method, Class<?> targetClass) {
|
||||
this.method = method;
|
||||
this.targetClass = targetClass;
|
||||
}
|
||||
|
||||
@@ -287,7 +287,7 @@ public class MapBasedMethodSecurityMetadataSource extends
|
||||
private final Method method;
|
||||
private final Class<?> registeredJavaType;
|
||||
|
||||
public RegisteredMethod(Method method, Class<?> registeredJavaType) {
|
||||
RegisteredMethod(Method method, Class<?> registeredJavaType) {
|
||||
Assert.notNull(method, "Method required");
|
||||
Assert.notNull(registeredJavaType, "Registered Java Type required");
|
||||
this.method = method;
|
||||
|
||||
@@ -29,5 +29,5 @@ import org.springframework.security.access.SecurityMetadataSource;
|
||||
* @author Ben Alex
|
||||
*/
|
||||
public interface MethodSecurityMetadataSource extends SecurityMetadataSource {
|
||||
public Collection<ConfigAttribute> getAttributes(Method method, Class<?> targetClass);
|
||||
Collection<ConfigAttribute> getAttributes(Method method, Class<?> targetClass);
|
||||
}
|
||||
|
||||
@@ -38,5 +38,5 @@ public @interface PostAuthorize {
|
||||
* @return the Spring-EL expression to be evaluated after invoking the protected
|
||||
* method
|
||||
*/
|
||||
public String value();
|
||||
String value();
|
||||
}
|
||||
|
||||
@@ -38,5 +38,5 @@ public @interface PostFilter {
|
||||
* @return the Spring-EL expression to be evaluated after invoking the protected
|
||||
* method
|
||||
*/
|
||||
public String value();
|
||||
String value();
|
||||
}
|
||||
|
||||
@@ -50,12 +50,12 @@ public @interface PreFilter {
|
||||
* @return the Spring-EL expression to be evaluated before invoking the protected
|
||||
* method
|
||||
*/
|
||||
public String value();
|
||||
String value();
|
||||
|
||||
/**
|
||||
* @return the name of the parameter which should be filtered (must be a non-null
|
||||
* collection instance) If the method contains a single collection argument, then this
|
||||
* attribute can be omitted.
|
||||
*/
|
||||
public String filterTarget() default "";
|
||||
String filterTarget() default "";
|
||||
}
|
||||
|
||||
@@ -45,14 +45,14 @@ public abstract class AbstractAccessDecisionManager implements AccessDecisionMan
|
||||
// ================================================================================================
|
||||
protected final Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
private List<AccessDecisionVoter<? extends Object>> decisionVoters;
|
||||
private List<AccessDecisionVoter<?>> decisionVoters;
|
||||
|
||||
protected MessageSourceAccessor messages = SpringSecurityMessageSource.getAccessor();
|
||||
|
||||
private boolean allowIfAllAbstainDecisions = false;
|
||||
|
||||
protected AbstractAccessDecisionManager(
|
||||
List<AccessDecisionVoter<? extends Object>> decisionVoters) {
|
||||
List<AccessDecisionVoter<?>> decisionVoters) {
|
||||
Assert.notEmpty(decisionVoters, "A list of AccessDecisionVoters is required");
|
||||
this.decisionVoters = decisionVoters;
|
||||
}
|
||||
@@ -72,7 +72,7 @@ public abstract class AbstractAccessDecisionManager implements AccessDecisionMan
|
||||
}
|
||||
}
|
||||
|
||||
public List<AccessDecisionVoter<? extends Object>> getDecisionVoters() {
|
||||
public List<AccessDecisionVoter<?>> getDecisionVoters() {
|
||||
return this.decisionVoters;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ import org.springframework.security.core.Authentication;
|
||||
*/
|
||||
public class AffirmativeBased extends AbstractAccessDecisionManager {
|
||||
|
||||
public AffirmativeBased(List<AccessDecisionVoter<? extends Object>> decisionVoters) {
|
||||
public AffirmativeBased(List<AccessDecisionVoter<?>> decisionVoters) {
|
||||
super(decisionVoters);
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ public class ConsensusBased extends AbstractAccessDecisionManager {
|
||||
|
||||
private boolean allowIfEqualGrantedDeniedDecisions = true;
|
||||
|
||||
public ConsensusBased(List<AccessDecisionVoter<? extends Object>> decisionVoters) {
|
||||
public ConsensusBased(List<AccessDecisionVoter<?>> decisionVoters) {
|
||||
super(decisionVoters);
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ import org.springframework.security.core.Authentication;
|
||||
*/
|
||||
public class UnanimousBased extends AbstractAccessDecisionManager {
|
||||
|
||||
public UnanimousBased(List<AccessDecisionVoter<? extends Object>> decisionVoters) {
|
||||
public UnanimousBased(List<AccessDecisionVoter<?>> decisionVoters) {
|
||||
super(decisionVoters);
|
||||
}
|
||||
|
||||
|
||||
@@ -402,7 +402,7 @@ public abstract class AbstractJaasAuthenticationProvider
|
||||
private class InternalCallbackHandler implements CallbackHandler {
|
||||
private final Authentication authentication;
|
||||
|
||||
public InternalCallbackHandler(Authentication authentication) {
|
||||
InternalCallbackHandler(Authentication authentication) {
|
||||
this.authentication = authentication;
|
||||
}
|
||||
|
||||
|
||||
@@ -61,24 +61,24 @@ public final class DelegatingSecurityContextScheduledExecutorService extends
|
||||
this(delegate, null);
|
||||
}
|
||||
|
||||
public final ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit) {
|
||||
public ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit) {
|
||||
command = wrap(command);
|
||||
return getDelegate().schedule(command, delay, unit);
|
||||
}
|
||||
|
||||
public final <V> ScheduledFuture<V> schedule(Callable<V> callable, long delay,
|
||||
public <V> ScheduledFuture<V> schedule(Callable<V> callable, long delay,
|
||||
TimeUnit unit) {
|
||||
callable = wrap(callable);
|
||||
return getDelegate().schedule(callable, delay, unit);
|
||||
}
|
||||
|
||||
public final ScheduledFuture<?> scheduleAtFixedRate(Runnable command,
|
||||
public ScheduledFuture<?> scheduleAtFixedRate(Runnable command,
|
||||
long initialDelay, long period, TimeUnit unit) {
|
||||
command = wrap(command);
|
||||
return getDelegate().scheduleAtFixedRate(command, initialDelay, period, unit);
|
||||
}
|
||||
|
||||
public final ScheduledFuture<?> scheduleWithFixedDelay(Runnable command,
|
||||
public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command,
|
||||
long initialDelay, long delay, TimeUnit unit) {
|
||||
command = wrap(command);
|
||||
return getDelegate().scheduleWithFixedDelay(command, initialDelay, delay, unit);
|
||||
@@ -87,4 +87,4 @@ public final class DelegatingSecurityContextScheduledExecutorService extends
|
||||
private ScheduledExecutorService getDelegate() {
|
||||
return (ScheduledExecutorService) getDelegateExecutor();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,9 +92,9 @@ class ComparableVersion implements Comparable<ComparableVersion> {
|
||||
private ListItem items;
|
||||
|
||||
private interface Item {
|
||||
final int INTEGER_ITEM = 0;
|
||||
final int STRING_ITEM = 1;
|
||||
final int LIST_ITEM = 2;
|
||||
int INTEGER_ITEM = 0;
|
||||
int STRING_ITEM = 1;
|
||||
int LIST_ITEM = 2;
|
||||
|
||||
int compareTo(Item item);
|
||||
|
||||
@@ -117,7 +117,7 @@ class ComparableVersion implements Comparable<ComparableVersion> {
|
||||
this.value = BigInteger_ZERO;
|
||||
}
|
||||
|
||||
public IntegerItem(String str) {
|
||||
IntegerItem(String str) {
|
||||
this.value = new BigInteger(str);
|
||||
}
|
||||
|
||||
@@ -184,7 +184,7 @@ class ComparableVersion implements Comparable<ComparableVersion> {
|
||||
|
||||
private String value;
|
||||
|
||||
public StringItem(String value, boolean followedByDigit) {
|
||||
StringItem(String value, boolean followedByDigit) {
|
||||
if (followedByDigit && value.length() == 1) {
|
||||
// a1 = alpha-1, b1 = beta-1, m1 = milestone-1
|
||||
switch (value.charAt(0)) {
|
||||
@@ -341,7 +341,7 @@ class ComparableVersion implements Comparable<ComparableVersion> {
|
||||
}
|
||||
}
|
||||
|
||||
public ComparableVersion(String version) {
|
||||
ComparableVersion(String version) {
|
||||
parseVersion(version);
|
||||
}
|
||||
|
||||
|
||||
@@ -37,6 +37,6 @@ public interface Attributes2GrantedAuthoritiesMapper {
|
||||
* @param attributes the attributes to be mapped
|
||||
* @return the collection of authorities created from the attributes
|
||||
*/
|
||||
public Collection<? extends GrantedAuthority> getGrantedAuthorities(
|
||||
Collection<? extends GrantedAuthority> getGrantedAuthorities(
|
||||
Collection<String> attributes);
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ public class KeyBasedPersistenceTokenService implements TokenService, Initializi
|
||||
long creationTime = new Date().getTime();
|
||||
String serverSecret = computeServerSecretApplicableAt(creationTime);
|
||||
String pseudoRandomNumber = generatePseudoRandomNumber();
|
||||
String content = Long.toString(creationTime) + ":" + pseudoRandomNumber + ":"
|
||||
String content = creationTime + ":" + pseudoRandomNumber + ":"
|
||||
+ extendedInformation;
|
||||
|
||||
// Compute key
|
||||
@@ -126,7 +126,7 @@ public class KeyBasedPersistenceTokenService implements TokenService, Initializi
|
||||
String sha1Hex = tokens[tokens.length - 1];
|
||||
|
||||
// Verification
|
||||
String content = Long.toString(creationTime) + ":" + pseudoRandomNumber + ":"
|
||||
String content = creationTime + ":" + pseudoRandomNumber + ":"
|
||||
+ extendedInfo.toString();
|
||||
String expectedSha512Hex = Sha512DigestUtils.shaHex(content + ":" + serverSecret);
|
||||
Assert.isTrue(expectedSha512Hex.equals(sha1Hex), "Key verification failure");
|
||||
|
||||
@@ -53,7 +53,7 @@ class AnonymousAuthenticationTokenMixin {
|
||||
* @param authorities the authorities granted to the principal
|
||||
*/
|
||||
@JsonCreator
|
||||
public AnonymousAuthenticationTokenMixin(@JsonProperty("keyHash") Integer keyHash, @JsonProperty("principal") Object principal,
|
||||
AnonymousAuthenticationTokenMixin(@JsonProperty("keyHash") Integer keyHash, @JsonProperty("principal") Object principal,
|
||||
@JsonProperty("authorities") Collection<? extends GrantedAuthority> authorities) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ class RememberMeAuthenticationTokenMixin {
|
||||
* @param authorities the authorities granted to the principal
|
||||
*/
|
||||
@JsonCreator
|
||||
public RememberMeAuthenticationTokenMixin(@JsonProperty("keyHash") Integer keyHash,
|
||||
RememberMeAuthenticationTokenMixin(@JsonProperty("keyHash") Integer keyHash,
|
||||
@JsonProperty("principal") Object principal,
|
||||
@JsonProperty("authorities") Collection<? extends GrantedAuthority> authorities) {
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ public final class SecurityJackson2Modules {
|
||||
*/
|
||||
static class WhitelistTypeResolverBuilder extends ObjectMapper.DefaultTypeResolverBuilder {
|
||||
|
||||
public WhitelistTypeResolverBuilder(ObjectMapper.DefaultTyping defaultTyping) {
|
||||
WhitelistTypeResolverBuilder(ObjectMapper.DefaultTyping defaultTyping) {
|
||||
super(defaultTyping);
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ class MutableUser implements MutableUserDetails {
|
||||
private String password;
|
||||
private final UserDetails delegate;
|
||||
|
||||
public MutableUser(UserDetails user) {
|
||||
MutableUser(UserDetails user) {
|
||||
this.delegate = user;
|
||||
this.password = user.getPassword();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user