Polish contribution
Removing all deprecated code Closes gh-4905 Closes gh-4917
This commit is contained in:
@@ -42,12 +42,4 @@ public @interface ConditionalOnMissingClass {
|
||||
*/
|
||||
String[] value() default {};
|
||||
|
||||
/**
|
||||
* An alias for {@link #value} specifying the names of the classes that must not be
|
||||
* present.
|
||||
* @return the class names that must not be present.
|
||||
* @deprecated since 1.3.0 in favor of {@link #value}.
|
||||
*/
|
||||
String[] name() default {};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
/*
|
||||
* Copyright 2012-2015 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.autoconfigure.groovy.template;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
|
||||
import groovy.text.markup.MarkupTemplateEngine;
|
||||
import groovy.text.markup.TemplateConfiguration;
|
||||
import groovy.text.markup.TemplateResolver;
|
||||
|
||||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
import org.springframework.web.servlet.view.groovy.GroovyMarkupConfigurer;
|
||||
import org.springframework.web.servlet.view.groovy.GroovyMarkupViewResolver;
|
||||
|
||||
/**
|
||||
* A custom {@link groovy.text.markup.TemplateResolver template resolver} which resolves
|
||||
* templates using the locale found in the thread locale. This resolver ignores the
|
||||
* template engine configuration locale.
|
||||
*
|
||||
* @author Cédric Champeau
|
||||
* @since 1.1.0
|
||||
* @deprecated since 1.2 in favor of Spring 4.1's {@link GroovyMarkupViewResolver} and
|
||||
* {@link GroovyMarkupConfigurer}.
|
||||
*/
|
||||
@Deprecated
|
||||
public class GroovyTemplateResolver implements TemplateResolver {
|
||||
|
||||
private ClassLoader templateClassLoader;
|
||||
|
||||
@Override
|
||||
public void configure(final ClassLoader templateClassLoader,
|
||||
final TemplateConfiguration configuration) {
|
||||
this.templateClassLoader = templateClassLoader;
|
||||
}
|
||||
|
||||
@Override
|
||||
public URL resolveTemplate(final String templatePath) throws IOException {
|
||||
MarkupTemplateEngine.TemplateResource templateResource = MarkupTemplateEngine.TemplateResource
|
||||
.parse(templatePath);
|
||||
URL resource = this.templateClassLoader.getResource(templateResource
|
||||
.withLocale(LocaleContextHolder.getLocale().toString().replace("-", "_"))
|
||||
.toString());
|
||||
if (resource == null) {
|
||||
// no resource found with the default locale, try without any locale
|
||||
resource = this.templateClassLoader
|
||||
.getResource(templateResource.withLocale(null).toString());
|
||||
}
|
||||
if (resource == null) {
|
||||
throw new IOException("Unable to load template:" + templatePath);
|
||||
}
|
||||
return resource;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -181,21 +181,6 @@ public class MongoProperties {
|
||||
return new MongoClientURI(this.uri).getDatabase();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a {@link MongoClient} using the given {@code options}.
|
||||
*
|
||||
* @param options the options
|
||||
* @return the Mongo client
|
||||
* @throws UnknownHostException if the configured host is unknown
|
||||
* @deprecated Since 1.3.0 in favour of
|
||||
* {@link #createMongoClient(MongoClientOptions, Environment)}
|
||||
*/
|
||||
@Deprecated
|
||||
public MongoClient createMongoClient(MongoClientOptions options)
|
||||
throws UnknownHostException {
|
||||
return this.createMongoClient(options, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a {@link MongoClient} using the given {@code options} and
|
||||
* {@code environment}. If the configured port is zero, the value of the
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2015 the original author or authors.
|
||||
* Copyright 2012-2016 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.
|
||||
@@ -51,17 +51,6 @@ public class BasicErrorController extends AbstractErrorController {
|
||||
|
||||
private final ErrorProperties errorProperties;
|
||||
|
||||
/**
|
||||
* Create a new {@link BasicErrorController} instance.
|
||||
* @param errorAttributes the error attributes
|
||||
* @deprecated since 1.3.0 in favor of
|
||||
* {@link #BasicErrorController(ErrorAttributes, ErrorProperties)}
|
||||
*/
|
||||
@Deprecated
|
||||
public BasicErrorController(ErrorAttributes errorAttributes) {
|
||||
this(errorAttributes, new ErrorProperties());
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new {@link BasicErrorController} instance.
|
||||
* @param errorAttributes the error attributes
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2015 the original author or authors.
|
||||
* Copyright 2012-2016 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.
|
||||
@@ -55,7 +55,6 @@ import org.springframework.boot.context.embedded.tomcat.TomcatContextCustomizer;
|
||||
import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory;
|
||||
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.context.EnvironmentAware;
|
||||
import org.springframework.core.Ordered;
|
||||
@@ -327,27 +326,6 @@ public class ServerProperties
|
||||
return (platform == null ? false : platform.isUsingForwardHeaders());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the session timeout.
|
||||
* @return the session timeout
|
||||
* @deprecated since 1.3.0 in favor of {@code session.timeout}.
|
||||
*/
|
||||
@Deprecated
|
||||
@DeprecatedConfigurationProperty(replacement = "server.session.timeout")
|
||||
public Integer getSessionTimeout() {
|
||||
return this.session.getTimeout();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the session timeout.
|
||||
* @param sessionTimeout the session timeout
|
||||
* @deprecated since 1.3.0 in favor of {@code session.timeout}.
|
||||
*/
|
||||
@Deprecated
|
||||
public void setSessionTimeout(Integer sessionTimeout) {
|
||||
this.session.setTimeout(sessionTimeout);
|
||||
}
|
||||
|
||||
public ErrorProperties getError() {
|
||||
return this.error;
|
||||
}
|
||||
@@ -632,48 +610,6 @@ public class ServerProperties
|
||||
return this.accesslog;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specify if access log is enabled.
|
||||
* @return {@code true} if access log is enabled
|
||||
* @deprecated since 1.3.0 in favor of {@code server.tomcat.accesslog.enabled}
|
||||
*/
|
||||
@Deprecated
|
||||
@DeprecatedConfigurationProperty(replacement = "server.tomcat.accesslog.enabled")
|
||||
public boolean getAccessLogEnabled() {
|
||||
return this.accesslog.isEnabled();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set if access log is enabled.
|
||||
* @param accessLogEnabled the access log enable flag
|
||||
* @deprecated since 1.3.0 in favor of {@code server.tomcat.accesslog.enabled}
|
||||
*/
|
||||
@Deprecated
|
||||
public void setAccessLogEnabled(boolean accessLogEnabled) {
|
||||
getAccesslog().setEnabled(accessLogEnabled);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the format pattern for access logs.
|
||||
* @return the format pattern for access logs
|
||||
* @deprecated since 1.3.0 in favor of {@code server.tomcat.accesslog.pattern}
|
||||
*/
|
||||
@Deprecated
|
||||
@DeprecatedConfigurationProperty(replacement = "server.tomcat.accesslog.pattern")
|
||||
public String getAccessLogPattern() {
|
||||
return this.accesslog.getPattern();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the format pattern for access logs.
|
||||
* @param accessLogPattern the pattern for access logs
|
||||
* @deprecated since 1.3.0 in favor of {@code server.tomcat.accesslog.pattern}
|
||||
*/
|
||||
@Deprecated
|
||||
public void setAccessLogPattern(String accessLogPattern) {
|
||||
this.accesslog.setPattern(accessLogPattern);
|
||||
}
|
||||
|
||||
public int getBackgroundProcessorDelay() {
|
||||
return this.backgroundProcessorDelay;
|
||||
}
|
||||
@@ -990,69 +926,6 @@ public class ServerProperties
|
||||
return this.accesslog;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the format pattern for access logs.
|
||||
* @return the format pattern for access logs
|
||||
* @deprecated since 1.3.0 in favor of {@code server.undertow.accesslog.pattern}
|
||||
*/
|
||||
@Deprecated
|
||||
@DeprecatedConfigurationProperty(replacement = "server.undertow.accesslog.pattern")
|
||||
public String getAccessLogPattern() {
|
||||
return this.accesslog.getPattern();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the format pattern for access logs.
|
||||
* @param accessLogPattern the pattern for access logs
|
||||
* @deprecated since 1.3.0 in favor of {@code server.undertow.accesslog.pattern}
|
||||
*/
|
||||
@Deprecated
|
||||
public void setAccessLogPattern(String accessLogPattern) {
|
||||
this.accesslog.setPattern(accessLogPattern);
|
||||
}
|
||||
|
||||
/**
|
||||
* Specify if access log is enabled.
|
||||
* @return {@code true} if access log is enabled
|
||||
* @deprecated since 1.3.0 in favor of {@code server.undertow.accesslog.enabled}
|
||||
*/
|
||||
@Deprecated
|
||||
@DeprecatedConfigurationProperty(replacement = "server.undertow.accesslog.enabled")
|
||||
public boolean isAccessLogEnabled() {
|
||||
return this.accesslog.isEnabled();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set if access log is enabled.
|
||||
* @param accessLogEnabled the access log enable flag
|
||||
* @deprecated since 1.3.0 in favor of {@code server.undertow.accesslog.enabled}
|
||||
*/
|
||||
@Deprecated
|
||||
public void setAccessLogEnabled(boolean accessLogEnabled) {
|
||||
getAccesslog().setEnabled(accessLogEnabled);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the access log directory.
|
||||
* @return the access log directory
|
||||
* @deprecated since 1.3.0 in favor of {@code server.undertow.accesslog.dir}
|
||||
*/
|
||||
@Deprecated
|
||||
@DeprecatedConfigurationProperty(replacement = "server.undertow.accesslog.dir")
|
||||
public File getAccessLogDir() {
|
||||
return this.accesslog.getDir();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the access log directory.
|
||||
* @param accessLogDir the access log directory
|
||||
* @deprecated since 1.3.0 in favor of {@code server.tomcat.accesslog.dir}
|
||||
*/
|
||||
@Deprecated
|
||||
public void setAccessLogDir(File accessLogDir) {
|
||||
getAccesslog().setDir(accessLogDir);
|
||||
}
|
||||
|
||||
void customizeUndertow(ServerProperties serverProperties,
|
||||
UndertowEmbeddedServletContainerFactory factory) {
|
||||
factory.setBufferSize(this.bufferSize);
|
||||
|
||||
@@ -61,7 +61,7 @@ public class ConditionalOnMissingClassTests {
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@ConditionalOnMissingClass(name = "FOO")
|
||||
@ConditionalOnMissingClass("FOO")
|
||||
protected static class MissingConfiguration {
|
||||
@Bean
|
||||
public String bar() {
|
||||
|
||||
Reference in New Issue
Block a user