Commit 5dad7182 authored by Andy Wilkinson's avatar Andy Wilkinson

Address deprecation warnings

parent d45d9452
/*
* Copyright 2012-2016 the original author or authors.
* Copyright 2012-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -118,7 +118,7 @@ public class ShellProperties {
}
public void setDisabledCommands(String[] disabledCommands) {
Assert.notEmpty(disabledCommands);
Assert.notEmpty(disabledCommands, "disabledCommands must not be empty");
this.disabledCommands = disabledCommands;
}
......@@ -127,7 +127,7 @@ public class ShellProperties {
}
public void setDisabledPlugins(String[] disabledPlugins) {
Assert.notEmpty(disabledPlugins);
Assert.notEmpty(disabledPlugins, "disabledPlugins must not be empty");
this.disabledPlugins = disabledPlugins;
}
......
/*
* Copyright 2012-2016 the original author or authors.
* Copyright 2012-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -72,7 +72,7 @@ public class StatsdMetricWriter implements MetricWriter, Closeable {
* @param client StatsD client to write metrics with
*/
public StatsdMetricWriter(StatsDClient client) {
Assert.notNull(client);
Assert.notNull(client, "client must not be null");
this.client = client;
}
......
......@@ -606,7 +606,7 @@ public class ConditionalOnMissingBeanTests {
public static class ExampleFactoryBean implements FactoryBean<ExampleBean> {
public ExampleFactoryBean(String value) {
Assert.state(!value.contains("$"));
Assert.state(!value.contains("$"), "value must not contain $");
}
@Override
......@@ -629,7 +629,7 @@ public class ConditionalOnMissingBeanTests {
public static class NonspecificFactoryBean implements FactoryBean<Object> {
public NonspecificFactoryBean(String value) {
Assert.state(!value.contains("$"));
Assert.state(!value.contains("$"), "value must not contain $");
}
@Override
......
/*
* Copyright 2012-2016 the original author or authors.
* Copyright 2012-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -94,7 +94,7 @@ public class PropertiesConfigurationFactory<T>
* @see #PropertiesConfigurationFactory(Class)
*/
public PropertiesConfigurationFactory(T target) {
Assert.notNull(target);
Assert.notNull(target, "target must not be null");
this.target = target;
}
......@@ -105,7 +105,7 @@ public class PropertiesConfigurationFactory<T>
*/
@SuppressWarnings("unchecked")
public PropertiesConfigurationFactory(Class<?> type) {
Assert.notNull(type);
Assert.notNull(type, "type must not be null");
this.target = (T) BeanUtils.instantiate(type);
}
......
/*
* Copyright 2012-2016 the original author or authors.
* Copyright 2012-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -76,7 +76,7 @@ public class YamlConfigurationFactory<T>
* @param type the root type
*/
public YamlConfigurationFactory(Class<?> type) {
Assert.notNull(type);
Assert.notNull(type, "type must not be null");
this.type = type;
}
......
......@@ -352,8 +352,7 @@ public class TomcatEmbeddedServletContainerFactory
Compression compression = getCompression();
protocol.setCompression("on");
protocol.setCompressionMinSize(compression.getMinResponseSize());
protocol.setCompressableMimeType(
StringUtils.arrayToCommaDelimitedString(compression.getMimeTypes()));
configureCompressibleMimeTypes(protocol, compression);
if (getCompression().getExcludedUserAgents() != null) {
protocol.setNoCompressionUserAgents(
StringUtils.arrayToCommaDelimitedString(
......@@ -362,6 +361,13 @@ public class TomcatEmbeddedServletContainerFactory
}
}
@SuppressWarnings("deprecation")
private void configureCompressibleMimeTypes(AbstractHttp11Protocol<?> protocol,
Compression compression) {
protocol.setCompressableMimeType(
StringUtils.arrayToCommaDelimitedString(compression.getMimeTypes()));
}
/**
* Configure Tomcat's {@link AbstractHttp11JsseProtocol} for SSL.
* @param protocol the protocol
......
/*
* Copyright 2012-2016 the original author or authors.
* Copyright 2012-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -36,7 +36,7 @@ public class CompressionTests {
private String[] getTomcatDefaultCompressableMimeTypes() {
Http11NioProtocol protocol = new Http11NioProtocol();
return protocol.getCompressableMimeTypes();
return protocol.getCompressibleMimeTypes();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment