'Collection.toArray()' call style

This commit is contained in:
Lars Grefer 2019-08-09 00:58:17 +02:00 committed by Rob Winch
parent b3352c7c6e
commit 578d628774
10 changed files with 11 additions and 11 deletions

View File

@ -191,7 +191,7 @@ public class JdbcUserDetailsManagerConfigurer<B extends ProviderManagerBuilder<B
protected DatabasePopulator getDatabasePopulator() {
ResourceDatabasePopulator dbp = new ResourceDatabasePopulator();
dbp.setScripts(initScripts.toArray(new Resource[initScripts.size()]));
dbp.setScripts(initScripts.toArray(new Resource[0]));
return dbp;
}

View File

@ -48,6 +48,6 @@ class ReactiveMethodSecuritySelector extends
List<String> result = new ArrayList<>();
result.add(AutoProxyRegistrar.class.getName());
result.add(ReactiveMethodSecurityConfiguration.class.getName());
return result.toArray(new String[result.size()]);
return result.toArray(new String[0]);
}
}

View File

@ -330,7 +330,7 @@ public final class LogoutConfigurer<H extends HttpSecurityBuilder<H>> extends
private LogoutFilter createLogoutFilter(H http) throws Exception {
logoutHandlers.add(contextLogoutHandler);
LogoutHandler[] handlers = logoutHandlers
.toArray(new LogoutHandler[logoutHandlers.size()]);
.toArray(new LogoutHandler[0]);
LogoutFilter result = new LogoutFilter(getLogoutSuccessHandler(), handlers);
result.setLogoutRequestMatcher(getLogoutRequestMatcher(http));
result = postProcess(result);

View File

@ -84,7 +84,7 @@ public class DefaultSpringSecurityContextSource extends LdapContextSource {
}
}
setUrls(urls.toArray(new String[urls.size()]));
setUrls(urls.toArray(new String[0]));
setBase(this.rootDn);
setPooled(true);
setAuthenticationStrategy(new SimpleDirContextAuthenticationStrategy() {

View File

@ -271,7 +271,7 @@ public class LdapUserDetailsManager implements UserDetailsManager {
}
}
template.modifyAttributes(dn, mods.toArray(new ModificationItem[mods.size()]));
template.modifyAttributes(dn, mods.toArray(new ModificationItem[0]));
// template.rebind(dn, ctx, null);
// Remove the old authorities and replace them with the new one

View File

@ -201,7 +201,7 @@ public class NestedLdapAuthoritiesPopulator extends DefaultLdapAuthoritiesPopula
.searchForMultipleAttributeValues(getGroupSearchBase(),
getGroupSearchFilter(), new String[] { userDn, username },
getAttributeNames()
.toArray(new String[getAttributeNames().size()]));
.toArray(new String[0]));
if (logger.isDebugEnabled()) {
logger.debug("Roles from search: " + userRoles);

View File

@ -56,7 +56,7 @@ public class Person extends LdapUserDetailsImpl {
}
public String[] getCn() {
return cn.toArray(new String[cn.size()]);
return cn.toArray(new String[0]);
}
public String getDescription() {

View File

@ -80,7 +80,7 @@ final class DigestAuthUtils {
list.add(str.substring(start, i));
}
return list.toArray(new String[list.size()]);
return list.toArray(new String[0]);
}
/**

View File

@ -248,6 +248,6 @@ class SavedRequestAwareWrapper extends HttpServletRequestWrapper {
}
}
return combinedParams.toArray(new String[combinedParams.size()]);
return combinedParams.toArray(new String[0]);
}
}

View File

@ -138,7 +138,7 @@ public class ThrowableAnalyzer {
@SuppressWarnings("unchecked")
final Class<? extends Throwable>[] getRegisteredTypes() {
Set<Class<? extends Throwable>> typeList = this.extractorMap.keySet();
return typeList.toArray(new Class[typeList.size()]);
return typeList.toArray(new Class[0]);
}
/**
@ -171,7 +171,7 @@ public class ThrowableAnalyzer {
currentThrowable = extractCause(currentThrowable);
}
return chain.toArray(new Throwable[chain.size()]);
return chain.toArray(new Throwable[0]);
}
/**