Skip to content

Cleanup Code Style Issues #7238

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Aug 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ class AclClassIdUtils {

private ConversionService conversionService;

public AclClassIdUtils() {
AclClassIdUtils() {
GenericConversionService genericConversionService = new GenericConversionService();
genericConversionService.addConverter(String.class, Long.class, new StringToLongConverter());
genericConversionService.addConverter(String.class, UUID.class, new StringToUUIDConverter());
this.conversionService = genericConversionService;
}

public AclClassIdUtils(ConversionService conversionService) {
AclClassIdUtils(ConversionService conversionService) {
Assert.notNull(conversionService, "conversionService must not be null");
this.conversionService = conversionService;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ private class ProcessResultSet implements ResultSetExtractor<Set<Long>> {
private final Map<Serializable, Acl> acls;
private final List<Sid> sids;

public ProcessResultSet(Map<Serializable, Acl> acls, List<Sid> sids) {
ProcessResultSet(Map<Serializable, Acl> acls, List<Sid> sids) {
Assert.notNull(acls, "ACLs cannot be null");
this.acls = acls;
this.sids = sids; // can be null
Expand Down Expand Up @@ -683,7 +683,7 @@ private void convertCurrentResultIntoObject(Map<Serializable, Acl> acls,
private static class StubAclParent implements Acl {
private final Long id;

public StubAclParent(Long id) {
StubAclParent(Long id) {
this.id = id;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ class AssertionImplMixin {
* @param attributes the key/value pairs for this attribute.
*/
@JsonCreator
public AssertionImplMixin(@JsonProperty("principal") AttributePrincipal principal,
AssertionImplMixin(@JsonProperty("principal") AttributePrincipal principal,
@JsonProperty("validFromDate") Date validFromDate, @JsonProperty("validUntilDate") Date validUntilDate,
@JsonProperty("authenticationDate") Date authenticationDate, @JsonProperty("attributes") Map<String, Object> attributes){
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ class AttributePrincipalImplMixin {
* @param proxyRetriever the ProxyRetriever implementation to call back to the CAS server.
*/
@JsonCreator
public AttributePrincipalImplMixin(@JsonProperty("name") String name, @JsonProperty("attributes") Map<String, Object> attributes,
AttributePrincipalImplMixin(@JsonProperty("name") String name, @JsonProperty("attributes") Map<String, Object> attributes,
@JsonProperty("proxyGrantingTicket") String proxyGrantingTicket,
@JsonProperty("proxyRetriever") ProxyRetriever proxyRetriever) {
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class CasAuthenticationTokenMixin {
* principal and how to obtain a proxy ticket for the user.
*/
@JsonCreator
public CasAuthenticationTokenMixin(@JsonProperty("keyHash") Integer keyHash, @JsonProperty("principal") Object principal,
CasAuthenticationTokenMixin(@JsonProperty("keyHash") Integer keyHash, @JsonProperty("principal") Object principal,
@JsonProperty("credentials") Object credentials,
@JsonProperty("authorities") Collection<? extends GrantedAuthority> authorities,
@JsonProperty("userDetails") UserDetails userDetails, @JsonProperty("assertion") Assertion assertion) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ private boolean proxyReceptorConfigured() {
private class CasAuthenticationFailureHandler implements AuthenticationFailureHandler {
private final AuthenticationFailureHandler serviceTicketFailureHandler;

public CasAuthenticationFailureHandler(AuthenticationFailureHandler failureHandler) {
CasAuthenticationFailureHandler(AuthenticationFailureHandler failureHandler) {
Assert.notNull(failureHandler, "failureHandler");
this.serviceTicketFailureHandler = failureHandler;
}
Expand All @@ -432,4 +432,4 @@ public void onAuthenticationFailure(HttpServletRequest request,
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ public void removeTicketFromCache(String serviceTicket) {
private class MockTicketValidator implements TicketValidator {
private boolean returnTicket;

public MockTicketValidator(boolean returnTicket) {
MockTicketValidator(boolean returnTicket) {
this.returnTicket = returnTicket;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public abstract class AbstractConfiguredSecurityBuilder<O, B extends SecurityBui
private final LinkedHashMap<Class<? extends SecurityConfigurer<O, B>>, List<SecurityConfigurer<O, B>>> configurers = new LinkedHashMap<>();
private final List<SecurityConfigurer<O, B>> configurersAddedInInitializing = new ArrayList<>();

private final Map<Class<? extends Object>, Object> sharedObjects = new HashMap<>();
private final Map<Class<?>, Object> sharedObjects = new HashMap<>();

private final boolean allowConfigurersOfSameType;

Expand Down Expand Up @@ -174,7 +174,7 @@ public <C> C getSharedObject(Class<C> sharedType) {
* Gets the shared objects
* @return the shared Objects
*/
public Map<Class<? extends Object>, Object> getSharedObjects() {
public Map<Class<?>, Object> getSharedObjects() {
return Collections.unmodifiableMap(this.sharedObjects);
}

Expand Down Expand Up @@ -409,7 +409,7 @@ private boolean isUnbuilt() {
* @author Rob Winch
* @since 3.2
*/
private static enum BuildState {
private enum BuildState {
/**
* This is the state before the {@link Builder#build()} is invoked
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public void setBuilder(B builder) {
*/
private static final class CompositeObjectPostProcessor implements
ObjectPostProcessor<Object> {
private List<ObjectPostProcessor<? extends Object>> postProcessors = new ArrayList<>();
private List<ObjectPostProcessor<?>> postProcessors = new ArrayList<>();

@SuppressWarnings({ "rawtypes", "unchecked" })
public Object postProcess(Object object) {
Expand All @@ -132,7 +132,7 @@ public Object postProcess(Object object) {
* @return true if the {@link ObjectPostProcessor} was added, else false
*/
private boolean addObjectPostProcessor(
ObjectPostProcessor<? extends Object> objectPostProcessor) {
ObjectPostProcessor<?> objectPostProcessor) {
boolean result = this.postProcessors.add(objectPostProcessor);
Collections.sort(postProcessors, AnnotationAwareOrderComparator.INSTANCE);
return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ private static class EnableGlobalAuthenticationAutowiredConfigurer extends
private static final Log logger = LogFactory
.getLog(EnableGlobalAuthenticationAutowiredConfigurer.class);

public EnableGlobalAuthenticationAutowiredConfigurer(ApplicationContext context) {
EnableGlobalAuthenticationAutowiredConfigurer(ApplicationContext context) {
this.context = context;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class InitializeAuthenticationProviderBeanManagerConfigurer
/**
* @param context the ApplicationContext to look up beans.
*/
public InitializeAuthenticationProviderBeanManagerConfigurer(
InitializeAuthenticationProviderBeanManagerConfigurer(
ApplicationContext context) {
this.context = context;
}
Expand Down Expand Up @@ -83,4 +83,4 @@ private <T> T getBeanOrNull(Class<T> type) {
.getBean(userDetailsBeanNames[0], type);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class InitializeUserDetailsBeanManagerConfigurer
/**
* @param context
*/
public InitializeUserDetailsBeanManagerConfigurer(ApplicationContext context) {
InitializeUserDetailsBeanManagerConfigurer(ApplicationContext context) {
this.context = context;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ final class AutowireBeanFactoryObjectPostProcessor
private final List<DisposableBean> disposableBeans = new ArrayList<>();
private final List<SmartInitializingSingleton> smartSingletons = new ArrayList<>();

public AutowireBeanFactoryObjectPostProcessor(
AutowireBeanFactoryObjectPostProcessor(
AutowireCapableBeanFactory autowireBeanFactory) {
Assert.notNull(autowireBeanFactory, "autowireBeanFactory cannot be null");
this.autowireBeanFactory = autowireBeanFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ protected RunAsManager runAsManager() {
* @return the {@link AccessDecisionManager} to use
*/
protected AccessDecisionManager accessDecisionManager() {
List<AccessDecisionVoter<? extends Object>> decisionVoters = new ArrayList<>();
List<AccessDecisionVoter<?>> decisionVoters = new ArrayList<>();
ExpressionBasedPreInvocationAdvice expressionAdvice = new ExpressionBasedPreInvocationAdvice();
expressionAdvice.setExpressionHandler(getExpressionHandler());
if (prePostEnabled()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
*/
final class GlobalMethodSecuritySelector implements ImportSelector {

public final String[] selectImports(AnnotationMetadata importingClassMetadata) {
public String[] selectImports(AnnotationMetadata importingClassMetadata) {
Class<EnableGlobalMethodSecurity> annoType = EnableGlobalMethodSecurity.class;
Map<String, Object> annotationAttributes = importingClassMetadata
.getAnnotationAttributes(annoType.getName(), false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,11 @@ public final class HttpSecurity extends
@SuppressWarnings("unchecked")
public HttpSecurity(ObjectPostProcessor<Object> objectPostProcessor,
AuthenticationManagerBuilder authenticationBuilder,
Map<Class<? extends Object>, Object> sharedObjects) {
Map<Class<?>, Object> sharedObjects) {
super(objectPostProcessor);
Assert.notNull(authenticationBuilder, "authenticationBuilder cannot be null");
setSharedObject(AuthenticationManagerBuilder.class, authenticationBuilder);
for (Map.Entry<Class<? extends Object>, Object> entry : sharedObjects
for (Map.Entry<Class<?>, Object> entry : sharedObjects
.entrySet()) {
setSharedObject((Class<Object>) entry.getKey(), entry.getValue());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ final class AutowiredWebSecurityConfigurersIgnoreParents {

private final ConfigurableListableBeanFactory beanFactory;

public AutowiredWebSecurityConfigurersIgnoreParents(
AutowiredWebSecurityConfigurersIgnoreParents(
ConfigurableListableBeanFactory beanFactory) {
Assert.notNull(beanFactory, "beanFactory cannot be null");
this.beanFactory = beanFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ protected final HttpSecurity getHttp() throws Exception {
AuthenticationManager authenticationManager = authenticationManager();
authenticationBuilder.parentAuthenticationManager(authenticationManager);
authenticationBuilder.authenticationEventPublisher(eventPublisher);
Map<Class<? extends Object>, Object> sharedObjects = createSharedObjects();
Map<Class<?>, Object> sharedObjects = createSharedObjects();

http = new HttpSecurity(objectPostProcessor, authenticationBuilder,
sharedObjects);
Expand Down Expand Up @@ -412,8 +412,8 @@ public void setAuthenticationConfiguration(
*
* @return the shared Objects
*/
private Map<Class<? extends Object>, Object> createSharedObjects() {
Map<Class<? extends Object>, Object> sharedObjects = new HashMap<>();
private Map<Class<?>, Object> createSharedObjects() {
Map<Class<?>, Object> sharedObjects = new HashMap<>();
sharedObjects.putAll(localConfigureAuthenticationBldr.getSharedObjects());
sharedObjects.put(UserDetailsService.class, userDetailsService());
sharedObjects.put(ApplicationContext.class, context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public void configure(H http) throws Exception {
* @return the {@link AccessDecisionVoter} instances used to create the default
* {@link AccessDecisionManager}
*/
abstract List<AccessDecisionVoter<? extends Object>> getDecisionVoters(H http);
abstract List<AccessDecisionVoter<?>> getDecisionVoters(H http);

abstract class AbstractInterceptUrlRegistry<R extends AbstractInterceptUrlRegistry<R, T>, T>
extends AbstractConfigAttributeRequestMatcherRegistry<T> {
Expand Down Expand Up @@ -195,4 +195,4 @@ private FilterSecurityInterceptor createFilterSecurityInterceptor(H http,
securityInterceptor.afterPropertiesSet();
return securityInterceptor;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -183,16 +183,16 @@ private void interceptUrl(Iterable<? extends RequestMatcher> requestMatchers,

@Override
@SuppressWarnings("rawtypes")
final List<AccessDecisionVoter<? extends Object>> getDecisionVoters(H http) {
List<AccessDecisionVoter<? extends Object>> decisionVoters = new ArrayList<>();
List<AccessDecisionVoter<?>> getDecisionVoters(H http) {
List<AccessDecisionVoter<?>> decisionVoters = new ArrayList<>();
WebExpressionVoter expressionVoter = new WebExpressionVoter();
expressionVoter.setExpressionHandler(getExpressionHandler(http));
decisionVoters.add(expressionVoter);
return decisionVoters;
}

@Override
final ExpressionBasedFilterInvocationSecurityMetadataSource createMetadataSource(
ExpressionBasedFilterInvocationSecurityMetadataSource createMetadataSource(
H http) {
LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>> requestMap = REGISTRY
.createRequestMap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ public H and() {
*/
@Override
@SuppressWarnings("rawtypes")
final List<AccessDecisionVoter<? extends Object>> getDecisionVoters(H http) {
List<AccessDecisionVoter<? extends Object>> decisionVoters = new ArrayList<>();
List<AccessDecisionVoter<?>> getDecisionVoters(H http) {
List<AccessDecisionVoter<?>> decisionVoters = new ArrayList<>();
decisionVoters.add(new RoleVoter());
decisionVoters.add(new AuthenticatedVoter());
return decisionVoters;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public ChannelSecurityInterceptor inboundChannelSecurity(MessageSecurityMetadata
MessageExpressionVoter<Object> voter = new MessageExpressionVoter<>();
voter.setExpressionHandler(getMessageExpressionHandler());

List<AccessDecisionVoter<? extends Object>> voters = new ArrayList<>();
List<AccessDecisionVoter<?>> voters = new ArrayList<>();
voters.add(voter);

AffirmativeBased manager = new AffirmativeBased(voters);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ private <S, T, I> Converter<S, T> pair(Converter<S, I> one, Converter<I, T> two)
private static class ConverterPropertyEditorAdapter<T> extends PropertyEditorSupport {
private final Converter<String, T> converter;

public ConverterPropertyEditorAdapter(Converter<String, T> converter) {
ConverterPropertyEditorAdapter(Converter<String, T> converter) {
this.converter = converter;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ final class AuthenticationConfigBuilder {

private String openIDLoginPage;

public AuthenticationConfigBuilder(Element element, boolean forceAutoConfig,
AuthenticationConfigBuilder(Element element, boolean forceAutoConfig,
ParserContext pc, SessionCreationPolicy sessionPolicy,
BeanReference requestCache, BeanReference authenticationManager,
BeanReference sessionStrategy, BeanReference portMapper,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class HttpConfigurationBuilder {
private BeanDefinition invalidSession;
private boolean addAllAuth;

public HttpConfigurationBuilder(Element element, boolean addAllAuth,
HttpConfigurationBuilder(Element element, boolean addAllAuth,
ParserContext pc, BeanReference portMapper, BeanReference portResolver,
BeanReference authenticationManager) {
this.httpElt = element;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,12 +415,12 @@ class OrderDecorator implements Ordered {
final BeanMetadataElement bean;
final int order;

public OrderDecorator(BeanMetadataElement bean, SecurityFilters filterOrder) {
OrderDecorator(BeanMetadataElement bean, SecurityFilters filterOrder) {
this.bean = bean;
this.order = filterOrder.getOrder();
}

public OrderDecorator(BeanMetadataElement bean, int order) {
OrderDecorator(BeanMetadataElement bean, int order) {
this.bean = bean;
this.order = order;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class LogoutBeanDefinitionParser implements BeanDefinitionParser {
private ManagedList<BeanMetadataElement> logoutHandlers = new ManagedList<>();
private boolean csrfEnabled;

public LogoutBeanDefinitionParser(String loginPageUrl, String rememberMeServices,
LogoutBeanDefinitionParser(String loginPageUrl, String rememberMeServices,
BeanMetadataElement csrfLogoutHandler) {
this.defaultLogoutUrl = loginPageUrl + "?logout";
this.rememberMeServices = rememberMeServices;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ enum SecurityFilters {
private static final int INTERVAL = 100;
private final int order;

private SecurityFilters() {
SecurityFilters() {
order = ordinal() * INTERVAL;
}

private SecurityFilters(int order) {
SecurityFilters(int order) {
this.order = order;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ final class ProtectPointcutPostProcessor implements BeanPostProcessor {
private final PointcutParser parser;
private final Set<String> processedBeans = new HashSet<>();

public ProtectPointcutPostProcessor(
ProtectPointcutPostProcessor(
MapBasedMethodSecurityMetadataSource mapBasedMethodSecurityMetadataSource) {
Assert.notNull(mapBasedMethodSecurityMetadataSource,
"MapBasedMethodSecurityMetadataSource to populate is required");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ public enum SecurityWebFiltersOrder {

private final int order;

private SecurityWebFiltersOrder() {
SecurityWebFiltersOrder() {
this.order = ordinal() * INTERVAL;
}

private SecurityWebFiltersOrder(int order) {
SecurityWebFiltersOrder(int order) {
this.order = order;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3645,7 +3645,7 @@ private static class OrderedWebFilter implements WebFilter, Ordered {
private final WebFilter webFilter;
private final int order;

public OrderedWebFilter(WebFilter webFilter, int order) {
OrderedWebFilter(WebFilter webFilter, int order) {
this.webFilter = webFilter;
this.order = order;
}
Expand Down
Loading