Clean up deprecation and unused code warnings

This commit is contained in:
Andy Wilkinson 2016-10-18 20:43:05 +01:00
parent c58852e05b
commit a416f496c0
9 changed files with 19 additions and 26 deletions

View File

@ -31,7 +31,6 @@ import org.springframework.boot.actuate.cache.CaffeineCacheStatisticsProvider;
import org.springframework.boot.actuate.cache.ConcurrentMapCacheStatisticsProvider;
import org.springframework.boot.actuate.cache.DefaultCacheStatistics;
import org.springframework.boot.actuate.cache.EhCacheStatisticsProvider;
import org.springframework.boot.actuate.cache.GuavaCacheStatisticsProvider;
import org.springframework.boot.actuate.cache.HazelcastCacheStatisticsProvider;
import org.springframework.boot.actuate.cache.InfinispanCacheStatisticsProvider;
import org.springframework.boot.actuate.cache.JCacheCacheStatisticsProvider;
@ -121,11 +120,12 @@ public class CacheStatisticsAutoConfiguration {
@Configuration
@ConditionalOnClass({ com.google.common.cache.Cache.class, GuavaCache.class })
@Deprecated
static class GuavaCacheStatisticsConfiguration {
@Bean
public GuavaCacheStatisticsProvider guavaCacheStatisticsProvider() {
return new GuavaCacheStatisticsProvider();
public org.springframework.boot.actuate.cache.GuavaCacheStatisticsProvider guavaCacheStatisticsProvider() {
return new org.springframework.boot.actuate.cache.GuavaCacheStatisticsProvider();
}
}

View File

@ -142,6 +142,7 @@ public class CrshAutoConfiguration {
}
@Configuration
@Deprecated
static class CrshAdditionalPropertiesConfiguration {
@Bean
@ -173,6 +174,7 @@ public class CrshAutoConfiguration {
@Configuration
@ConditionalOnProperty(prefix = AUTH_PREFIX, name = "type", havingValue = "spring", matchIfMissing = true)
@ConditionalOnBean(AuthenticationManager.class)
@Deprecated
public static class AuthenticationManagerAdapterConfiguration {
private final ManagementServerProperties management;

View File

@ -16,14 +16,11 @@
package org.springframework.boot.actuate.endpoint;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import org.springframework.boot.actuate.info.Info;
import org.springframework.boot.actuate.info.InfoContributor;
import org.springframework.boot.actuate.info.MapInfoContributor;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.util.Assert;
@ -49,14 +46,6 @@ public class InfoEndpoint extends AbstractEndpoint<Map<String, Object>> {
this.infoContributors = infoContributors;
}
private static List<InfoContributor> createContributors(Map<String, Object> info,
InfoContributor[] infoContributors) {
List<InfoContributor> result = new ArrayList<InfoContributor>(
Arrays.asList(infoContributors));
result.add(0, new MapInfoContributor(info));
return result;
}
@Override
public Map<String, Object> invoke() {
Info.Builder builder = new Info.Builder();

View File

@ -244,6 +244,7 @@ public class ShellPropertiesTests {
return this.context.getBean(type);
}
@SuppressWarnings("deprecation")
@Configuration
@EnableConfigurationProperties({ ShellProperties.class,
JaasAuthenticationProperties.class, KeyAuthenticationProperties.class,
@ -253,6 +254,7 @@ public class ShellPropertiesTests {
}
@Configuration
@Deprecated
public static class TestShellConfiguration {
public static String uuid = UUID.randomUUID().toString();

View File

@ -42,12 +42,17 @@ final class CacheConfigurations {
mappings.put(CacheType.COUCHBASE, CouchbaseCacheConfiguration.class);
mappings.put(CacheType.REDIS, RedisCacheConfiguration.class);
mappings.put(CacheType.CAFFEINE, CaffeineCacheConfiguration.class);
mappings.put(CacheType.GUAVA, GuavaCacheConfiguration.class);
addGuavaMapping(mappings);
mappings.put(CacheType.SIMPLE, SimpleCacheConfiguration.class);
mappings.put(CacheType.NONE, NoOpCacheConfiguration.class);
MAPPINGS = Collections.unmodifiableMap(mappings);
}
@Deprecated
private static void addGuavaMapping(Map<CacheType, Class<?>> mappings) {
mappings.put(CacheType.GUAVA, GuavaCacheConfiguration.class);
}
private CacheConfigurations() {
}

View File

@ -43,6 +43,7 @@ import org.springframework.util.StringUtils;
@ConditionalOnClass({ CacheBuilder.class, GuavaCacheManager.class })
@ConditionalOnMissingBean(CacheManager.class)
@Conditional(CacheCondition.class)
@Deprecated
class GuavaCacheConfiguration {
private final CacheProperties cacheProperties;

View File

@ -66,6 +66,7 @@ import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletCon
import org.springframework.boot.context.embedded.undertow.UndertowBuilderCustomizer;
import org.springframework.boot.context.embedded.undertow.UndertowEmbeddedServletContainerFactory;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.DeprecatedConfigurationProperty;
import org.springframework.boot.context.properties.NestedConfigurationProperty;
import org.springframework.boot.web.servlet.ServletContextInitializer;
import org.springframework.context.EnvironmentAware;
@ -1216,6 +1217,7 @@ public class ServerProperties
/**
* Number of buffer per region.
*/
@Deprecated
private Integer buffersPerRegion;
/**
@ -1243,6 +1245,7 @@ public class ServerProperties
this.bufferSize = bufferSize;
}
@DeprecatedConfigurationProperty(reason = "The property is not used by Undertow. See https://issues.jboss.org/browse/UNDERTOW-587 for details")
public Integer getBuffersPerRegion() {
return this.buffersPerRegion;
}
@ -1284,9 +1287,6 @@ public class ServerProperties
if (this.bufferSize != null) {
factory.setBufferSize(this.bufferSize);
}
if (this.buffersPerRegion != null) {
factory.setBuffersPerRegion(this.buffersPerRegion);
}
if (this.ioThreads != null) {
factory.setIoThreads(this.ioThreads);
}

View File

@ -200,8 +200,6 @@ public class SpringApplication {
private Banner banner;
private boolean printedCustomBannerViaDeprecatedMethod;
private ResourceLoader resourceLoader;
private BeanNameGenerator beanNameGenerator;

View File

@ -110,8 +110,6 @@ public class UndertowEmbeddedServletContainerFactory
private Integer bufferSize;
private Integer buffersPerRegion;
private Integer ioThreads;
private Integer workerThreads;
@ -236,9 +234,6 @@ public class UndertowEmbeddedServletContainerFactory
if (this.bufferSize != null) {
builder.setBufferSize(this.bufferSize);
}
if (this.buffersPerRegion != null) {
builder.setBuffersPerRegion(this.buffersPerRegion);
}
if (this.ioThreads != null) {
builder.setIoThreads(this.ioThreads);
}
@ -544,8 +539,9 @@ public class UndertowEmbeddedServletContainerFactory
this.bufferSize = bufferSize;
}
@Deprecated
public void setBuffersPerRegion(Integer buffersPerRegion) {
this.buffersPerRegion = buffersPerRegion;
}
public void setIoThreads(Integer ioThreads) {